[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4592] contrib/py/scripts/addons/ object_edit_linked.py: [Edit Linked Library] Fix to re-enable support for non-dupligroup linked assets

Jason van Gumster jason at handturkeystudios.com
Mon Jun 24 17:59:00 CEST 2013


Revision: 4592
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4592
Author:   thefallenweeble
Date:     2013-06-24 15:58:59 +0000 (Mon, 24 Jun 2013)
Log Message:
-----------
[Edit Linked Library] Fix to re-enable support for non-dupligroup linked assets

There's still an issue with using nested links if you're not launching a new
Blender instance. Currently, there's not a good way to warn the user about
that.

Modified Paths:
--------------
    contrib/py/scripts/addons/object_edit_linked.py

Modified: contrib/py/scripts/addons/object_edit_linked.py
===================================================================
--- contrib/py/scripts/addons/object_edit_linked.py	2013-06-23 23:30:40 UTC (rev 4591)
+++ contrib/py/scripts/addons/object_edit_linked.py	2013-06-24 15:58:59 UTC (rev 4592)
@@ -20,7 +20,7 @@
 bl_info = {
     "name": "Edit Linked Library",
     "author": "Jason van Gumster (Fweeb), Bassam Kurdali, Pablo Vazquez",
-    "version": (0, 7, 2),
+    "version": (0, 7, 3),
     "blender": (2, 65, 0),
     "location": "View3D > Toolshelf > Edit Linked Library",
     "description": "Allows editing of objects linked from a .blend library.",
@@ -167,16 +167,24 @@
             kmi_edit.active = True
             kmi_return.active = False
 
-            props = layout.operator("object.edit_linked", icon="LINK_BLEND",
-                                    text="Edit Library: %s" % context.active_object.dupli_group.name)
+            if (context.active_object.dupli_group is not None):
+                props = layout.operator("object.edit_linked", icon="LINK_BLEND",
+                                        text="Edit Library: %s" % context.active_object.dupli_group.name)
+            else:
+                props = layout.operator("object.edit_linked", icon="LINK_BLEND",
+                                        text="Edit Library: %s" % context.active_object.name)
             props.use_autosave = context.scene.use_autosave
             props.use_instance = context.scene.use_instance
 
             layout.prop(context.scene, "use_autosave")
             layout.prop(context.scene, "use_instance")
 
-            layout.label(text="Path: %s" %
-                         context.active_object.dupli_group.library.filepath)
+            if (context.active_object.dupli_group is not None):
+                layout.label(text="Path: %s" %
+                             context.active_object.dupli_group.library.filepath)
+            else:
+                layout.label(text="Path: %s" %
+                             context.active_object.library.filepath)
 
         elif settings["original_file"] != "":
             kmi_edit.active = False
@@ -189,6 +197,9 @@
 
                 layout.separator()
 
+                #XXX - This is for nested linked assets... but it only works
+                #  when launching a new Blender instance. Nested links don't
+                #  currently work when using a single instance of Blender.
                 props = layout.operator("object.edit_linked",
                                         text="Edit Library: %s" % context.active_object.dupli_group.name,
                                         icon="LINK_BLEND")



More information about the Bf-extensions-cvs mailing list