Jump to content

Separate fbx part


davidyannick

Recommended Posts

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

Annotation 2020-10-21 182925.png

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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()

 

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