Home

Awesome

Palladio - CityEngine Plugin for Houdini

Palladio is a plugin for SideFX Houdini. It provides operator nodes which enable the execution of CityEngine ‘rules’ within Houdini networks. Therefore, a 3D environment artist does not have to leave their familiar Houdini toolset anymore to make use of CityEngine’s procedural modeling power. Complicated export-import pipelines are no longer needed, which also means that the procedural building models do not need to be “baked” anymore. The buildings stay procedural during the entire modeling workflow (optionally even at render time). Consequently, the 3D environment artist can change the height, style and appearance of buildings easily with a parametric interface at any point during production.

Palladio requires so-called rule packages (RPK) as input, which are authored in CityEngine. An RPK includes assets and a CGA rule file which encodes an architectural style. Comprehensive RPK examples are available below and can be used “out-of-the-box” in Palladio.

Palladio is well suited for managing the procedural generation of architectural 3D content in digital sets. However, Palladio is restricted to the procedural generation of single buildings / objects. Palladio does not include the city layouting and street network editing tools of CityEngine i.e. the rich CityEngine toolset to design a city from scratch (or based on geographic data) is still needed.

Quick Start

  1. Download the latest Palladio binary from the release page.

  2. Extract the archive into your <home>\Documents\houdiniX.Y (Windows) or <home>/houdiniX.Y (Linux) directory, so that the files end up in the corresponding config, dso and packages sub-directories.

  3. Start Houdini and you will find the new pldAssign and pldGenerate nodes in the OBJ operator menu under custom.

  4. In Houdini, create a quad as initial shape by setting up a grid node with 2 cols/rows.

  5. Open the geometry node in the network editor and connect the mesh output to a new pldAssign node.

  6. Create a new pldGenerate node and connect the input to the ouput of the previous pldAssign node.

  7. Make the pldGenerate node the active render node.

  8. Download the Parthenon rule package. Or alternatively, in CityEngine, download Tutorial 9 and export the "Parthenon" CGA rule to a RPK (see Creating a Rule Package).

  9. Select the pldAssign node and set the Rule Package parameter in the parameter editor to the path of the previously exported RPK.

  10. The model should generate and rule attributes should now be editable inside the parameter editor.

Table of Contents

External documentation:

User Manual

Please refer to the release notes for the supported CityEngine version.

Installation

Software Requirements (Latest Release)

From Pre-Built Binaries

  1. Download the latest Palladio binary from the release page.
  2. Extract the archive into your <home>\Documents\houdiniX.Y (Windows) or <home>/houdiniX.Y (Linux) directory, so that the files end up in the config, dso and packages sub-directories.
  3. Start Houdini and you will find the new pldAssign and pldGenerate nodes in the OBJ operator menu under custom.

Note: it is NOT necessary to modify the system PATH environment variable.

From Source

  1. Build Palladio
  2. The install step should automatically copy all required files into your <home>\Documents\houdiniX.Y (Windows) or <home>/houdiniX.Y (Linux) directory and Palladio is ready to run.

Using Palladio

Palladio adds the two new geometry (SOP) nodes pldAssign and pldGenerate to Houdini in the 'Custom' category. These can be created inside of any geometry object in the Network Editor.

pldAssign Node

The pldAssign node is designed to create the required metadata to the input geometry (as primitive attributes) such that the pldGenerate operator can procedurally generate the geometry. When selected, a RPK (rule package), seed and corresponding CGA attributes can directly be set in the parameter editor. When evaluated, the pldAssign node attaches the required metadata to the geometry (in the form of primitive attributes) and updates the CGA attributes in the parameter editor accordingly. The primitive attributes can also be overwritten before the geometry is passed to a pldGenerate node (i.e using an Attribute Create node).

pldGenerate Node

The pldGenerate node is used to generate the final geometry. It takes an initial shape geometry with metadata as input (i.e. the output of a pldAssign node) and executes the CityEngine rule to generate a 3D model. In the parameter editor we have the options to:

Execute a simple CityEngine Rule

  1. In CityEngine, create the following rule file and share it as a rule package (RPK) to disk somewhere (or download one of the provided examples and share it as a RPK (see Creating a Rule Package)):

    attr height = 1
    
    @StartRule
    Init -->
       extrude(height)
    

    (Instead you can also directly use this RPK)

  2. In Houdini, in a new scene, add a grid node.

  3. Enter the grid node, set the Rows and Columns parameters to two and add the two Palladio nodes pldAssign and pldGenerate. Connect them like this:

  4. Select the pldAssign node and set the Rule Package parameter to the path of the previously exported RPK in the parameter editor.

  5. Make the pldGenerate node the active render node, this will trigger a "cooking" of the assign and generate nodes and execute the CityEngine Rule. You should now see a cuboid:

Overriding Rule Attributes

In the previous section we've used the default value for the height attribute. Let's use Houdini tools to modify the rule attribute prior to execution.

Using Parameter Editor

  1. Make sure the pldAssign is evaluated by making the connected pldGenerate the active render node

  2. Edit the rule attribute in the parameter editor by changing the value in the generated handle (a rule attribute can be reset by calling revert to Defaults or pressing ctrl + MMB on the rule name)

Manual Override

  1. Add an AttributeCreate node between pldAssign and pldGenerate.

  2. Set the attribute name to height and the Class to Primitive. The extrusion vanishes because the default value is 0.

  3. Increase the value for height to see an actual extrusion:

Please note the steps for the general case:

  1. See the CGA file (or CityEngine) for the available attributes and their data types (number, string, boolean).
  2. In the AttributeCreate node, set name to the name of the CGA attribute (make sure to check Encode Invalid Attribute Names).
  3. Set class to Primitive.
  4. Set type to Float for CGA number attributes, String for CGA strings and Integer with 8 bit precision for CGA booleans.

Working with multiple Assign Nodes

In this section, we are going to showcase how we can use multiple pldAssign nodes with a single pldGenerate node.

  1. Duplicate the grid and pldAssign nodes.

  2. Set the Center of the second grid node to (15, 0, 0).

  3. Add a new Attribute Create node between the new grid and pldAssign nodes.

  4. Set the attribute name to "primCls", change the Class to primitive and change its value to 1. This value needs to be set such that the pldGenerate node later knows which initial faces should be generated together or separately.

  5. Merge the output of both assign nodes with a merge node and feed the output to the previous generate node like this:

  6. You can now change the rule files and attributes of both pldAssign nodes and it should generate them correctly

Working with Material Attributes

In this section, we are going to connect a material attribute generated by pldGenerate with a Mantra shader (the same mechanism can also be used for Viewport materials).

Using provided HDA

  1. Download the ready-made Houdini Digital Asset with a CityEngine Material for Mantra.

  2. Import the HDA to your current project (File>Import>Houdini Digital Asset) and click install.

  3. Select the pldGenerate node and check the Emit material attributes check box. Open the spreadsheet to observe a number of material primitive attributes now being emitted by pldGenerate.

  4. Create a new PalladioCityEngineMaterial node and connect it to the pldGenerate node. Make it the active render node.

  5. Hit Mantra render and you should see a red box in the render view.

Creating a new custom Shader

  1. Extend the rule from the previous section with a color statement and re-export it:

    attr height = 1
    
    @StartRule
    Init -->
       color(1,0,0)
       extrude(height)
    

    (Instead you can also directly use this RPK)

  2. In Houdini, select the pldGenerate node and check the Emit material attributes check box. Open the spreadsheet to observe a number of material primitive attributes now being emitted by pldGenerate.

  3. Add a Material node and connect it to the pldGenerate node. Make it the active render node:

  4. In the Material Palette, create a new Principled Shader instance (by dragging it from the navigator to the \mat window) and rename it to CityEngineShader:

  5. Enter the CityEngineShader node and connect a Parameter node to the Surface/basecolor input:

  6. Set the name of the Parameter node to diffuseColor and also set the type to Color. This name will match the primitive attribute emitted by pldGenerate.

  7. Back in the network of the grid node, select the Material node and select /mat/CityEngineShader for the Material parameter.

  8. Hit Mantra render and you should see a red box in the render view.

Tips and Tricks

How to export an Alembic from CityEngine as input to Palladio

This short CityEngine guide explains how to include the random seed and start rule assignments when exporting input geometry to Alembic.

  1. Run the following Python script on your scene objects to assign the random seed as object attributes:

    from scripting import *
    
    ce = CE()
    
    shapes = ce.getObjectsFrom(ce.scene(), ce.isShape)
    for s in shapes:
        seed = ce.getAttribute(s, "/ce/rule/randomSeed")
        ce.setAttribute(s, "seed", seed)
    
  2. Assign this CGA script to the desired shapes to report out seed and rule (the start rule):

    version "2019.0"
    
    attr seed = 0
    
    Lot --> R
    LotInner --> R
    Street --> R
    Sidewalk --> R
    Crossing --> R
    OpenSpace --> R
    Joint --> R
    R -->
        report("seed", seed)
        report("rule", initialShape.startRule)
    

    The seed rule attribute should have been connected to the previously assigned seed object attribute.

  3. Export the shapes to Alembic, the two report values are now attached as user properties to the meshes.

Keep CityEngine Rule Packages in the Houdini Project

It can be useful to put RPKs into an rpk sub-directory of your current Houdini project. If you use $HIP to refer to the RPK in the pldAssign node, your Houdini project will stay relocatable.

Environment Variables

Developer Manual

Supported Operating Systems

Required Toolchain & Compiler

Required Build Dependencies (Latest Release)

The following will be automatically fetched via the bootstrap steps below:

Build Instructions

Default is Houdini 20.0. See below how to build for different Houdini versions.

Bootstrap

The below steps will populate your local Conan repository with dependencies for the Palladio build system. You only need to work through this section once (or if you want to upgrade one of the dependencies).

Linux
  1. Checkout Palladio: git clone git@github.com:esri/palladio.git && cd palladio
  2. Download CityEngine SDK: conan create -pr conan/profiles/linux-gcc112 conan/cesdk cesdk/3.2.10211@esri-rd-zurich/stable
  3. Extract and package the HDK from your local Houdini 20.0 installation (adjust Z to your Houdini version): conan create -pr conan/profiles/linux-gcc112 conan/houdini houdini/20.0.Z@sidefx/stable (Note: use the option -e HOUDINI_INSTALL=/path/to/your/hfs20.0.Z, if Houdini is not installed at the standard location, e.g. at /opt/hfs20.0.Z for Linux).
Windows
  1. Checkout Palladio: git clone git@github.com:esri/palladio.git
  2. Open a Windows command shell and cd to the Palladio git repository
  3. Download CityEngine SDK: conan create -pr conan/profiles/windows-v143 conan/cesdk cesdk/3.2.10211@esri-rd-zurich/stable
  4. Extract and package the HDK from your local Houdini installation (adjust Z to your Houdini version): conan create -pr conan/profiles/windows-v143 conan/houdini houdini/20.0.Z@sidefx/stable (Note: use the option -e HOUDINI_INSTALL=C:/path/to/your/houdini/installation, if Houdini is not installed at the standard location for Windows).

Building Palladio

Note: to build for another Houdini version, add the cmake argument -DPLD_HOUDINI_VERSION=X.Y.

Linux
  1. Ensure GCC 11.2 is active.
  2. cd into your Palladio git repository
  3. mkdir -p build/release && cd build/release
  4. cmake -DCMAKE_BUILD_TYPE=Release ../../src
  5. make install (the plugin will be installed into your ~/houdini20.0/dso directory)
Windows
  1. Open a MSVC 14.37 x64 shell (Visual Studio 2022) and cd to the Palladio git repository
  2. mkdir build/release
  3. cd build/release
  4. cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ../../src
  5. nmake install (the plugin will be installed into your %USERPROFILE%/Documents/houdini20.0/dso directory)

Debugging Palladio

For the best debugging UX, please use the build type RelWithDebInfo when running CMake (or in Visual Studio). The Debug mode does not work as it will result in incompatible ABI between Houdini, PRT and the Palladio client code.

Running Palladio

See Quick Start how to launch Houdini with Palladio.

Building and Running Unit Tests

Linux

  1. Ensure GCC 11.2 is active.
  2. cd into your Palladio git repository
  3. mkdir -p build/relTest && cd build/relTest
  4. cmake -DCMAKE_BUILD_TYPE=Release -DPLD_TEST=1 ../../src
  5. make palladio_test
  6. Run bin/palladio_test

Windows

  1. Open a MSVC 14.37 x64 shell (Visual Studio 2022) and cd to the Palladio git repository
  2. mkdir build/relTest
  3. cd build/relTest
  4. cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DPLD_TEST=1 ../../src
  5. nmake palladio_test
  6. Run bin\palladio_test

Release Notes

v2.1.0 (Nov 1, 2024)

Added:

Removed:

Changed:

v2.0.0 (Jul 1, 2023)

Added:

Changed:

v2.0.0 Beta 2 (Mar 27, 2023)

Required CityEngine version: 2022.1 or older

Changed:

Development:

v2.0.0 Beta 1 (Nov 22, 2022)

Required CityEngine version: 2022.0 or older

Added:

Changed:

Development:

Removed

v1.9.0 (Dec 7, 2020)

v1.9.0 Beta 2 (Dec 2, 2020)

v1.9.0 Beta 1 (Nov 16, 2020)

v1.8.0 (Oct 5, 2020)

v1.8.0 Beta 1 (Aug 23, 2020)

v1.7.0 (June 14, 2020)

v1.7.0 Beta 1 (Dec 9, 2019)

v1.7.0 Pre-Release (Oct 20, 2019)

v1.6.3 (July 27, 2019)

v1.6.2 (June 22, 2019)

v1.6.1 (June 7, 2019)

v1.6.0 (May 8, 2019)

v1.5.0 (May 7, 2019)

v1.5.0 Beta 2 (Mar 19, 2019)

v1.5.0 Beta 1 (Mar 14, 2019)

v1.4.1 (Mar 11, 2019)

v1.4.0 (Feb 27, 2019)

v1.3.1 (Feb 20, 2019)

v1.3.0 (Jan 20, 2019)

v1.2.0 (Jan 17, 2019)

v1.2.0 RC 1 (Jun 11, 2018)

v1.1.1 (Apr 16, 2018)

v1.1 (Apr 7, 2018)

v1.0 (Jan 26, 2018)

v0.9 (Jan 18, 2018)

v0.8 (Dec 19, 2017)

v0.7.1 (Nov 27, 2017)

v0.7 (Sep 19, 2017)

v0.6 (Mar 15, 2016)

v0.4 (Oct 22, 2015)

v0.1 - v0.3 (Spring 2015)

Community

Palladio is maintained as an open-source project by Matthias Buehler (vrbn studios) and Simon Haegler (Esri R&D Zurich). Matthias is focusing on UX/UI topics and use-cases, while Simon is focusing on the implementation and procedural modelling technology.

Our goal is to bring as many Houdini and CityEngine users and developers on board as possible. Anyone is invited to submit issues and/or to fork and contribute to this project.

Join us on Slack at palladio-houdini-ce.slack.com!

Our thanks also go to the fine folks at Esri R&D Zurich and vrbn studios which provided valuable comments and feedback.

History

Palladio has been invented by Matthias Buehler and Simon Haegler in early 2015. It started out as a research project at Esri R&D Zurich to get to a tighter integration of CityEngine and Houdini than just via file-based import/export of assets. Early results were promising, so we slowly cooked the project to v1.0 in our spare time. In December 2017, we decided to open-source Palladio with an Apache 2.0 license.

Licensing Information

Palladio is free for personal, educational, and non-commercial use. Commercial use requires at least one commercial license of the latest CityEngine version installed in the organization. Redistribution or web service offerings are not allowed unless expressly permitted.

Palladio is under the same license as the included CityEngine SDK. An exception is the Palladio source code (without CityEngine SDK, binaries, or object code), which is licensed under the Apache License, Version 2.0 (the “License”); you may not use this work except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.

All content in the "Examples" directory/section is licensed under the APACHE 2.0 license as well.

The "Favela" example data is copyrighted by vrbn studios. Please contact vrbn_studios for commercial licensing options.

For questions or enquiries, please contact the Esri CityEngine team (cityengine-info@esri.com).