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_export_pc2.py
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_export_pc2.py')
-rw-r--r--io_export_pc2.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/io_export_pc2.py b/io_export_pc2.py
index 7384e21e..5e69d14f 100644
--- a/io_export_pc2.py
+++ b/io_export_pc2.py
@@ -63,7 +63,12 @@ def do_export(context, props, filepath):
end = props.range_end
sampling = float(props.sampling)
apply_modifiers = props.apply_modifiers
- me = ob.to_mesh(context.depsgraph, apply_modifiers)
+ depsgraph = None
+ if apply_modifiers:
+ depsgraph = context.evaluated_depsgraph_get()
+ me = ob.evaluated_get(depsgraph).to_mesh()
+ else:
+ me = ob.to_mesh()
vertCount = len(me.vertices)
sampletimes = get_sampled_frames(start, end, sampling)
sampleCount = len(sampletimes)
@@ -79,7 +84,10 @@ def do_export(context, props, filepath):
for frame in sampletimes:
# stupid modf() gives decimal part first!
sc.frame_set(int(frame[1]), subframe=frame[0])
- me = ob.to_mesh(context.depsgraph, apply_modifiers)
+ if apply_modifiers:
+ me = ob.evaluated_get(depsgraph).to_mesh()
+ else:
+ me = ob.to_mesh()
if len(me.vertices) != vertCount:
bpy.data.meshes.remove(me, do_unlink=True)