HOW to lock constraint or zero constraint with Python?


#1

I am not a newbie. But right now I feel like one.

FOR THE LIFE OF ME… I can’t figure out how to “Lock” a constraint or “Zero” it with python.

Anyone?


#2

Hi DangerAhead,

U can control “Lock” from the property list of your contstraint. For example

let put some constraint into scene, it will have 0 index in constraint manager

lConstraint = FBConstraintManager().ConstraintGet(0)

print all properties to python console (main menu Window -> Python Console)

for lProp in lConstraint.PropertyList: print lProp.GetName()

now U can easily find Lock property in printed names (use it to change lock constraint parameter)

about “Zero”, I suppose U need to make this operation by your self (put source object into the destination, then switch on active&lock property of the constraint)


#3

this works:


const1LockAttrName = 'Lock'
const1LockSettings = constraintName.PropertyList.Find(const1LockAttrName)
const1LockSettings.Data = True


#4

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.