Jump to content

Colour codes


Nerox

Recommended Posts

...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
Link to comment
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.

Link to comment
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
Link to comment
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
Link to comment
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

Link to comment
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

Link to comment
Share on other sites

  • 6 months later...

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. 

Link to comment
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]

Link to comment
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 :)

Link to comment
Share on other sites

  • 4 years later...

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
Link to comment
Share on other sites

  • 1 year later...
On 12/19/2010 at 6:10 PM, graham said:

...Any comments or suggestions are welcome since it's just something I hacked together pretty quickly and always has room for improvement.

OnCreated.py.tar.gz

This is awesome! Do you know, how can we also change the shape of the node, not only the color? For example, I usually use a down pointing node, for imports.

Link to comment
Share on other sites

On 10/06/2020 at 8:09 PM, Fake Pilot said:

This is awesome! Do you know, how can we also change the shape of the node, not only the color? For example, I usually use a down pointing node, for imports.

For node’s color and shapes, you don’t have to set them up in OnCreated script at all. If you hold ctrl and drag Shape OR Color to any nodes in networkEditor, that action get saved as your default Shape and or Color. 

  • Like 1
Link to comment
Share on other sites

2 minutes ago, ftaswin said:

For node’s color and shapes, you don’t have to set them up in OnCreated script at all. If you hold ctrl and drag Shape OR Color to any nodes in networkEditor, that action get saved as your default Shape and or Color. 

Are you f***n kidding me?! :blink: That's an amazing tip, never heard it before. :D

  • Haha 1
Link to comment
Share on other sites

50 minutes ago, Fake Pilot said:

Are you f***n kidding me?! :blink: That's an amazing tip, never heard it before. :D

Well, if you appreciate that tip you might like these sets. I used to hate node shapes when sesi introduced them. But since its fully customizable, it went out of controls now. Let me know what you think. 

BA55B277-EEEA-49E8-ACA6-79A9C4470124.jpeg

Link to comment
Share on other sites

Just now, ftaswin said:

Well, if you appreciate that tip you might like these sets. I used to hate node shapes when sesi introduced them. But since its fully customizable, it went out of controls now. Let me know what you think. 

Haha.. Well, I like bat1 and OUT. The other ones, I don't think I would use. :lol:
My setup is usually only making the Output node and Null into an X and black. Object merge into purple down arrow. Wrangle, orange colored. That's basically all I need! B)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...