-
Notifications
You must be signed in to change notification settings - Fork 512
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
Ability to type expressions directly into value fields #4439
Comments
In my experience the trigger character for expressions is usually an equal sign (=). This is fairly traditional for spreadsheet program expressions from programs like Excel etc. Example: "=valuex" I definitely like the idea of adding expressions more easily in places where appropriate. Here's an example from the every ubiquitous spreadsheet program Excel: I would imagine that the logic for storing values (whether they be actual values or expressions) would need to be added to the code because they likely are only used as a temporary holding place until the enter key is pressed in which time the value is input into the underylying database. I don't think we currently have a 'live' connection although perhaps in places we do... I'm thinking brush sizes and such. I do see the hash mark (#) as being useful and it currently is used in Opentoonz for drilling down to objects/layers in PSD files. That can be seen by opening a PSD file in OT and checking the path via Level Settings. There the path appears to be simply stored as a pointer... again no 'live' connection but when prompted for a refresh it surely uses that path to find the source and provide the update. In this sense a 'path' entered as an expression would not only resolve the location but also any relationships via math. Bigger picture thoughts That of course would be handled by the process that validates expressions so the primary addition here is that trigger symbol that would signify the data thereafter is to be parsed/registered as an expression. There is also the matter of prompting the user for input when they enter the trigger symbol... or as Opentoonz already does when adding an expression give hints based on what the user has entered thus far. Here is a random example from another program: At any rate, I like the idea. |
I like the idea. Another expressions related feature that would be great to have, would be that expressions be by default additive to the keyframes entered for that channel. |
That would be helpful, but what I would like even more would be temporary variable support, so you can use the current value of a columns attribute, save it into a temp variable (even if it's just one or two ...) and then operate on that value before putting it back into the attribute. You can't do something like (pseudocode): column1.X = column1.X + 5 For example: Creating a controller like this for 2D Cutouts and other 'boney' stuff is a huge pain as it is now. This can be done with columns that act as controls, but it's difficult to clamp them to a value, for example. let's say you draw a level that represents a knob on a slider, not to be rendered in the final compositon, but as a tool to work with. And you place this knob on the X coordiate of 0, and you want to interpret this as '0' So if you drag this knob to the X coordinate of 200, the doll part would receive a '1' for its controller input. Thing is, you can't clamp it, you can't limit it to 200 easily because if you were to go (pseudocode) Then you can't you do that! |
That's because a channel's value can either be defined by a key xor an expression. i.e. the expression completely replaces the key as a form of assigning value to the channel. That's another advantage of the "layered" expressions system I refered to above. |
Please try |
Is your feature request related to a problem? Please describe
When animating FX, there are many situations where you wish to use a simple expression to drive the value of a parameter. An example would be using the expression
f
to change the value linearly over time based on the current frame's number.To write an expression, you need to go to the
Function Editor
, locate the desired parameter, set theInterpolation Mode
toExpression
and finally enter the expression (making sure to hitApply
). This feels a bit cumbersome when the expression itself is very simple, as the aforementioned steps contribute the majority of the time taken.Describe the solution you'd like
Inspired by Blender, I think a user-friendly solution would be to allow directly entering expressions into value fields using a prefix such as
#
. This would then automatically create the expression when the user presses enter.Currently, if a value field is driven by an expression and the user tries to modify its value outside of the
Function Editor
, the change will simply be rejected. With the above change, it would be useful to instead display the expression when the user attempts to edit the value in the field, allowing them to alter the expression without needing to return to theFunction Editor
.Example:
The text was updated successfully, but these errors were encountered: