[Bf-extensions-cvs] [18cabd73] blender-v2.79-release: Improve to objects to groups. Only set the selected objects

Eugenio Pignataro noreply at git.blender.org
Mon Sep 4 15:17:31 CEST 2017


Commit: 18cabd73761743462c2cb07f5f0145e7359e8ecd
Author: Eugenio Pignataro
Date:   Fri Aug 25 12:31:36 2017 -0300
Branches: blender-v2.79-release
https://developer.blender.org/rBA18cabd73761743462c2cb07f5f0145e7359e8ecd

Improve to objects to groups. Only set the selected objects

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

M	oscurart_tools/oscurart_objects.py

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

diff --git a/oscurart_tools/oscurart_objects.py b/oscurart_tools/oscurart_objects.py
index 47b01378..d4fab225 100644
--- a/oscurart_tools/oscurart_objects.py
+++ b/oscurart_tools/oscurart_objects.py
@@ -530,10 +530,11 @@ def DefObjectToGroups():
         "%s_MSH" %
         (os.path.basename(bpy.data.filepath).replace(".blend", "")))
     for ob in bpy.data.objects:
-        if ob.type == "MESH":
-            gr = bpy.data.groups.new(ob.name)
-            gr.objects.link(ob)
-            scgr.objects.link(ob)
+        if ob.select:
+            if ob.type == "MESH":
+                gr = bpy.data.groups.new(ob.name)
+                gr.objects.link(ob)
+                scgr.objects.link(ob)
 
 
 class ObjectsToGroups (Operator):



More information about the Bf-extensions-cvs mailing list