ng.aniki Posted November 30, 2017 Share Posted November 30, 2017 (edited) 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 November 30, 2017 by ng.aniki Add gifs + hipnc file 1 Quote Link to comment Share on other sites More sharing options...
ng.aniki Posted November 30, 2017 Author Share Posted November 30, 2017 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. 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.