api-issue-tracker icon indicating copy to clipboard operation
api-issue-tracker copied to clipboard

SUMaterialSet[Metalness/Roughness/etc]Enabled() is ignored if we set values after calling it

Open merwaaan opened this issue 7 months ago • 1 comments

Disabling a PBR attribute with SUMaterialSetMetalnessEnabled(material, false) is reverted if we later set related values:

SUMaterialSetMetalnessEnabled(material, false);
SUMaterialSetMetallicFactor(material, metalness); // becomes enabled 
SUMaterialSetMetallicTexture(material, suTexture); // becomes enabled 

To make this work as I expected, I actually have to disable the PBR attribute last:

SUMaterialSetMetallicFactor(material, metalness);
SUMaterialSetMetallicTexture(material, suTexture);
SUMaterialSetMetalnessEnabled(material, false); // will stay disabled, and the material keeps the previous values

Same thing with the other attributes like roughness and normal (haven't tested AO).

This is either an unintended bug or it should be mentionned in the API documentation to avoid surprising users :)

merwaaan avatar Apr 29 '25 14:04 merwaaan

Logged as: SKEXT-4663

sketchup[bot] avatar May 05 '25 15:05 sketchup[bot]