Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Transfer maya sets to gaffer sets with USD

297 views
Skip to first unread message

mario naumovski

unread,
Oct 5, 2023, 9:04:48 AM10/5/23
to gaffer-dev
Hey guys, quick question, I need to transfer maya sets to gaffer sets as they are the base structure we use for reassigning the look dev to a rigged asset in our pipeline. Which would be the corresponding maya usd tool or attribute that conforms to gaffer's "Set" standard?

John Haddon

unread,
Oct 5, 2023, 9:11:04 AM10/5/23
to gaffe...@googlegroups.com
Hi Mario,
The USD equivalent of a Gaffer set is called a Collection, and we translate between the two in the SceneReader and SceneWriter nodes. So the question is really "How can I export UsdCollections from Maya?". I'm afraid it's a long time since I used Maya, so I don't know the answer to that, but hopefully it gives you a clue...
Cheers...
John

On Thu, Oct 5, 2023 at 2:04 PM 'mario naumovski' via gaffer-dev <gaffe...@googlegroups.com> wrote:
Hey guys, quick question, I need to transfer maya sets to gaffer sets as they are the base structure we use for reassigning the look dev to a rigged asset in our pipeline. Which would be the corresponding maya usd tool or attribute that conforms to gaffer's "Set" standard?

--
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gaffer-dev/87d12ac4-3525-4be5-a773-db721a38f373n%40googlegroups.com.

mario naumovski

unread,
Oct 5, 2023, 9:14:38 AM10/5/23
to gaffer-dev
Thanks John, I'll see what I can do with Maya's USD system, which is very primitive at best at this moment. Thanks for the input.

royni...@gmail.com

unread,
Oct 5, 2023, 9:29:40 AM10/5/23
to gaffer-dev

Hi Mario,

A bit of topic maybe - but out of curiosity. Would you be able to elaborate a bit more how you're using maya sets to define lookdevs and reassign them in the rigged asset pipeline in Maya? How does that work?

Sachin Shrestha

unread,
Oct 5, 2023, 9:45:08 AM10/5/23
to gaffer-dev
Just throwing some ideas here.

You may have better luck using bifrost usd where you may be able to convert the maya selection set to usd collection. I don't think selection sets are supported directly inside bifrost yet but a simple MEL/python script should be able to do that and once you have the required prims inside bifrost for each collection you can use this node to define the usd collection.


Another possible way could be to convert the maya selection sets into component tags in maya. Component tags are directly readable in bifrost now so you can then go from there and convert it to a usd collection. Outside of usd, in the past when we had to do this for material sets, we just wrote out the maya sets info into a sidecar file and used that to rebuild the sets inside gaffer.

Please do ask on the bifrost discord and somebody there or Guillaume himself (from the bifrost team) may help solve this.

Cheers,
Sachin

Murray Stevenson

unread,
Oct 5, 2023, 2:22:52 PM10/5/23
to gaffe...@googlegroups.com
Another option could be to convert your sets into material assignments and try the -exportMaterialCollections and -materialCollectionsPath flags on the mayaUSDExport command. These create a collection per material containing the objects the material is assigned to. This may not be appropriate to your workflow, but is one of the few methods I'm aware of for generating collections from Maya other than Sachin's Bifrost ideas...

https://github.com/Autodesk/maya-usd/blob/dev/lib/mayaUsd/commands/Readme.md#command-flags-1

Cheers,

Murray

Disclaimer: This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

--
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.

Sachin Shrestha

unread,
Oct 6, 2023, 1:59:50 AM10/6/23
to gaffer-dev
Aah, that's a cool one Murray! I wasn't aware of that either...should make things much simpler and sounds more straightforward than my bifrost route.

Cheers,
Sachin

Sachin Shrestha

unread,
Oct 16, 2023, 4:46:21 AM10/16/23
to gaffer-dev
Hi OP,

Murray's suggestion works quite well and seems to be straightforward (once you have created the per selection set materials in maya). Note that the material collections uses the Shading Engine node's name and not the shader node's name since that's the node that defines the collection. So, you may want to name your maya shading engines as per what you need in gaffer. These come into gaffer as sets with material: prefix and are accessible in all set related nodes and UIs.

Thanks Murray!

maya_sets_to_usd_collections_gaffer.png

-Sachin

mario naumovski

unread,
Oct 17, 2023, 6:22:03 PM10/17/23
to gaffer-dev
Hey guys thanks for the help. The solution provided from Murray was the exact thing we needed and with USD's python api in maya it was a breeze to setup our exporters.
As for the question of how we use the sets, when we are doing look development for an Asset all the shaders are assigned on the sets, and if anything changes in the rig it just reassigns the materials based on the sets (python script runs a gaffer process in the background).
The only drawback so far is if they change the mesh structure while rigging, then the asset has to go through look-dev manually (if there is a smarter way to go for animated assets I'd really like to hear more). For static assets it works perfect for back and forth modeling/texturing/lookdev as the modeler can assign the same material presets that we have in maya and Gaffer can pick them up.

Thanks again for the help.

William Eguienta

unread,
Nov 21, 2024, 8:47:56 AM11/21/24
to gaffer-dev
Hey Sachin,
trying to reproduce your example, i see the sets but they are empty
any idea what I'm doing wrong please ?
my command :
cmds.mayaUSDExport( exportCollectionBasedBindings=True, exportMaterialCollections=True, file=usdFilePath, )
I also tried
cmds.mayaUSDExport( exportCollectionBasedBindings=True, exportMaterialCollections=True, materialCollectionsPath="/mtl", file=usdFilePath, )

thanks

Sachin Shrestha

unread,
Dec 13, 2024, 10:59:52 PM12/13/24
to gaffer-dev
Hi kaiz3,

It has been a while since I tried this workflow but from what I remember, I just followed the steps outlined previously by Murray and the usd commands doc and it worked fine. Your flags seem okay to me. Perhaps set some of the other material flags too (like exportMaterials) and maybe your materialCollectionsPath needs to be the root "/" or "/top_grp" (basically the root transform name in Maya) instead of "/mtl" but I may be mistaken as I used this almost over a year ago so I'm a bit foggy on the details. In my example screenshot, the "mtl" path seems to be under the "/mdl_grp".

Please let me know if that helps. If not, I will try to test it out in Maya and recollect what I used.

Cheers,

William Eguienta

unread,
Dec 17, 2024, 10:58:25 AM12/17/24
to gaffer-dev
Hey Sachin, 
thanks for your help, working now
Reply all
Reply to author
Forward
0 new messages