Change color particular node by default

   5758   9   2
User Avatar
Member
19 posts
Joined: Aug. 2015
Offline
Hello guys!
How I can change color particular node (in my case i want change color of file cache node) from white to purple or red, and make it by default?

Thanks forward!
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Two ways to do this:

Create/edit Houdini node operator creation script.
or
Modify the Tool Script.


For the operator creation script, you can add or edit the tool command script.
Every node in Houdini will run it's companion creation command script. You can add an hscript colour line to the script.

Here's an example of adding a creation script for the Add SOP, one of the c++ compiled operators for Houdini:


# add.cmd - Creation script for the Add SOP
\set noalias = 1

if ( “$arg1” == “” ) then
echo This script is intended as a creation script
exit
endif

opcolor -c 0.5 0.2 0.8 $arg1


Here's a link to a good tutorial on how to set this up in Houdini:

http://houdinitricks.com/post/130285694014/quicktip-configure-operators-with-event-scripts



Tool Scripts are another and in most cases the preferable way to add custom behaviours when you add a node.

This is a fantastic way to add behaviours to your own assets.

For any Houdini Digital Asset type nodes, you can open the Edit Operator Type Properties and edit the Tool creation script.

Here's an example for the Scatter SOP in Houdini. You can find the Scatter SOP on the tool shelf, then RMB (Right Mouse Button) menu and choose to edit the tool. In the scripts folder, you can change this:


import soptoolutils

soptoolutils.genericTool(kwargs, ‘scatter::2.0’)


to this:


import soptoolutils

node = soptoolutils.genericTool(kwargs, ‘scatter::2.0’)

node.setColor(hou.Color())


Pass the output of the soptoolutils to a variable like node and then you can do more work on node.

You can set the colour, set up other node options as well.


Hope this helps.
There's at least one school like the old school!
User Avatar
Member
19 posts
Joined: Aug. 2015
Offline
Yes!

Than you, Jeff!

Very useful and open for understanding.

Today I will try to modify some SOP's and post here my results.

Houdini forum as always give me right answer less than one day,

Love you guys!
User Avatar
Member
19 posts
Joined: Aug. 2015
Offline
Thank you again, Jeff,

Your info help me a lot,

I have one question, where I can found full list of operators in Mac OS folder for modify like i see from tutorial about geo.cmd?

This way very useful for me because help store modify cmd files and can be transferred from one version Houdini to another.

Way through EDIT TOOL much faster but I don't know how I can transfer it from 14 to 15.
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
The install directory for Houdini support files is:

/Library/Frameworks/Houdini.framework/Versions/15.0.381/Resources/houdini/scripts

This is a version specific directory which is great for grabbing existing .cmd node creation scripts but not so great for installing any custom files that you add to your environment and configuration.

The best place to install your changes is set up with the Houdini specific environment variable: $HOUDINI_PATH

On the mac, $HOUDINI_PATH is set up to look in to a few folders with one being the shared directory:
/Users/Shared/houdini/15.0
You can add a new directory called “scripts” in the shared 15.0 directory then install your .cmd node override scripts in the 15.0/scripts directory. Any scripts located in this directory will override scripts in the base install directory for Houdini.

Installing your .cmd scripts in this directory will allow any install of H15.0 to use them. This is a mac specific set-up and isn't the same on either Windows or Linux.


You can also set and use the environment variable $HSITE and point this variable at another shared directory location. Search the help and the web to see more about setting and managing $HSITE as well as $HOUDINI_PATH. The main benefit to $HSITE is that you can install tools on a central server machine and let many users point to this directory.
There's at least one school like the old school!
User Avatar
Member
19 posts
Joined: Aug. 2015
Offline
Okay, shared folder is another way, super,

but I can't find in this directory

(/Library/Frameworks/Houdini.framework/Versions/15.0.381/Resources/houdini/scripts)

for example scatter.cmd for modify and store it in my custom scripts folder,

and if I want modify DOP network I can't do this from the shelf too.

Yes, many questions, but, thank you Jeff anyway!
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Ahh that is because I copied one of the existing .cmd files and edited it then saved it as scatter.cmd and put it in one of the above directories.

These days most operators do not have node creation scripts as we rely on the asset tool script to add behaviours when the node is put down.

I forgot to mention this…
There's at least one school like the old school!
User Avatar
Member
19 posts
Joined: Aug. 2015
Offline
jeff
Ahh that is because I copied one of the existing .cmd files and edited it then saved it as scatter.cmd and put it in one of the above directories.

These days most operators do not have node creation scripts as we rely on the asset tool script to add behaviours when the node is put down.

I forgot to mention this…


So, and how I can modify DOP network for example? I use it a lot and don't want spent time for apply colors and so on…?
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Most DOP networks are constructed from Shelf Tools for set-up.

This means you can edit the Tool itself to add colors to the nodes.
There's at least one school like the old school!
User Avatar
Member
19 posts
Joined: Aug. 2015
Offline
jeff
Most DOP networks are constructed from Shelf Tools for set-up.

This means you can edit the Tool itself to add colors to the nodes.

Ok, I got it, thank you Jeff,

Good day/night!

I save this topic in favorites for remind.
  • Quick Links