Skip to content

Feature/rm stylized node display#6967

Open
IRONIC3D wants to merge 2 commits into
GafferHQ:mainfrom
IRONIC3D:feature/rm-stylized-node-display
Open

Feature/rm stylized node display#6967
IRONIC3D wants to merge 2 commits into
GafferHQ:mainfrom
IRONIC3D:feature/rm-stylized-node-display

Conversation

@IRONIC3D

Copy link
Copy Markdown
Contributor

Generally describe what this PR will do, and why it is needed

This PR is to reduce the display of RenderMan Stylized Looks Shading nodes, as these nodes are used heavily currently they expose every parameter as an input node. I've made changes to the visible ports by default based on usage.

  • PxrStylizedControl: Reduced the default ports that are displayed to minimize the size of the node.
  • PxrStylizedHatchControl: Reduced the default ports that are displayed to minimize the size of the node.
  • PxrStylizedLineControl: Reduced the default ports that are displayed to minimize the size of the node.
  • PxrStylizedToonControl: Reduced the default ports that are displayed to minimize the size of the node.
  • README: During building on a fresh Windows 11 environment many issues during the build were causing the build to error out. This is due to configuration on windows vs Linux. I've updated the README file with windows specific builds and how to prepare for the build.

Related issues

  • README: During building on a fresh Windows 11 environment many issues during the build were causing the build to error out. This is due to configuration on windows vs Linux. I've updated the README file with windows specific builds and how to prepare for a successful build.
  • PxrStylizedControl: Node display is much more manageable and correctly reflects actual use for required ports.
  • PxrStylizedHatchControl: Node display is much more manageable and correctly reflects actual use for required ports.
  • PxrStylizedLineControl: Node display is much more manageable and correctly reflects actual use for required ports.
  • PxrStylizedToonControl: Node display is much more manageable and correctly reflects actual use for required ports.

Dependencies

  • None

Breaking changes

  • There are no breaking changes

Checklist

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have tested my change(s) in the test suite, and added new test cases where necessary.
  • My code follows the Gaffer project's prevailing coding style and conventions.

@johnhaddon johnhaddon requested a review from ericmehl June 11, 2026 16:52
@johnhaddon

Copy link
Copy Markdown
Member

Reminder to review this please @ericmehl

@ericmehl ericmehl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @IRONIC3D for contributing this! Those stylized looks nodes are much more reasonably sized with this. I apologize for letting the Windows build description fall behind, looks like you had to jump through some hoops to get this working.

The code for your original goal of reducing the nodules on the stylized shader nodes looks good. I left some comments on the build instructions that hopefully will simplify that.

If you want to get the nodule commit merged before going through the README changes, it might be easiest to just create a new branch, cherry pick that commit and submit it as a new PR for just the nodule changes.

Comment thread README.md
../gaffer-build/bin/gaffer
```

### Build process on Windows 11###

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a space between the 11 and the trailing # signs. Otherwise it will display the actual hash symbols rather than interpret it as a formatting code.

Comment thread README.md

```bash
# Must be executed inside Git Bash to interpret the .sh file
./config/installDependencies.sh ../gaffer-build

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the use of installDependencies.sh (also mentioned above in the main build instructions) is out of date now. Even easier than using git bash is to run .github/workflows/main/installDependencies.py. On Linux you can run that script directly, on Windows you need to do python .github/workflows/main/installDependencies.py (Windows doesn't recognize Python scripts as being executable).

Might be worth putting this into the shared build steps since it's now cross-platform?

Comment thread README.md
```
Once the dependencies finish unpacking into your gaffer-build directory, close Git Bash.

#### 2- Install Scons

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm kind of inclined to let this step be covered by the Main build requirements section above, where scons is mentioned. I don't think scons is installed by default on most Linux distributions, so maybe it's worth adding a note to the shared build steps that it can be installed using pip install scons?

Comment thread README.md

```powershell
:: 1. Navigate to your local clone directory
cd path\to\your\gaffer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure this shouldn't be needed since pip will install scons for the user / system-wide Python interpreter, independent of the current directory.

Comment thread README.md
pip install scons
```

#### 3- Add existing 7-Zip to your System PATH

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! This is definitely missing from the instructions and could trip up someone using the installDependencies.py script. I think it might be helpful to add it to the Main build requirements a bit further up in this file.

I'm wary though of including instructions for adding it to the system PATH. That requires administrator privileges that I'm guessing users in a lot of studios won't be able to elevate to.

I think the 7zip installer should handle adding itself to PATH, did you find that not to be the case?

Comment thread README.md
- Click OK on all windows to save.
- Restart your terminal and run the script again.

#### 4- Force Python to use UTF-8 encoding in this PowerShell window

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch here too, this is needed and unique to Windows. Similar to above, I'm a little reluctant to add it to the system variables. I assume it requires elevation to admin, or the Powershell session itself needs to be admin? It would also have side effects for other Python sessions that may cause issues.

In Powershell, you can do $env:PYTHONUTF8=1 to set it for just the terminal session you're in and not have to worry about it affecting other uses of Python.

Comment thread README.md

Before you can build you need to setup a few things because of the difference between linux and windows. Windows requires a little bit more hand holding. Make sure you do these steps below for a successful and fluid build.

***1. Inkscape Errors:*** Gaffer utilizes Inkscape purely during the compilation phase to automatically convert all of the UI icon assets (.svg vector files) into .png raster graphics for the application layouts. But the problem is that even though Inkscape might be in the environment path scons will not find it. So we have to force it in the command line. The line to add at the end of the build command is `INKSCAPE="C:\Program Files\Inkscape\bin\inkscape.exe" --config=force`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, which version of Inkscape are you using? I think this may be a problem with newer versions and holding back a few versions older may solve the problem.

We're using 1.2.2 in the CI builds (see .github/workflows/main.yml). I've been remiss about adding this to the version information for Inkscape in the section above.

Comment thread README.md

***1. Inkscape Errors:*** Gaffer utilizes Inkscape purely during the compilation phase to automatically convert all of the UI icon assets (.svg vector files) into .png raster graphics for the application layouts. But the problem is that even though Inkscape might be in the environment path scons will not find it. So we have to force it in the command line. The line to add at the end of the build command is `INKSCAPE="C:\Program Files\Inkscape\bin\inkscape.exe" --config=force`

***2. Scons cannot see installed git:*** Same issue with Inkscape we'll need to create a symbolic link to the real git for scons to see. Open power shell in elviated privilages

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is interesting, I wonder if this is something that's a problem in the Scons environment. Are you able to run git in the terminal you're building from, something like git -v to print version information? Is the git binary directory in your PATH? (You can do echo $env:PATH in your Powershell terminal to check it).

Comment thread README.md
New-Item -ItemType SymbolicLink -Path "C:\src\gaffer-build\bin\git.exe" -Target "C:\Program Files\Git\bin\git.exe"
```

***3. GLEW.lib:*** The linker will blow up looking for GLEW.lib, the fix is to find the real file, and create a mirror copy named exactly what the linker wants.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this, and possibly some of the Inkscape stuff above, can be helped by using the sconsOptions file. In the CI build, we add OPTIONS=.github/workflows/main/sconsOptions to the command to set some Scons options.

The key one in that options file for GLEW is GLEW_LIB_SUFFIX = "32" That should point your build to the right version and not need to horse around with hard-linking.

Comment thread README.md
New-Item -ItemType HardLink -Path "C:\src\gaffer-build\lib\GLEW.lib" -Value "C:\src\gaffer-build\lib\glew32.lib"
```

***4. Build Time:*** By default, SCons acts conservatively and compiles everything on a single CPU thread. You need to explicitly tell it to spin up parallel workers using the -j (jobs) flag. ***Note: switching to multi core build will error out when reaching the Inkscape stage. Because you split the build into multiple parallel threads using `-j 8`, Gaffer launched 8 separate instances of Inkscape simultaneously, all trying to access the exact same SVG file at once. Inkscape on Windows often handles parallel thread calling very poorly, resulting in memory overflows and crashes. Since you only need to build these icons once (and they don't change when you tweak your RenderMan C++ node code), you can bypass this multi-threaded bug easily.Because SCons tracks file generation states, it will not recompile any of your C++ code. All your RenderMan and Gaffer UI objects are already safely compiled as .obj and .dll binaries from your last run. So make sure to run the build again with `-j 1` when the build errors out on the icons

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully this can be simplified by using the sconsOptions file I mention above, along with a better-working Inkscape. That options file will also take care of setting up RENDERMAN_ROOT, ARNOLD_ROOT, and DELIGHT_ROOT.

That options file does require having 3Delight and ONNX installed and configured, which can be done with Python scripts in the .github/workflows/main directory.

@IRONIC3D

Copy link
Copy Markdown
Contributor Author

Thanks Eric, I'll cherry pick the nodal changes and submit another PR. I'll check your notes about the README and respond later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants