Jump to content

create "SIM_Relationship" data for each DOP object with Python


yongbin

Recommended Posts

Hi, I want mimic "constraint" and "apply relationship" nodes with python.

But hou.DopObject.createSubData("Somename", data_type="SIM_Relationship") didn't work for me.

I putted several other types but only default value "SIM_EmptyData" made it work.

So, Relationship isn't a data? How can I attach it from python?

Thank you :)

Link to comment
Share on other sites

So, Relationship isn't a data?

Nope! Well not exactly. Relationships are a special type of data, and need to be treated a little differently. But you can still add them in python. To create relationships in python you need to use hou.DopSimulation.createRelationship() which returns a hou.DopRelationship object. Then you use hou.DopRelationship.setGroup() and hou.DopRelationship.setAffectorGroup() to set what objects the relationship affects.

  • Like 1
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...