Skip to content

Conversation

@ld-kerley
Copy link
Contributor

Description of Change(s)

MaterialX 1.39.X introduced API changes, this PR allows OpenUSD to be built against either MaterialX 1.38.X or 1.39.X.

Most of the changed arise from an API change around MaterialX::TypeDesc being passed by value instead of pointer. The other change is the complete removal of the channels attribute.

NOTE : The MaterialX versioning PR (#3157) should be merged before this.

Fixes Issue(s)

Fixes compile issues when using MaterialX 1.39.X

  • I have verified that all unit tests pass with the proposed changes
  • I have submitted a signed Contributor License Agreement

@jesschimein
Copy link
Collaborator

Filed as internal issue #USD-9837

❗ Please make sure that a signed CLA has been submitted!

@jesschimein
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

if (outputConnection) {

std::string finalOutput = outputConnection->getVariable();
#if MATERIALX_MAJOR_VERSION == 1 && MATERIALX_MINOR_VERSION==38
Copy link
Contributor

Choose a reason for hiding this comment

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

Worth doing "MATERIALX_MAJOR_VERSION == 1 && MATERIALX_MINOR_VERSION < 39"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think any version of MaterialX prior to 1.38.something was ever used or would compile against the USD codebase, so this seemed more direct, but if you prefer the < I have no objections to changing it.

Maybe #if MATERIALX_MAJOR_VERSION == 1 && MATERIALX_MINOR_VERSION<=38 is better overall?

const std::string type = mxType
? Base::_syntax->getTypeName(mxType) : "vec2";

#if MATERIALX_MAJOR_VERSION == 1 && MATERIALX_MINOR_VERSION==38
Copy link
Contributor

Choose a reason for hiding this comment

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

I appreciated how most of the other ifdefs are hidden away inside helper functions; is there a way to do that here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good - I'll look to see if this is possibly cleanly.

{
#if MATERIALX_MAJOR_VERSION == 1 && MATERIALX_MINOR_VERSION==38
// Add whatever is necessary for current codebase:
static const auto _typeLibrary =
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor thing, but I wonder if you could have an ifdef around
"using typename MxTypeDesc = const mx::TypeDesc"
or something and then only define the map once, since aside from the map type everything is character-for-character identical. You'd still need another ifdef around the find/return code below, but that's less likely to be edited than this type map table.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep - seems like a good improvement.

@jesschimein
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@zwillikon
Copy link

May you please rebase materialXFilter.cpp ?

@ld-kerley ld-kerley force-pushed the materialx1_39_build_updates branch from 68cee6c to 1033d49 Compare September 16, 2024 19:37
gador added a commit to gador/nixpkgs that referenced this pull request Nov 3, 2024
This reverts commit 993ec32.
MaterialX has some upstream issues which haven't been quite
worked out, yet[1]. It is therefore reasonable to wait
with an update in nixpkgs. It also breaks downstream packages
like python312Packages.openusd as well as blender[2]

[1]: PixarAnimationStudios/OpenUSD#3159
[2]: NixOS#326466 (comment)

Signed-off-by: Florian Brandes <[email protected]>
gador added a commit to ShaddyDC/nixpkgs that referenced this pull request Nov 3, 2024
This reverts commit 993ec32.
MaterialX has some upstream issues which haven't been quite
worked out, yet[1]. It is therefore reasonable to wait
with an update in nixpkgs. It also breaks downstream packages
like python312Packages.openusd as well as blender[2]

[1]: PixarAnimationStudios/OpenUSD#3159
[2]: NixOS#326466 (comment)

Signed-off-by: Florian Brandes <[email protected]>
@nyabinary
Copy link

bump :p

@jesschimein
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Pull request contains merge conflicts.

wentasah pushed a commit to wentasah/nixpkgs that referenced this pull request Nov 4, 2024
This reverts commit 993ec32.
MaterialX has some upstream issues which haven't been quite
worked out, yet[1]. It is therefore reasonable to wait
with an update in nixpkgs. It also breaks downstream packages
like python312Packages.openusd as well as blender[2]

[1]: PixarAnimationStudios/OpenUSD#3159
[2]: NixOS#326466 (comment)

Signed-off-by: Florian Brandes <[email protected]>
@pixar-oss pixar-oss closed this in 82a2f3f Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants