Add Rigidbody Constraint without bpy.ops.rigidbody.constraint_add ?

How can i add Rigidbody constraint on data level?

Like in the manner of:

        scene = bpy.context.scene        objects = bpy.data.objects
        empty = objects.new(self.empty_name, None)
        scene.objects.link(empty)
        scene.update()

for the bpy.ops.rigidbody.constraint_add i need to select Objects, which i can’t do in this case… (let’s say i’d be very ugly. The purpose is to use with Sverchok Nodes)

AFAIK there are no RNA methods to do this low-level, you really need to use the operators (and possibly change context object or override operator context)

Thank you for the answer CoDEmanX. (Now i notice i always read you as CoDEmaX somehow, and the DE makes also sense now… :wink:

Anyhow, i might go annoy some developer with this issue sooner or later :wink: Have a nice one.

Right, it’s upper DE on purpose, it was CodeManX originally :wink:

I already added Rigid Body stuff to RNA access todo a while ago, so you may want to give this link to a dev:
http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Scripting#Python_RNA_access