Skip to content

Fix undefined vtValueToUfeValue when UFE_SCENEITEM_HAS_METADATA is no… - #4649

Merged
seando-adsk merged 2 commits into
Autodesk:devfrom
dj-mcg:pr/fix-vtValueToUfeValue-ifdef-guard
Jun 17, 2026
Merged

Fix undefined vtValueToUfeValue when UFE_SCENEITEM_HAS_METADATA is no…#4649
seando-adsk merged 2 commits into
Autodesk:devfrom
dj-mcg:pr/fix-vtValueToUfeValue-ifdef-guard

Conversation

@dj-mcg

@dj-mcg dj-mcg commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

…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

…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 seando-adsk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@AramAzhari-adsk

AramAzhari-adsk commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

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.
I think we wanted tomake them available in V3, but perhaps it was backported. It is possible that somewhere during V4, we added the 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?

@seando-adsk

Copy link
Copy Markdown
Collaborator

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. I think we wanted tomake them available in V3, but perhaps it was backported. It is possible that somewhere during V4, we added the 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 seando-adsk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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).

@dj-mcg

dj-mcg commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator Author

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!

@dj-mcg
dj-mcg force-pushed the pr/fix-vtValueToUfeValue-ifdef-guard branch from 3bf4679 to d9331c2 Compare June 16, 2026 18:45
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+.
@dj-mcg
dj-mcg force-pushed the pr/fix-vtValueToUfeValue-ifdef-guard branch from d9331c2 to 87b448c Compare June 16, 2026 18:47
@dj-mcg

dj-mcg commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator Author

I implemented the suggested fix and ended up just removing the check in UsdShaderAttributeDef.cpp since that is only built with UFE 4 and up. Thanks!

@seando-adsk seando-adsk added the build Related to building maya-usd repository label Jun 16, 2026
@seando-adsk seando-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Jun 17, 2026
@seando-adsk
seando-adsk merged commit b5405e7 into Autodesk:dev Jun 17, 2026
12 checks passed
@dj-mcg
dj-mcg deleted the pr/fix-vtValueToUfeValue-ifdef-guard branch June 22, 2026 22:34
deboisj pushed a commit that referenced this pull request Jun 26, 2026
…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>
deboisj pushed a commit that referenced this pull request Jun 26, 2026
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>
deboisj pushed a commit that referenced this pull request Jun 26, 2026
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>
deboisj pushed a commit that referenced this pull request Jun 26, 2026
…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>
deboisj pushed a commit that referenced this pull request Jun 26, 2026
…-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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Related to building maya-usd repository ready-for-merge Development process is finished, PR is ready for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants