Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python bindings for TargetDef and AttributeDef #1241

Merged

Conversation

kwokcb
Copy link
Contributor

@kwokcb kwokcb commented Feb 13, 2023

There are no new C++ APIs. They are just missing from the Python API

Changes

  • Add in AttributeDef Python interface
  • Add in TargetDef Python interface
  • Add in missing Python interfaces on Document and ShaderGenerator using these interface and metadata registration

Test

  • Update genshader Python test to test TargetDef to find targets and match against the sahder generator
  • Update gensahder test to add custom AttributeDef and test that they make it through OSL code gen. Resulting code should have custom string data node_name which is associated with the std surface nodedef:
surface standardSurface1
[[
    string mtlx_category = "standard_surface",
    string mtlx_name = "standardSurface1",
    string help = "Autodesk standard surface shader",
    string node_name = "Standard_Surface_Number_1"
]]

@kwokcb
Copy link
Contributor Author

kwokcb commented Feb 13, 2023

@niklasharrysson, I needed targetdef, but noticed that attributedef was missing so added that in as well. The test here is just for a string metadata attribute (borrowed from the C++ test).

@jstone-lucasfilm jstone-lucasfilm changed the title Add Target / Attribute Definition and Metadata setting to Shader Generation Python API Add Python bindings for TargetDef and AttributeDef Feb 13, 2023
Copy link
Member

@jstone-lucasfilm jstone-lucasfilm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this change together, @kwokcb, and it looks good to me!

@jstone-lucasfilm jstone-lucasfilm merged commit 4be7456 into AcademySoftwareFoundation:main Mar 24, 2023
@kwokcb kwokcb deleted the shadergen_python_api branch September 6, 2023 11:47
Michaelredaa pushed a commit to Michaelredaa/MaterialX that referenced this pull request Oct 21, 2023
…undation#1241)

- Add in AttributeDef Python interface
- Add in TargetDef Python interface
- Add in missing Python interfaces on Document and ShaderGenerator using these interface and metadata registration
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.

None yet

2 participants