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

Robust interrogation of UsdAttribute via USD APIs #1483

Closed
HamedSabri-adsk opened this issue Mar 29, 2021 · 1 comment
Closed

Robust interrogation of UsdAttribute via USD APIs #1483

HamedSabri-adsk opened this issue Mar 29, 2021 · 1 comment

Comments

@HamedSabri-adsk
Copy link
Contributor

Description of Issue

We would like to have a set of APIs that could reliably and efficiently answer if single attribute(s) (e.g radius) or two-tiered attribute(s) (e.g transform op/order) can be allowed to edit depending on where the stronger opinion(s) come from.

We are currently achieving this by comparing the calculated “position index” between a strongest layer containing the attribute and edit target layer across all the sites. Strongest layer always has a lower index than a weak layer(s).

https://github.com/Autodesk/maya-usd/blob/8b00e510717e9339fe174b5e07bcfd0f607becc9/lib/mayaUsd/ufe/Utils.cpp#L87

https://github.com/Autodesk/maya-usd/blob/8b00e510717e9339fe174b5e07bcfd0f607becc9/lib/mayaUsd/ufe/Utils.cpp#L378

https://github.com/Autodesk/maya-usd/blob/94a3e3e3f91835caae462c7cf89b82ac5741ffc4/lib/mayaUsd/ufe/UsdTransform3dMayaXformStack.cpp#L510

Example 1:

Simple example involving reference arc, where an attribute ( e.g “doubleSided” ) is being interrogated in "LayerA.usda"

LayerA.usda

#usda 1.0
over "refSphere" (
    prepend references = @./Sphere.usda@
)
{
    uniform token[] xformOpOrder = []
}

Sphere.usda

#usda 1.0
(
    defaultPrim = "transform"
)

def Xform "transform"
{
    def Sphere "sphereShape"
    {
        uniform bool doubleSided = 1
        float3[] extent = [(-2, -2, -2), (2, 2, 2)]
        color3f[] primvars:displayColor = [(0, 0, 1)]
        double radius = 2
    }
}

In this scenario, strongest Layer for “doubleSided” attribute is “Sphere.usda” where its value is set to true. Authoring a new opinion for “doubleSided” attribute in LayerA.usda should be possible.

Example 2:

Simple example that shows when an attribute edit is blocked in weaker layers. Consider following Sublayer hierarchy:

anonymousLayer1
    anonymousLayer6
    anonymousLayer5
    anonymousLayer4
    anonymousLayer3
    anonymousLayer2

With “anonymousLayer5” selected as an "edit target", the user authors a new height/radius opinion:

over "Capsule1"
{
    float3[] extent = [(-1, -1, -3.5), (1, 1, 3.5)]
    double height = 5
    double radius = 1
}

Any edits in weaker layers (anonymousLayer4, anonymousLayer3, anonymousLayer2) are blocked. Making edits in stronger layers (anonymousLayer1, anonymousLayer6) should be still allowed.

@jilliene
Copy link

Filed as internal issue #USD-6629

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants