Closed radon199 closed 1 year ago
Filed as internal issue #USD-4919.
Hey there,
PxrUsdIn authors the "proxies.viewer" attribute group for models via the PxrUsdKatanaUtils::GetViewerProxyAttr utility. It appears to be authoring StaticSceneCreate as the opType, rather than PxrUsdIn, as well as several other (different) opArgs. Can you give this utility a try?
-- Emily
Hey,
If we patch this up, and use PxrUsdIn as the OpType, then we do get proxies in the Katana Hydra viewport and the legacy viewport, however they are offset from their position by double their transformation matrix.
I think this is because Katana expects the proxy to be at the origin, and to transform that itself to the current world space position for the given location the attributes are authored on.
Proxies still work in the legacy viewer, with proper offset when using StaticSceneCreate, but they are offset in the same way when using PxrUsdIn.
It seems like one solution is to allow the PxrUsdIn Op to import the specified SdfPath without any authored transforms above it, and then let Katana apply it’s transformation matrix to move it into position.
Not sure if that is remotely the best solution. The Katana docs suggest you can chain proxy Ops, but I don’t know enough to know what transform Op could be used to revert the proxy location inside Katana.
Yes, what you're saying corresponds to what we've observed with respect to using PxrUsdIn as the load op. Even with the use of an isolatePath, all transforms above the isolated prim will still be respected. Meaning, the transform stack for the real prim will be applied and then the transform of the proxy prim will be applied. When using SSC as the load op, the isolation logic is different.
There is a Katana notion of "reset all transforms above me to Identity". You can do this by setting an "xform.origin" double attr to 1.0 (in this case, at the location where the proxies attr is being authored). However, you would need to do so ONLY for the viewer op chain (otherwise the render would be borked) and ONLY when loading proxies. I have not read the docs myself, but it sounds like if you wrapped up an AttributeSet (that sets the origin attr) and chained it after the PxrUsdIn op, that might do the trick?
That being said, I'd love to understand a bit more about why you're using PxrUsdIn instead of SSC as the load op. Is it because SSC doesn't work with the Hydra Viewer (is that what was being conveyed by Step 2)?
Yes, correct. SSC does not show anything in the Hydra viewport in Katana 3.0+ when expended to a location with proxy attributes set, or at least as it is currently configured. Proxies however are visible within the legacy hydra viewport with SSC.
I was going based on this post from this spring, which does not mention anything about an offset, however does mention how to set the attributes to make something show when expanded to that location. https://groups.google.com/d/msg/usd-interest/63zP6hSV-SM/CY1pURlaEAAJ
Unfortunately I don't know enough to say why it doesn't work in the Hydra viewer, just that it does not currently work for me or anyone else at our facility.
Ah, thank you for explaining. Okay, the SSC op and its args (as authored by PxrUsdIn) is creating locations of type "usd". The old viewer knows how to render these locations because the code to do so comes with the shipped usd code. But, the analogous code for the hydra viewer hasn't been added to the shipped bundle (and is a bit more complex, so is not as straightforward to do so). I'll consult with folks to see how feasible it would be to include it. In the meantime, I see that you're faced with needing an alternative load op! Were you able to try adding an AttributeSet to the proxies op chain?
Hey,
I tried the AttributeSet but was unable to get it to work.
Setting the xform.origin to 1.0 using an AttributeSet node worked ( offsetting the whole model to the origin), however when I try to set it using the proxies.viewer method it didn’t work.
I set :
proxies.viewer.x.opType = AttributeSet proxies.viewer.x.opArgs.setAttr.name = xform.origin proxies.viewer.x.opArgs.setAttr.attr = 0.0
I also tried to set the CEL attribute but that didn’t do anything.
Not sure if this is even remotely correct.
I spoke too soon.
I needed to add a child to the setAttrs group attribute, and then set the CEL to /root, but that is offsets it to the origin. Trying anything else in the CEL causes it to jump back to the double offset location.
Ah, it sounds like the xform.origin attr is too much of a heavy hammer. Bummer.
The good news is that we're going to make our hydra viewer plugins for viewing usd proxies public, so jumping through all of these hoops won't be necessary.
Great!
I did actually just get it to work.
To get it working for me I added these to every location with a proxy and deleted the ones that come with usd.
proxies.viewer.op1.opType = PxrUsdIn proxies.viewer.op1.opArgs.fileName = your_usd_file proxies.viewer.op1.opArgs.isolatePath = component_SdfPath
proxies.viewer.op2.opType = AttributeSet proxies.viewer.op2.CEL = /root proxies.viewer.op2.setAttrs.sa1.name = xform.matrix proxies.viewer.op2.setAttrs.sa1.attr = 1.0
Closing old issue out.
Description of Issue
When importing a USD file into Katana proxies are not shown in the Hydra viewport.
You can get them to show by modifying the attributes on the scene graph but then they will be offset.
Steps to Reproduce
Import a stage with components or assemblies into Katana 3 and switch to the Hydra viewport.
Expand scenegraph to a assembly or component that has proxy attributes. Only the bounds will show.
Set “proxies.viewer.load.opType” attribute to “PxrUsdIn”. Also set “proxies.viewer.load.OpArgs.fileName” and “proxies.viewer.load.OpArgs.isolatePath”. You should see the proxy in the Hydra viewport but it is offset from the bounds and proper location.
System Information (OS, Hardware)
CentOS7
Package Versions
usd-18.09
Build Flags