Skip to content
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

Problem with Arnold USD instancing in Bifrost. #3933

Open
pixelwash opened this issue Sep 25, 2024 · 5 comments
Open

Problem with Arnold USD instancing in Bifrost. #3933

pixelwash opened this issue Sep 25, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@pixelwash
Copy link

pixelwash commented Sep 25, 2024

I suspect like the other couple of bugs I posted here that this is more of a Bifrost bug than a USD bug, but this one is very important to me. I've used Arnold "standins" functionality to insert geometry into my Maya scenes for years, it's like a pre-USD functionality to handle large datasets in Maya. When USD was added to Maya, Arnold added the ability within Maya to "save selection as an Arnold USD" file, in addition to the .ASS file format of the previous Arnold instance reference archives.

These Arnold USD files follow the Maya scene descriptor hierarchy, including incorporating the Maya convention of making the meshes child objects of "shape nodes", and they include all the shader, gamma, and Arnold settings in the files.

The Arnold USD files can be used like the ASS files within Maya referenced by Arnold "Standins", which is very handy, and something I use all the time in my scenes. The Arnold USD files also work and render fine as USD files within Maya using the create stage from file option, and can then be used with all the new Maya USD functionality.

My problem is using them in Bifrost. These Arnold USD files render fine with all shaders in place in Bifrost when referenced as sublayers to a parent layer attached to a Stage, but they don't work with the instancing functionality currently implemented in Maya Bifrost.

In Bifrost USD instancing, the "define_usd_reference_from_file" node has to be used to add the path to these files - and that node doesn't handle the "extra" stuff in the Arnold USD file properly, and ends up completely failing to read the file, resulting in Arnold USD instances within Bifrost not being displayed or rendering.

To reproduce the problem follow these steps: 1. Create a Maya scene with a global light in Arnold, and an object with an Arnold Standard Surface shader with a texture. 2. Select the object, and export it using the Arnold USD file format (which is the format which works fine with Arnold "Standins" in Maya.) 3. Reference the Arnold USD file using an Arnold Standin in Maya and see how it renders. (It will/should render exactly the same as the original object) 4. Reference within a Bifrost graph the Arnold USD file using the standard method as a single file via a Stage, Layer container, and finally the file itself via a sublayer. 5. Render the image. It looks the same as the original object. 6. Instance the Arnold USD file using a Bifrost USD instancer node. 7. Render the image. (It will be blank, as not even previews work for Arnold USD files.)

I've found that using the Maya "export USD" of the selected file rather than the "Arnold USD" file results in USD archives that work in the Bifrost USD instancing, and render with shaders in place, but they do not react correctly to scene lighting, and do not of course follow all the extra Arnold rendering options like denoising settings. Looking at the USD files in the Maya proxy node in the Outliner shows the outstanding difference between a "regular USD" Maya export, and an "Arnold USD" export is that the base mesh in the regular USD is exposed directly in the scene hierarchy with no "shape node", whereas the Arnold USD has the mesh as a child of a "shape node".

Currently the big reason why this is so important to me is that whether I use the Bifrost Arnold USD instancing or not in my scene, I still continue to want to use the Arnold "Standin" functionality because it is so quick and convenient for dealing with single instances of heavy geometry within Maya. I guess I could switch completely over the USD and its proxies, perhaps that is what I should be aiming to do, but I am left with the dilemma of how to easily create these "new" USD files with included proxies within the Maya UI.

Currently making Arnold "standins" of selected heavy objects is just a single action (which I've assigned a key shortcut because I use it so often.) The obvious short term solution is for the Bifrost USD instancing to read these Arnold USD files correctly, but going forward, it seems that a logical step for Maya is for it to replicate the simplicity & efficiency of Arnold instances within the Maya USD UI functionality ie providing an easy way to export USD geometry that automatically builds a proxy object with all the Arnold shading and rendering options included for later use in instancing and referencing within the Maya USD functionality.

One extra observation is that by including a way to incorporate Arnold ":Standins" in the Bifrost graph would allow those who have built up large libraries of Arnold format archives to use them within the new Bifrost workflows.

@pixelwash pixelwash added the bug Something isn't working label Sep 25, 2024
@wallworm
Copy link
Collaborator

Thank you for sharing this. We will investigate.

@sebastienblor
Copy link
Collaborator

Hi @pixelwash , if I understand well the issue you're having is that Arnold USD exports don't include the whole scene under the defaultPrimPath defined in the file, which is needed when you do instances of that file.

We no longer recommend using the Arnold USD export, neither do we recommend using standins anymore, now that we added the "Arnold" plugin configuration to MayaUSD.

When you export with MayaUSD, you should see an option under "Plugin configuration" where you can enable "Arnold". This will trigger the mayaUSD export and add all the needed Arnold data on top of that file, so it should be the best of both worlds. If anything is missing in that workflow with recent versions of mayaUSD & MtoA, please let us know so that we can fix it asap, as this is now the preferred worflow for arnold & usd inside of maya.

Also, loading that file with a proxy shape instead of a standin will allow you to do way more things, like properly editing the usd data, seeing & editing the shading trees in lookdevx, handling multiple usd files in the usd layer editor, etc... if there are features of the standin that you're missing in the proxy shape, that's also something we want to know so that we can focus on that.

Cheers

@dsgrahame
Copy link

dsgrahame commented Sep 28, 2024 via email

@dsgrahame
Copy link

dsgrahame commented Sep 28, 2024 via email

@pixelwash
Copy link
Author

pixelwash commented Sep 28, 2024

In the bug report, I hope you noticed that I did try the "Maya USD" export selected objects option in the Bifrost USD workflow, and while the model via that method did display the texture maps correctly, they didn't render at the correct relative brightness to the rest of the scene, but now that you mention it in your suggestion for a "solution" I see I might have been confused by the new UI of that process that you guys have come up with. I saw "Arnold" there in that weird little rounded rectangular box, and assumed that was the option selected (a menu toggle popup is pretty common in maya to set options), but now messing with it again I see that it has an additional element built into it, which is a round sliding "switch" like a cellphone, and in my case. I hadn't toggled it "on". (A more standard UI for setting an option like that in Maya would be a simple menu selection popup with the selected option left showing) So after doing that, I'll try using Maya USD files again in the Bifrost USD workflow, and see if they work properly. Fingers crossed.

The other thing missing from this new workflow compared with Arnold "Standins" is a automatic method for displaying all "placed" geometry as bounding boxes, point clouds or polygons. Arnold "Standins" have this built into them, and your choice of the various settings can be assigned to different display layers in Maya for selected objects to easily be changed en masse in the viewport, which is functionality I use all the time.

So using the new USD workflow, I'm going to have to build some way of making USD proxy objects for all my models to emulate that functionality, as you observed. (So I'm thinking the Maya shrinkwrap deformer, or maybe Maya particles into Bifrost to create an ultra low poly proxy objects.) So once again I suggest that it seems a logical thing to build into the Maya USD export dialog, namely the option of creating ultra low polygon stand-ins automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants