Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f( obj ):
- def g( obj, objs, varpath ):
- if obj.name in objs:
- for o in objs:
- if o == obj:
- return varpath + "['" + obj.name + "']";
- s = g( obj, bpy.data.objects, "bpy.data.objects")
- if None != s:
- return s
- s = g( obj, bpy.data.meshes, "bpy.data.meshes")
- if None != s:
- return s
- #
- # >> obj = bpy.data.objects['Plane']
- # >> f( obj )
- # "bpy.data.objects['Plane']"
- # >> f( obj.data )
- # "bpy.data.meshes['Plane']"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement