Script tg_node_display_options

Started by Kevin Kipper, January 08, 2025, 04:32:05 AM

Previous topic - Next topic

Kevin Kipper

There are over twenty types of nodes in Terragen that have some kind of display options for viewing the node in the 3D Preview.  As you can see in the image below the potential for visual clutter starts to add up as more and more nodes are added to the project. 

tg_node_display_options_before.jpg

Terragen provides a number of ways to set an item's display options ranging from manually setting the options for each node to globally hiding or unhiding all object nodes via the "Perform an action" button at the bottom of the Object List.  Even so, some node types such as Cloud layer nodes and Light nodes must be completely disabled in order to hide them in the 3D Preview, which is not always ideal.

This script allows you to select any type of node listed in its UI and turn the display options on or off, or to toggle between the two settings.  Some node classes, like Camera, have multiple display options, and with this script you can choose which of those options to affect.

tg_node_display_options_gui.jpg

This version of the script affects all the nodes of a particular class in the project. For example, you can turn off the "Show b-box in preview" option of all the Simple Shape shaders in the project at once.  With another click of the button you can turn them back on.  Some nodes let you choose between multiple display modes like "Bounding box", "Wireframe", or "Smooth shaded".  Currently the script doesn't keep track of the original display mode, and toggles between "Hidden" mode and "Texture" mode, but that feature may be something to add in the future.

tg_node_display_options_after.jpg

Instead of affecting all nodes of a particular class, I was toying with the idea of affecting only nodes selected in the Node Network, but now I'm thinking it would be better to make that a separate script without a UI.  It would be more akin to selecting a node in the Node Network and pressing the "d" key to disable it.  Let me know what you think.

Just to clarify, the script does not affect the render state of a node, only its preview options, i.e. how it is displayed in the 3D preview.

This script is now included with the redmaw-tg-toolkit repository.
 
Click the link below for download and installation information for the entire toolkit.
https://github.com/RedMawVFX/redmaw-tg-toolkit

Or, click the link below to go directly to the tg-node-display-options folder in the toolkit.
https://github.com/RedMawVFX/redmaw-tg-toolkit/tree/main/scripts/tg-node-display-options