Auto return shader hooks#8384
Conversation
|
🎉 Thanks for opening this pull request! For guidance on contributing, check out our contributor guidelines and other resources for contributors! Thank You! |
davepagurek
left a comment
There was a problem hiding this comment.
This looks great, thanks for making these changes and also adding tests!
davepagurek
left a comment
There was a problem hiding this comment.
oh actually it looks like the tests are failing:
FAIL |unit-tests| test/unit/visual/cases/webgl.js > WebGL > p5.strands > auto-return for shader hooks > auto-return works with getObjectInputs > matches expected screenshots
TypeError: Cannot read properties of undefined (reading 'position')
❯ p5.hookImplementation src/strands/strands_api.js:446:50
444| const expectedProp = expectedProperties[i];
445| const propName = expectedProp.name;
446| const receivedValue = effectiveReturn[propName];
| ^
447| if (receivedValue === undefined) {
448| FES.userError('type error', `You've returned an incomple…
❯ eval src/strands/strands_transpiler.js:1078:39
❯ src/strands/strands_transpiler.js:1087:20
❯ p5.Shader.modify src/strands/p5.strands.js:114:9
❯ test/unit/visual/cases/webgl.js:965:48
❯ test/unit/visual/visualTest.js:432:13
Possibly the isStructType check is failing? Maybe try adding some logging and then run npm run test test/unit/visual/cases/webgl.js to see what the types are?
|
Sure, I will look into it. |
|
Hi @vietnguyen2358! We're working on some updates to the p5.strands API for the next release in #8314 and we don't want to put any time pressure on you related to that, so I'm going to integrate your PR into that branch and fix the tests there, since other parts of the code are moving around too. Thanks for your help on this so far, I'm excited to have this functionality in the next version 🙂 |
|
@all-contributors please add @vietnguyen2358 for code |
|
I've put up a pull request to add @vietnguyen2358! 🎉 |
Resolves #7994
Addresses #7992
Changes:
return inputswhen modifying struct properties in placePR Checklist
npm run lintpasses