[Bf-extensions-cvs] [1860441e] blender2.8: Use collection and instance terminology in Python API

Sergey Sharybin noreply at git.blender.org
Wed Nov 28 18:23:41 CET 2018


Commit: 1860441ee7cd4ec75c99cc372fccec839c525f46
Author: Sergey Sharybin
Date:   Wed Nov 28 17:51:13 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBA1860441ee7cd4ec75c99cc372fccec839c525f46

Use collection and instance terminology in Python API

This follows naming convention agreed on in T56648.

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

M	add_advanced_objects_menu/arrange_on_curve.py
M	add_advanced_objects_menu/pixelate_3d.py
M	add_advanced_objects_menu/random_box_structure.py
M	add_advanced_objects_panels/drop_to_ground.py
M	add_curve_sapling/utils.py
M	add_mesh_extra_objects/add_empty_as_parent.py
M	btrace/bTrace.py
M	io_blend_utils/blend/blendfile_path_walker.py
M	io_blend_utils/blender_bam-unpacked.whl/bam/blend/blendfile_path_walker.py
M	io_import_dxf/dxfimport/do.py
M	io_mesh_pdb/import_pdb.py
M	io_scene_fbx/export_fbx_bin.py
M	io_scene_fbx/fbx_utils.py
M	io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py
M	io_scene_ms3d/ms3d_import.py
M	io_scene_obj/export_obj.py
M	mesh_carver.py
M	modules/rna_manual_reference.py
M	object_boolean_tools.py
M	object_edit_linked.py
M	object_fracture/fracture_ops.py
M	object_fracture_cell/__init__.py
M	object_scatter/operator.py
M	oscurart_tools/__init__.py
M	oscurart_tools/oscurart_files.py
M	oscurart_tools/oscurart_meshes.py
M	oscurart_tools/oscurart_objects.py
M	oscurart_tools/oscurart_overrides.py
M	oscurart_tools/oscurart_render.py
M	render_povray/render.py
M	space_view3d_copy_attributes.py
M	space_view3d_spacebar_menu.py
M	uv_texture_atlas.py

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

diff --git a/add_advanced_objects_menu/arrange_on_curve.py b/add_advanced_objects_menu/arrange_on_curve.py
index c292e341..bfed37a7 100644
--- a/add_advanced_objects_menu/arrange_on_curve.py
+++ b/add_advanced_objects_menu/arrange_on_curve.py
@@ -59,7 +59,7 @@ class PanelDupliCurve(Panel):
             elif adv_obj.arrange_c_select_type == 'G':
                 layout.column(align=True).prop_search(
                               adv_obj, "arrange_c_obj_arranjar",
-                              bpy.data, "groups"
+                              bpy.data, "collections"
                               )
         if context.object.type == 'CURVE':
             layout.operator("object.arranjar_numa_curva", text="Arrange Objects")
@@ -238,7 +238,7 @@ class DupliCurve(Operator):
         elif adv_obj.arrange_c_select_type == 'O':
             G_Objeto = bpy.data.objects[adv_obj.arrange_c_obj_arranjar],
         elif adv_obj.arrange_c_select_type == 'G':
-            G_Objeto = bpy.data.groups[adv_obj.arrange_c_obj_arranjar].objects
+            G_Objeto = bpy.data.collections[adv_obj.arrange_c_obj_arranjar].objects
 
         yawMatrix = mathutils.Matrix.Rotation(self.Yaw, 4, 'X')
         pitchMatrix = mathutils.Matrix.Rotation(self.Pitch, 4, 'Y')
diff --git a/add_advanced_objects_menu/pixelate_3d.py b/add_advanced_objects_menu/pixelate_3d.py
index 3a9fc886..567e882a 100644
--- a/add_advanced_objects_menu/pixelate_3d.py
+++ b/add_advanced_objects_menu/pixelate_3d.py
@@ -28,7 +28,7 @@ def pix(self, obj):
     mes.transform(obj.matrix_world)
     dup = bpy.data.objects.new('dup', mes)
     sce.objects.link(dup)
-    dup.dupli_type = 'VERTS'
+    dup.instance_type = 'VERTS'
     sce.objects.active = dup
     bpy.ops.object.mode_set()
     ver = mes.vertices
diff --git a/add_advanced_objects_menu/random_box_structure.py b/add_advanced_objects_menu/random_box_structure.py
index fa4b6497..ead19bd1 100644
--- a/add_advanced_objects_menu/random_box_structure.py
+++ b/add_advanced_objects_menu/random_box_structure.py
@@ -94,8 +94,8 @@ class makestructure(Operator):
         rsdchange = self.rsd
         oblst = []
         uvyes = 0
-        bpy.ops.group.create(name='Cubagrouper')
-        bpy.ops.group.objects_remove()
+        bpy.ops.collection.create(name='Cubagrouper')
+        bpy.ops.collection.objects_remove()
 
         for ob in bpy.context.selected_objects:
             oblst.append(ob)
@@ -107,7 +107,7 @@ class makestructure(Operator):
                 uvyes = 1
             else:
                 uvyes = 0
-            bpy.ops.object.group_link(group='Cubagrouper')
+            bpy.ops.object.collection_link(group='Cubagrouper')
             dim = obj.dimensions
             rot = obj.rotation_euler
             if self.uf is True:
@@ -155,7 +155,7 @@ class makestructure(Operator):
                     )
                 bpy.ops.object.mode_set(mode='OBJECT')
                 select = bpy.context.object  # This is used to keep something selected for poll()
-                bpy.ops.object.group_link(group='Cubagrouper')
+                bpy.ops.object.collection_link(group='Cubagrouper')
                 rsdchange += 3
             bpy.ops.object.select_grouped(type='GROUP')
             bpy.ops.transform.rotate(
@@ -180,7 +180,7 @@ class makestructure(Operator):
             if uvyes == 1:
                 bpy.ops.object.join_uvs()
 
-            bpy.ops.group.objects_remove()
+            bpy.ops.collection.objects_remove()
             bpy.context.scene.objects.active = select
 
             if self.dc is True:
diff --git a/add_advanced_objects_panels/drop_to_ground.py b/add_advanced_objects_panels/drop_to_ground.py
index e6facbcf..8c66fb46 100644
--- a/add_advanced_objects_panels/drop_to_ground.py
+++ b/add_advanced_objects_panels/drop_to_ground.py
@@ -87,13 +87,13 @@ def get_lowest_world_co(context, ob, mat_parent=None):
     if ob.type == 'MESH':
         return get_lowest_world_co_from_mesh(ob)
 
-    elif ob.type == 'EMPTY' and ob.dupli_type == 'GROUP':
-        if not ob.dupli_group:
+    elif ob.type == 'EMPTY' and ob.instance_type == 'COLLECTION':
+        if not ob.instance_collection:
             return None
 
         else:
             lowest_co = None
-            for ob_l in ob.dupli_group.objects:
+            for ob_l in ob.instance_collection.objects:
                 if ob_l.type == 'MESH':
                     lowest_ob_l = get_lowest_world_co_from_mesh(ob_l, ob.matrix_world)
                     if not lowest_co:
diff --git a/add_curve_sapling/utils.py b/add_curve_sapling/utils.py
index 7f6a45b7..fb1fc7d3 100644
--- a/add_curve_sapling/utils.py
+++ b/add_curve_sapling/utils.py
@@ -1797,17 +1797,17 @@ def addTree(props):
 
         # enable duplication
         if leafShape == 'dFace':
-            leafObj.dupli_type = "FACES"
-            leafObj.use_dupli_faces_scale = True
-            leafObj.dupli_faces_scale = 10.0
+            leafObj.instance_type = "FACES"
+            leafObj.use_instance_faces_scale = True
+            leafObj.instance_faces_scale = 10.0
             try:
                 if leafDupliObj not in "NONE":
                     bpy.data.objects[leafDupliObj].parent = leafObj
             except KeyError:
                 pass
         elif leafShape == 'dVert':
-            leafObj.dupli_type = "VERTS"
-            leafObj.use_dupli_vertices_rotation = True
+            leafObj.instance_type = "VERTS"
+            leafObj.use_instance_vertices_rotation = True
             try:
                 if leafDupliObj not in "NONE":
                     bpy.data.objects[leafDupliObj].parent = leafObj
diff --git a/add_mesh_extra_objects/add_empty_as_parent.py b/add_mesh_extra_objects/add_empty_as_parent.py
index 32d0d167..a6ae69e6 100644
--- a/add_mesh_extra_objects/add_empty_as_parent.py
+++ b/add_mesh_extra_objects/add_empty_as_parent.py
@@ -81,15 +81,15 @@ class P2E(Operator):
         context.object.show_in_front = True
 
         if self.grupo:
-            bpy.ops.group.create(name=self.nombre)
-            bpy.ops.group.objects_add_active()
+            bpy.ops.collection.create(name=self.nombre)
+            bpy.ops.collection.objects_add_active()
 
         for o in objs:
             o.select = True
             if not o.parent:
                 bpy.ops.object.parent_set(type='OBJECT')
             if self.grupo:
-                bpy.ops.group.objects_add_active()
+                bpy.ops.collection.objects_add_active()
             o.select = False
         for o in objs:
             if self.renom:
diff --git a/btrace/bTrace.py b/btrace/bTrace.py
index 82d93f9d..8df06475 100644
--- a/btrace/bTrace.py
+++ b/btrace/bTrace.py
@@ -115,9 +115,9 @@ class OBJECT_OT_objectconnect(Operator):
             if curve_handle == 'AUTOMATIC':  # hackish because of naming conflict in api
                 curve_handle = 'AUTO'
             # Check if Btrace group exists, if not create
-            bgroup = bpy.data.groups.keys()
+            bgroup = bpy.data.collections.keys()
             if 'Btrace' not in bgroup:
-                bpy.ops.group.create(name="Btrace")
+                bpy.ops.collections.create(name="Btrace")
             #  check if noise
             if Btrace.connect_noise:
                 bpy.ops.object.btfcnoise()
@@ -181,7 +181,7 @@ class OBJECT_OT_objectconnect(Operator):
             if Btrace.animate:   # Add Curve Grow it?
                 bpy.ops.curve.btgrow()
 
-            bpy.ops.object.group_link(group="Btrace")  # add to Btrace group
+            bpy.ops.object.collection_link(group="Btrace")  # add to Btrace group
             if Btrace.animate:
                 bpy.ops.curve.btgrow()  # Add grow curve
 
@@ -245,9 +245,9 @@ class OBJECT_OT_particletrace(Operator):
                 curve_handle = 'FREE'
 
             # Check if Btrace group exists, if not create
-            bgroup = bpy.data.groups.keys()
+            bgroup = bpy.data.collections.keys()
             if 'Btrace' not in bgroup:
-                bpy.ops.group.create(name="Btrace")
+                bpy.ops.collection.create(name="Btrace")
 
             if Btrace.curve_join:
                 tracer = curvetracer('Tracer', 'Splines')
@@ -271,7 +271,7 @@ class OBJECT_OT_particletrace(Operator):
             for curveobject in curvelist:
                 curveobject.select = True
                 bpy.context.scene.objects.active = curveobject
-                bpy.ops.object.group_link(group="Btrace")
+                bpy.ops.object.collection_link(group="Btrace")
                 # Materials
                 trace_mats = addtracemat(curveobject.data)
                 if not trace_mats and check_materials is True:
@@ -721,9 +721,9 @@ class OBJECT_OT_meshfollow(Operator):
 
             # Run methods
             # Check if Btrace group exists, if not create
-            bgroup = bpy.data.groups.keys()
+            bgroup = bpy.data.collections.keys()
             if 'Btrace' not in bgroup:
-                bpy.ops.group.create(name="Btrace")
+                bpy.ops.collection.create(name="Btrace")
 
             Btrace = bpy.context.window_manager.curve_tracer
             sel = getsel_option()  # Get selection
@@ -743,7 +743,7 @@ class OBJECT_OT_meshfollow(Operator):
                 if curveobject.type == 'CURVE':
                     curveobject.select = True
                     context.scene.objects.active = curveobject
-                    bpy.ops.object.group_link(group="Btrace")
+                    bpy.ops.object.collection_link(group="Btrace")
                     # Materials
                     trace_mats = addtracemat(curveobject.data)
                     if not trace_mats and check_materials is True:
diff --git a/io_blend_utils/blend/blendfile_path_walker.py b/io_blend_utils/blend/blendfile_path_walker.py
index df07235e..ef499604 100644
--- a/io_blend_utils/blend/blendfile_path_walker.py
+++ b/io_blend_utils/blend/blendfile_path_walker.py
@@ -726,7 +726,7 @@ class ExpandID:
             del dup_group
 
         yield block.get_pointer(b'proxy')
-        yield block.get_pointer(b'proxy_group')
+        yield block.get_pointer(b'proxy_collection')
 
         if USE_ALEMBIC_BRANCH:
             if has_dup_gr

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list