Fix undefined vtValueToUfeValue when UFE_SCENEITEM_HAS_METADATA is no… - #4649
Conversation
…t defined The PXR_VERSION >= 2603 code path in getUsdShaderMetaData() unconditionally calls vtValueToUfeValue(), but that function is only defined when UFE_SCENEITEM_HAS_METADATA is set. This causes an undefined symbol linker error when building with USD 26.08+ against a Maya/UFE version that doesn't have SceneItem::getMetadata (e.g., Maya 2024). Add an #ifdef guard with a std::stringstream fallback matching the pattern used elsewhere in the same file (e.g., the existing #else at line 76 which returns the string representation).
seando-adsk
left a comment
There was a problem hiding this comment.
This one is strange as in the function ufeValueToVtValue I don't see anything that has to do with SceneItem Metadata.
@AramAzhari-adsk The two functions (ufe to vt and vt to ufe) in the .cpp file are wrapped in
#ifdef UFE_SCENEITEM_HAS_METADATA, which was done in PR 3505. But in the .h the two functions are protected by #ifdef UFE_V3_FEATURES_AVAILABLE. Do you recall why? I'm thinking it was a mistake and in the cpp they should be wrapped in #ifdef UFE_V3_FEATURES_AVAILABLE which would make them available in Maya 2024 which uses Ufe v4.
I also recall having to do the separate conditions. Isn't this a special case where we're trying to compile an unsupported USD version (26.03) in an older version of Maya? |
@AramAzhari-adsk Yes it is a special case, of building an older Maya with a newer USD, but still something we should support. My concern here is that the two functions are protected by different ifdef conditions in the .h and .cpp. It should be the same. And I'm thinking the Ufe one since I don't see how either of those functions rely on SceneItem metadata. Sean |
seando-adsk
left a comment
There was a problem hiding this comment.
After a discussion with Aram (see PR thread) @dj-mcg I think you can instead change #ifdef UFE_SCENEITEM_HAS_METADATA (on line 1689 of lib/usdUfe/ufe/Utils.cpp) to #ifdef UFE_V3_FEATURES_AVAILABLE which will make it match the ifdef of the .h file.
Then you can also change the ifdef here to the V3 one. This will then mean if you are building with Maya 2024 (which has Ufe v4) you will get the conversion function called (instead of just string conversion).
Thanks @seando-adsk - I'll give that a try! |
3bf4679 to
d9331c2
Compare
Per review feedback from seando-adsk, the root cause is that Utils.cpp uses #ifdef UFE_SCENEITEM_HAS_METADATA to guard vtValueToUfeValue() and ufeValueToVtValue(), while Utils.h uses #ifdef UFE_V3_FEATURES_AVAILABLE. Fix the mismatch at the source (Utils.cpp lines 65 and 1673) rather than adding workarounds at callsites. This makes vtValueToUfeValue() available whenever UFE v3+ features are present, which covers Maya 2024 (UFE v4). The previous UsdShaderAttributeDef.cpp workaround is no longer needed since that file is only built with UFE v4+.
d9331c2 to
87b448c
Compare
|
I implemented the suggested fix and ended up just removing the check in |
…uard Fix undefined vtValueToUfeValue when UFE_SCENEITEM_HAS_METADATA is no…both unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> eToVtValue(), while Utils.h uses #ifdef UFE_V3_FEATURES_AVAILABLE. Fix the mismatch at the source (Utils.cpp lines 65 and 1673) rather than adding workarounds at callsites. This makes vtValueToUfeValue() available whenever UFE v3+ features are present, which covers Maya 2024 (UFE v4). The previous UsdShaderAttributeDef.cpp workaround is no longer needed since that file is only built with UFE v4+. EKmJOxCWg 84mCSbjw9b9eJLNNoh9ZzJtxfU8jCpSf4ipWNbego6OAReRaW2uC25dgUhVp4mVE 4g25t56+HWMCVp2AkVmCdv5TCKsm4hk06YWOI8o0/5LYVneMocGPOJr2kqmh80Qy SfW5pgRUJHilAp7bZSSrJSwUy+x+ZvN6w0427qRDkmpLyyxTxoT3g8yepfqlrxDu w15G2t7BQMoqn8woKJPS =aQMD -----END PGP SIGNATURE----- Merge pull request #4643 from jufrantz/fix_dangling_reference_warning vp2RenderDelegate: fix dangling-reference warning with GCC14rity suite 310, both unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
m> 1781703675 -0400 gpgsig -----BEGIN PGP SIGNATURE----- wsFcBAABCAAQBQJqMqP7CRC1aQ7uu5UhlAAAv04QAAqdNrb6Tz5O838IHOUOCRRW pBd9ZJwaluhWwGs5y3Aa2t9MW9p1nJIWueRahznlvkQpvee2MU/L0YMpjS6qgb4h kdzfO30DlYMi9u+aQs0Olj+j7Sc4lqU0bc9zgfFVkyvDP9hfC4AWa68v0v1dc4ii ieHece6ACMGNWY52RnOOxj1sNO3OFGVuVpjR6HvUSxWsWwErW+9jESZ1WI+Bok6D +xB9K6wkANvUs1nQDnGpvUzzaVu1ngl4FLgyd74Xzqh0kK505WUcG89/0XRmJf5Y zm//WtVMXJYAUZbMRJPG5pW+bIzt7rpqgXagXVUUA3+gQWOdtGMF1WGRD0Vequ2E Uh2S6bgLx1z3Sh73iFHmfXhy80kI3ZJwfLNOPdFvGo0pFL3XFfV84fypVXVD+7fA tNbR5ap6xtPm3gRWm5Pj8dNhY8hA9D0FwsbV84ZaMhpJU8SrNxWZ9UJpniwLp+mQ 3oEIxKntXRJL/ulVyBZNYEgB1h00k6QOXZiqqnZ1BkVDks/vAF7Fdbj50gfNCXAD IS+AcbR97VfqLcK1bXLqx+C4uThoQjEQFvgKZ1udk3aCu9Q/LPG3eEDkmQsYsucK rZIVqRLalDb8KKBqAsdtIwd4FdsztyA13wVWrHAx5VaV3ayPufoXPukXuZukRRMA KA1MutisuUm2xGEu5PIC =6Nuz -----END PGP SIGNATURE----- Merge pull request #4649 from dj-mcg/pr/fix-vtValueToUfeValue-ifdef-guard Fix undefined vtValueToUfeValue when UFE_SCENEITEM_HAS_METADATA is no…both unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> ly@anthropic.com>
m> 1781703675 -0400 gpgsig -----BEGIN PGP SIGNATURE----- wsFcBAABCAAQBQJqMqP7CRC1aQ7uu5UhlAAAv04QAAqdNrb6Tz5O838IHOUOCRRW pBd9ZJwaluhWwGs5y3Aa2t9MW9p1nJIWueRahznlvkQpvee2MU/L0YMpjS6qgb4h kdzfO30DlYMi9u+aQs0Olj+j7Sc4lqU0bc9zgfFVkyvDP9hfC4AWa68v0v1dc4ii ieHece6ACMGNWY52RnOOxj1sNO3OFGVuVpjR6HvUSxWsWwErW+9jESZ1WI+Bok6D +xB9K6wkANvUs1nQDnGpvUzzaVu1ngl4FLgyd74Xzqh0kK505WUcG89/0XRmJf5Y zm//WtVMXJYAUZbMRJPG5pW+bIzt7rpqgXagXVUUA3+gQWOdtGMF1WGRD0Vequ2E Uh2S6bgLx1z3Sh73iFHmfXhy80kI3ZJwfLNOPdFvGo0pFL3XFfV84fypVXVD+7fA tNbR5ap6xtPm3gRWm5Pj8dNhY8hA9D0FwsbV84ZaMhpJU8SrNxWZ9UJpniwLp+mQ 3oEIxKntXRJL/ulVyBZNYEgB1h00k6QOXZiqqnZ1BkVDks/vAF7Fdbj50gfNCXAD IS+AcbR97VfqLcK1bXLqx+C4uThoQjEQFvgKZ1udk3aCu9Q/LPG3eEDkmQsYsucK rZIVqRLalDb8KKBqAsdtIwd4FdsztyA13wVWrHAx5VaV3ayPufoXPukXuZukRRMA KA1MutisuUm2xGEu5PIC =6Nuz -----END PGP SIGNATURE----- Merge pull request #4649 from dj-mcg/pr/fix-vtValueToUfeValue-ifdef-guard Fix undefined vtValueToUfeValue when UFE_SCENEITEM_HAS_METADATA is no…both unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> ly@anthropic.com>
…ub.com/Autodesk/maya-usd into barbalt/dev/EMSUSD-3311-remove-opinion eRahznlvkQpvee2MU/L0YMpjS6qgb4h kdzfO30DlYMi9u+aQs0Olj+j7Sc4lqU0bc9zgfFVkyvDP9hfC4AWa68v0v1dc4ii ieHece6ACMGNWY52RnOOxj1sNO3OFGVuVpjR6HvUSxWsWwErW+9jESZ1WI+Bok6D +xB9K6wkANvUs1nQDnGpvUzzaVu1ngl4FLgyd74Xzqh0kK505WUcG89/0XRmJf5Y zm//WtVMXJYAUZbMRJPG5pW+bIzt7rpqgXagXVUUA3+gQWOdtGMF1WGRD0Vequ2E Uh2S6bgLx1z3Sh73iFHmfXhy80kI3ZJwfLNOPdFvGo0pFL3XFfV84fypVXVD+7fA tNbR5ap6xtPm3gRWm5Pj8dNhY8hA9D0FwsbV84ZaMhpJU8SrNxWZ9UJpniwLp+mQ 3oEIxKntXRJL/ulVyBZNYEgB1h00k6QOXZiqqnZ1BkVDks/vAF7Fdbj50gfNCXAD IS+AcbR97VfqLcK1bXLqx+C4uThoQjEQFvgKZ1udk3aCu9Q/LPG3eEDkmQsYsucK rZIVqRLalDb8KKBqAsdtIwd4FdsztyA13wVWrHAx5VaV3ayPufoXPukXuZukRRMA KA1MutisuUm2xGEu5PIC =6Nuz -----END PGP SIGNATURE----- Merge pull request #4649 from dj-mcg/pr/fix-vtValueToUfeValue-ifdef-guard Fix undefined vtValueToUfeValue when UFE_SCENEITEM_HAS_METADATA is no…both unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> red-By: Claude Opus 4.8 <noreply@anthropic.com> ly@anthropic.com>
…-opinion EMSUSD-3311 - Add remove opinion + undoENEITEM_HAS_METADATA is no…both unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> 4AWa68v0v1dc4ii ieHece6ACMGNWY52RnOOxj1sNO3OFGVuVpjR6HvUSxWsWwErW+9jESZ1WI+Bok6D +xB9K6wkANvUs1nQDnGpvUzzaVu1ngl4FLgyd74Xzqh0kK505WUcG89/0XRmJf5Y zm//WtVMXJYAUZbMRJPG5pW+bIzt7rpqgXagXVUUA3+gQWOdtGMF1WGRD0Vequ2E Uh2S6bgLx1z3Sh73iFHmfXhy80kI3ZJwfLNOPdFvGo0pFL3XFfV84fypVXVD+7fA tNbR5ap6xtPm3gRWm5Pj8dNhY8hA9D0FwsbV84ZaMhpJU8SrNxWZ9UJpniwLp+mQ 3oEIxKntXRJL/ulVyBZNYEgB1h00k6QOXZiqqnZ1BkVDks/vAF7Fdbj50gfNCXAD IS+AcbR97VfqLcK1bXLqx+C4uThoQjEQFvgKZ1udk3aCu9Q/LPG3eEDkmQsYsucK rZIVqRLalDb8KKBqAsdtIwd4FdsztyA13wVWrHAx5VaV3ayPufoXPukXuZukRRMA KA1MutisuUm2xGEu5PIC =6Nuz -----END PGP SIGNATURE----- Merge pull request #4649 from dj-mcg/pr/fix-vtValueToUfeValue-ifdef-guard Fix undefined vtValueToUfeValue when UFE_SCENEITEM_HAS_METADATA is no…both unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> red-By: Claude Opus 4.8 <noreply@anthropic.com> ly@anthropic.com>
…t defined
The PXR_VERSION >= 2603 code path in getUsdShaderMetaData() unconditionally calls vtValueToUfeValue(), but that function is only defined when UFE_SCENEITEM_HAS_METADATA is set. This causes an undefined symbol linker error when building with latest USD against a Maya/UFE version that doesn't have SceneItem::getMetadata (e.g., Maya 2024). The fallback behavior matches the pattern used elsewhere