Jump to: Board index » General » Fusion

Expressions: String to variable name

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

obanana

  • Posts: 3
  • Joined: Fri Mar 15, 2019 10:05 pm
  • Real Name: Kirill Adamenya

Expressions: String to variable name

PostWed Mar 20, 2019 10:15 pm

Is it possible to convert a string in expression into a variable name to call the value of another tool?

I have several easing functions in custom tool (Easing.e0, Easing.e1, Easing.e2 etc...)

I also have a ComboControl (Easing.Easing) to choose one of the easings (output a number: 0, 1, 2 etc...)

In transform, I want it to get value of the selected easing function from the custom tool.

This:
"Easing.e"..Easing.Easing
Returns a string "Easing.e0" (when Easing.Easing is set to 0).

_G[Easing.e0] - the function that gets a value of global variable. It returns "nil".

How do I make it return the value of Easing.e0?

Return to Fusion

Who is online

Users browsing this forum: CryingWalnut, Jacob Danell and 18 guests