Post Translation Callback
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
We are noticing an issue when running Arnold IPR in Maya in combination with a `Post Translation` callback.
We setup our environments we gpuCache nodes pointing to the proxy representation of the assets. All representations of the asset and their respective paths on disk are stored on `mtoa_constant` attributes on the gpuCache shape node. At render-time we swap the proxy path on the alembic procedural with the path of the render representation of the asset. This is done through a script in the `Post Translation` callback.
This is all working fine, until we jump to another frame, triggering an update of the IPR. When this happens, Arnolds seems to fallsback to the proxy paths. Is feels like Arnold is translating the scene and storing the result in memory, prior to running the post translation callback. Then, when we jump frame, it seems to fallback to the result stored in memory, discarding all changes made in the callback.
My question: Is there a way to ensure that the effects of the callback are not discarded when jumping frames?
I'm aware that the aiStringReplace to achieve a similar proxy-switching behavior. However, this is name pattern based, which is a bit implicit. We went with our callback approach to be more flexible and explicit.
Here is a snipped of the code ran in the callback:
node_it = AiUniverseGetNodeIterator(AI_NODE_SHAPE) while not AiNodeIteratorFinished(node_it): node = AiNodeIteratorGetNext(node_it) if ai.AiNodeIs(node, 'alembic'): purpose = 'render' render_parm = AiNodeLookUpUserParameter(node, purpose) if render_parm: render_asset = AiNodeGetStr(node, purpose) if not render_asset: AiMsgWarning('Value for "%s.%s" is null.', AiNodeGetName(node), purpose) AiNodeSetStr(node, 'filename', render_asset AiNodeIteratorDestroy(node_it)