Jump to content
catchyid

break dop constraints in python dop solver

Recommended Posts

Hi, 

I am using Script solver inside a DOP RBD bullet sim, I was able to change velocities of individual RBD packed objects, however I don't know how to access/modify constraints network parameters (e.g strength, add/remove broken group, etc.)? The constraint network in defined globally "Relationships" subdata (i.e. not attached to each object), below is the code I am trying to write :

from __future__ import with_statement

def solveForObjects( solver_data, new_dop_objects, existing_dop_objects, time, timestep):

    dopsim = solver_data.simulation()
    relationships   = dopsim.findRelationship("constraintnetwork1")
    constraintsnetwork = relationships.findSubData("constraintnetwork") # geometry lives inside 'constraintnetwork' subdata
    geo = constraintsnetwork.findSubData("Geometry") #that works, but it's not a hou.Geometry that can be edited!
    with    constraintsnetwork.editableGeometry() as geo: #error: AttributeError: 'DopData' object has no attribute 'editableGeometry
        #.... do something here

image.thumb.png.d7008f442258175d1f1854fe626f1259.png

image.thumb.png.764cef8109e8270498a689a6987a40d1.png

 

Share this post


Link to post
Share on other sites

did some investigating, it's possible to break constraints also but they must be attached to objects (and not the generic relationship subdata), attached file is an example if someone is interested :)

pythonrbdscript.hip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×