[Bf-extensions-cvs] [ceed704] master: New tool: sync missing groups

Oscurart noreply at git.blender.org
Mon Oct 5 21:26:51 CEST 2015


Commit: ceed7041a98ce7158ce0e83155adc1e2d09b1e18
Author: Oscurart
Date:   Mon Oct 5 16:26:33 2015 -0300
Branches: master
https://developer.blender.org/rBACceed7041a98ce7158ce0e83155adc1e2d09b1e18

New tool: sync missing groups

===================================================================

M	oscurart_tools/__init__.py
M	oscurart_tools/oscurart_files.py

===================================================================

diff --git a/oscurart_tools/__init__.py b/oscurart_tools/__init__.py
index 34c1a75..1298e49 100644
--- a/oscurart_tools/__init__.py
+++ b/oscurart_tools/__init__.py
@@ -266,6 +266,7 @@ class OscPanelFiles(OscPollFiles, bpy.types.Panel):
         col = layout.column(align=1)
         col.operator("file.save_incremental_osc", icon="NEW")
         col.operator("image.reload_images_osc", icon="IMAGE_COL")
+        col.operator("file.sync_missing_groups", icon="LINK_AREA")
         col = layout.column(align=1)
         colrow = col.row(align=1)
         colrow.prop(bpy.context.scene, "oscSearchText", text="")
diff --git a/oscurart_tools/oscurart_files.py b/oscurart_tools/oscurart_files.py
index 1d331af..4ec97f4 100644
--- a/oscurart_tools/oscurart_files.py
+++ b/oscurart_tools/oscurart_files.py
@@ -56,4 +56,17 @@ class replaceFilePath(bpy.types.Operator):
         for image in bpy.data.images:
             image.filepath = image.filepath.replace(TEXTSEARCH,TEXTREPLACE)
 
-        return {'FINISHED'}
\ No newline at end of file
+        return {'FINISHED'}
+    
+    
+##---------------------- SYNC MISSING GROUPS --------------------------
+
+class reFreshMissingGroups(bpy.types.Operator):
+    bl_idname = "file.sync_missing_groups"
+    bl_label = "Sync Missing Groups"
+    bl_options = {"REGISTER", "UNDO"}
+    def execute(self, context):
+        for lib in bpy.data.libraries:
+            with bpy.data.libraries.load(lib.filepath, link=True) as (linked,local):
+                local.groups = linked.groups    
+        return {'FINISHED'}        
\ No newline at end of file



More information about the Bf-extensions-cvs mailing list