Alembic: remove non-functional "Renderable Objects" only option
When introduced in {rB61050f75b13e} this was actually working (meaning it checked the Outliner OB_RESTRICT_RENDER flag and skipped the object if desired). Behavior has since then been commented in rBae6e9401abb7 and apparently refactored out in rB2917df21adc8. If checked, it seemed to be working (objects marked non-renderable in the Outliner were pruned from the export), however unchecking that option did not include them in the export. Now it changed - for the worse if you like - in rBa95f86359673 which made it so if "Renderable Objects" only is checked, it will still export objects invisible in renders. So since we now have the non-functional option with a broken/misleading default, it is better to just remove it entirely. In fact it has been superseeded by the "Visible Objects" option (this does the same thing: depsgraph is evaluated in render mode) and as a second step (and to make this even clearer) a choice whether Render or Viewport evaluation is used can be added (just like the USD exporter has). When that choice is explicit, it's also clear which visibility actually matters. This is breaking API usage, should be in release notes. ref. T89594 Maniphest Tasks: T89594 Differential Revision: https://developer.blender.org/D11808
This commit is contained in:
parent
ae8fa7062c
commit
834e87af7b
Notes:
blender-bot
2023-02-14 10:32:59 +01:00
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93 Referenced by issue #89594, Alembic export not respecting the renderable flag.
|
@ -126,7 +126,6 @@ static int wm_alembic_export_exec(bContext *C, wmOperator *op)
|
|||
.curves_as_mesh = RNA_boolean_get(op->ptr, "curves_as_mesh"),
|
||||
.flatten_hierarchy = RNA_boolean_get(op->ptr, "flatten"),
|
||||
.visible_objects_only = RNA_boolean_get(op->ptr, "visible_objects_only"),
|
||||
.renderable_only = RNA_boolean_get(op->ptr, "renderable_only"),
|
||||
.face_sets = RNA_boolean_get(op->ptr, "face_sets"),
|
||||
.use_subdiv_schema = RNA_boolean_get(op->ptr, "subdiv_schema"),
|
||||
.export_hair = RNA_boolean_get(op->ptr, "export_hair"),
|
||||
|
@ -194,7 +193,6 @@ static void ui_alembic_export_settings(uiLayout *layout, PointerRNA *imfptr)
|
|||
|
||||
sub = uiLayoutColumnWithHeading(col, true, IFACE_("Only"));
|
||||
uiItemR(sub, imfptr, "selected", 0, IFACE_("Selected Objects"), ICON_NONE);
|
||||
uiItemR(sub, imfptr, "renderable_only", 0, IFACE_("Renderable Objects"), ICON_NONE);
|
||||
uiItemR(sub, imfptr, "visible_objects_only", 0, IFACE_("Visible Objects"), ICON_NONE);
|
||||
|
||||
/* Object Data */
|
||||
|
@ -354,12 +352,6 @@ void WM_OT_alembic_export(wmOperatorType *ot)
|
|||
RNA_def_boolean(
|
||||
ot->srna, "selected", 0, "Selected Objects Only", "Export only selected objects");
|
||||
|
||||
RNA_def_boolean(ot->srna,
|
||||
"renderable_only",
|
||||
1,
|
||||
"Renderable Objects Only",
|
||||
"Export only objects marked renderable in the outliner");
|
||||
|
||||
RNA_def_boolean(ot->srna,
|
||||
"visible_objects_only",
|
||||
0,
|
||||
|
|
|
@ -54,7 +54,6 @@ struct AlembicExportParams {
|
|||
bool curves_as_mesh;
|
||||
bool flatten_hierarchy;
|
||||
bool visible_objects_only;
|
||||
bool renderable_only;
|
||||
bool face_sets;
|
||||
bool use_subdiv_schema;
|
||||
bool packuv;
|
||||
|
|
|
@ -207,7 +207,6 @@ static void rna_Scene_alembic_export(Scene *scene,
|
|||
bool apply_subdiv,
|
||||
bool flatten_hierarchy,
|
||||
bool visible_objects_only,
|
||||
bool renderable_only,
|
||||
bool face_sets,
|
||||
bool use_subdiv_schema,
|
||||
bool export_hair,
|
||||
|
@ -241,7 +240,6 @@ static void rna_Scene_alembic_export(Scene *scene,
|
|||
.apply_subdiv = apply_subdiv,
|
||||
.flatten_hierarchy = flatten_hierarchy,
|
||||
.visible_objects_only = visible_objects_only,
|
||||
.renderable_only = renderable_only,
|
||||
.face_sets = face_sets,
|
||||
.use_subdiv_schema = use_subdiv_schema,
|
||||
.export_hair = export_hair,
|
||||
|
@ -383,11 +381,6 @@ void RNA_api_scene(StructRNA *srna)
|
|||
0,
|
||||
"Visible layers only",
|
||||
"Export only objects in visible layers");
|
||||
RNA_def_boolean(func,
|
||||
"renderable_only",
|
||||
0,
|
||||
"Renderable objects only",
|
||||
"Export only objects marked renderable in the outliner");
|
||||
RNA_def_boolean(func, "face_sets", 0, "Facesets", "Export face sets");
|
||||
RNA_def_boolean(func,
|
||||
"subdiv_schema",
|
||||
|
|
|
@ -197,7 +197,7 @@ class HierarchicalAndFlatExportTest(AbstractAlembicTest):
|
|||
def test_hierarchical_export(self, tempdir: pathlib.Path):
|
||||
abc = tempdir / 'cubes_hierarchical.abc'
|
||||
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
||||
"renderable_only=True, visible_objects_only=True, flatten=False)" % abc.as_posix()
|
||||
"visible_objects_only=True, flatten=False)" % abc.as_posix()
|
||||
self.run_blender('cubes-hierarchy.blend', script)
|
||||
|
||||
# Now check the resulting Alembic file.
|
||||
|
@ -215,7 +215,7 @@ class HierarchicalAndFlatExportTest(AbstractAlembicTest):
|
|||
def test_flat_export(self, tempdir: pathlib.Path):
|
||||
abc = tempdir / 'cubes_flat.abc'
|
||||
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
||||
"renderable_only=True, visible_objects_only=True, flatten=True)" % abc.as_posix()
|
||||
"visible_objects_only=True, flatten=True)" % abc.as_posix()
|
||||
self.run_blender('cubes-hierarchy.blend', script)
|
||||
|
||||
# Now check the resulting Alembic file.
|
||||
|
@ -236,7 +236,7 @@ class DupliGroupExportTest(AbstractAlembicTest):
|
|||
def test_hierarchical_export(self, tempdir: pathlib.Path):
|
||||
abc = tempdir / 'dupligroup_hierarchical.abc'
|
||||
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
||||
"renderable_only=True, visible_objects_only=True, flatten=False)" % abc.as_posix()
|
||||
"visible_objects_only=True, flatten=False)" % abc.as_posix()
|
||||
self.run_blender('dupligroup-scene.blend', script)
|
||||
|
||||
# Now check the resulting Alembic file.
|
||||
|
@ -254,7 +254,7 @@ class DupliGroupExportTest(AbstractAlembicTest):
|
|||
def test_flat_export(self, tempdir: pathlib.Path):
|
||||
abc = tempdir / 'dupligroup_hierarchical.abc'
|
||||
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
||||
"renderable_only=True, visible_objects_only=True, flatten=True)" % abc.as_posix()
|
||||
"visible_objects_only=True, flatten=True)" % abc.as_posix()
|
||||
self.run_blender('dupligroup-scene.blend', script)
|
||||
|
||||
# Now check the resulting Alembic file.
|
||||
|
@ -332,7 +332,7 @@ class CurveExportTest(AbstractAlembicTest):
|
|||
def test_export_single_curve(self, tempdir: pathlib.Path):
|
||||
abc = tempdir / 'single-curve.abc'
|
||||
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
||||
"renderable_only=True, visible_objects_only=True, flatten=False)" % abc.as_posix()
|
||||
"visible_objects_only=True, flatten=False)" % abc.as_posix()
|
||||
self.run_blender('single-curve.blend', script)
|
||||
|
||||
# Now check the resulting Alembic file.
|
||||
|
@ -353,7 +353,7 @@ class HairParticlesExportTest(AbstractAlembicTest):
|
|||
def _do_test(self, tempdir: pathlib.Path, export_hair: bool, export_particles: bool) -> pathlib.Path:
|
||||
abc = tempdir / 'hair-particles.abc'
|
||||
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
||||
"renderable_only=True, visible_objects_only=True, flatten=False, " \
|
||||
"visible_objects_only=True, flatten=False, " \
|
||||
"export_hair=%r, export_particles=%r, as_background_job=False)" \
|
||||
% (abc.as_posix(), export_hair, export_particles)
|
||||
self.run_blender('hair-particles.blend', script)
|
||||
|
@ -419,7 +419,7 @@ class UVMapExportTest(AbstractAlembicTest):
|
|||
basename = 'T77021-multiple-uvmaps-animated-mesh'
|
||||
abc = tempdir / f'{basename}.abc'
|
||||
script = f"import bpy; bpy.ops.wm.alembic_export(filepath='{abc.as_posix()}', start=1, end=1, " \
|
||||
f"renderable_only=True, visible_objects_only=True, flatten=False)"
|
||||
f"visible_objects_only=True, flatten=False)"
|
||||
self.run_blender(f'{basename}.blend', script)
|
||||
|
||||
self.maxDiff = 1000
|
||||
|
@ -468,7 +468,7 @@ class LongNamesExportTest(AbstractAlembicTest):
|
|||
def test_export_long_names(self, tempdir: pathlib.Path):
|
||||
abc = tempdir / 'long-names.abc'
|
||||
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
||||
"renderable_only=False, visible_objects_only=False, flatten=False)" % abc.as_posix()
|
||||
"visible_objects_only=False, flatten=False)" % abc.as_posix()
|
||||
self.run_blender('long-names.blend', script)
|
||||
|
||||
name_parts = [
|
||||
|
@ -565,7 +565,7 @@ class InvisibleObjectExportTest(AbstractAlembicTest):
|
|||
def test_hierarchical_export(self, tempdir: pathlib.Path):
|
||||
abc = tempdir / 'visibility.abc'
|
||||
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=2, " \
|
||||
"renderable_only=False, visible_objects_only=False)" % abc.as_posix()
|
||||
"visible_objects_only=False)" % abc.as_posix()
|
||||
self.run_blender('visibility.blend', script)
|
||||
|
||||
def test(cube_name: str, expect_visible: bool):
|
||||
|
|
|
@ -300,7 +300,6 @@ class CameraExportImportTest(unittest.TestCase):
|
|||
abc_path = self.tempdir / "camera_transforms.abc"
|
||||
self.assertIn('FINISHED', bpy.ops.wm.alembic_export(
|
||||
filepath=str(abc_path),
|
||||
renderable_only=False,
|
||||
flatten=flatten,
|
||||
))
|
||||
|
||||
|
|
Loading…
Reference in New Issue