Jump to content

break dop constraints in python dop solver

Recommended Posts


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




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


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