Skip to content

Support implicit conversions between Float3 and Float4 ARNOLD-14028#1748

Merged
sebastienblor merged 4 commits intoAutodesk:masterfrom
sebastienblor:ARNOLD-14028
Nov 20, 2023
Merged

Support implicit conversions between Float3 and Float4 ARNOLD-14028#1748
sebastienblor merged 4 commits intoAutodesk:masterfrom
sebastienblor:ARNOLD-14028

Conversation

@sebastienblor
Copy link
Copy Markdown
Collaborator

This PR adds implicit conversions between RGB and RGBA values, so that using one type instead of the expected one still manages to read the data. Done in both the procedural and the render delegate.
Added test_14028 to exercise this.

I'm setting this PR as a draft as it's not clear yet whether we want to accept these use cases, or if we want to keep being restrictive about these data types.

@sebastienblor sebastienblor marked this pull request as ready for review November 15, 2023 12:50
};

auto nodeSetRGBAFromVec3 = [](AtNode* node, const AtString paramName, const GfVec3f& v) {
AiNodeSetRGBA(node, paramName, v[0], v[1], v[2], 1.f);
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.

are we sure we always want 1.f ?

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.

One test on linux is failing

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this is what the implicit conversion in Arnold does when you convert color3 to color4, alpha is set to 1

cpichard
cpichard previously approved these changes Nov 16, 2023
@sebastienblor sebastienblor merged commit 56b072f into Autodesk:master Nov 20, 2023
@sebastienblor sebastienblor deleted the ARNOLD-14028 branch November 20, 2023 07:22
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.

2 participants