MATricks : Get Value

BECOME PART OF THE COMMUNITY - Sign up here
  • Hello,

    I'm currently using GrandMA3 version 1.9.2.

    I realized that, in a matricks, if I have a decimal number, calling the method: "MATricks:Get('FadeFromX')" for example returns the integer number instead of my decimal number.

    If I dump via the ":dump()" method or via gma3_helpers, I can see my decimal value.

    Is there a way to retrieve this decimal value, or is this a bug? At the moment, I'm working around the problem using a variable, but I was wondering if it's just me who doesn't know lua very well.

  • this seems like a bug

    try this workaround:

    local x = tonumber(MATricks:Get('FadeFromX', Enums.Roles.Display)) or 'None'

    Code
    local root = Root();
    local MATricks = root.ShowData.DataPools.Default.MAtricks:Children()
    local fx
    ...
    fx = tonumber(MATricks[1]:Get('FadeFromX', Enums.Roles.Display)) or 'None'

    I get an error : LUA Runtime Error[string "LC_View@"]:15: attempt to call a nil value (method 'Get')

    What am I not doing well?

  • It's ok, I found my mistake.

    in fact I developed a multitude of functions: fade, delay_from, delay_to,...etc

    and only declared

    Code
    local root = Root();
    local MATricks = root.ShowData.DataPools.Default.MAtricks:Children()

    at the beginning of the code

    then who must declare it in each function.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!