Incorrect enum values for wrapS and wrapT on ND_UsdUVTexture_23

Open Beginner friendly
#2,704 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active

Research direction

Start in libraries/bxdf/usd_preview_surface.mtlx at the ND_UsdUVTexture_23 definition around lines 41-42, then compare its wrapS and wrapT enums with the ND_image_* definitions in libraries/stdlib/stdlib_defs.mtlx and the mapping around lines 345-356. Done means the enum values consistently match the mapped address-mode inputs, unless an explicit USD-token remapping is added.

Written by the indexing model from the issue text.

Description

Greetings,

Issue

The valid enum values for the wrapS and wrapT inputs on the ND_UsdUVTexture_23 node are listed as:

enum="black,clamp,periodic,mirror"

This seems to be a blend between the valid options from the original UsdUVTexture node, which are:

allowedTokens = ["black", "clamp", "repeat", "mirror", "useMetadata"]

And the options for the uaddressmode and vaddressmode on a regular ND_image_* node, which are:

enum="constant,clamp,periodic,mirror"
Suggested Fix

Considering that the implementation of the ND_UsdUVTexture_23 is based on a ND_image_color4 node and that there is a direct mapping of wrapS -> uaddressmode and wrapT -> vaddressmode, I think the enum values should match those on a normal ND_image_* node.

https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/libraries/bxdf/usd_preview_surface.mtlx#L345-L356

... unless you have plans to actually accept the tokens from the USD version with some form of remapping.

Cheers!

Affected versions:

This issue is present in the current 1.39.4 version of MaterialX:
https://github.com/AcademySoftwareFoundation/MaterialX/blob/v1.39.4/libraries/bxdf/usd_preview_surface.mtlx#L41-L42

Dominant language
C++
Stars
2.3k
Forks
464
Avg merge
4d 13h
Merged PRs (30d)
13

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AcademySoftwareFoundation/MaterialX

All issues in AcademySoftwareFoundation/MaterialX

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.