Palladio enables the execution of CityEngine CGA rules inside of SideFX Houdini.
APACHE-2.0 License
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 CityEngines 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.
Download the latest Palladio binary from the release page.
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.
Start Houdini and you will find the new pldAssign
and pldGenerate
nodes in the OBJ operator menu under custom
.
In Houdini, create a quad as initial shape by setting up a grid
node with 2 cols/rows.
Open the geometry node in the network editor and connect the mesh output to a new pldAssign
node.
Create a new pldGenerate
node and connect the input to the ouput of the previous pldAssign
node.
Make the pldGenerate
node the active render node.
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).
Select the pldAssign
node and set the Rule Package
parameter in the parameter editor to the path of the previously exported RPK.
The model should generate and rule attributes should now be editable inside the parameter editor.
External documentation:
Please refer to the release notes for the supported CityEngine version.
<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.pldAssign
and pldGenerate
nodes in the OBJ operator menu under custom
.Note: it is NOT necessary to modify the system PATH
environment variable.
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.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
.
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).
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:
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)
In Houdini, in a new scene, add a grid
node.
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:
Select the pldAssign
node and set the Rule Package
parameter to the path of the previously exported RPK in the parameter editor.
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:
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.
Make sure the pldAssign
is evaluated by making the connected pldGenerate
the active render node
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)
Add an AttributeCreate
node between pldAssign
and pldGenerate
.
Set the attribute name to height
and the Class
to Primitive
. The extrusion vanishes because the default value is 0.
Increase the value for height
to see an actual extrusion:
Please note the steps for the general case:
AttributeCreate
node, set name
to the name of the CGA attribute (make sure to check Encode Invalid Attribute Names
).class
to Primitive
.type
to Float
for CGA number attributes, String
for CGA strings and Integer
with 8 bit precision for CGA booleans.In this section, we are going to showcase how we can use multiple pldAssign
nodes with a single pldGenerate
node.
Duplicate the grid
and pldAssign
nodes.
Set the Center of the second grid
node to (15, 0, 0).
Add a new Attribute Create
node between the new grid
and pldAssign
nodes.
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.
Merge the output of both assign nodes with a merge
node and feed the output to the previous generate node like this:
You can now change the rule files and attributes of both pldAssign
nodes and it should generate them correctly
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).
Download the ready-made Houdini Digital Asset with a CityEngine Material for Mantra.
Import the HDA to your current project (File
>Import
>Houdini Digital Asset
) and click install.
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
.
Create a new PalladioCityEngineMaterial node and connect it to the pldGenerate
node. Make it the active render node.
Hit Mantra render and you should see a red box in the render view.
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)
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
.
Add a Material
node and connect it to the pldGenerate
node. Make it the active render node:
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
:
Enter the CityEngineShader
node and connect a Parameter
node to the Surface/basecolor
input:
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
.
Back in the network of the grid
node, select the Material
node and select /mat/CityEngineShader
for the Material
parameter.
Hit Mantra render and you should see a red box in the render view.
This short CityEngine guide explains how to include the random seed and start rule assignments when exporting input geometry to Alembic.
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)
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.
Export the shapes to Alembic, the two report values are now attached as user properties to the meshes.
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.
CITYENGINE_LOG_LEVEL
: controls the global (minimal) log level for all assign and generate nodes. Valid values are "debug", "info", "warning", "error", "fatal". The default is "error". Additionally, the log level can be controlled for each pldAssign
and pldGenerate
instance.HOUDINI_DSO_ERROR
: useful to debug loading issues, see https://www.sidefx.com/docs/houdini/ref/env
The following will be automatically fetched via the bootstrap steps below:
Default is Houdini 19.5. See below how to build for different Houdini versions.
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).
git clone [email protected]:esri/palladio.git && cd palladio
conan create -pr conan/profiles/linux-gcc93 conan/cesdk cesdk/3.0.8905@esri-rd-zurich/stable
conan create -pr conan/profiles/linux-gcc93 conan/houdini houdini/19.5.Z@sidefx/stable
(Note: use the option -e HOUDINI_INSTALL=/path/to/your/hfs19.5.Z
, if Houdini is not installed at the standard location, e.g. at /opt/hfs19.5.Z
for Linux).git clone [email protected]:esri/palladio.git
cd
to the Palladio git repositoryconan create -pr conan/profiles/windows-v142 conan/cesdk cesdk/3.0.8905@esri-rd-zurich/stable
conan create -pr conan/profiles/windows-v142 conan/houdini houdini/19.5.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).Note: to build for another Houdini version, add the cmake argument -DPLD_HOUDINI_VERSION=X.Y
.
cd
into your Palladio git repositorymkdir -p build/release && cd build/release
cmake -DCMAKE_BUILD_TYPE=Release ../../src
make install
(the plugin will be installed into your ~/houdini19.5/dso
directory)cd
to the Palladio git repositorymkdir build/release
cd build/release
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ../../src
nmake install
(the plugin will be installed into your %USERPROFILE%/Documents/houdini19.5/dso
directory)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.
See Quick Start how to launch Houdini with Palladio.
cd
into your Palladio git repositorymkdir -p build/relTest && cd build/relTest
cmake -DCMAKE_BUILD_TYPE=Release -DPLD_TEST=1 ../../src
make palladio_test
bin/palladio_test
cd
to the Palladio git repositorymkdir build/relTest
cd build/relTest
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DPLD_TEST=1 ../../src
nmake palladio_test
bin\palladio_test
Required CityEngine version: 2022.1 or older
RelWithDebInfo
to have better debugger experienceRequired CityEngine version: 2022.0 or older
pldAssign
node
pldAssign
node is evaluatedpldAssign
nodePalladio 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.
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.
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 ([email protected]).