USD primvars in vray material

Hi,
I’m unable to render USD files that has v-ray materials that’s referencing primvars in the material.
It works when I’m creating the file in Houdini but when I load it in 3dsMax with a VRayScene it grabs the default “User Color” instead of the primvar.

Attaching three .usda files
v03 is referencing “Cd” (this works in Houdini)
v04 is referencing “displayColor”
v05 is referencing “primvars:displayColor”
All of them is rendering it as orange (the default color)

Is there any way of getting this to work now or is this something that will come with time?
USD_primvars.zip (5.58 KB)

> is this something that will come with time?

Yes, this is not yet implemented by the VRayScene’s node USD loader…

Any update on this?

Hello,
reopenig this thread. Is it still not possible to read USD primvars trought UserColor or UserScalar? And what about new native Max USD support?

@frodopytlicek ​ could you please share a scene that doesn’t work for you?

For me every scene because I dont know how to do it :slight_smile: Is there some documentation about it?

No specific documentation about it, however, from what I tested (with the attached USD files), primvars are correctly read from the VRayScene without the need for VRayUserColor/Scalar nodes. An exception to this is the last (v05 is referencing “primvars:displayColor”), but this is a syntax issue (internal tracker ID: HOU-4835), which we’ll get to eventually.

My point is to be able to reassign materials in usd and this is not possible with vray scene. So I have to us max usd stage, but then how to read primvars from it?

Have you tried reassigning/overriding through the “Assign USD Materials” method (described in a gif here)? I think this is what you’re looking for.

Yes overriding material works just fine but reading primvars dont. Are you sure its working? Can you provide test scene?
Thanks

I’m guessing you are trying to read primvars with a VRayUserColor (that’s not in the USD itself). This indeed does not work. However, if it is in the description, it should work properly (I tested with the attached USD files from post 1). As Andrei asked, please send a sample scene so we can stop guessing and become aware of precisely how you’ve set things up and what results you are expecting.

Here it is. Its just one of the files from original post.
USD_primvars.zip (78.1 KB)

That’s the one with the unsupported syntax I mentioned earlier. Edit this line in the .USD:
string inputs:user_attribute = "primvars:displayColor" to string inputs:user_attribute = "displayColor" and it should work.

Sorry I just dont get it, maybe we both talking about something else. I want to read primvar saved on mesh inside usd via vrayuserscalar/color in vray for 3ds max. So far I was not able to do it. It doesnt do anything with or without primvars: prefix in user scalar/color node.

The only thing I did to render the primvars on the scene you sent was to open the.USD file in Notepad++ and edit line 142, (as explained in my previous post) so as to get rid of the unsupported syntax. This way, you don’t need a VRayUserColor to read the primvars; they will be read automatically.

As already mentioned, the VRayUserColor method indeed does not seem to work.

Yes but I need to read them, so I can use them in shading network. I dont want to use any material from usd I want to create new one directly in max.

For example if you take a look at the files related to different topic I send yesterday (ticket 390568 ), there is primvar called MOUNTAIN_layer which I want to yous as a extra tex for compositing. But how to to get it?

I understand. Let me ask the devs for any suggestions, or is it just a case of supporting VRayUserColor to read primvars.

Great thank you.

According to our devs, there’s no way to read primvars via VRayUserColor directly from the USD Stage. In USD 0.11 (will be officially supported soon), however, Autodesk has added a “Promote USD prim to 3ds Max object” option. This will give you direct access to the prims in the stage, and if some custom attributes are written, they could be read by the VRayUserColor (in STD) and VertexColor in 3ds Max. This might work for your case.

EDIT: This actually works without promotion to 3ds Max objects, too. But again, it needs the data as per primitive attributes, not the primvars themselves (since from what I understand, and I’m no USD wiz, primvars are the interpreters of per-primitive data).