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 /io_import_dxf
parentfef2540b25775c3e1e4012bec35ddb8695daa209 (diff)
Use collection and instance terminology in Python API
This follows naming convention agreed on in T56648.
Diffstat (limited to 'io_import_dxf')
-rw-r--r--io_import_dxf/dxfimport/do.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/io_import_dxf/dxfimport/do.py b/io_import_dxf/dxfimport/do.py
index be79908c..8db6b854 100644
--- a/io_import_dxf/dxfimport/do.py
+++ b/io_import_dxf/dxfimport/do.py
@@ -989,13 +989,13 @@ class Do:
bbox = self._object_bbox(objects + inserts, block_scene, name, True)
for i in inserts:
- sub_group = i.dupli_group
+ sub_group = i.instance_collection
block_scene.objects.unlink(i)
block_group.objects.unlink(i)
i_empty = bpy.data.objects.new(i.name, None)
i_empty.matrix_basis = i.matrix_basis
- i_empty.dupli_type = "GROUP"
- i_empty.dupli_group = sub_group
+ i_empty.instance_type = "COLLECTION"
+ i_empty.instance_collection = sub_group
block_group.objects.link(i_empty)
block_scene.objects.link(i_empty)
@@ -1006,8 +1006,8 @@ class Do:
bpy.context.screen.scene = scene
o = bbox.copy()
# o.empty_display_size = 0.3
- o.dupli_type = "GROUP"
- o.dupli_group = block_group
+ o.instance_type = "COLLECTION"
+ o.instance_collection = block_group
group.objects.link(o)
if invisible is not None:
o.hide = invisible
@@ -1021,7 +1021,7 @@ class Do:
"""
entity: DXF entity
name: String; not used but required to be consistent with the methods being called from _call_type()
- group: Blender group of type (bpy_types.group) being set if called from block()
+ group: Blender group of type (bpy_types.Collection) being set if called from block()
invisible: boolean to control visibility; being set if called from block()
"""
aunits = self.dwg.header.get('$AUNITS', 0)
@@ -1066,7 +1066,7 @@ class Do:
entity.col_count, entity.row_count)
o = bpy.data.objects.new(entity.name, dm)
instance.parent = o
- o.dupli_type = "VERTS"
+ o.instance_type = "VERTS"
# insert transformations
rot = radians(entity.rotation) if aunits == 0 else entity.rotation
@@ -1342,11 +1342,11 @@ class Do:
name: name of group (String)
Finds group by name or creates it if it does not exist.
"""
- groups = bpy.data.groups
+ groups = bpy.data.collections
if name in groups.keys():
group = groups[name]
else:
- group = bpy.data.groups.new(name)
+ group = bpy.data.collections.new(name)
return group
def _call_object_types(self, TYPE, entities, group, name, scene, separated=False):
@@ -1466,9 +1466,9 @@ class Do:
scene.objects.link(o)
self._nest_block(o, blockname, blgroup, scene)
- o.dupli_type = "FACES"
- o.use_dupli_faces_scale = True
- o.dupli_faces_scale = f
+ o.instance_type = "FACES"
+ o.use_instance_faces_scale = True
+ o.instance_faces_scale = f
def _nest_block(self, parent, name, blgroup, scene):
b = self.dwg.blocks[name]