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

Recognize string properties with IsAssetIdentifier as being filename #2994

Merged
merged 5 commits into from
Mar 31, 2023

Conversation

JGamache-autodesk
Copy link
Collaborator

No description provided.

retVal = Ufe::Attribute::kEnumString;
} else if (shaderProperty->IsAssetIdentifier()) {
retVal = Ufe::Attribute::kFilename;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some 3rd party rendering engines can decide to keep "string" as the type of their asset ports. We can recognize them because they will have the asset flag enabled.

@JGamache-autodesk JGamache-autodesk added the ufe Related to UFE component in Maya label Mar 30, 2023
}

return std::string();
}

void UsdAttributeFilename::set(const std::string& value)
{
SdfAssetPath path(value);
setUsdAttr<PXR_NS::SdfAssetPath>(*this, path);
if (UsdAttribute::nativeType() == "string") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this should be the constant Ufe::Attribute::kString

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would work, however nativeType is supposed to return a USD type as a string, so I have to use this longer constant that ends up having exactly the same value as Ufe::Attribute::kString.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And instead of nativeType, I really should have used something that returns the true USD type. Fixed.

@seando-adsk seando-adsk added ufe-usd Related to UFE-USD plugin in Maya-Usd and removed ufe Related to UFE component in Maya labels Mar 30, 2023
pierrebai-adsk
pierrebai-adsk previously approved these changes Mar 30, 2023
@JGamache-autodesk JGamache-autodesk added the ready-for-merge Development process is finished, PR is ready for merge label Mar 31, 2023
@seando-adsk seando-adsk merged commit d41fe8b into dev Mar 31, 2023
@seando-adsk seando-adsk deleted the gamaj/recognize_sdr_assets_in_ufe_attributes branch March 31, 2023 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge ufe-usd Related to UFE-USD plugin in Maya-Usd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants