blender/tests/python
Jesse Yurkovich 9daded5d87 USD: Use nodes for alpha-clip behavior instead of material properties
EEVEE-next has removed the MA_BM_CLIP / alpha_threshold material
properties in favor of using nodes for equivalent functionality. This
changes USD to build and traverse node graphs during import and export
accordingly. Indirectly this allows Cycles to correctly render such
materials now too.

A complicating factor is that the UsdPreviewSurface defines its opacity
threshold using greater-than-equals[1], which Blender does not support
(and for which was technically already incorrect as EEVEE-legacy only
used greater-than for its shaders). Due to this we actually need to use
2 nodes: A less-than, followed by a one-minus invert, to arrive at the
proper value. We'll translate UsdPreviewSurface to this form on Import.

For Export we will look for either this 2-node pattern or a Round
node plugged into Alpha. Looking for Round is a result of the glTF
documentation which recommended the use of this node for thresholds of
0.5[2]. It's a tiny addition that seems reasonable to accommodate.

[1] https://openusd.org/release/spec_usdpreviewsurface.html (search for "opacityThreshold")
[2] https://docs.blender.org/manual/en/4.2/addons/import_export/scene_gltf2.html#alpha-modes

See PR for example images

Pull Request: https://projects.blender.org/blender/blender/pulls/122025
2024-05-25 23:30:13 +02:00
..
collada Cleanup: remove redundant string formatting 2024-04-12 10:04:07 +10:00
modules
ui_simulate
view_layer
alembic_export_tests.py
batch_import.py
bevel_operator.py
bl_alembic_io_test.py
bl_animation_armature.py
bl_animation_drivers.py
bl_animation_fcurves.py Anim: add keytype argument to keyframe_insert() RNA function 2024-04-15 11:36:38 +02:00
bl_animation_id.py Anim: merge Animation data-block into bAction 2024-05-13 15:58:04 +02:00
bl_animation_keyframing.py Anim: Add unit tests for keying custom properties 2024-04-23 09:36:38 +02:00
bl_animation_nla_strip.py
bl_blendfile_io.py
bl_blendfile_liblink.py
bl_blendfile_library_overrides.py
bl_blendfile_utils.py
bl_blendfile_versioning.py Cleanup: Formatting 2024-05-10 17:58:56 +02:00
bl_bundled_modules.py
bl_constraints.py
bl_id_management.py
bl_imbuf_load.py
bl_imbuf_save.py
bl_io_curve_svg_test.py
bl_keymap_completeness.py
bl_keymap_validate.py
bl_load_addons.py
bl_load_py_modules.py Cleanup: restore error, exclude extensions tests from bl_load_py_modules 2024-05-16 16:02:25 +10:00
bl_mesh_modifiers.py
bl_mesh_validate.py
bl_node_field_type_inference.py Cleanup: unused imports 2024-04-19 16:09:30 +10:00
bl_node_group_compat.py
bl_node_group_interface.py
bl_pyapi_bpy_driver_secure_eval.py
bl_pyapi_bpy_path.py
bl_pyapi_bpy_utils_units.py
bl_pyapi_idprop.py
bl_pyapi_idprop_datablock.py
bl_pyapi_mathutils.py
bl_pyapi_prop_array.py
bl_pyapi_text.py
bl_rigging_symmetrize.py
bl_rna_defaults.py
bl_rna_manual_reference.py
bl_rst_completeness.py
bl_test.py
bl_usd_export_test.py USD: Use nodes for alpha-clip behavior instead of material properties 2024-05-25 23:30:13 +02:00
bl_usd_import_test.py USD: Read and write custom attributes for Curves 2024-05-25 22:23:40 +02:00
boolean_operator.py
CMakeLists.txt Unittests: 'versioning' py test: generate multiple instances to parallelize it. 2024-05-10 16:00:30 +02:00
compositor_cpu_render_tests.py Compositor: Explicitly set device in test scripts 2024-05-14 19:03:55 +03:00
compositor_realtime_render_tests.py Compositor: Explicitly set device in test scripts 2024-05-14 19:03:55 +03:00
curve_to_mesh.py
curves_extrude.py
cycles_render_tests.py
deform_modifiers.py
eevee_next_render_tests.py EEVEE-Next: Shadow: Add Maximum Resolution Option 2024-05-13 14:34:11 +02:00
eevee_render_tests.py
ffmpeg_tests.py
geo_node_sim_test.py
geo_node_test.py
gpu_info.py
modifiers.py Tests: Add modifier tests for shrinkwrap target normal project 2024-03-29 10:11:22 -04:00
opengl_draw_tests.py
operators.py
pep8.py
physics_cloth.py
physics_dynamic_paint.py
physics_ocean.py
physics_particle_instance.py
physics_particle_system.py
physics_softbody.py
rna_array.py
rna_info_dump.py
rst_to_doctree_mini.py
sequencer_render_tests.py
storm_render_tests.py
workbench_render_tests.py