how to activate/deactivate armature.bone constraint?

How to activate/deactivate armature.bone constraint without actuator?

sce.objects['arm'].constraints['bone1:contstr1'].mode

AttributeError: 'BL_ArmatureConstraint' object has no attribute 'mode'
Blender Game Engine Finished

Use the active attribute active of BL_ArmatureConstraint


armature = scene.objects["armature"]
constraint = armature.constraints[0]
constraint.active = True

I tested it and work.

EDIT: A blend file: deactivate bone.blend (91.3 KB)

@carlo697, Thank you.
Is it possible to control the parameter of the ‘enfluence’?

Use the enforce attribute.


contraint.enforce = 0.5 #Need a number between 0 and 1

Tested, and working.

PD: there is some interesting things in the api documentation.

@carlo697, Thank you very much.

You’re welcome. :wink: