Skip to content

Add Maya material integration#46

Merged
Ahmed-Hindy merged 1 commit into
mainfrom
codex/maya-material-integration
May 31, 2026
Merged

Add Maya material integration#46
Ahmed-Hindy merged 1 commit into
mainfrom
codex/maya-material-integration

Conversation

@Ahmed-Hindy

@Ahmed-Hindy Ahmed-Hindy commented May 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • add Maya material graph adapters, traversal, and recreation under materials_processor.dcc.maya
  • support an initial native Maya shader slice: standardSurface, file, place2dTexture, bump2d, and shadingEngine
  • add maya_nodes as a standardizer source type while keeping Maya out of Houdini target FORMAT_CHOICES
  • add Maya material smoke validation through mayapy and expose it via scripts/validate_maya2024_runtime.py --smoke-material

Notes

  • This brings Maya up to the same early integration shape as Blender: reader/writer adapters plus a real DCC runtime smoke.
  • Validation uses actual Maya 2024 mayapy, actual Maya DG nodes, and actual Maya connections in a synthetic in-memory scene.
  • This does not yet validate an existing production .ma / .mb scene or broad Maya/Arnold utility-node fidelity.

Validation

  • uv --native-tls run pytest tests/test_maya_support.py tests/test_maya_runtime.py tests/test_public_imports.py
  • uv --native-tls run pytest -m maya
  • uv --native-tls run python scripts/validate_maya2024_runtime.py --timeout 120 --smoke-material
  • uv --native-tls run pytest
  • uv --native-tls run ruff check src tests scripts
  • uv --native-tls build

Full local pytest result: 134 passed, 21 skipped, 1 xfailed.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added --smoke-material CLI flag to validate Maya material conversion functionality
    • Implemented support for reading and converting Maya shader networks to a neutral format
    • Implemented support for writing/recreating Maya shader networks from the neutral format
    • Extended material mappings to recognize Maya shader node types including standard surface, texture files, and related components
  • Tests

    • Added comprehensive Maya material support test coverage

@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The PR adds complete Maya material support by introducing traversal, standardization, and recreation modules that enable reading Maya shading networks, converting them through a neutral graph format, and writing them back to Maya. Mapping infrastructure is extended, adapters bridge the pipeline, smoke validation tests the round-trip, and a CLI flag integrates validation into the runtime check script.

Changes

Maya Material Read/Convert/Write Pipeline

Layer / File(s) Summary
Maya node and parameter mappings
src/materials_processor/mappings.py
STANDARDIZER_SUPPORTED_SOURCE_TYPES adds maya_nodes; REGULAR_NODE_TYPES_TO_GENERIC maps Maya node types (standardSurface, file, place2dTexture, bump2d, etc.) to GENERIC::*; REGULAR_PARAM_NAMES_TO_GENERIC maps Maya shader parameter names to generic schema.
Maya graph traversal and standardization
src/materials_processor/dcc/maya/traverser.py
MayaNodeTraverser reads Maya shading networks, resolves surface connections, recursively walks upstream inputs, collects node parameters and output metadata, and produces standardized dictionaries with cycle detection.
Maya graph recreation from neutral representation
src/materials_processor/dcc/maya/recreator.py
MayaNodeRecreator rebuilds Maya shader networks from MaterialGraph by creating nodes, translating generic parameter names to Maya attributes, setting values, recursively wiring plugs, and binding shading engines.
Material reader/writer adapters
src/materials_processor/dcc/maya/adapters.py
MayaMaterialReader.read() uses traverser and standardizer to convert Maya shaders to MaterialGraph; MayaMaterialWriter.write() uses recreator to rebuild networks from graphs.
Smoke validation and runtime infrastructure
src/materials_processor/dcc/maya/runtime.py
Added validate_maya_material_smoke() that runs embedded mayapy script creating a standardSurface, converting it end-to-end, and validating recreation success via prefixed JSON output; includes output parsing helper and mayapy execution wrapper.
Runtime and adapter unit tests
tests/test_maya_runtime.py
New test mocks mayapy smoke output and verifies validate_maya_material_smoke() parsing; extended local Maya 2024 test also runs smoke validation and asserts recreated and standardSurface presence.
End-to-end traverser/recreator/adapter tests
tests/test_maya_support.py
Fake Maya cmds implementations and comprehensive tests covering mapping, traversal with texture/bump graph preservation, reader/writer adapters, recreator node/connection wiring, and full round-trip conversion with standardization assertions.
Public import coverage
tests/test_public_imports.py
Updates smoke-check test to verify materials_processor.dcc.maya.adapters, recreator, and traverser are importable.
CLI smoke-material flag
scripts/validate_maya2024_runtime.py
Adds optional --smoke-material flag that conditionally runs validate_maya_material_smoke() after standard runtime validation and prints smoke-test results (node count and output connections).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through Maya's shader maze,
Reads networks, writes them back in countless ways,
Traverser finds the connections true,
Recreator builds fresh, in neutral hue,
Round-trips validated, the pipeline's ablaze!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.08% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add Maya material integration' directly and accurately summarizes the main change: introducing Maya material support with adapters, traversal, recreation, and validation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/maya-material-integration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Ahmed-Hindy
Ahmed-Hindy marked this pull request as ready for review May 31, 2026 10:28
@Ahmed-Hindy Ahmed-Hindy changed the title [codex] Add Maya material integration Add Maya material integration May 31, 2026
@Ahmed-Hindy Ahmed-Hindy self-assigned this May 31, 2026
@Ahmed-Hindy
Ahmed-Hindy merged commit a5cdcec into main May 31, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant