Context codes for scripts

   3533   9   1
User Avatar
Member
319 posts
Joined:
Offline
Hello,

I am dynamically writing creation scripts for nodes based on user preferences selected from a pyqt gui. My scripts get created here:-

~/houdiniX.Y/scripts/<context>/<node type>.py

So for example when I place down a null sop, the ~/houdini13.0/scripts/sop/null.py script gets executed. Most contexts seem to look into a logical directory for node creation scripts, sops look in /sop, pops look in /pop etc. but I have found a couple of exceptions.

For example cops do not look for /cop, they look for /cop2. The context I am having most trouble with is dops. I have tried dop, dops, dopnet, Dop, Dops, Dopnet but I just can't get a creation script to execute for a dop node. Does anyone know what the directory needs to be named for this context?

Also, does anyone know where or if this list is documented?

Finally, is anyone aware of a hom command which returns these context types for a node which correspond to where node creation scripts have to look? I am aware of things like mynode.type() or mytype.category()/nameWithCategory() etc but these are not what I need as none of them return the magic directory naming required for a dop node to look up a creation script (despite them returning something which works for other contexts).

Thanks for any help or clarification on the subject.
User Avatar
Member
8583 posts
Joined: July 2007
Online
for dops it's called: dop
(tried, works)

you can see the directory names in: $HFS/houdini/scripts
where the default creation scripts live
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
319 posts
Joined:
Offline
Hey Tomas,

Can I ask what node you tried it with and what script you executed?

Trying it now, both with a .py and .cmd, and neither will execute!

Oh, and the build I am trying is 13.0.401..
User Avatar
Member
8583 posts
Joined: July 2007
Online
simple .py script (13.0.401)
print “%s says hello” %kwargs
tried with merge and sopsolver

but you are right it seems not to work for hda's like null, or pyrosolver
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
319 posts
Joined:
Offline
Yep, just tried it with a merge dop and it works for that, but not with null, gasfieldvop or rbdobject.

That's somewhat annoying!
User Avatar
Member
678 posts
Joined: July 2005
Offline
Do you really need them? I'v been on the same track couple months ago and solution wasn't nice http://forums.odforce.net/topic/20158-why-my-initialization-script/ [forums.odforce.net]
User Avatar
Member
319 posts
Joined:
Offline
Yeah I came across your odforce post when trying to research a solution. Not sure I wish to go down the expanding/collapsing route!

May have to rethink a different way…
User Avatar
Member
665 posts
Joined: July 2005
Offline
http://houdinitoolbox.com/houdini.php?asset=38 [houdinitoolbox.com]

Check out Graham's toolbox. He has a method to run an init script no matter what type of node is dropped down.
User Avatar
Member
8583 posts
Joined: July 2007
Online
so apparently you can put onCreated.py file to your $HOME/houdiniX.Y/scripts/
which will be run every time any node is created
you can do filtering by type there
seems pretty powerful:
http://forums.odforce.net/topic/12280-colour-codes/?p=77600 [forums.odforce.net]
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
319 posts
Joined:
Offline
Ah, thanks guys, both routes seem to present possible solutions.

Cheers!
  • Quick Links