Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-11-28 19:51:13 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-11-28 20:23:31 +0300
commit1860441ee7cd4ec75c99cc372fccec839c525f46 (patch)
treefe8ef38166fce2ff001b2b92dcc77458526e4ebc /oscurart_tools
parentfef2540b25775c3e1e4012bec35ddb8695daa209 (diff)
Use collection and instance terminology in Python API
This follows naming convention agreed on in T56648.
Diffstat (limited to 'oscurart_tools')
-rw-r--r--oscurart_tools/__init__.py2
-rw-r--r--oscurart_tools/oscurart_files.py4
-rw-r--r--oscurart_tools/oscurart_meshes.py2
-rw-r--r--oscurart_tools/oscurart_objects.py28
-rw-r--r--oscurart_tools/oscurart_overrides.py6
-rw-r--r--oscurart_tools/oscurart_render.py2
6 files changed, 22 insertions, 22 deletions
diff --git a/oscurart_tools/__init__.py b/oscurart_tools/__init__.py
index 420a4990..4b7b5cf7 100644
--- a/oscurart_tools/__init__.py
+++ b/oscurart_tools/__init__.py
@@ -208,7 +208,7 @@ class OscPanelMesh(Panel):
colrow.operator("lattice.mirror_selected", icon="LATTICE_DATA")
colrow = col.row(align=1)
colrow.label(text="Edit Multimesh")
- colrow.prop_search(scene, "multimeshedit", bpy.data, "groups", text="")
+ colrow.prop_search(scene, "multimeshedit", bpy.data, "collections", text="")
colrow = col.row(align=1)
colrow.operator("mesh.create_edit_multimesh", icon="IMPORT", text= "StartEdit")
colrow.operator("mesh.apply_edit_multimesh", icon="EXPORT", text="FinishEdit")
diff --git a/oscurart_tools/oscurart_files.py b/oscurart_tools/oscurart_files.py
index 65c248eb..6c2f371d 100644
--- a/oscurart_tools/oscurart_files.py
+++ b/oscurart_tools/oscurart_files.py
@@ -97,10 +97,10 @@ class reFreshMissingGroups(Operator):
bl_options = {"REGISTER", "UNDO"}
def execute(self, context):
- for group in bpy.data.groups:
+ for group in bpy.data.collections:
if group.library is not None:
with bpy.data.libraries.load(group.library.filepath, link=True) as (linked, local):
- local.groups = linked.groups
+ local.collections = linked.collections
return {'FINISHED'}
diff --git a/oscurart_tools/oscurart_meshes.py b/oscurart_tools/oscurart_meshes.py
index a601aa53..39257542 100644
--- a/oscurart_tools/oscurart_meshes.py
+++ b/oscurart_tools/oscurart_meshes.py
@@ -659,7 +659,7 @@ class createEditMultimesh(Operator):
global relvert
global me
global ob
- temp = [[ob , [vert.co for vert in ob.data.vertices]]for ob in bpy.data.groups[bpy.context.scene.multimeshedit].objects]
+ temp = [[ob , [vert.co for vert in ob.data.vertices]]for ob in bpy.data.collections[bpy.context.scene.multimeshedit].objects]
vi = 0
pi = 0
relvert = {}
diff --git a/oscurart_tools/oscurart_objects.py b/oscurart_tools/oscurart_objects.py
index dd3d4624..b3773b7a 100644
--- a/oscurart_tools/oscurart_objects.py
+++ b/oscurart_tools/oscurart_objects.py
@@ -198,7 +198,7 @@ def CopyObjectGroupsAndLayers(self):
scene.object_bases[OBJECT.name].layers[:] = list(GLOBALLAYERS)
# REMUEVO DE TODO GRUPO
- for GROUP in bpy.data.groups[:]:
+ for GROUP in bpy.data.collections[:]:
if GROUP in OBJECT.users_group[:]:
GROUP.objects.unlink(OBJECT)
@@ -342,17 +342,17 @@ class SetLayersToOtherScenes (Operator):
def DefRenderOnlyInCamera():
# crea grupos
- if "INCAMERA" not in bpy.data.groups:
- bpy.data.groups.new("INCAMERA")
- if "NOTINCAMERA" not in bpy.data.groups:
- bpy.data.groups.new("NOTINCAMERA")
+ if "INCAMERA" not in bpy.data.collections:
+ bpy.data.collections.new("INCAMERA")
+ if "NOTINCAMERA" not in bpy.data.collections:
+ bpy.data.collections.new("NOTINCAMERA")
# limpio grupos
for ob in bpy.data.objects:
- if ob.name in bpy.data.groups["INCAMERA"].objects:
- bpy.data.groups["INCAMERA"].objects.unlink(ob)
- if ob.name in bpy.data.groups["NOTINCAMERA"].objects:
- bpy.data.groups["NOTINCAMERA"].objects.unlink(ob)
+ if ob.name in bpy.data.collections["INCAMERA"].objects:
+ bpy.data.collections["INCAMERA"].objects.unlink(ob)
+ if ob.name in bpy.data.collections["NOTINCAMERA"].objects:
+ bpy.data.collections["NOTINCAMERA"].objects.unlink(ob)
# ordeno grupos
for ob in bpy.data.objects:
@@ -370,9 +370,9 @@ def DefRenderOnlyInCamera():
else:
obs = True
if obs:
- bpy.data.groups["INCAMERA"].objects.link(ob)
+ bpy.data.collections["INCAMERA"].objects.link(ob)
else:
- bpy.data.groups["NOTINCAMERA"].objects.link(ob)
+ bpy.data.collections["NOTINCAMERA"].objects.link(ob)
class RenderOnlyInCamera (Operator):
@@ -528,15 +528,15 @@ class oscDuplicateSymmetricalOp (Operator):
def DefObjectToGroups():
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", ""))]
+ scgr = bpy.data.collections["%s_MSH" % (os.path.basename(bpy.data.filepath).replace(".blend", ""))]
except:
- scgr = bpy.data.groups.new(
+ scgr = bpy.data.collections.new(
"%s_MSH" %
(os.path.basename(bpy.data.filepath).replace(".blend", "")))
for ob in bpy.data.objects:
if ob.select:
if ob.type == "MESH":
- gr = bpy.data.groups.new(ob.name)
+ gr = bpy.data.collections.new(ob.name)
gr.objects.link(ob)
scgr.objects.link(ob)
diff --git a/oscurart_tools/oscurart_overrides.py b/oscurart_tools/oscurart_overrides.py
index 5709c5b5..9924fda5 100644
--- a/oscurart_tools/oscurart_overrides.py
+++ b/oscurart_tools/oscurart_overrides.py
@@ -39,7 +39,7 @@ def DefOscApplyOverrides(self):
scene = bpy.context.scene
proptolist = list(eval(scene.oscurart.overrides))
for group, material in proptolist:
- for object in bpy.data.groups[group].objects:
+ for object in bpy.data.collections[group].objects:
lenslots = len(object.material_slots)
if object.type in types:
if len(object.data.materials):
@@ -133,7 +133,7 @@ class OscCheckOverrides(Operator):
MATLIST.append(MATERIAL.name)
GROUPLIST = []
- for GROUP in bpy.data.groups[:]:
+ for GROUP in bpy.data.collections[:]:
if GROUP.users > 0:
GROUPLIST.append(GROUP.name)
@@ -194,7 +194,7 @@ class OscOverridesGUI(Panel):
for i, m in enumerate(bpy.context.scene.ovlist):
colrow = col.row(align=1)
- colrow.prop_search(m, "grooverride", bpy.data, "groups", text="")
+ colrow.prop_search(m, "grooverride", bpy.data, "collections", text="")
colrow.prop_search(
m,
"matoverride",
diff --git a/oscurart_tools/oscurart_render.py b/oscurart_tools/oscurart_render.py
index f6e083e9..67dacfb2 100644
--- a/oscurart_tools/oscurart_render.py
+++ b/oscurart_tools/oscurart_render.py
@@ -55,7 +55,7 @@ def defRenderAll(frametype, scenes):
scene.frame_start = FC
for group, material in proptolist:
- for object in bpy.data.groups[group].objects:
+ for object in bpy.data.collections[group].objects:
lenslots = len(object.material_slots)
if object.type in types:
if len(object.data.materials):