Jump to content

Cannot remove/replace intparameter from my DigitalAsset ParmTemplateGroup


ng.aniki

Recommended Posts

Hi ! I am just at the learning stage in Houdini, and I am in front of an issue:

I am trying to dynamically change the min/max value of an integer parameter of my digital asset.
I read a bit online, and every forum post seem to give the same solution:

 

def UpdateRangeTest(MyNode):
	MyTemplateGroup = MyNode.parmTemplateGroup()
	ReplacementParameter = MyTemplateGroup.find('IntegerParameter')
	ReplacementParameter.setMaxValue(20)
	MyTemplateGroup.replace('IntegerParameter', ReplacementParameter)
	MyNode.setParmTemplateGroup(MyTemplateGroup)

This does not seem to work, my max value is not updated in my parameter list.

Note that if I insert my ReplacementParameter in MyTemplateGroup (After changing it's name), it is actually added to my parameter list... So I thought: "Hey, then you could try removing the existing parameter first, then insert the new one !" but it did not work either, no change would be visible.

So I also tried this:

def RemoveParameterTest(MyNode):
	MyTemplateGroup = MyNode.parmTemplateGroup()
	MyTemplateGroup.remove('IntegerParameter')
	MyNode.setParmTemplateGroup(MyTemplateGroup)

With this function, I can see that it is actually affecting my IntegerParameter, but it is not completely removed from my digital asset, it is removed from the parameter folder it was in, and is just displayed at the very bottom of the parameter list...

So: I cannot replace an existing parameter, I cannot completely remove a parameter, but I can insert a new one....

 

What am I doing wrong ?

 

Edit: Attaching Houdini Apprentie Non-Commercial hipnc file.
And something more visual:

Replacing Parameter(No Change): https://demo.gyazo.com/5467b02885bfaca90e186821da21d578
Removing Parameter (Is not removed, only moved at the bottom): https://demo.gyazo.com/1e1f2ba4b4ba0c80aee85ba722337eda
Inserting new parameter(Working fine): https://demo.gyazo.com/5b2f0ab55cfa9c0cafd1cd7ee2ee7333

 

 

 

TemplateGroupUpdate.hipnc

Edited by ng.aniki
Add gifs + hipnc file
  • Like 1
Link to comment
Share on other sites

Alright, after some more searching, I think I found the answer here: http://forums.odforce.net/topic/24473-python-cannot-dynamically-set-minmax-parm-values-of-my-da/

It seem only possible to do that kind of change on spare parms, I will play with it later and post updates here. Thank you for reading though. 

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