# Making Proxy on a Linked Rig via the API

Using the blender API, I am trying to "Make Proxy" on a linked rig.

My first approach was to identify the linked objects through bpy.data.groups.objects and then use the bpy.ops.object.proxy_make() operator to make proxies.

However, this would make proxies for all linked objects (rigs, meshes etc.), when my objective is to do it only to the rigs.

Is there a way to identify the right objects to proxy? Alternatively, is there a better method to do the whole exercise?

The make proxy operator works only on the active object (it has to be visible). You set the active object like this:

import bpy
objects = bpy.context.scene.objects
objects.active = objects["Name"]


If you don't know the name you can list all objects in the scene with dupli group:

ob_list = [ob for ob in objects if ob.dupli_group]


You can specify what object inside the group to make the proxy of like this:

bpy.ops.object.proxy_make(object="Name_Of_Object_Inside_Linked_Group")


If you don't know the name, you can list all the armatures inside the active object's dupli group:

armatures = [ob for ob in objects.active.dupli_group.objects if ob.type == 'ARMATURE']


The proxy object then becomes the active object. You can rename the proxy easily (otherwise it will carry the name of the linked group object):

objects.active.name = "Name_Of_Object_Inside_Linked_Group_PROXY"


To complete this you also get the linked group object from a proxy object like this (if you need to know what the proxy is influencing and if the object is a proxy at all):

group_ob = proxy_ob.proxy_group

• Thanks for the comprehensive answer. Learned some new things. Very helpful
• when executing bpy.ops.object.proxy_make(object="Name_Of_Object_Inside_Linked_Group") from script I got the famous bpy.ops.object.proxy_make.poll() failed, context is incorrect. I tried some context override but I failed. is there a way to make the override working or can we make proxy without ops at all ? Jul 19 '17 at 10:10