Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for element connection in arnold node graph #1031

Merged
merged 1 commit into from
Feb 21, 2022

Conversation

jhodgson
Copy link
Contributor

@jhodgson jhodgson commented Feb 16, 2022

Currently we have a warning in the render delegate code for connecting array elements

render_delegate/node_graph.cpp:830:54: warning: multi-character character constant [-Wmultichar]
            size_t elemPos = outputAttr.find_last_of(':i');
                                                     ^
render_delegate/node_graph.cpp:830:54: warning: implicit conversion from 'int' to 'std::basic_string<char>::value_type' (aka 'char') changes value from 14953 to 105 [-Wconstant-conversion]
            size_t elemPos = outputAttr.find_last_of(':i');

This doesn't amount to a bug in the render delegate, but is in fact only searching for the last :, not the last :i since we pass a char not a string. If we has used a string it would pick the last of : OR i which is not what we want either.

We can fix by using rfind("i0") and updating the indices.

Note we only get different behaviour for strings such as input[3].i which we would represent as input:i0:i, but we would never have such connections, only input[3].x or similar (i.e. components x,yz,r,g,b,a).

But this fix will make the code tighter and remove the compile warning.

Fixes #1031

@jhodgson jhodgson self-assigned this Feb 16, 2022
@jhodgson jhodgson added the render delegate Related to the Arnold Render Delegate label Feb 16, 2022
@jhodgson
Copy link
Contributor Author

Test_0293 is still passing in HtoA.

@jhodgson jhodgson merged commit e52df05 into Autodesk:master Feb 21, 2022
@jhodgson jhodgson deleted the FB/1029 branch February 21, 2022 10:00
@sebastienblor sebastienblor added this to In progress in Sprint 65 via automation Feb 25, 2022
@sebastienblor sebastienblor moved this from In progress to Done in Sprint 65 Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
render delegate Related to the Arnold Render Delegate
Projects
No open projects
Sprint 65
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants