-
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
always register and de-register the PxrMayaHdImagingShape and its draw override #810
always register and de-register the PxrMayaHdImagingShape and its draw override #810
Conversation
…w override While the USD proxy shape classes included in the maya-usd repo all use either the (legacy) Pixar batch renderer *or* the Viewport 2.0 render delegate, there may be other custom node types that may or may not leverage USD but still want to take advantage of aggregated drawing using Hydra. This change decouples the registration and de-registration of the PxrMayaHdImagingShape and its draw override from whether the Viewport 2.0 render delegate is enabled for proxies and instead does it unconditionally. Shapes that use PxrMayaHdImagingShape must call its GetOrCreateInstance() in their postConstructor() override in order to get setup for drawing.
To put it another way, right now enabling the Viewport 2.0 render delegate for USD proxy shape node types effectively disables the Pixar batch renderer for all shape node types, not just USD proxies. We'd like to still be able to use the batch renderer for non-proxy shape types to smooth the transition. |
I am not familiar with the |
@HdC-adsk: Good question. No, we should be ok there. We effectively have two layers of protection against that. The proxy shape classes guard against even creating an instance of the
So if none of these custom node types are in play, we really shouldn't end up with a Even if we do have a |
No worry about the preflight build errors. They are relevant to a new API class we recently added and will fix it soon. |
While the USD proxy shape classes included in the maya-usd repo all use either the (legacy) Pixar batch renderer or the Viewport 2.0 render delegate, there may be other custom node types that may or may not leverage USD but still want to take advantage of aggregated drawing using Hydra.
As an example, internally at Pixar we have a custom Maya shape node that is a severely stripped down approximation of a
UsdGeomPointInstancer
. This shape maintains its own data structures as a mix of USD and non-USD data, but it still uses thePxrMayaHdImagingShape
and the Pixar batch renderer for drawing. I'm not sure whether other studios have custom shape nodes that leverage the Pixar batch renderer and its shape adapter system in this way, but it was definitely written with the intention of supporting that.In our case, the eventual goal is that once we've fully transitioned to the Viewport 2.0 render delegate and UFE, we'll be authoring
UsdGeomPointInstancer
prims directly under amayaUsdProxyShape
and will no longer need this custom node type. As a result, we don't see value putting effort into making the custom shape work with the Viewport 2.0 render delegate. Instead, we're hoping that it can continue to use the Pixar batch renderer as we transition, and then we'll retire the shape once we've switched.I don't think there should be any ill effects from always registering and de-registering
PxrMayaHdImagingShape
and its draw override. If no nodes are created in the scene that callPxrMayaHdImagingShape::GetOrCreateInstance()
in theirpostConstructor()
override, we shouldn't see any imaging nodes created and the Pixar batch renderer shouldn't get instantiated either.