-
Notifications
You must be signed in to change notification settings - Fork 25
String valueType #337
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
String valueType #337
Conversation
const THREE = require('three') | ||
const fontJson = require('../../fonts/droid/droid_sans_regular.typeface.json') | ||
|
||
class TextBasic { |
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.
this sketch and config will need some work before getting added, but getting this up for you now so you can make a string do something right away
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.
Yeah makes sense. Perhaps we could provide a few fonts in the global HEDRON
object. Otherwise I'd advise to have the font located inside the sketch folder itself. Also, worth noting your folder structure is a bit wrong for this example project, see the other ones to see what I mean. Although I was recently thinking we could change the structure of all this anyway: #341
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.
It's probably worth doing an upstream merge to this branch so that you're up to date. You shouldn't be pulling in THREE
like that with the new hedron, it's now a global object. window.HEDRON.dependencies.THREE
return typeof value === 'string' | ||
} | ||
|
||
compatibleInputs = { |
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 get the following error, but only the first time hedron is compiled, if I cmd+r to reload it begins to work. Though sometimes after that, upon reloading again it freezes
TypeError: Cannot read property 'inputs' of undefined
at processDevices(MidiInput.js ? 6582 : 68)
at runCallEffect(/Users/cale.bradbury…nternal / proc.js: 524)
I'm wondering if this is due to the fact that this type has no inputs?
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.
Also forgot to mention that for the second freeze I get the following in the terminal
[19645:1123/151459.614385:ERROR:gles2_cmd_decoder.cc(18470)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
Hedron does render, but is very quickly frozen
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.
Strangely, I'm not getting these errors. Might be a node issue? You shouldn't need the compatibleInputs
as it's empty in the base class for value type.
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 think you might be running multiple instances of Hedron and getting these issues. Check your task manager. Sometimes happens while developing!
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'll check in tonight and let you know, thanks for the thing to look into!
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.
No more errors :) I didn't see those again, I'll keep an eye open for multiple processes in the future though!
}) | ||
return ( | ||
<TextField | ||
value={value || ''} //This seems to not handle multiple fast keypresses, only updating with one of the keys |
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.
Is this the correct way to be feeding the value into the component? as the comment states, it works well enough until you start typing fast
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 just had the thought that perhaps why it wasn't handling fast typing is because it was updating the geometry with each change, which could have cause slight lag/frame-drops (especially as your text gets longer)
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 think we might want to have some sort of debounce option for the text field. We kind of have this with the slow-tick
event listener though. My advice would be to get it working with canvas on a plane first, before going for full 3D text.
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 actually believe the 3d lag can be mitigated by having a sketch that generates all the character geometry on creation then re-assembles into a parent object container as the text updates. Having a debounce, or not applying the text until enter is pressed could be good though
Hey, I just did a tiny bit of linting and a few little minor edits just as I was looking through it locally. So far so good though! Most of my feedback is inline |
…tringParam # Conflicts: # example-projects/text/textBasic/index.js
Hey @cale-bradbury, how's this one going? Have you finished on your end and want me to take a look? |
Hey @cale-bradbury I went ahead and fixed up some things. It's ready to go now. I'm merging it in, thanks so much! Explanation of changes below. Lagging text input In a normal React/Redux application, this update of the state would happen instantly and notify the component, but for performance reasons I'm bypassing the whole thing, c 57A6 hecking the state and updating the UI on a "slow tick". Param bars don't actually update at 60fps, but something like 30fps instead. This works fine for these sorts of inputs, as the GUI doesn't need to be frame perfect for the user. However with text it's different, If you're typing super quick, you can beat this tick before the data has updated, and when it does you're suddenly back a few keystrokes. So I'm cheating a bit and updating the text input from within the component, rather than doing the unidirectional approach. We're still also updating on the tick, in case the update is coming from a macro or a shot. Example sketch |
Heya, went ahead and tried to add a string type, ran into a few issues which I'm hoping you might be able to shed some light on. I'll comment through the PR with the problem areas