Replies: 4 comments 7 replies
-
I like the idea of this, I was thinking that t could be extended, by allowing a JobContext to supply a list of overrides. As a thing pair like {"mesh", "NeilsMeshWriter"} { "camera",NeilsCameraWriter"} etc.. The topic of overriding the built in readers/writers is very timely but I wonder if the system "Could" or "should" allow multiple readers/writers to be registered. As a first step, I like this direction just purely thinking larger scale and whether it could be extended to a larger solution, or if that is even needed. |
Beta Was this translation helpful? Give feedback.
-
What we have done in 3dsMax to enable overriding "base" writers, is this (and for this we were inspired by the mayaUsd shader writers) :
Note that this does not solve the cases where multiple third parties register "Supported" writers for the same objects.. in this case the first one wins... Perhaps a similar approach could be used here. |
Beta Was this translation helpful? Give feedback.
-
I'm currently working on overriding for readers with the design as @deboisj mentioned above, and will apply the same mechanism to writers as well. |
Beta Was this translation helpful? Give feedback.
-
There are many options, but the issue still comes down to "Supported" option which is why I personally like the JobContext route, but interested if there are any other opinions about this. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
We have a need in our pipeline to export a Maya native camera to our custom schema camera prim. Currently, the prim writer register mapping for Maya native cameras is taken by PxrUsdTranslators_CameraWriter and is mapped to USD's default camera prim
UsdGeomCamera
. With the current design of PXRUSDMAYA_REGISTER_WRITER and PXRUSDMAYA_REGISTER_ADAPTOR_SCHEMA, I couldn't find a way to overridePxrUsdTranslators_CameraWriter
with another writer. Hence, I have come up with an approach to allow an existing register to be overwritten.Firstly, I'd a new parameter
canOverride
to UsdMayaPrimWriterRegistry::Register and extend its functionality so that it becomes:primWriterRegistry.h
primWriterRegistry.cpp
Then, I'd add a new macro in primWriterRegistry.h:
primWriterRegistry.h
Similarly, I'd also add a
canOverride
parameter to RegisterTypedSchemaConversion and extend its functionality so that it becomes:adaptor.h
adaptor.cpp
Then, I'd add a new macro in adaptor.h:
adaptor.h
With all that, I can use the new macros to register my custom camera writer against maya native cameras to override PxrUsdTranslators_CameraWriter like so:
What do you think? Or you have other recommended ways of overriding the default camera writer? Thank you.
Beta Was this translation helpful? Give feedback.
All reactions