Jump to content
Nerox

Colour codes

Recommended Posts

Ghaha, yep it 'insiders only' jargon I suppose. Welcome to the 'club' ;-)

Share this post


Link to post
Share on other sites

...and now for something not entirely different...

This is how my Null SOP's default preset looks like:

post-56-0-30142100-1377778648_thumb.png

These buttons are one-liner python scripts which rename and colorize the Null accordingly. So I never type "OUT", I just click. :))

I color "display" nodes to blue (same as display flag color); OUTs (render outputs) are purple (same as render flag color), animated ones are yellow, "waypoints" (important network points marking end of a section) are red, and that's about it. ("export points", e.g. where I fetch data from to other networks are green)

I'll check out this OnCreated.py script, I didn't know this functionality existed. I wish it was documented...

A word of warning: don't go too crazy with colors, or else you end up with networks that drive you crazy because they look like rainbows, and you lose what you thought you'd gain.

This is an actual production network (hence a few dead ends :)), IMHO this is the amount of coloring that provides relevant information without polluting everything with colored candy :))

post-56-0-27318200-1377779466_thumb.png

Edited by riviera
  • Like 1

Share this post


Link to post
Share on other sites

This is how my Null SOP's default preset looks like:

post-56-0-30142100-1377778648_thumb.png

These buttons are one-liner python scripts which rename and colorize the Null accordingly. So I never type "OUT", I just click. :))

Oh wow that is really neat. Any insight on how you would create this? I didn't know you could modify existing nodes like that! I'm also tired writing OUT all the time, hehe.

Share this post


Link to post
Share on other sites

I know I'm going to lose lots of $$$-s, but I'll tell it for free :)

You can add buttons as spare parameters (Edit Parameter Interface...), then use a one-liner callback script (python) like:


hou.pwd().setName("DISPLAY"); hou.pwd().setColor(hou.Color((0,.4,1))); hou.pwd().setDisplayFlag(True);

[/CODE]

or

[CODE]
hou.pwd().setName("RENDER"); hou.pwd().setColor(hou.Color((.4,.2,.6))); hou.pwd().setRenderFlag(True);

[/CODE]

or

[CODE]
hou.pwd().setColor(hou.Color((.8,.8,.8))); hou.pwd().setName("OUT"); hou.pwd().setRenderFlag(True); hou.pwd().setDisplayFlag(True);

[/CODE]

This is for DISPLAY, RENDER and OUT, accordingly.

Once you added all buttons of your liking, you save the parameters as defaults ("Save as Permanent Defaults").

I have quite a few operators where I added some extra interface for convenience (for example my Object Merge SOP has a button which auto-names the SOP based on the name of the geometry that is merged).

cheers

  • Like 1

Share this post


Link to post
Share on other sites

As an opportunity for another shameless plug, qLib comes with galleries that are basically regular Houdini nodes with some similarly customized interfaces.

This is a regular Null SOP that provides information about its input geometry (also has auto-naming buttons). You can link those bounding box parameters on the Null to initial boundaries of a pyro sim to have a really fitting initial container, for example.

post-56-0-58259500-1377950302_thumb.png

...or you can just go really nuts and roll an "align geometry" operator from a single Transform SOP: https://www.facebook...598018626898592

Very useful. (Although not strictly color-coding, but at least it's user interface-related :))

Edited by riviera

Share this post


Link to post
Share on other sites

Oh my god, you are my hero Imre! Thank you so much for sharing!

qLib looks interesting as well, I'll have a look at that :)

Share this post


Link to post
Share on other sites

You're welcome, no big deal. :)

In the meantime I took a look at this OnCreated.py -- here's my take on it, a minimalistic version, just by node type.

I found that although on SOP level one is better careful about coloring, it can be quite the opposite on the OBJ level (probably because there's much less node types to choose from). Right now I find very helpful to color objects, lights and cameras differently. (This might change, though :))

cheers

OnCreated_py.zip

Share this post


Link to post
Share on other sites

Posted this in the other thread but might as well post it here since this is still where all the action is:

Since my code examples are quite old now I have a fairly new version of all my code available here: https://github.com/c...Houdini-Toolbox

The coloring related stuff is located in:

python/ht/nodes/colors/ (python files that do most of the work)

houdini/config/gcs.json (example .json definition file)

houdini/scripts/ (initializer and event handlers to handle the automatic coloring)

Improvements include:

- Object oriented

- Data stored in .json file

- Supports wildcards in the names to match against

- Supports proper order precedence

Share this post


Link to post
Share on other sites

Posted this in the other thread but might as well post it here since this is still where all the action is:

Since my code examples are quite old now I have a fairly new version of all my code available here: https://github.com/c...Houdini-Toolbox

The coloring related stuff is located in:

python/ht/nodes/colors/ (python files that do most of the work)

houdini/config/gcs.json (example .json definition file)

houdini/scripts/ (initializer and event handlers to handle the automatic coloring)

Improvements include:

- Object oriented

- Data stored in .json file

- Supports wildcards in the names to match against

- Supports proper order precedence

Sounds interesting! Mind explaining how to get it working? I couldn't figure out where to put the files, specifically the python/ht ones. 

Share this post


Link to post
Share on other sites

You can get away with putting them in your $HOME/houdiniX.Y folder.

 

$HOME/houdiniX.Y/scripts/python/rh/nodes/colors/[__init__.py|parser.py]

$HOME/houdiniX.Y/config/gcs.json

$HOME/houdiniX.Y/scripts/[456.py|OnCreated.py|OnNameChanged.py]

Share this post


Link to post
Share on other sites

You can get away with putting them in your $HOME/houdiniX.Y folder.

 

$HOME/houdiniX.Y/scripts/python/rh/nodes/colors/[__init__.py|parser.py]

$HOME/houdiniX.Y/config/gcs.json

$HOME/houdiniX.Y/scripts/[456.py|OnCreated.py|OnNameChanged.py]

Lovely, works like a charm! And then you can very simply add your own keywords and colors in the .json-file. Great work as always Graham :)

Share this post


Link to post
Share on other sites

Great idea. I would like the color nodes (Color, PopColor, etc) to reflect the parameter color setting. 

Share this post


Link to post
Share on other sites

Thanks to everybody contributing here especially graham. Now I would like to go one step further, but I'm a noob in python, so I hope for you to help me. :P

I want to have a network box "Lights" created if I add a new light to the scene. Every light created from this point on should be placed inside this networkbox.

Edited by Drughi

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×