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>2019-05-15 15:11:13 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-05-16 11:34:11 +0300
commite5c3ae31189b3acb54d33061da2bd27c3d0abad5 (patch)
treea53fe430313980bc37f98966d35d2c390cdbfb62 /io_scene_obj
parent05baedacbfdb15b74a2c89a790e8b3f196ef1417 (diff)
Addons: Adopt for Dependency Graph API changes
Mainly search-and-replace approach. Tested the enabled-by-default export/import addons. Seems to work with an exception of X3D which is still referencing Blender Internal material properties. Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D4866
Diffstat (limited to 'io_scene_obj')
-rw-r--r--io_scene_obj/export_obj.py6
-rw-r--r--io_scene_obj/import_obj.py2
2 files changed, 5 insertions, 3 deletions
diff --git a/io_scene_obj/export_obj.py b/io_scene_obj/export_obj.py
index 5e2121d6..49ec8bc0 100644
--- a/io_scene_obj/export_obj.py
+++ b/io_scene_obj/export_obj.py
@@ -347,8 +347,10 @@ def write_file(filepath, objects, depsgraph, scene,
continue
# END NURBS
+ ob_for_convert = ob.evaluated_get(depsgraph) if EXPORT_APPLY_MODIFIERS else ob.original
+
try:
- me = ob.to_mesh(depsgraph, EXPORT_APPLY_MODIFIERS)
+ me = ob_for_convert.to_mesh()
except RuntimeError:
me = None
@@ -678,7 +680,7 @@ def _write(context, filepath,
base_name, ext = os.path.splitext(filepath)
context_name = [base_name, '', '', ext] # Base name, scene name, frame number, extension
- depsgraph = context.depsgraph
+ depsgraph = context.evaluated_depsgraph_get()
scene = context.scene
# Exit edit mode before exporting, so current object states are exported properly.
diff --git a/io_scene_obj/import_obj.py b/io_scene_obj/import_obj.py
index b278c849..2763f8fe 100644
--- a/io_scene_obj/import_obj.py
+++ b/io_scene_obj/import_obj.py
@@ -1243,7 +1243,7 @@ def load(context,
# we could apply this anywhere before scaling.
obj.matrix_world = global_matrix
- scene.update()
+ view_layer.update()
axis_min = [1000000000] * 3
axis_max = [-1000000000] * 3