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

Support for exporting metadata in shader generation (#371) #435

Conversation

niklasharrysson
Copy link
Contributor

This change list adds support for exporting shader metadata in shader generation, as well as addresses a couple of other issues:

  • Implementation of AttributeDef elements (according to 1.37 specification)
  • Usage of AttributeDef to define custom metadata to be exported
  • Support for exporting metadata for standard attributes like uiname, uifolder, doc, etc..
  • Improvement for thin_film thickness input definition
  • Bug fix for ShaderStage source code scope tracking

* Add implemention of AttributeDef element.

* Added AttributeDef pointer types

* Support [[ ]] punctuations for scope begin/end.

* Fixed issue with boolean type in OSL.

* Add metadata to ShaderPort. Support generation of metadata for shader inputs.

* Added AttributeDef methods to document.

* Fixed bug with scope handling in shader generation

* Using AttributeDefs for registering shader metadata.

* Support for metadata on node level.

* Added unittest for metadata generation.

* Fix typo in standard_surface nodedef.

* Support input widget metadata.

* Code cleanup.

* Fix initialization order issue.

/// @class GenUserData
/// Base class for custom user data needed during shader generation.
class GenUserData : public std::enable_shared_from_this<GenUserData>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved out to a separate file.

/// Derived shader generators may override this method to change the registration.
/// Applications must explicitly call this method before shader generation to enable
/// export of metadata.
virtual void registerShaderMetadata(const DocumentPtr& doc, GenContext& context) const;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Calling this method on the GenContext will enable export for shader metadata, according to which attributedefs are defined and/or which metadata this shader generator allows if the method is overridden.

@jstone-lucasfilm
Copy link
Member

Looks good, thanks @niklasharrysson!

@jstone-lucasfilm jstone-lucasfilm merged commit 05ddcdc into AcademySoftwareFoundation:master May 26, 2020
@bernardkwok bernardkwok deleted the adsk_to_lucasfilm branch September 3, 2020 14:23
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