Translation-time selective export/visibility swapping

Hi,

Probably missing something wildly obvious here.

Context: Maya (2017) modeler, Arnold renderder.

We want to display an object as one type of geometry in the viewport, and have a different geometry at rendertime. Without any user interaction required (no toggling layers, visibilities, etc).

In ye-olde-days, a pair of pre/post-renderMELs would get most of the way, flipping the visibility of objects pre and post export of a frame render. This is not as meaningful in an IPR context, given they monitor changes to the scene state, such as visibility.

I think what we need is a pre-translation/export callback hook? So we can mask what objects are translated into the .ass being used.

To give a more explicit example:

  • we want to render tonnes of cylinders, which we do with an instancer-fed setup (> ginstances)

  • its too heavy to display this instancer set in the viewport with full geometry (and the bounding box instancer display options arent sufficient for interactive evaluation of the cylinder placements in the scene [they clutter])

  • for proxy representation of the cylinders, we use a particle system with ‘streak’ display type for OpenGl line drawing of the cylinder axes (or just a custom MPxLocator drawer)

  • we want to always keep our proxy representation in the viewport, but see the full geo rep in renders (eg in Arnold’s new renderView in IPR mode). [or sometimes just render the proxy, and ignore the full geo, and occasionally disp and render geo, hide proxy. Flexibility.]

  • exporting for Arnold stand-ins doesnt (seem) to fit, as there are constant edits being made to the ‘asset’ [unless we can at-translation-time export an .ass for a procedural node to use?.. a pre-translation callback slot somewhere?]

Any suggestions greatly appreciated!

Can you use Mental Ray proxies?

https://www.antoniobosi.com/maya-tutorials-mental-ray-3d/maya-tutorial-c/maya-mental-ray-proxies-tutorial

Thanks for the thought! Definitely used them in the past for various tasks, but they have a very similar behaviour to Arnold stand-ins/procedurals and ~references in genreal (we’d need to update the referenced file just pre-render [because its being continually edited in scene]). In any case, we are committed to Arnold platform.

Another way to phrase the problem by what an end solution/interface might look like:

> the presence of a flag on an object that forces it to be exported/translated, regardless of its current visibility state. A ‘.assForceExport’.

(whether the base mtoa translator even bothers to sniff any further on objects with their scene visibility off, i dont know)

(i’m currently suspecting i might need to put a wrapper around Arnold translators, and hopefully do such a ‘.assForceExport’ flag check, then pass back up to the inherited translator methods?)

Thanks!

So, simply flipping off Maya’s lod visibility seems a mildly safe way to go about having things hidden in viewport, but the visibility flag well mean it gets translated (and be visible to arnold, who doesnt care about this LOD at this stage).

But, how to prevent mtoa from transalting geo that is visible? You can use an override set to knock visibility off on the object once its in the the ass file, but we dotn want to spend the time translating the whoel proxy object every time, unnecessarily.

How to forcefully exclude certain visible nodes from being translated?