Andz Posted December 7, 2007 Share Posted December 7, 2007 I'm trying to learn some python scripting for H. frame = geo.createNode('circle') frame.parm('type').set('poly') It took me a while of trial and error to find out that the argument for the circle type was "poly" and not "polygon", etc... Is there a reference somewhere about all these parameters and arguments ? Thank you. Quote Link to comment Share on other sites More sharing options...
symek Posted December 7, 2007 Share Posted December 7, 2007 (edited) I don't think so... what I do in such a case is that I call eval() for a parameter in question to see its current value. This way I'm sure about the token. cheers, sy. EDIT: upss... not true actually, sorry. Tokens work for hscript only...: opparm -d circle1 type In python you get menu item's index from eval(): mynode.parm('type').eval() -> 0 for prim Nevertheless both methods of investigations work well Edited December 7, 2007 by SYmek Quote Link to comment Share on other sites More sharing options...
Andz Posted December 7, 2007 Author Share Posted December 7, 2007 Hi SYmek I don't know if I understood you well. As you can see in the video attached, eval was giving me numbers (0,1,2,etc.) not the Argument But while I was trying it out, I found the list of tokens... check it out in the vid ;-) ** Tech Smith codec ***edit*** Oh, got it now... I can also use its index number for the token, both lines would work: hou.node('/obj/geo1/circle1').parm('type').set(1) or hou.node('/obj/geo1/circle1').parm('type').set('poly') teste_001.avi Quote Link to comment Share on other sites More sharing options...
symek Posted December 8, 2007 Share Posted December 8, 2007 yep, all is clear now. I've just wanted to point you out that in case you look for a token, index number could help glad you solve the problem, cheers, sy. Quote Link to comment Share on other sites More sharing options...
Andz Posted December 8, 2007 Author Share Posted December 8, 2007 glad you solve the problem,cheers, sy. Thank you Sir! Quote Link to comment Share on other sites More sharing options...
symek Posted December 8, 2007 Share Posted December 8, 2007 My please, but you helped your self actually good luck! sy. Quote Link to comment Share on other sites More sharing options...
Andz Posted December 13, 2007 Author Share Posted December 13, 2007 Continuing exploring python... I'm creating a PolyBevel node and adjusting some parameters: bevel = geo.createNode('polybevel') bevel.parm('group').set('p5-1 p5-4-0 p4-7-3 p7-6 p5-6-2') bevel.parm('beveltype').set('lowround') #bevel.parm('setinset_1').set(True) bevel.parm('absinset').set(0.019) bevel.parm('repetitions').set(2) bevel.setFirstInput(instance) On line 4, I'm trying to turn on the Absolute radio button, but I get a message that there is no Set attribute. I thought that only by adjusting the absinset value would be enough to switch it on, but I was wrong. ** Edit **************************************************** I got a hint from SYmek's post on another thread: hou.node('/obj/geo1/polybevel1').asCode() In it, I found out that the parameter name listed is deferent than the actual parameter used in the code. That line should look like: bevel.parm('setinset1').set(1) 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.