davidyannick Posted October 21, 2020 Share Posted October 21, 2020 I've downloaded free Utopia kit from kitbash 3D, I've created in vex groups with parts s@dir; s@lname; splitpath(@name,@dir,@lname); So if I use a for each connected piece with @dir as piece attribute it works, but I'd like to generate a blast node for each group in Python, but with Python SOP I can't create nodes, so how can I create blast nodes (linked to my wrangle) a blast for each @dir ? Thanks for your help separate.hiplc Quote Link to comment Share on other sites More sharing options...
davpe Posted October 22, 2020 Share Posted October 22, 2020 you have to use Python Source Editor, or save it as a shelf tool with python script in it. python SOP can only manipulate things inside of it's own object. Quote Link to comment Share on other sites More sharing options...
davidyannick Posted October 22, 2020 Author Share Posted October 22, 2020 10 minutes ago, davpe said: you have to use Python Source Editor, or save it as a shelf tool with python script in it. python SOP can only manipulate things inside of it's own object. I've tried with shelf but I didn't find tthe way to read priimitive attributte and make a for ... in prim from the shelf Quote Link to comment Share on other sites More sharing options...
davpe Posted October 22, 2020 Share Posted October 22, 2020 check this out - it should help. vfxbrain.wordpress.com/2016/03/15/python-in-houdini/ Quote Link to comment Share on other sites More sharing options...
davidyannick Posted October 22, 2020 Author Share Posted October 22, 2020 6 hours ago, davpe said: check this out - it should help. vfxbrain.wordpress.com/2016/03/15/python-in-houdini/ thanks for your help here is a draft. it works acNode=hou.node('/obj/geo1/attribwrangle1') ac=hou.node('/obj/geo1/attribwrangle1').geometry() l=ac.primStringAttribValues('dir') print(set(l)) root=hou.node('/obj/geo1/') for n in set(l): b=root.createNode('blast',n) b.parm('group').set('@dir='+n) b.parm('negate').set(1) b.setInput(0,acNode) b.moveToGoodPosition() 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.