-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[p5.strands] Auto-return input objects if omitted #8229
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
base: main
Are you sure you want to change the base?
[p5.strands] Auto-return input objects if omitted #8229
Conversation
|
🎉 Thanks for opening this pull request! For guidance on contributing, check out our contributor guidelines and other resources for contributors! Thank You! |
perminder-17
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.
Hi, really thanks for working on this. For 1.x versions, your logic works well. Currently we are not adding any features to the 1.x versions (i.e. the main branch), I think you need to open up the PR targeting the dev-2.0 branch as well, and
For this PR if you would still like to continue adding this to main branch, you could probably add visual tests to it instead of unit tests. Do you think that would make sense to you and your team?
Really thanks for working on this.
|
Thanks so much for the clarification. We'll open a new PR targeting the For this current PR, I think we can close it and just focus on the other branch. |
Yes working bothway would be possible. Like, it would be nice to have changes in both main and dev-2.0 branch. Which means, updating unit tests to visual tests here, and opening up a new PR targeting dev-2.0 branch. CC: @davepagurek, would u also support changes on the main branch? |
|
I think we can 1.x as-is, since we're just doing bugfixes in 1.x at this point. |
|
Also in 2.x, hooks are in JavaScript primarily instead of GLSL, so instead of string matching on the source code, we could probably do something where we keep a reference to the inputs object that we pass in as a parameter, and then check the return value, and substitute it with that same inputs object if the return value is undefined. |
|
Sounds good. I will work towards changes in both branches. |
Resolves #7994
Addresses #7992
Changes:
p5.Shader.modify()to auto-return input objects when return is omittedvoidhooks or mismatched return typesLive: https://editor.p5js.org/viet.nguyen2358/sketches/J1H2c-kWN
PR Checklist
npm run lintpassesContributors:
@phamjoshua6, @SaKaR22