Hot answers tagged


You can loop through all objects and check if they are parented to the armature. rig =['rig'] for obj in 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 =['rig'] ...


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....


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( #check the console If you run this code, does ...


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