-
Notifications
You must be signed in to change notification settings - Fork 202
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
Allow loading pure-USD shading mode plugins #923
Conversation
Previous code expected to load a Maya plugin. This change allows loading shading modes, importers, and exporters as a USD plugin.
} | ||
|
||
return false; | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return true as soon as we found the Info:UsdMaya:ShadingModePlugin. The mayaPlugin resolution becomes optional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation would be very welcome here. Things that will let developers know that mayaPluginName is a return argument, that it may not be initialized (if someone forgot to do so), and that shading mode plugin doesn't have to be associated with maya plugin.
.Msg( | ||
"Found shading mode plugin %s: Loading via USD API.\n", | ||
plug->GetName().c_str()); | ||
plug->Load(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Load shading modes that are not in a Maya plugin.
@@ -13,7 +13,7 @@ | |||
# See the License for the specific language governing permissions and | |||
# limitations under the License. | |||
# | |||
set(TARGET_NAME usdTestPlugin) | |||
set(TARGET_NAME usdTestMayaPlugin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now create 2 test plugins. One is Maya-style, the other one is pure USD.
mayaUsd | ||
usdShade | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note the absence of maya_set_plugin_properties
. This plugin is USD only.
set(PLUGIN_TYPES | ||
Maya | ||
USD | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add unit tests for USD-style plugin loading.
@@ -189,7 +189,6 @@ void UsdMaya_RegistryHelper::FindAndLoadMayaPlug( | |||
// already loaded. | |||
plug->Load(); | |||
} | |||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code would stop at the first usdPreviewSurface translator found. Since we can export to multiple rendering contexts, we need to continue until all usdPreviewSurface translators are found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
# In case tests are run in parallel, make sure we export to separate | ||
# directories: | ||
pluginPath = os.getenv("PXR_PLUGINPATH_NAME") | ||
if "../plugin/Maya" in pluginPath or "..\\plugin\\Maya" in pluginPath: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a platform-dependent thing, I'm assuming? Maybe this?:
if os.path.join(os.path.pardir, 'plugin', 'Maya') in pluginPath:
....
# In case tests are run in parallel, make sure we export to separate | ||
# directories: | ||
pluginPath = os.getenv("PXR_PLUGINPATH_NAME") | ||
if "../plugin/Maya" in pluginPath or "..\\plugin\\Maya" in pluginPath: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same os.path.join()
incantation here?
Previous code expected to load a Maya plugin. This change allows loading shading modes, importers, and exporters as a USD plugin.