f913fb6159
This change adds the ability to export MaterialX networks into the resulting USD layer. Details: A new export option has been added to the USD export to enable MaterialX export. It is off by default currently due to reasons in the caveats section. When enabled, it exports the MaterialX shading network alongside the UsdPreviewSurface network, on the same USD Material. This allows the same material to be used by renderers that don't support MaterialX, using the USDPreviewSurface as a fallback. This is similar to setups in other DCC packages, and matches the format we've used in our Reality Composer Pro asset library. It uses the existing MaterialX framework used to generate MaterialX documents for rendering, to act as the basis for the USD graph. In this process it also re-uses the existing texture export code as well if provided and necessary. Once the MaterialX document is created, use usdMtlx to generate a USD shading network. Unfortunately, usdMtlx generates a graph that is unlike what other DCCs that support MaterialX-embedded-in-USD generates. It generates several extra prim hierarchies, and externalizes all shader inputs, making them difficult to edit in other MaterialX graph editors. To workaround this, generate the MaterialX shading network onto a temporary stage, where we then run various pre-processing steps to prevent prim collisions and to reflow the paths once they're converted. The PrimSpecs are then copied over to their new path. The resulting prim hierarchy matches what many artists we've worked with prefer to work with. Caveats: The Export MaterialX check is off by default. When using the Principled BSDF, the resulting graph is very usable. However, when using some of the other BSDFs, the shading networks generated by the existing MaterialX framework in Blender generate some shading graphs that are difficult for usdview and other DCC's to understand. The graph is still correct, but because we're trying to prioritize compatibility, the default is off. In future PRs we can aim to make the graphs for those other BSDFs play better with other DCCs. Other Implementation Details: As part of this commit we've also done the following: * Place some of the materialx graphs inside a passthrough nodegraph to avoid node conflicts. * Better handle some shader output types , and better handle some conflict cases. * Moved the ExportTextureFunction to materials.h due to some difficult to resolve header ordering issues. This has no effect on any runtime code. * There is a test for the MaterialX export that does some basic checking to make sure we get an export out the other end that matches our expectations Authored by Apple: Dhruv Govil This PR is based on an earlier implementation by Brecht van Lommel , as well as Brian Savery and his teams' work at AMD to implement the general MaterialX framework within Blender. Pull Request: https://projects.blender.org/blender/blender/pulls/122575 |
||
---|---|---|
.. | ||
collada | ||
modules | ||
ui_simulate | ||
view_layer | ||
alembic_export_tests.py | ||
batch_import.py | ||
bevel_operator.py | ||
bl_alembic_io_test.py | ||
bl_animation_action.py | ||
bl_animation_armature.py | ||
bl_animation_drivers.py | ||
bl_animation_fcurves.py | ||
bl_animation_keyframing.py | ||
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 | ||
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 | ||
bl_mesh_modifiers.py | ||
bl_mesh_validate.py | ||
bl_node_field_type_inference.py | ||
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_datablock.py | ||
bl_pyapi_idprop.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 | ||
bl_usd_import_test.py | ||
boolean_operator.py | ||
CMakeLists.txt | ||
compositor_cpu_render_tests.py | ||
compositor_realtime_render_tests.py | ||
curve_to_mesh.py | ||
curves_extrude.py | ||
cycles_render_tests.py | ||
deform_modifiers.py | ||
eevee_next_render_tests.py | ||
ffmpeg_tests.py | ||
geo_node_sim_test.py | ||
geo_node_test.py | ||
gpu_info.py | ||
modifiers.py | ||
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 |