diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-11-28 19:49:52 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-11-28 20:22:51 +0300 |
commit | 7c7f3776dd0e2f0125a4065e4b4d070a8666ef7c (patch) | |
tree | c7be442387f617b6066a22cb1056d3b84f9566bc /release/scripts/modules | |
parent | 98ecab1af07a6f8f31b7889d1da92593deb87ae2 (diff) |
Use collection and instance terminology in Python API
This follows naming convention agreed on in T56648.
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/bl_previews_utils/bl_previews_render.py | 10 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/io_utils.py | 4 | ||||
-rw-r--r-- | release/scripts/modules/bpy_types.py | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/release/scripts/modules/bl_previews_utils/bl_previews_render.py b/release/scripts/modules/bl_previews_utils/bl_previews_render.py index 16b0b107927..f425278e8cb 100644 --- a/release/scripts/modules/bl_previews_utils/bl_previews_render.py +++ b/release/scripts/modules/bl_previews_utils/bl_previews_render.py @@ -229,13 +229,13 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): def object_bbox_merge(bbox, ob, ob_space, offset_matrix): # Take collections instances into account (including linked one in this case). - if ob.type == 'EMPTY' and ob.dupli_type == 'COLLECTION': - grp_objects = tuple((ob.name, ob.library.filepath if ob.library else None) for ob in ob.dupli_group.all_objects) + if ob.type == 'EMPTY' and ob.instance_type == 'COLLECTION': + grp_objects = tuple((ob.name, ob.library.filepath if ob.library else None) for ob in ob.instance_collection.all_objects) if (len(grp_objects) == 0): ob_bbox = ob.bound_box else: coords = objects_bbox_calc(ob_space, grp_objects, - Matrix.Translation(ob.dupli_group.dupli_offset).inverted()) + Matrix.Translation(ob.instance_collection.instance_offset).inverted()) ob_bbox = ((coords[0], coords[1], coords[2]), (coords[21], coords[22], coords[23])) elif ob.bound_box: ob_bbox = ob.bound_box @@ -390,11 +390,11 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): bpy.context.screen.scene = scene bpy.ops.object.collection_instance_add(collection=grp.name) - grp_ob = next((ob for ob in scene.objects if ob.dupli_group and ob.dupli_group.name == grp.name)) + grp_ob = next((ob for ob in scene.objects if ob.instance_collection and ob.dupli_coilection.name == grp.name)) grp_obname = grp_ob.name scene.update() - offset_matrix = Matrix.Translation(grp.dupli_offset).inverted() + offset_matrix = Matrix.Translation(grp.instance_offset).inverted() preview_render_do(render_context, 'collections', grp.name, objects, offset_matrix) diff --git a/release/scripts/modules/bpy_extras/io_utils.py b/release/scripts/modules/bpy_extras/io_utils.py index e74631256e3..4b28a9edf70 100644 --- a/release/scripts/modules/bpy_extras/io_utils.py +++ b/release/scripts/modules/bpy_extras/io_utils.py @@ -341,10 +341,10 @@ def axis_conversion_ensure(operator, forward_attr, up_attr): # return a tuple (free, object list), free is True if memory should be freed # later with free_derived_objects() def create_derived_objects(scene, ob): - if ob.parent and ob.parent.dupli_type in {'VERTS', 'FACES'}: + if ob.parent and ob.parent.instance_type in {'VERTS', 'FACES'}: return False, None - if ob.dupli_type != 'NONE': + if ob.instance_type != 'NONE': ob.dupli_list_create(scene) return True, [(dob.object, dob.matrix) for dob in ob.dupli_list] else: diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index dda1ab7b4ed..7779e1ba38a 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -104,7 +104,7 @@ class Collection(bpy_types.ID): """The collection instance objects this collection is used in""" import bpy return tuple(obj for obj in bpy.data.objects - if self == obj.dupli_group) + if self == obj.instance_collection) class Object(bpy_types.ID): |