Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2021-07-06 11:20:14 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-07-06 14:22:22 +0300
commit8f5a4a2453887e37b51bb131176b0efbd0e9b42e (patch)
tree0b1ba9b04d3f2fa0b4d500a11aa7901bb5ff9cca /source/blender/editors
parent834e87af7bbf719e18acd7ae8adc0d9403681a1b (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/editors')
-rw-r--r--source/blender/editors/io/io_alembic.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/blender/editors/io/io_alembic.c b/source/blender/editors/io/io_alembic.c
index 56ba32f0ffe..12890552b1d 100644
--- a/source/blender/editors/io/io_alembic.c
+++ b/source/blender/editors/io/io_alembic.c
@@ -63,10 +63,26 @@
# include "WM_api.h"
# include "WM_types.h"
+# include "DEG_depsgraph.h"
+
# include "io_alembic.h"
# include "ABC_alembic.h"
+const EnumPropertyItem rna_enum_abc_export_evaluation_mode_items[] = {
+ {DAG_EVAL_RENDER,
+ "RENDER",
+ 0,
+ "Render",
+ "Use Render settings for object visibility, modifier settings, etc"},
+ {DAG_EVAL_VIEWPORT,
+ "VIEWPORT",
+ 0,
+ "Viewport",
+ "Use Viewport settings for object visibility, modifier settings, etc"},
+ {0, NULL, 0, NULL, NULL},
+};
+
static int wm_alembic_export_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
if (!RNA_struct_property_is_set(op->ptr, "as_background_job")) {
@@ -136,6 +152,7 @@ static int wm_alembic_export_exec(bContext *C, wmOperator *op)
.triangulate = RNA_boolean_get(op->ptr, "triangulate"),
.quad_method = RNA_enum_get(op->ptr, "quad_method"),
.ngon_method = RNA_enum_get(op->ptr, "ngon_method"),
+ .evaluation_mode = RNA_enum_get(op->ptr, "evaluation_mode"),
.global_scale = RNA_float_get(op->ptr, "global_scale"),
};
@@ -195,6 +212,9 @@ static void ui_alembic_export_settings(uiLayout *layout, PointerRNA *imfptr)
uiItemR(sub, imfptr, "selected", 0, IFACE_("Selected Objects"), ICON_NONE);
uiItemR(sub, imfptr, "visible_objects_only", 0, IFACE_("Visible Objects"), ICON_NONE);
+ col = uiLayoutColumn(box, true);
+ uiItemR(col, imfptr, "evaluation_mode", 0, NULL, ICON_NONE);
+
/* Object Data */
box = uiLayoutBox(layout);
row = uiLayoutRow(box, false);
@@ -460,6 +480,14 @@ void WM_OT_alembic_export(wmOperatorType *ot)
"This option is deprecated; EXECUTE this operator to run in the foreground, and INVOKE it "
"to run as a background job");
+ RNA_def_enum(ot->srna,
+ "evaluation_mode",
+ rna_enum_abc_export_evaluation_mode_items,
+ DAG_EVAL_RENDER,
+ "Use Settings for",
+ "Determines visibility of objects, modifier settings, and other areas where there "
+ "are different settings for viewport and rendering");
+
/* This dummy prop is used to check whether we need to init the start and
* end frame values to that of the scene's, otherwise they are reset at
* every change, draw update. */