-
Notifications
You must be signed in to change notification settings - Fork 203
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
Recognize string properties with IsAssetIdentifier as being filename #2994
Conversation
retVal = Ufe::Attribute::kEnumString; | ||
} else if (shaderProperty->IsAssetIdentifier()) { | ||
retVal = Ufe::Attribute::kFilename; | ||
} |
There was a problem hiding this comment.
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.
lib/mayaUsd/ufe/UsdAttribute.cpp
Outdated
} | ||
|
||
return std::string(); | ||
} | ||
|
||
void UsdAttributeFilename::set(const std::string& value) | ||
{ | ||
SdfAssetPath path(value); | ||
setUsdAttr<PXR_NS::SdfAssetPath>(*this, path); | ||
if (UsdAttribute::nativeType() == "string") { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
No description provided.