I’m trying to assign a custom displayName to a specific GeomSubset. The GeomSubset has no displayName initially. I’m basically trying something like:
# ...
display_name = "a display name"
prim = subset.GetPrim()
print(prim.GetName())
>> "_1_"
prim.SetDisplayName(display_name)
print(prim.GetDisplayName())
>> "a display name"
# ...
which seems fine, but if I save the stage afterwards the result in the file shows that the prim got a displayName… equal to the name of the GeomSubset?
That is highly unexpected, @joao_dgg ! Is this happening within a particular DCC )looks like possbile inside 3dsMax?), or is it reproducible completely in a plain python shell? The other thing I’m wondering is if that “_1_” displayName was already authored in your root layer by an app, but your SetDisplayName() command targeted the session layer, which does not get saved as part of the stage.
So, I’d try setting the Stage’s EditTarget to the Stage’s GetRootLayer() (using a UsdEditContext) before setting the displayName… but if the app is explicitly trying to “true up” displayNames with prim names, it might get set back… some apps might do this if their identifier-naming scheme is more permissive than USD’s, so they can “round trip” the names more gracefully… and if that’s the case, allowing you to override it will make for lossy round-tripping. Unfortunately there’s not a perfect solution here, but it would be something to discuss with AutoDesk if that’s indeed what is going on!