Commit: 834e87af7bbf719e18acd7ae8adc0d9403681a1b
Author: Philipp Oeser
Date:   Mon Jul 5 11:27:17 2021 +0200
Branches: master
https://developer.blender.org/rB834e87af7bbf719e18acd7ae8adc0d9403681a1b

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

===================================================================

M       source/blender/editors/io/io_alembic.c
M       source/blender/io/alembic/ABC_alembic.h
M       source/blender/makesrna/intern/rna_scene_api.c
M       tests/python/alembic_export_tests.py
M       tests/python/bl_alembic_io_test.py

===================================================================

diff --git a/source/blender/editors/io/io_alembic.c 
b/source/blender/editors/io/io_alembic.c
index 28838d677f0..56ba32f0ffe 100644
--- a/source/blender/editors/io/io_alembic.c
+++ b/source/blender/editors/io/io_alembic.c
@@ -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,
diff --git a/source/blender/io/alembic/ABC_alembic.h 
b/source/blender/io/alembic/ABC_alembic.h
index 5664a43233a..958122ae9e7 100644
--- a/source/blender/io/alembic/ABC_alembic.h
+++ b/source/blender/io/alembic/ABC_alembic.h
@@ -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;
diff --git a/source/blender/makesrna/intern/rna_scene_api.c 
b/source/blender/makesrna/intern/rna_scene_api.c
index caecd9a07d8..3e292ea89e2 100644
--- a/source/blender/makesrna/intern/rna_scene_api.c
+++ b/source/blender/makesrna/intern/rna_scene_api.c
@@ -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",
diff --git a/tests/python/alembic_export_tests.py 
b/tests/python/alembic_export_tests.py
index 9d1738691f0..23a4a376533 100644
--- a/tests/python/alembic_export_tests.py
+++ b/tests/python/alembic_export_tests.py
@@ -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):
diff --git a/tests/python/bl_alembic_io_test.py 
b/tests/python/bl_alembic_io_test.py
index 53a0879f160..c0d0bcdea70 100644
--- a/tests/python/bl_alembic_io_test.py
+++ b/tests/python/bl_alembic_io_test.py
@@ -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,
         ))

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to