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:
authorBastien Montagne <montagne29@wanadoo.fr>2019-02-06 23:46:44 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-02-06 23:46:44 +0300
commitf541b292efd661313cf3f95ed68e4af8974c4e4b (patch)
treedd2779388d30a051186ba51385446f722c2d9e1b /io_scene_obj
parent16f675ceda249a1c99c6567fa1bf54cbbb10db82 (diff)
Fix T60845: Export OBJ: error exporting as obj when file contains collection instances.
Looks like that was skipped somehow when OBJ IO was ported to 2.8...
Diffstat (limited to 'io_scene_obj')
-rw-r--r--io_scene_obj/__init__.py2
-rw-r--r--io_scene_obj/export_obj.py18
2 files changed, 6 insertions, 14 deletions
diff --git a/io_scene_obj/__init__.py b/io_scene_obj/__init__.py
index 84bddf9d..1ae4a8bf 100644
--- a/io_scene_obj/__init__.py
+++ b/io_scene_obj/__init__.py
@@ -21,7 +21,7 @@
bl_info = {
"name": "Wavefront OBJ format",
"author": "Campbell Barton, Bastien Montagne",
- "version": (3, 5, 7),
+ "version": (3, 5, 8),
"blender": (2, 80, 0),
"location": "File > Import-Export",
"description": "Import-Export OBJ, Import OBJ mesh, UV's, materials and textures",
diff --git a/io_scene_obj/export_obj.py b/io_scene_obj/export_obj.py
index 17920c2a..34a279f4 100644
--- a/io_scene_obj/export_obj.py
+++ b/io_scene_obj/export_obj.py
@@ -325,20 +325,15 @@ def write_file(filepath, objects, depsgraph, scene,
for i, ob_main in enumerate(objects):
# ignore dupli children
if ob_main.parent and ob_main.parent.instance_type in {'VERTS', 'FACES'}:
- # XXX
subprogress1.step("Ignoring %s, dupli child..." % ob_main.name)
continue
obs = [(ob_main, ob_main.matrix_world)]
- if ob_main.instance_type != 'NONE':
- # XXX
- print('creating dupli_list on', ob_main.name)
- ob_main.dupli_list_create(scene)
-
- obs += [(dob.object, dob.matrix) for dob in ob_main.dupli_list]
-
- # XXX debug print
- print(ob_main.name, 'has', len(obs) - 1, 'dupli children')
+ if ob_main.is_instancer:
+ obs += [(dup.instance_object.original, dup.matrix_world.copy())
+ for dup in depsgraph.object_instances
+ if dup.parent and dup.parent.original == ob_main]
+ # ~ print(ob_main.name, 'has', len(obs) - 1, 'dupli children')
subprogress1.enter_substeps(len(obs))
for ob, ob_mat in obs:
@@ -644,9 +639,6 @@ def write_file(filepath, objects, depsgraph, scene,
# clean up
bpy.data.meshes.remove(me)
- if ob_main.instance_type != 'NONE':
- ob_main.dupli_list_clear()
-
subprogress1.leave_substeps("Finished writing geometry of '%s'." % ob_main.name)
subprogress1.leave_substeps()