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

Redesigning the shading mode export interface #168

Conversation

sirpalee
Copy link
Contributor

@sirpalee sirpalee commented Feb 23, 2017

Description of Change(s)

This change deals with redesigning the shading mode export/import interface. As a first step, it's a take on the export interface. I tried to create a bit more flexible export process, so exporters can overwrite the whole process too if they don't want to go through the exporter context.

This is just a take on the shading mode export, so feedback can be gathered, before moving on to the importers.

Fixes Issue(s)

  • There is no way to do stateful shading mode export / import interfaces.
  • There is no way to include spaces in the shading mode exporter's/importer's name, so lots of manual remapping is required.
  • No easy way to link the same exporter to multiple modes.
  • Exporters can't take over the whole process themselves, just by one shading node at a time.

@sirpalee
Copy link
Contributor Author

sirpalee commented Feb 23, 2017

If we combine these changes with #166 , we can completely remove the need for the branching logic when reading in the shading modes from the commands, because it is possible to re-register the displayColor exporter under multiple aliases, pxrRis under an alias that displayed properly in the Option Menu, and register an empty exporter for None. The two combined also helps writing flexible shader exporters for other applications, without relying on a custom build.

Copy link
Contributor

@sunyab sunyab left a comment

Choose a reason for hiding this comment

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

Hi @sirpalee, our sets team had a few questions/notes, thanks!

@@ -1,264 +1,41 @@
//
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering about the removal of the copyright notice here -- was that intentional? If not, could we put it back?

SdfPathSet _bindableRoots;
};

typedef boost::function< void (PxrUsdMayaShadingModeExportContext*) > PxrUsdMayaShadingModeExporterContext;
Copy link
Contributor

Choose a reason for hiding this comment

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

From what we could tell, this typedef isn't used anywhere -- could you confirm and remove if it isn't?

Otherwise, (and this is nit-picky) -- could we rename this typedef (and use a C++11 type alias), since this type isn't really a context, it's a function accepting a context?


exporter(&c);
auto exporter = exporterCreator();
if (exporter != nullptr) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we used an inline assignment at line 320, can we make this if check also do the same for consistency? e.g.,

if (auto exporter = exporterCreator()) { ... }

@sirpalee sirpalee force-pushed the pr_rewriting_shading_mode_interface branch from 37ae3ec to 28b0d3c Compare March 20, 2017 22:50
@sirpalee
Copy link
Contributor Author

sirpalee commented Mar 20, 2017

@sunyab Thanks for the feedback!

About the copyright notice, it was probably lost during a rebase when we switched between our branch and yours, nothing intentional there.

For future reference, what do you prefer when addressing feedback? Updating the original commit with the changes (cleaner history), or making an extra commit (simpler tracking of changes)?

@sunyab
Copy link
Contributor

sunyab commented Mar 21, 2017

@sirpalee Thanks for the changes! I think I'd prefer to squash and get the cleaner history for now.

@sirpalee sirpalee force-pushed the pr_rewriting_shading_mode_interface branch from 28b0d3c to 1c36c76 Compare March 21, 2017 07:04
@sirpalee
Copy link
Contributor Author

@sunyab Done! If you are happy with the current state, I'll go ahead and change the import interface in a similar manner.

@pixar-oss pixar-oss merged commit 1c36c76 into PixarAnimationStudios:dev Mar 25, 2017
pixar-oss added a commit that referenced this pull request Mar 25, 2017
…face

Redesigning the shading mode export interface
@sirpalee sirpalee deleted the pr_rewriting_shading_mode_interface branch April 13, 2017 07:36
AdamFelt pushed a commit to autodesk-forks/USD that referenced this pull request Apr 16, 2024
### Description of Change(s)
Add more for lineStyle schema.

### Fixes Issue(s)
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.

4 participants