David Gary Posted May 12, 2004 Share Posted May 12, 2004 Is it possible to embed functions definitions ( for expressions ) in OTLs ? thx for help Quote Link to comment Share on other sites More sharing options...
Jason Posted May 13, 2004 Share Posted May 13, 2004 Yes, it is. You can put all your functions into a .expr file and add the .expr file to your OTL. Now you can exread the expr file out of OTL just like you'd "source" files from within an OTL. You can put the exread command into the OnCreate script or have a button for it or however you need it. Hope this helps, Jason Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted May 13, 2004 Share Posted May 13, 2004 Hi French (is it "David"?), Here's one way to do it (there may be others): Put all your expression functions in one file, then add it to your OTL as a new section (or add an empty section and fill it in). This is done through the OperatorTypeManager->[optype]->EditContents dialog. Let's say you put them in a section called "ExFuncs". Next, you're going to add the following hscript command into a section of the OTL that is guaranteed to run either on every instance, or only once at load time (preferably the latter). The hscript snippet just loads the functions in the section "ExFuncs" into houdini. Something like: exread opdef:/<optype>?ExFuncs Where <optype> is replaced by the path to your type definition (e.g: /Sop/mySop). Now the question is where to put this command. If the OTL already has a "CreateScript" section, then you can put the "exread..." line at the begining of that section... but then you'd have to redo this every time you alter the op definition through the UI. So perhaps a better place would be in the script that runs every time the op gets loaded: this is just another section called "OnCreated". You can either add a section by that name manually, or open up the "Operator Type Properties" dialog and add the line directly in the "Events" tab, for the event handler "On Created". This makes houdini load all the functions embedded in "ExFuncs" every time it loads the op definition, making them available for use by the op itself, or anywhere else in the hipfile where this op is loaded. Hope that makes sense Cheers! @Jason: LOL! we posted at the same time (sorry for the redundancy) Quote Link to comment Share on other sites More sharing options...
David Gary Posted May 13, 2004 Author Share Posted May 13, 2004 Thanks both! (Yes, Mario, it's David!) I just created a special operator that allow to flipbook-render ( could be mantra) all the steps of a modeling process as an animation in one single pass ( that is looping through all the SOPs with time), i will soon post a link to the animation ( i took an example with head modeling). It could be nice that people share their work this way. Quote Link to comment Share on other sites More sharing options...
michael Posted May 13, 2004 Share Posted May 13, 2004 hehe...cool Quote Link to comment Share on other sites More sharing options...
David Gary Posted May 13, 2004 Author Share Posted May 13, 2004 I did it. It's in the modeling section now! 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.