PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
5.96k stars 1.18k forks source link

Compilation fails against MaterialX_v1_39_0 #3135

Open waarmond opened 2 months ago

waarmond commented 2 months ago

Description of Issue

Due to compilation issues with materialx 1.38.10 I'm resorting to the git master sources of https://github.com/AcademySoftwareFoundation/MaterialX . Are there true incompatibilites prohibiting the use of a very recent MaterialX?

 ./OpenUSD/pxr/imaging/hdSt/materialXFilter.cpp: In function 'const std::string& pxrInternal_v0_24__pxrReserved__::_GetMaterialTag(const HdMaterialNetwork2&, const HdMaterialNode2&)':
 ./OpenUSD/pxr/imaging/hdSt/materialXFilter.cpp:792:22: error: no match for 'operator==' (operand types are 'const MaterialX_v1_39_0::TypeDesc*' and 'const MaterialX_v1_39_0::TypeDesc')
  792 |         if (typeDesc == mx::Type::COLOR4 || typeDesc == mx::Type::VECTOR4) {
      |             ~~~~~~~~ ^~ ~~~~~~~~~~~~~~~~
      |             |                     |
      |             |                     const MaterialX_v1_39_0::TypeDesc
      |             const MaterialX_v1_39_0::TypeDesc*
./OpenUSD/pxr/imaging/hdSt/materialXFilter.cpp: In function 'void pxrInternal_v0_24__pxrReserved__::_AddMaterialXParams(const MaterialX_v1_39_0::ShaderPtr&, HdMaterialNetwork2*, const SdfPath&, const HdAnnonNodePathMap&, HdSt_MaterialParamVector*)':
 ./OpenUSD/pxr/imaging/hdSt/materialXFilter.cpp:1114:24: error: base operand of '->' has non-pointer type 'const MaterialX_v1_39_0::TypeDesc'
 1114 |             if (varType->getBaseType() == mx::TypeDesc::BASETYPE_BOOLEAN ||
      |                        ^~
 ./OpenUSD/pxr/imaging/hdSt/materialXFilter.cpp:1115:24: error: base operand of '->' has non-pointer type 'const MaterialX_v1_39_0::TypeDesc'
 1115 |                 varType->getBaseType() == mx::TypeDesc::BASETYPE_FLOAT ||

[..]

Steps to Reproduce

  1. cmake -S OpenUSD -B build -G Ninja {various CMAKE_FLAGS}
  2. cmake --build build

System Information (OS, Hardware)

ArchLinux

Package Versions

dev

Build Flags

same as in https://github.com/PixarAnimationStudios/OpenUSD/issues/3115

dgovil commented 2 months ago

1.39 isn't yet officially released, and I don't believe there's been any work to integrate it with USD yet. It has fairly significant changes so I don't expect it to be a drop in replacement.

It might be better to help investigate your 1.38.10 compilation issues instead since that is the intended version that works with USD.

jesschimein commented 2 months ago

Filed as internal issue #USD-9790