Jump to content

Chcp


Visual Cortex Lab

Recommended Posts

Actually using a button to call the script is one way to go. Open up the Operator Type Manager and navigate to your digital asset. Right click on it and select "Edit Contents". You can add all of your scripts in there as 'sections'. You will need to give the new script a section name and then click the "Add empty Section" button to create the placeholder for your script. Then select the script from the section list and edit away. To call the script use the opdef sytnax in your callback script in the button parameter of your Digital Asset. For example, if you named your new section "chcopy" you would enter this into the Callback Script parameter of the button:

opdef:.?chcopy

You can add arguments if you like as well which are accessed in the section scripts as $arg1, $arg2, etc. One other thing to consider is the Events section of the Operator Type Properties where you can enter scripts that are automatically called every time certain actions are performed such changing the name of the asset.

And one more tip make it a habit to NEVER have the type properties and edit contents dialoges open at the same time! It is far too easy to make changes in one that are overwritten by accepting changes in the other if both are open.

Click on the ? in your Operator Type Properties to get (a little) more help.

john.

Man,

I never went to that "edit content" !! omg... totally new possibilities now I have!

thanks a lot for pointing me there... your help has been really precious... wow... ok... now you gave me new plans for my saturday! eheheh

thanks a lot for your invaluable help...

I owe you lot of beer once I'll get to LA!!.. someday... hopefully...

cheers :)

Link to comment
Share on other sites

ok John,

I tried to apply your script with my needed changes... and everything works really excellent... except I need the HDA (my scene_setup HDA) to be unlocked to work ... if its unlocked it does exactly what I needed... but if the HDA is just loaded in the scene and its locked by default.. then inner OBJ channel cant be changed cause they are locked....

since this puts me in the same situation as before (I menaged to have same result as with your script with opcopy and needed opwire hscript commnands in my previous callback scripts of this button)... is there a workaround which lets me modify locked HDA inner OBJ, and therefore paste such copied Channels?

the actual scene situation is a collada imported subnet from which I copy channels from the inner OBJ ... and my HDA which have an OBJ inside to which I want to copy previous copied channels... so they are both OBJ...... but the second is inside my locked HDA...

thanks a lot again.

p.s. problem #2..: In case I have a nested HDA inside this "scene_setup_HDA", let's say a "camera_HDA", is there also a way to have camera_HDA parameters inside a folder (or menu) page of my scene_setup_HDA?

Link to comment
Share on other sites

hm... damn i'm stuck again ...

now I'm setting almost everything with opdef:.?myscript in callback parameters...

but most of the things I need to do are using "opparm" or similar hscript commands... which fails .... guess cause the HDA is locked...

I'm definetly doing something wrong here... or I cant understand the reason such scripts shouldnt work even on a locked HDA ... where the sense of making HDA which cant be scripted?...

please put some light in my head on this :)

cheers.

Link to comment
Share on other sites

[one' date=Nov 4 2006, 11:55 AM' post='31774]

ok John,

I tried to apply your script with my needed changes... and everything works really excellent... except I need the HDA (my scene_setup HDA) to be unlocked to work ... if its unlocked it does exactly what I needed... but if the HDA is just loaded in the scene and its locked by default.. then inner OBJ channel cant be changed cause they are locked....

since this puts me in the same situation as before (I menaged to have same result as with your script with opcopy and needed opwire hscript commnands in my previous callback scripts of this button)... is there a workaround which lets me modify locked HDA inner OBJ, and therefore paste such copied Channels?

the actual scene situation is a collada imported subnet from which I copy channels from the inner OBJ ... and my HDA which have an OBJ inside to which I want to copy previous copied channels... so they are both OBJ...... but the second is inside my locked HDA...

thanks a lot again.

p.s. problem #2..: In case I have a nested HDA inside this "scene_setup_HDA", let's say a "camera_HDA", is there also a way to have camera_HDA parameters inside a folder (or menu) page of my scene_setup_HDA?

If I follow what you are describing then you can work with a locked asset as long as you promote up the channels you intend to copy animation on to. Then your HDA scripts just need to update the promoted up channels which works if your HDA is locked. It's always best to build your asset to work locked if at all possible. Don't forget, if you don't want the promoted up channels to be user-editable you can make them invisible. Alternatively, if you really can't find a way to make it work with the locked asset your scripts can control unlocking (see otunsync).

As to the second question, again just promote up the parameters from the inner asset to the asset it is contained within. You can create a folder on the outer asset and place the promoted up parameters in there.

[one' date=Nov 6 2006, 10:26 AM' post='31810]

hm... damn i'm stuck again ...

now I'm setting almost everything with opdef:.?myscript in callback parameters...

but most of the things I need to do are using "opparm" or similar hscript commands... which fails .... guess cause the HDA is locked...

I'm definetly doing something wrong here... or I cant understand the reason such scripts shouldnt work even on a locked HDA ... where the sense of making HDA which cant be scripted?...

please put some light in my head on this :)

cheers.

As I said above the general idea is that any channel you want to be editable should be promoted up to the asset as a parameter that can be edited through scripts. Make a promoted parameter invisible if you don't want the user to change it manually but want to be able to control it through scripts. A common practice is to make asset-level parameters invisible so they can be used in a similar way to variables when they are queried by scripts.

Hope that helps

John.

Link to comment
Share on other sites

.... again ... you turned on some many lights on this ... that I cant believe I'll pass my next 3/4 days doing this HDA from scratch.. and again with totally new vision of all the thing.

the word "thanks" doesnt fit enought what I'd say to you.

... but I know no other word... so...

THANKS John.... a lot.

cheers

Link to comment
Share on other sites

[one' date=Nov 6 2006, 06:55 PM' post='31819]

.... again ... you turned on some many lights on this ... that I cant believe I'll pass my next 3/4 days doing this HDA from scratch.. and again with totally new vision of all the thing.

the word "thanks" doesnt fit enought what I'd say to you.

... but I know no other word... so...

THANKS John.... a lot.

cheers

Glad to hear you are making progress.

j.

Link to comment
Share on other sites

ok... next question.

how do i pass parameters value from a script to another?... example..

I've got a parameter which is a "file" type... where i get the path for a certain file...

then I've got a button.. which should run a script .. which involves using above file as well...

the only way i menaged to be able to do this now.. is by setting a variable for every such parameter... but I'm sure ther's a way to do that without filling up my "aliases and variables" pane ... :)

thanks in advance...

Link to comment
Share on other sites

[one' date=Nov 7 2006, 11:53 AM' post='31829]

ok... next question.

how do i pass parameters value from a script to another?... example..

I've got a parameter which is a "file" type... where i get the path for a certain file...

then I've got a button.. which should run a script .. which involves using above file as well...

the only way i menaged to be able to do this now.. is by setting a variable for every such parameter... but I'm sure ther's a way to do that without filling up my "aliases and variables" pane ... :)

thanks in advance...

Just query the asset parameter directly from the asset script (section) that is called by the button:

set file = `chs("./file")`

or pass it to the asset script as an argument in the callback script of your button

opdef:.?fileScript `chs("./file")`

which you can access in the asset script using $arg1

set file = "$arg1"

Link to comment
Share on other sites

..... ok ... (thanks is obsolete... i wont repeat myself :)) ...

my "last" question is more an... how to manage otls question ...

I did searched in the forums... and found couple of thread where Jason wrote his workflow (at D2 I guess) on how to manage different Oplibrariers location...

but even after having read lot of help pages.... the whole above threads... i cant figure how to properly set the variables to have more HOUDINI_OTL_PATH where to search for Oplibraries files....

so now I've got my $HOME/houdini8.1/Oplibraries file which contains different locations for the otls to load... but... i cant find such PATHs in the "Install Operator Type" drop down menu for example... just "Current HIP" and "$HOME/houdini8.1" which is not enought... if I'll plan to be the primary TD here...

I must be honest.. I'm starting to be confused about the overall method, workflow... on how to manage Otls in a "distributed environment"... and also basically on how to develop 'em ... i mean .. the "Edit content" editor.. aint surely an editor.. and using an external editor aint that fun since you dont have access to others scripts name/parameters names....

ok too much asked here... but maybe you can give me a basic idea on how to manage my "TD for dummies" personal experience :) .. which you already really made it possibile until now... really.

This thread I guess became something really helpfull to many people anyway ... since I had not much chance to find good (not as good as your replies at least) reference/examples/guidelines on HDA development... thanks a lot. (oh now.. i did it!)

cheers.

Link to comment
Share on other sites

From what I remember you only need a single OPlibraries file which contains a list of all the OTLs to load when starting Houdini. The paths can be relative to the OPlibraries location or you can use absolute paths. You can also #include other OPlibraries files.

Typically where you want to make OTLs available show-wide or shop-wide you would have a single OPlibraries file somewhere in the path that is seen by all users and that file is edited every time a new OTL is published to include a link to the new OTL's location (obviously you might want to make this file protected). You can have a list of OTLs for "personal use" by having your own OPlibraries file which you place in your houdini8.0 folder.

I haven't been using OTLs for a long time so I'm a bit rusty. I'm no doubt missing out some important details here. Hopefully someone else will provide a better overview.

john

Link to comment
Share on other sites

From what I remember you only need a single OPlibraries file which contains a list of all the OTLs to load when starting Houdini. The paths can be relative to the OPlibraries location or you can use absolute paths. You can also #include other OPlibraries files.

Typically where you want to make OTLs available show-wide or shop-wide you would have a single OPlibraries file somewhere in the path that is seen by all users and that file is edited every time a new OTL is published to include a link to the new OTL's location (obviously you might want to make this file protected). You can have a list of OTLs for "personal use" by having your own OPlibraries file which you place in your houdini8.0 folder.

ok then... that's exactly the way I'm going now... thanks for your confirmation :)

I haven't been using OTLs for a long time so I'm a bit rusty. I'm no doubt missing out some important details here. Hopefully someone else will provide a better overview.

john

oh.. woof.. I wont imagine what you'd said on the whole thread if you were hardly doing OTL now :D :D eheheh.

thanks again ... I'll have a lot to work on now... I'll hopefully dont abuse of your availability for some (little) time now :)

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