hoknamahn Posted January 25, 2004 Share Posted January 25, 2004 How to embed HScript code and VEX functions into OTL and how to use embedded code? Quote Link to comment Share on other sites More sharing options...
edward Posted January 25, 2004 Share Posted January 25, 2004 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. Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted January 25, 2004 Author Share Posted January 25, 2004 I need to embed VEX (or if you wish expression) function into subnet type custom operator. Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted January 25, 2004 Share Posted January 25, 2004 I need to embed VEX (or if you wish expression) function into subnet type custom operator. A little more detail might help, yes? Quote Link to comment Share on other sites More sharing options...
Jason Posted January 25, 2004 Share Posted January 25, 2004 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:) Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted January 25, 2004 Author Share Posted January 25, 2004 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? Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted January 25, 2004 Share Posted January 25, 2004 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.