Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mistafunk committed Dec 7, 2020
2 parents a65e1f7 + 1529c54 commit 28e968d
Show file tree
Hide file tree
Showing 13 changed files with 127 additions and 58 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Palladio is maintained as an open-source project by Matthias Buehler ([vrbn stud

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!](https://join.slack.com/t/palladio-houdini-ce/shared_invite/enQtMzAzNTc4MzIzNjA1LTEwYmQ1ZjE0MTExODIxNTA4ZDEzYWYyYzNkZGZmMWQ0NmM2MjMzYTllOGI5OTQwNGM0N2RjYjFlNjJjNzVhMjE)
Join us on Slack at [palladio-houdini-ce.slack.com](https://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.

Expand Down
45 changes: 23 additions & 22 deletions doc/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Windows: Visual Studio 2019 (MSVC 14.2)

### Required Build Dependencies
* Installation of Houdini 17.0 or later (see https://sidefx.com/download)
* Installation of Houdini 17.5 or later (see https://sidefx.com/download)

The following will be automatically fetched via the bootstrap steps below:
* [CityEngine SDK](https://github.com/esri/cityengine-sdk)
Expand All @@ -23,22 +23,22 @@ The following will be automatically fetched via the bootstrap steps below:

## Build Instructions

Default is Houdini 18.0. See below how to build for different Houdini versions.
Default is Houdini 18.5. 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`
1. Download CityEngine SDK: `conan create -pr conan/profiles/linux-gcc63 conan/cesdk cesdk/2.1.5704@esri-rd-zurich/stable`
1. Extract and package the HDK from your local Houdini 18 installation (adjust Z to your Houdini version): `conan create -pr conan/profiles/linux-gcc63 conan/houdini houdini/18.0.Z@sidefx/stable` (Note: use the option `-e HOUDINI_INSTALL=/path/to/your/hfs18.0.Z`, if Houdini is not installed at the standard location, e.g. at `/opt/hfs18.0.Z` for Linux).
1. Download CityEngine SDK: `conan create -pr conan/profiles/linux-gcc63 conan/cesdk cesdk/2.3.6821@esri-rd-zurich/stable`
1. Extract and package the HDK from your local Houdini 18.5 installation (adjust Z to your Houdini version): `conan create -pr conan/profiles/linux-gcc63 conan/houdini houdini/18.5.Z@sidefx/stable` (Note: use the option `-e HOUDINI_INSTALL=/path/to/your/hfs18.5.Z`, if Houdini is not installed at the standard location, e.g. at `/opt/hfs18.5.Z` for Linux).

#### Windows
1. Checkout Palladio: `git clone git@github.com:esri/palladio.git`
1. Open a Windows command shell and `cd` to the Palladio git repository
1. Download CityEngine SDK: `conan create -pr conan/profiles/windows-v141 conan/cesdk cesdk/2.1.5704@esri-rd-zurich/stable`
1. Extract and package the HDK from your local Houdini installation (adjust Z to your Houdini version): `conan create -pr conan/profiles/windows-v141 conan/houdini houdini/18.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).
1. Download CityEngine SDK: `conan create -pr conan/profiles/windows-v142 conan/cesdk cesdk/2.3.6821@esri-rd-zurich/stable`
1. Extract and package the HDK from your local Houdini installation (adjust Z to your Houdini version): `conan create -pr conan/profiles/windows-v142 conan/houdini houdini/18.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).

### Building Palladio

Expand All @@ -47,34 +47,35 @@ Note: to build for another Houdini version, add the cmake argument `-DPLD_HOUDIN
#### Linux
1. Ensure GCC 6.3 is active.
1. `cd` into your Palladio git repository
1. ```mkdir -p build/release && cd build/release```
1. ```cmake -DCMAKE_BUILD_TYPE=Release ../../src```
1. ```make install``` (the plugin will be installed into your ~/houdini18.0/dso directory)
1. `mkdir -p build/release && cd build/release`
1. `cmake -DCMAKE_BUILD_TYPE=Release ../../src`
1. `make install` (the plugin will be installed into your `~/houdini18.5/dso` directory)

#### Windows
1. Open a MSVC 14.1 x64 shell (Visual Studio 2017) and `cd` to the Palladio git repository
1. ```mkdir build/release```
1. ```cd build/release```
1. ```cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ../../src```
1. ```nmake install``` (the plugin will be installed into your ~/houdini18.0/dso directory)
1. Open a MSVC 14.2 x64 shell (Visual Studio 2019) and `cd` to the Palladio git repository
1. `mkdir build/release`
1. `cd build/release`
1. `cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ../../src`
1. `nmake install` (the plugin will be installed into your `%USERPROFILE%/Documents/houdini18.5/dso` directory)

### Running Palladio
See [Quick Start](usage.md) how to launch Houdini with Palladio.

### Building and Running Unit Tests

#### Linux
1. Ensure GCC 6.3 is active.
1. `cd` into your Palladio git repository
1. ```mkdir -p build/relTest && cd build/relTest```
1. ```cmake -DCMAKE_BUILD_TYPE=Release -DPLD_TEST=1 ../../src```
1. ```make palladio_test```
1. `mkdir -p build/relTest && cd build/relTest`
1. `cmake -DCMAKE_BUILD_TYPE=Release -DPLD_TEST=1 ../../src`
1. `make palladio_test`
1. run `bin/palladio_test`

#### Windows
1. Open a MSVC 14.1 x64 shell (Visual Studio 2017) and `cd` to the Palladio git repository
1. ```mkdir build/relTest```
1. ```cd build/relTest```
1. ```cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DPLD_TEST=1 ../../src```
1. ```nmake palladio_test```
1. Open a MSVC 14.2 x64 shell (Visual Studio 2019) and `cd` to the Palladio git repository
1. `mkdir build/relTest`
1. `cd build/relTest`
1. `cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DPLD_TEST=1 ../../src`
1. `nmake palladio_test`
1. ensure that the `bin` subdirectory of your Houdini installation is in the `PATH`
1. run `bin\palladio_test`
12 changes: 12 additions & 0 deletions doc/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Palladio ChangeLog

## v1.9.0 (Dec 7, 2020)
* No functional changes compared to Beta 2.

## v1.9.0 Beta 2 (Dec 2, 2020)
* Updated doc section for "overriding rule attributes".
* General doc cleanup.

## v1.9.0 Beta 1 (Nov 16, 2020)
* Update default CityEngine SDK to 2.3 (CityEngine 2020.1).
* Added support for Houdini 18.5.
* Add error message to assign node in case of e.g. invalid rule package (#159).

## v1.8.0 (Oct 5, 2020)
* No functional changes compared to Beta 1.

Expand Down
45 changes: 25 additions & 20 deletions doc/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Prerequisites

* RedHat Enterprise Linux 7 (and compatible) or Windows 10
* Houdini 17.5 or later (building is supported from Houdini 17.0 or later)
* Houdini 17.5 or later
* To create CityEngine rule packages, an installation of CityEngine (2019.0 or later)
* For commercial work, a [license](https://esri.com/cityengine) for CityEngine (2019.0 or later)

Expand All @@ -14,15 +14,15 @@
### From Pre-Built Binaries

1. [Download](https://esri.github.io/palladio/#downloads) Palladio
1. Extract into your `<home>/houdiniX.Y` directory, so that the files end up in the `dso` and `packages` sub-directories.
1. Extract the archive into your `<home>\Documents\houdiniX.Y` (Windows) or `<home>/houdiniX.Y` (Linux) directory, so that the files end up in the `dso` and `packages` sub-directories.
1. Start Houdini and Palladio will be loaded automatically.

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

### From Source

1. [Build](build.md) Palladio
1. The `install` step should automatically copy all required files into your `<home>/houdiniX.Y` directory and Palladio is ready to run.
1. 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.


## Execute a simple CityEngine Rule
Expand All @@ -35,27 +35,32 @@ Note: it is NOT necessary to modify the system `PATH` environment variable.
Init -->
extrude(height)
```
1. In Houdini, in a new scene, add a ``grid`` node.
1. Enter the ``grid`` node and add the two Palladio nodes ``pldAssign`` and ``pldGenerate``. Connect them like this: ![](img/extrude01.png)
1. In the ``pldAssign`` node, set the ``Rule Package`` parameter to the path of the previously exported RPK.
1. 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 an extruded grid: ![](img/extrude02.png)
1. In Houdini, in a new scene, add a `grid` node.
1. Enter the `grid` node and add the two Palladio nodes `pldAssign` and `pldGenerate`. Connect them like this: ![](img/extrude01.png)
1. In the `pldAssign` node, set the `Rule Package` parameter to the path of the previously exported RPK.
1. 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 an extruded grid: ![](img/extrude02.png)

## 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.
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.

1. Right click on the ``pldAssign`` node and bring up the spreadsheet view. Observe how the ``height`` primitive parameter is set to 1 for all primitives. This is the rule attribute default value and we're going to override it now. ![](img/attribute01.png)
1. Add an ``AttributeCreate`` node between ``pldAssign`` and ``pldGenerate``.
1. Set the attribute name to ``height`` and the ``Class`` to ``Primitive``. The extrusion vanishes because the default value is 0.
1. Increase the value for ``height`` to see an actual extrusion: ![](img/attribute02.png)
1. Add an `AttributeCreate` node between `pldAssign` and `pldGenerate`.
1. Set the attribute name to `height` and the `Class` to `Primitive`. The extrusion vanishes because the default value is 0.
1. Increase the value for `height` to see an actual extrusion: ![](img/attribute02.png)

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).
1. In the `AttributeCreate` node, set `name` to the name of the CGA attribute (replace dots `.` with double underscores `__`).
1. Set `class` to `Primitive`.
1. Set `type` to `Float` for CGA number attributes, `String` for CGA strings and `Int` for CGA booleans.

## Working with Material Attributes

Note: we provide a ready-made Houdini Digital Asset with a [CityEngine Material for Mantra](https://github.com/Esri/palladio/releases/download/v1.6.1/PalladioCityEngineMaterial-v2.hdanc).

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).
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).

1. Extend the rule from the first section with a ``color`` statement:
1. Extend the rule from the first section with a `color` statement:
```
attr height = 1
Expand All @@ -65,22 +70,22 @@ In this section, we are going to connect a material attribute generated by ``pld
extrude(height)
```
![](img/materials01.png)
1. 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``.
1. Add a ``Material`` node and connect it to the ``pldGenerate`` node. Make it the active render node:
1. 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`.
1. Add a `Material` node and connect it to the `pldGenerate` node. Make it the active render node:
![](img/materials02.png)
1. In the ``Material Palette``, create a new ``Principled Shader`` instance and call it ``CityEngineShader``:
1. In the `Material Palette`, create a new `Principled Shader` instance and call it `CityEngineShader`:
![](img/materials03.png)
1. Enter the ``CityEngineShader`` node and connect a ``Parameter`` node to the ``Surface/basecolor`` input:
1. Enter the `CityEngineShader` node and connect a `Parameter` node to the `Surface/basecolor` input:
![](img/materials04.png)
1. Set the name of the ``Parameter`` node to ``color`` and also set the type to ``Color``. This name will match the primitive attribute emitted by ``pldGenerate``.
1. Set the name of the `Parameter` node to `color` and also set the type to `Color`. This name will match the primitive attribute emitted by `pldGenerate`.
![](img/materials05.png)
1. Back in the network of the ``grid`` node, select the ``Material`` node and select ``/mat/CityEngineShader`` for the ``Material`` parameter.
1. Back in the network of the `grid` node, select the `Material` node and select `/mat/CityEngineShader` for the `Material` parameter.
1. Hit Mantra render and you should see a red box in the render view.
Expand Down
7 changes: 7 additions & 0 deletions pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ import com.esri.zrh.jenkins.psl.UploadTrackingPsl
[ os: cepl.CFG_OS_WIN10, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_VC142, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64, houdini: '18.0' ],
]

@Field final List CONFIGS_HOUDINI_185 = [
[ os: cepl.CFG_OS_RHEL7, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_GCC63, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64, houdini: '18.5' ],
[ os: cepl.CFG_OS_WIN10, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_VC142, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64, houdini: '18.5' ],
]


// -- PIPELINE

@Field String myBranch = env.BRANCH_NAME
Expand Down Expand Up @@ -57,6 +63,7 @@ Map taskGenPalladio() {
// FIXME: this is a workaround to get unique task names
tasks << cepl.generateTasks('pld-hdn17.5', this.&taskBuildPalladio, CONFIGS_HOUDINI_175)
tasks << cepl.generateTasks('pld-hdn18.0', this.&taskBuildPalladio, CONFIGS_HOUDINI_180)
tasks << cepl.generateTasks('pld-hdn18.5', this.&taskBuildPalladio, CONFIGS_HOUDINI_185)
return tasks;
}

Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/dependencies.cmake)
### versioning

set(PLD_VERSION_MAJOR 1)
set(PLD_VERSION_MINOR 8)
set(PLD_VERSION_MINOR 9)
set(PLD_VERSION_PATCH 0)
set(PLD_VERSION_PRE "") # set to empty string for final releases
if(NOT PLD_VERSION_BUILD)
Expand Down
2 changes: 1 addition & 1 deletion src/conanfile-h17.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ def requirements(self):
if "PLD_CONAN_CESDK_VERSION" in os.environ:
cesdk_version = os.environ["PLD_CONAN_CESDK_VERSION"]
else:
cesdk_version = "2.2.6332"
cesdk_version = "2.3.6821"
self.requires("cesdk/{}@esri-rd-zurich/stable".format(cesdk_version))
2 changes: 1 addition & 1 deletion src/conanfile-h175.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ def requirements(self):
if "PLD_CONAN_CESDK_VERSION" in os.environ:
cesdk_version = os.environ["PLD_CONAN_CESDK_VERSION"]
else:
cesdk_version = "2.2.6332"
cesdk_version = "2.3.6821"
self.requires("cesdk/{}@esri-rd-zurich/stable".format(cesdk_version))
2 changes: 1 addition & 1 deletion src/conanfile-h180.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ def requirements(self):
if "PLD_CONAN_CESDK_VERSION" in os.environ:
cesdk_version = os.environ["PLD_CONAN_CESDK_VERSION"]
else:
cesdk_version = "2.2.6332"
cesdk_version = "2.3.6821"
self.requires("cesdk/{}@esri-rd-zurich/stable".format(cesdk_version))
22 changes: 22 additions & 0 deletions src/conanfile-h185.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import os
from conans import ConanFile


class PalladioConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"

def requirements(self):
self.requires("catch2/2.0.1@bincrafters/stable")

if "PLD_CONAN_HOUDINI_VERSION" in os.environ:
self.requires("houdini/{}@sidefx/stable".format(os.environ["PLD_CONAN_HOUDINI_VERSION"]))
else:
self.requires("houdini/[>18.5.0 <19.0.0]@sidefx/stable")

if "PLD_CONAN_SKIP_CESDK" not in os.environ:
if "PLD_CONAN_CESDK_VERSION" in os.environ:
cesdk_version = os.environ["PLD_CONAN_CESDK_VERSION"]
else:
cesdk_version = "2.3.6821"
self.requires("cesdk/{}@esri-rd-zurich/stable".format(cesdk_version))
15 changes: 12 additions & 3 deletions src/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@ conan_check(VERSION 1.20 REQUIRED)
### select Houdini version and required toolchain

if (NOT PLD_HOUDINI_VERSION)
set(PLD_HOUDINI_VERSION "18.0") # use Houdini 18.0 by default
set(PLD_HOUDINI_VERSION "18.5") # use Houdini 18.5 by default
endif()

string(REPLACE "." ";" PLD_HDN_VER "${PLD_HOUDINI_VERSION}")
list(GET PLD_HDN_VER 0 PLD_HDN_VER_MAJ)
list(GET PLD_HDN_VER 1 PLD_HDN_VER_MIN)

# Houdini 18.5
if (${PLD_HDN_VER_MAJ} STREQUAL "18" AND ${PLD_HDN_VER_MIN} STREQUAL "5")
message(STATUS "Asking Conan for Houdini 18.5...")
set(PLD_CONANFILE "conanfile-h185.py")

# Houdini 18.0
if (${PLD_HDN_VER_MAJ} STREQUAL "18" AND ${PLD_HDN_VER_MIN} STREQUAL "0")
elseif (${PLD_HDN_VER_MAJ} STREQUAL "18" AND ${PLD_HDN_VER_MIN} STREQUAL "0")
message(STATUS "Asking Conan for Houdini 18.0...")
set(PLD_CONANFILE "conanfile-h180.py")

Expand Down Expand Up @@ -93,7 +98,11 @@ function(pld_add_dependency_houdini TGT)
target_compile_definitions(${TGT} PRIVATE -DPLD_BOOST_NS=hboost)
if(PLD_WINDOWS)
set(houdini_lib_path "${_houdini_install_root}/custom/houdini/dsolib")
set(houdini_hboost_fs hboost_filesystem-mt)
if (${Houdini_VERSION_MINOR} STREQUAL "5")
set(houdini_hboost_fs hboost_filesystem-mt-x64)
else()
set(houdini_hboost_fs hboost_filesystem-mt)
endif()
elseif(PLD_LINUX)
set(houdini_lib_path "${_houdini_install_root}/dsolib")
set(houdini_hboost_fs hboost_filesystem)
Expand Down
Loading

0 comments on commit 28e968d

Please sign in to comment.