Extend OVRTX MaterialX/OpenPBR conversion
When to Use
Use when adding supported shader nodes, sockets, texture operations, UV handling, material bindings, fallback policy, conversion diagnostics, or OpenPBR parity.
Boundary
Work in the distributed source checkout and use documented runtime interfaces.
The add-on owns Blender graph discovery, conversion policy, texture materialization,
USD overlay generation, binding identity, caching, and diagnostics. Do not solve
unsupported graph conversion by patching the runtime or mutating the source
material.
Code map
addon/ovrtx_blender_example/materialx_openpbr_conversion.py
scene_layer_from_materials: conversion entry and fallback policy.
_scene_overlay_from_materials, _resolve_binding, _classify_material:
selection, USD binding resolution, supported/unsupported classification.
_active_material_surface, _surface_graph_nodes, _node_diagnostics,
_blocking_reasons: active graph discovery and fail-closed diagnostics.
_openpbr_values_from_surface and _principled_openpbr_values: surface and
socket-to-OpenPBR value conversion.
_texture_record_from_socket, _post_image_op_record,
_normal_texture_record, _linked_texture_node: texture graph extraction.
_material_block_lines, _texture_shader_lines, _input_connect_line,
_binding_tree_lines: deterministic USDA emission and binding.
addon/ovrtx_blender_example/texture_materialization.py:
materialized_image_path and texture_cache_directory own disk/packed image
resolution and content-addressed cache stability.
addon/ovrtx_blender_example/render_requests.py::MaterialPresentationLayer:
typed composition payload, authored properties, digest content, diagnostics.
addon/ovrtx_blender_example/blender_signal_translation.py::_material_scene_layer_from_scene:
selects MaterialX conversion, caches by source path/material identity, and
preserves the exact-stage boundary.
addon/ovrtx_blender_example/usd_preview_emission_layer.py: legacy final-render
preview path; do not broaden it when the feature belongs to MaterialX/OpenPBR.
Instructions
- Define the Blender node/socket pattern, OpenPBR input, value type, units,
colorspace, defaults, and unsupported cases. Decide whether the graph is a
value extension, texture-chain extension, surface topology, or binding change.
- Extend active-graph discovery and
_SUPPORTED_NODE_TYPES only for nodes whose
semantics are actually converted. Ensure disconnected nodes cannot block or
influence output.
- Add pure value conversion beside
_openpbr_values_from_surface or the
relevant _apply_*_values function. Clamp or transform only when the mapping
specifies it; preserve omission semantics for inactive lobes.
- For textures, extend
_TEXTURE_INPUTS and extraction/emission together.
Resolve packed and library-aware images through materialized_image_path.
Mark scalar data raw and color data sRGB as appropriate. Model channel,
normal, mapping, and post-image operations explicitly; never bake silently.
- Extend
_material_block_lines/_texture_shader_lines with deterministic
identifiers and ordering. Include every output-affecting value in digest
content so cache reuse cannot return stale overlays.
- If binding behavior changes, update
_resolve_binding and binding-tree
emission without guessing a target from material name when identity is
ambiguous. Invalid or absent targets must remain diagnostic, not misbound.
- Preserve
allow_stock_fallback: strict conversion returns
MaterialSceneConversionStatus.ERROR; fallback records each skipped material
and leaves its stock binding intact. Never claim a partial graph was converted.
- Change
blender_signal_translation.py only if conversion inputs or cache
identity change. Keep exact-stage requests free of automatic replacement.
Required tests
Extend tests/test_materialx_openpbr_conversion.py for:
- supported constants and boundary values;
- linked texture, packed image, colorspace, channel, mapping, and normal cases;
- disconnected/unsupported nodes and actionable
blocking_reasons;
- deterministic layer text/digest and unique identifiers;
- strict error versus stock fallback;
- unbound, invalid, ambiguous, and multiple binding targets.
Extend tests/test_texture_materialization.py for any new image path/cache
behavior. Extend tests/test_render_requests.py when translation inputs, cache
keys, reuse/invalidation, or exact-stage behavior changes. Add a small Blender
fixture only when fake node graphs cannot establish the Blender API contract.
Run the focused tests, then the complete tests suite. With the supported
runtime, compare a generic textured multi-object scene between Blender reference
and OVRTX output. Check bindings, UV orientation, color/non-color handling,
opacity, normals, and lobe response; a successful render call alone is not a pass.
Runtime escalation gate
Stay add-on-only when generated USD contains the intended MaterialX/OpenPBR
network and bindings but the add-on omitted or mistranslated Blender data.
Escalate only when a minimal hand-authored USD fixture using documented OpenPBR
nodes fails on a compatible installed runtime while the same runtime accepts its
documented baseline. Record fixture, runtime version, diagnostics, and output;
do not propose worker implementation changes from an unexplained visual mismatch.
Handoff
Return changed files and symbols, supported and rejected graph patterns,
focused/full test results, generic visual comparison, cache/binding compatibility
notes, and addon-only or runtime-capability-missing.
1---2name: extend-ovrtx-materialx-openpbr3description: Extend and test Blender material graph conversion to MaterialX OpenPBR in the OVRTX Blender add-on. Use when adding supported shader nodes, sockets, texture operations, UV handling, material bindings, fallback policy, conversion diagnostics, or OpenPBR parity.4license: Apache-2.05---6# Extend OVRTX MaterialX/OpenPBR conversion78## When to Use910Use when adding supported shader nodes, sockets, texture operations, UV handling, material bindings, fallback policy, conversion diagnostics, or OpenPBR parity.1112## Boundary1314Work in the distributed source checkout and use documented runtime interfaces.15The add-on owns Blender graph discovery, conversion policy, texture materialization,16USD overlay generation, binding identity, caching, and diagnostics. Do not solve17unsupported graph conversion by patching the runtime or mutating the source18material.1920## Code map2122- `addon/ovrtx_blender_example/materialx_openpbr_conversion.py`23 - `scene_layer_from_materials`: conversion entry and fallback policy.24 - `_scene_overlay_from_materials`, `_resolve_binding`, `_classify_material`:25 selection, USD binding resolution, supported/unsupported classification.26 - `_active_material_surface`, `_surface_graph_nodes`, `_node_diagnostics`,27 `_blocking_reasons`: active graph discovery and fail-closed diagnostics.28 - `_openpbr_values_from_surface` and `_principled_openpbr_values`: surface and29 socket-to-OpenPBR value conversion.30 - `_texture_record_from_socket`, `_post_image_op_record`,31 `_normal_texture_record`, `_linked_texture_node`: texture graph extraction.32 - `_material_block_lines`, `_texture_shader_lines`, `_input_connect_line`,33 `_binding_tree_lines`: deterministic USDA emission and binding.34- `addon/ovrtx_blender_example/texture_materialization.py`:35 `materialized_image_path` and `texture_cache_directory` own disk/packed image36 resolution and content-addressed cache stability.37- `addon/ovrtx_blender_example/render_requests.py::MaterialPresentationLayer`:38 typed composition payload, authored properties, digest content, diagnostics.39- `addon/ovrtx_blender_example/blender_signal_translation.py::_material_scene_layer_from_scene`:40 selects MaterialX conversion, caches by source path/material identity, and41 preserves the exact-stage boundary.42- `addon/ovrtx_blender_example/usd_preview_emission_layer.py`: legacy final-render43 preview path; do not broaden it when the feature belongs to MaterialX/OpenPBR.4445## Instructions46471. Define the Blender node/socket pattern, OpenPBR input, value type, units,48 colorspace, defaults, and unsupported cases. Decide whether the graph is a49 value extension, texture-chain extension, surface topology, or binding change.502. Extend active-graph discovery and `_SUPPORTED_NODE_TYPES` only for nodes whose51 semantics are actually converted. Ensure disconnected nodes cannot block or52 influence output.533. Add pure value conversion beside `_openpbr_values_from_surface` or the54 relevant `_apply_*_values` function. Clamp or transform only when the mapping55 specifies it; preserve omission semantics for inactive lobes.564. For textures, extend `_TEXTURE_INPUTS` and extraction/emission together.57 Resolve packed and library-aware images through `materialized_image_path`.58 Mark scalar data raw and color data sRGB as appropriate. Model channel,59 normal, mapping, and post-image operations explicitly; never bake silently.605. Extend `_material_block_lines`/`_texture_shader_lines` with deterministic61 identifiers and ordering. Include every output-affecting value in digest62 content so cache reuse cannot return stale overlays.636. If binding behavior changes, update `_resolve_binding` and binding-tree64 emission without guessing a target from material name when identity is65 ambiguous. Invalid or absent targets must remain diagnostic, not misbound.667. Preserve `allow_stock_fallback`: strict conversion returns67 `MaterialSceneConversionStatus.ERROR`; fallback records each skipped material68 and leaves its stock binding intact. Never claim a partial graph was converted.698. Change `blender_signal_translation.py` only if conversion inputs or cache70 identity change. Keep exact-stage requests free of automatic replacement.7172## Required tests7374Extend `tests/test_materialx_openpbr_conversion.py` for:7576- supported constants and boundary values;77- linked texture, packed image, colorspace, channel, mapping, and normal cases;78- disconnected/unsupported nodes and actionable `blocking_reasons`;79- deterministic layer text/digest and unique identifiers;80- strict error versus stock fallback;81- unbound, invalid, ambiguous, and multiple binding targets.8283Extend `tests/test_texture_materialization.py` for any new image path/cache84behavior. Extend `tests/test_render_requests.py` when translation inputs, cache85keys, reuse/invalidation, or exact-stage behavior changes. Add a small Blender86fixture only when fake node graphs cannot establish the Blender API contract.8788Run the focused tests, then the complete `tests` suite. With the supported89runtime, compare a generic textured multi-object scene between Blender reference90and OVRTX output. Check bindings, UV orientation, color/non-color handling,91opacity, normals, and lobe response; a successful render call alone is not a pass.9293## Runtime escalation gate9495Stay add-on-only when generated USD contains the intended MaterialX/OpenPBR96network and bindings but the add-on omitted or mistranslated Blender data.97Escalate only when a minimal hand-authored USD fixture using documented OpenPBR98nodes fails on a compatible installed runtime while the same runtime accepts its99documented baseline. Record fixture, runtime version, diagnostics, and output;100do not propose worker implementation changes from an unexplained visual mismatch.101102## Handoff103104Return changed files and symbols, supported and rejected graph patterns,105focused/full test results, generic visual comparison, cache/binding compatibility106notes, and `addon-only` or `runtime-capability-missing`.