Hot answers tagged

2

You can loop through all objects and check if they are parented to the armature. rig = bpy.data.objects['rig'] for obj in bpy.data.objects: if obj.parent == rig: # Do stuff pass If some objects are only connected via the armature modifier, simply check that the rig is the object of the armature modifier. rig = bpy.data.objects['rig'] ...


1

Just like keyframes look at data_path and array_index data_path is the path from the owner of the driver, array index if it is an array type, eg 0, 1, 2 for x, y, z locations. Example Y Euler rotation of pose bone "shin.L", from the context object in python console. >>> for d in C.object.animation_data.drivers: ... d.data_path, d....


1

bpy.ops.object.duplicate() finishes with the duplicated object as the currently selected object. Therefore, bpy.context.object is the reference to the new object. Ex (assume object selected in 3d viewport): import bpy bpy.ops.object.duplicate() dupli_obj = bpy.context.object print(dupli_obj.name) #check the console If you run this code, does ...


1

The answer is simple: the gpencil.annotate() call on the last line needs to include the argument "INVOKE_DEFAULT". bpy.ops.gpencil.annotate('INVOKE_DEFAULT')


Only top voted, non community-wiki answers of a minimum length are eligible