Jump to content

Scripts That Modify Hda Internals Issues


lisux

Recommended Posts

Hi everybody.

I have created and HDA and put it into an OTL, but this time this HDA have something special I use some embeeded scripts (into the HDA) that modifies connections and some flags of nodes contained into the HDA itself.

So when the user use the HDA he/she is modifying it's internals connections and flags from the ui.

My problem is that to be abe to do this I have to save the HDA unlocked, otherwise is impossible to change the internal connections from the HDA ui.

This is a potential problem and is a mess because open HDA (unlocked) don't update by default, if I change the original HDA and save into the OTL the existing ones don't refresh.

So is there any way to save an HDA locked and at the same some scripts from the HDA can change the internals of the HDA?

Thanks

Link to comment
Share on other sites

well..nothing really...I just don't like them...they feel like a hack...

if you're building an HDA - a tool - it should be designed and built properly, as few hacks as possible, and since HDAs have the ability to hold parameters that can do the same things as a spare channel - with added flexibilty, I think it's best to stick with that...

just a philisophical difference I guess...but that said, in the time I've used Houdini in production I've never used spare channels...as far as I can remember anyway....

Link to comment
Share on other sites

I see and that makes sense. When I use spare channels, I usually put them all in a single Null SOP and channel reference parameters somewhere deep inside the HDA to those spare channels. That way if I need to change something, I can just go to that Null SOP and change the Spare Channel instead of remembering where the parameter exists. Its more of an organizational thing for me. But with that being said, does channel referencing take more processing time to compute?

Link to comment
Share on other sites

That way if I need to change something, I can just go to that Null SOP and change the Spare Channel instead of remembering where the parameter exists.

Are spare channels the same thing as spare parameters?

I cannot change spare parameters :( And my houdini crashes if i delete one of them to make a new one. (But this can be caused be the way I use them in a addSOP ...)

I will try to see what you mean with this:

invisible parameters, nulls etc instead

Georg

Link to comment
Share on other sites

This is a potential problem and is a mess because open HDA (unlocked) don't update by default, if I change the original HDA and save into the OTL the existing ones don't refresh.

Even if there was a way, how do you expect it to refresh? You've changed connections. How do you determine which connections to keep? I think that it's easy to think of what you want in specific cases, but extremely hard to do in general.

Link to comment
Share on other sites

Thanks for the replies.

The problem is thenext I ma using a couple os blendShapes ans sequenceBlends whose parameters are controlled by en expression that use opninputs("."). I connects several File SOP to the blends, and this blends works in function of the operators connected to every of them.

So, if the user add a geo file from the HDA ui it's File OP is connected to the blend.

I can't have all the files connected or I am going to have errors.

I have used the switch solution in other parts of the tool but when you have to control the connection of 50 File SOP to different blend operators then scripting is more easy but it needs to change connections and here is the problems.

I think that using spare parameters or switch operators is not practical in this case.

This is the onternal look of the HDA with some connections.

Only File SOP with a valid file path are connected to their blend, otherwise it is manteined unconnected.

HDA_Internals.png

Hope this clearify something.

Link to comment
Share on other sites

Aren't there two commands, one to unlock an HDA, and another to relock it (w/o saving)?

So you could unlock your HDA, rewire the internals / add your File SOP, etc - then lock it?

Also, would it be such a bad thing if your HDA remained unlocked (i.e. are you planning on distributing this to a bunch of artists, or is it for personal use)?

Link to comment
Share on other sites

Aren't there two commands, one to unlock an HDA, and another to relock it (w/o saving)?

So you could unlock your HDA, rewire the internals / add your File SOP, etc - then lock it?

Also, would it be such a bad thing if your HDA remained unlocked (i.e. are you planning on distributing this to a bunch of artists, or is it for personal use)?

Yes? what are these commands? I have dive in the help and I haven't found them.

And the HDA is for a personal excersise, ideally it should be closed as in a production environment.

Edited by lisux
Link to comment
Share on other sites

otsync and otunsync

but these WILL NOT do what you're after

an 'unlocked' HDA can be edited - BUT unless you save those changes to the definition (overriting the currend definition) simply using otsync will lock the HDA to the old definition

your screen grab helps but I think there may be a better way to do what you're after or wire everything to gether and use lookup tables to do your switching...but that can get complicated...

more info would help

Link to comment
Share on other sites

Yes? what are these commands? I have dive in the help and I haven't found them.

And the HDA is for a personal excersise, ideally it should be closed as in a production environment.

The process actually involves unsyncing, saving the otl, then syncing again using the otsync command. If you simply unsync , make changes, then resync, you will have lost your changes. So, in order to do that.

  1. otsync -u /obj/myOtl


  2. Make Changes to network
  3. otwrite obj/myOtl myCustomLibrary.otl


  4. otsync /obj/myOtl


-Francisco Rodriguez

Link to comment
Share on other sites

The process actually involves unsyncing, saving the otl, then syncing again using the otsync command. If you simply unsync , make changes, then resync, you will have lost your changes. So, in order to do that.
  1. otsync -u /obj/myOtl


  2. Make Changes to network
  3. otwrite obj/myOtl myCustomLibrary.otl


  4. otsync /obj/myOtl


-Francisco Rodriguez

Thanks for the replies.

Hey francisco great to hear about you again!

Well the otsync/unsync I think that is not the way to go because it saves the operator in an inconsistent state, I mean in the current state for this shot, but waht happens if then anybody loads the HDA, he/she is going to get "your HDA" not the default state of the HDA.

Arctor, what do you refer about lookup table, at the end I need to enable/disable connections, otherwise blendShape SOP and sequenceBlend SOP, the goal of the connections, fails.

If a empty File SOP is connected to a blend you get an error, the only way is to disconnect and connect only when the user selects a file.

This is the reason because in the HDA I have a callback script called in every file I have promoted, when the use selects a file the internal File SOP is connected to the blend, if the user modifies the file and set it to blank then is disconnected.

Link to comment
Share on other sites

What about adding a Switch SOP and Null SOP combo for each File SOP? In the expression of the Switch SOP, do something like:

strlen(findfiles(chs("../filename"), " ")) == 0

EDIT: You could create your own special FileIgnoreError SOP HDA for this as well.

Link to comment
Share on other sites

What about adding a Switch SOP and Null SOP combo for each File SOP? In the expression of the Switch SOP, do something like:

strlen(findfiles(chs("../filename"), " ")) == 0

EDIT: You could create your own special FileIgnoreError SOP HDA for this as well.

Great edward! this seems a perfect solution to avoise the blens error when the file is empty.

Now the only problem is that it makes the seqblend expression a little more complex because I need to test first what connections are using the file and what are using the null and the instead of usinf opninputs() use the results of the previous test to use the real connections only.

But the trick make sense and seems a prefect solution.

Thanks!

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