-
Notifications
You must be signed in to change notification settings - Fork 398
osltoy - Feature Request: autodetect output color variable #2051
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
Conversation
|
Great to see this land! I'm a little busy with releases for the next couple days, but will get to it right away after that. Don't mind the failed CI for now, that is due to issues unrelated to your PR, and I'm fixing them. |
|
Can you please rebase on the current main and force push to trigger a new CI run to see what's working and what's failing? |
|
It succeeded! I thought seeing the latest commits on the main branch with a red ❌ meant it would fail on this too. |
lgritz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this and it does seem to work. Looks fine to me, though I made a couple of fairly minor cosmetic suggestions I'd like you to make, then we can merge.
src/osltoy/osltoyapp.h
Outdated
| // The currently selected output | ||
| ustring m_selectedoutput = ustring(""); // Empty until set by user | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ustring by defaults constructs an empty string, so this can be more compactly expressed as
| // The currently selected output | |
| ustring m_selectedoutput = ustring(""); // Empty until set by user | |
| // The currently selected output | |
| ustring m_selectedoutput; // Empty until set by user |
src/osltoy/osltoyrenderer.cpp
Outdated
| // In our SimpleRenderer, the "renderstate" itself just a pointer to | ||
| // the ShaderGlobals. | ||
| // sg.renderstate = &sg; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you intend to remove this non-functional code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, oops 😬
src/osltoy/osltoyrenderer.h
Outdated
| std::function<ustring()> | ||
| m_get_selected_output; // Store the getter function that gets selection from app | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's break the comment onto a separate line in order to fix the awkward formatting here. And maybe also put this new item after m_framebuffer, intead of at the beginning? (Sorry, I can't make a diff for that through this interface; seems like GH will only let me include lines you actually changed in the diff, not surrounding code.)
| std::function<ustring()> | |
| m_get_selected_output; // Store the getter function that gets selection from app | |
| // Store the getter function that gets selection from app | |
| std::function<ustring()> m_get_selected_output; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay done ✅
|
Please note that the two Windows failures are not your fault. They are a GH thing, and I fixed them in a PR I merged that is not yet incorporated in your patch, but will be once you merge. Or you could rebase on top of current main to pick up those changes. I recommend against ever doing "git merge", and instead think it's cleaner and easier to understand the history if you "git rebase main" and then force-push your branch. That tends to make a linear history that's easy to follow, rather than multiple branching merges. |
|
Aside to whoever is listening (not the fault of your PR, just something I noticed): I noticed both in my testing of this, and Sylvia's screen shot, that at least on Mac, the color scheme is making the currently-edited line highlight color fully obscure the text in the code. Maybe it's been like that for a while (certainly not related to this PR), but I don't remember it being like that before. Maybe it's a recent change in the MacOS side, or the result of dark mode in our OS preferences? I'm not sure how to fix, but it's pretty annoying, so if anybody else knows how to fix that, please give us some tips! |
Signed-off-by: silvialpz <[email protected]>
Co-authored-by: Larry Gritz <[email protected]> Signed-off-by: Silvia <[email protected]>
Signed-off-by: silvialpz <[email protected]>
Signed-off-by: silvialpz <[email protected]>
I see what you mean now, I used the the "sync fork" button on GitHub twice before but this does look nicer on the graph. Thanks! |
I'm listening, I'll fix it |
lgritz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
f2f70f3
into
AcademySoftwareFoundation:main


Description
Fixes #2021
How it works:
osltoy-auto-detect-output-variable.mov
Tests
I was working with a simple OSL file with two color output variables to test that the user could select the desired output with radio buttons.
Checklist:
already run clang-format v17 before submitting, I definitely will look at
the CI test that runs clang-format and fix anything that it highlights as
being nonconforming.