diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2021-07-06 11:20:14 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2021-07-06 14:22:22 +0300 |
commit | 8f5a4a2453887e37b51bb131176b0efbd0e9b42e (patch) | |
tree | 0b1ba9b04d3f2fa0b4d500a11aa7901bb5ff9cca /source/blender/io/alembic | |
parent | 834e87af7bbf719e18acd7ae8adc0d9403681a1b (diff) |
Alembic export: evaluation mode option
This option will determine visibility on either render or the viewport
visibility. Same for modifer settings. So it will either evaluate the
depsgrah with DAG_EVAL_RENDER or DAG_EVAL_VIEWPORT.
This not only makes it more flexible, it is also a lot
clearer which visibility / modfier setting is taken into account (up
until now, this was always considered to be DAG_EVAL_RENDER)
This option was always present in the USD exporter, this just brings
Alembic in line with that.
ref. T89594
Maniphest Tasks: T89594
Differential Revision: https://developer.blender.org/D11820
Diffstat (limited to 'source/blender/io/alembic')
4 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/io/alembic/ABC_alembic.h b/source/blender/io/alembic/ABC_alembic.h index 958122ae9e7..3d1391ac2a4 100644 --- a/source/blender/io/alembic/ABC_alembic.h +++ b/source/blender/io/alembic/ABC_alembic.h @@ -19,6 +19,8 @@ * \ingroup balembic */ +#include "DEG_depsgraph.h" + #ifdef __cplusplus extern "C" { #endif @@ -62,6 +64,7 @@ struct AlembicExportParams { bool export_particles; bool export_custom_properties; bool use_instancing; + enum eEvaluationMode evaluation_mode; /* See MOD_TRIANGULATE_NGON_xxx and MOD_TRIANGULATE_QUAD_xxx * in DNA_modifier_types.h */ diff --git a/source/blender/io/alembic/exporter/abc_export_capi.cc b/source/blender/io/alembic/exporter/abc_export_capi.cc index 5b8998a0b1a..efe04d64cc3 100644 --- a/source/blender/io/alembic/exporter/abc_export_capi.cc +++ b/source/blender/io/alembic/exporter/abc_export_capi.cc @@ -213,8 +213,7 @@ bool ABC_export(Scene *scene, job->export_ok = false; BLI_strncpy(job->filename, filepath, sizeof(job->filename)); - job->depsgraph = DEG_graph_new( - job->bmain, scene, view_layer, DAG_EVAL_RENDER /* TODO(Sybren): params->evaluation_mode */); + job->depsgraph = DEG_graph_new(job->bmain, scene, view_layer, params->evaluation_mode); job->params = *params; bool export_ok = false; diff --git a/source/blender/io/alembic/exporter/abc_writer_abstract.cc b/source/blender/io/alembic/exporter/abc_writer_abstract.cc index 27b5c2fa2a4..910e04f3bf5 100644 --- a/source/blender/io/alembic/exporter/abc_writer_abstract.cc +++ b/source/blender/io/alembic/exporter/abc_writer_abstract.cc @@ -137,7 +137,7 @@ void ABCAbstractWriter::update_bounding_box(Object *object) void ABCAbstractWriter::write_visibility(const HierarchyContext &context) { - const bool is_visible = context.is_object_visible(DAG_EVAL_RENDER); + const bool is_visible = context.is_object_visible(args_.export_params->evaluation_mode); Alembic::Abc::OObject abc_object = get_alembic_object(); if (!abc_visibility_.valid()) { diff --git a/source/blender/io/alembic/exporter/abc_writer_mesh.cc b/source/blender/io/alembic/exporter/abc_writer_mesh.cc index fd7db005dd2..7ffb61e1d1b 100644 --- a/source/blender/io/alembic/exporter/abc_writer_mesh.cc +++ b/source/blender/io/alembic/exporter/abc_writer_mesh.cc @@ -162,7 +162,7 @@ ModifierData *ABCGenericMeshWriter::get_liquid_sim_modifier(Scene *scene, Object bool ABCGenericMeshWriter::is_supported(const HierarchyContext *context) const { if (args_.export_params->visible_objects_only) { - return context->is_object_visible(DAG_EVAL_RENDER); + return context->is_object_visible(args_.export_params->evaluation_mode); } return true; } |