Jump to content

How to embed...?


hoknamahn

Recommended Posts

VEX functions can just be embedded into your VOP networks and/or shop nodes under the VEX Code section.

As for hscript code, right-click on your custom operator and choose "Operator Type Manager". This should bring up a new dialog with your operator type highlighted. Right-click on this and choose "Edit Contents..." Click on the Help button in this new window for instructions.

PS. Now added to the OdWiki under CustomOperators.

Link to comment
Share on other sites

There are only 2 types of Custom Operators; Subnet types and VEX types. The only way to "combine" them is to have one of each, but the subnet can contain the VEX type.

i.e. In the OperatorTypeManager you'll see two entries. There is no way to state within an OTL that the VEX "belongs" to the Subnet type. In other words, if you wish to copy the subnet operator to another OTL, you're going to have to take care to manually copy the VEX type too. (I wish this was different, by the way - I'd love to be able to form a heirarchy inside of an OTL. It would make administration of complex heirarchical OTLs much less error-prone. RFE? :))

So, basically, subnet operators can contain other subnet ops and VEX ops, but it doesn't imply that children nodes are "owned" by the parent subnet.

ps. also odWiki'd - probably in better English:)

Link to comment
Share on other sites

I don't want to combine VEX and subnet operator types.

Okay, little more details.

We have one subnet type operator which contains... Transform SOP.

And some function which controls tx, ty and tz channels of this Transform SOP. How to embed this function into this custom operator library? And how to call it after embedding?

Link to comment
Share on other sites

We have one subnet type operator which contains... Transform SOP.

And some function which controls tx, ty and tz channels of this Transform SOP. How to embed this function into this custom operator library? And how to call it after embedding?

OK. I haven't done this, but it's worth a try:

After you've created your OP, add the file with all your functions to the op definition as per Edward and Jason's suggestions.

Then add an event handler for maybe the "Before First Create" or "On Created" events (intuitively I'd say "Before First Created"). This is just an hscript command to read the embedded functions into the Houdini session. Something like:

exread opdef:/<optype>/<opname>?<otl_section_with_functions>

Then the functions would presumably get loaded into Houdini's global space, ready to use directly, as in:

call_my_function(arg,arg,...)

from inside the TX/TY/whatever fields of your xform sop.

I may be wrong, but I don't think you can slap the URL syntax to the call itself (i.e. you can't put "opdef:/<optype>/<opname>?<otl_section_with_functions>/call_my_function(arg,arg,...)" directly into the channels. That's why I'm thinking you need to bring them into the common scope first...

All of this is untested though...

Cheers.

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...