Hello world Posted September 28, 2011 Share Posted September 28, 2011 I want to add and delete a node when I select a toggle.I think this could be done in the call back script in type parameters. the given below is the code I ve tried hp=hou.node('/obj').createNode('shopnet','test') test1=hou.ToggleParmTemplate('a','test1t',1) hp.addSpareParmTuple(test1,('General test',),True) toout=hou.node('out').createNode('shopnet','test1') test2=hou.ToggleParmTemplate('b','test2',1) toout.addSpareParmTuple(test2,('General test',),True) test2t=hou.node('out/test1/') test2t.parm('b').setExpression('ch("/obj/test/a")') if(test2t.evalParm('b')==1): tout1=hou.node('out').createNode('ifd','mantraworking') else: tout11=hou.node('/out/mantraworking') tou1=hou.node('obj/mantraworking') tou1.destroy() for some reason it doesnt work.do i need to type all these code in the call back script field? could anyone please correct me. thank you Quote Link to comment Share on other sites More sharing options...
Hello world Posted September 29, 2011 Author Share Posted September 29, 2011 still getting problems Quote Link to comment Share on other sites More sharing options...
kubabuk Posted September 29, 2011 Share Posted September 29, 2011 at the first glance your if/else indentations are messed up 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.