diff options
author | Eugenio Pignataro <info@oscurart.com.ar> | 2017-08-25 18:58:37 +0300 |
---|---|---|
committer | Eugenio Pignataro <info@oscurart.com.ar> | 2017-08-25 18:58:37 +0300 |
commit | 32dc2209dd67b8a6693d9acc59420a4d7b1e7efb (patch) | |
tree | ce0d59753f3971eed1a3490bddc1ec01713966f6 /oscurart_tools | |
parent | 9ab377b2345812ad908e21061624e9d6380b7149 (diff) |
Add new objects to MESH group
Diffstat (limited to 'oscurart_tools')
-rw-r--r-- | oscurart_tools/oscurart_objects.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/oscurart_tools/oscurart_objects.py b/oscurart_tools/oscurart_objects.py index d4fab225..2b24938a 100644 --- a/oscurart_tools/oscurart_objects.py +++ b/oscurart_tools/oscurart_objects.py @@ -526,9 +526,13 @@ class oscDuplicateSymmetricalOp (Operator): # ------------------------ OBJECTS TO GROUPS ------------------------ def DefObjectToGroups(): - scgr = bpy.data.groups.new( - "%s_MSH" % - (os.path.basename(bpy.data.filepath).replace(".blend", ""))) + try: + "%s_MSH" % (os.path.basename(bpy.data.filepath).replace(".blend", "")) + scgr = bpy.data.groups["%s_MSH" % (os.path.basename(bpy.data.filepath).replace(".blend", ""))] + except: + scgr = bpy.data.groups.new( + "%s_MSH" % + (os.path.basename(bpy.data.filepath).replace(".blend", ""))) for ob in bpy.data.objects: if ob.select: if ob.type == "MESH": |