LUA: insert cue in Sequence

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

    I hope someone can lend a hand with an issue I'm facing in my Lua code. I'm trying to insert a CUE into a sequence, but it seems like something isn't working as expected. I've attached two images of my code to help illustrate the problem.


    CODE

    OUTPUT

    In my code, I'm attempting to use the `Insert` function to insert a CUE into a sequence. However, I haven't been able to achieve the desired results.

    I'm trying to understand why CUE insertion isn't working correctly. I've tried various combinations of parameters, but to no avail.

    If anyone has any ideas on what might be the issue or has suggestions on how I can improve my code to get CUE insertion working correctly, I would be extremely grateful!

    Thanks

    V

  • the first two children of a sequence object is offcue and cuezero, to insert a new actual first-cue you need to insert as child index 3:

    Code
    return function()
      local seq = DataPool().Sequences[1]
      local newcue = seq:Insert(3)
      newcue.No = "0.9"
    end
  • Thank you, it works perfectly! I just have one additional issue:

    when I try to change the 'Name' property of the cue, it doesn't seem to work.

    Any suggestions on what the problem might be?"

    I tired:

    newcue.Name = "abcd"

    newcue:Set(“Name”, “abcd”)

  • internally, a cue's name is determined by its first child (part 0):

    Code
    return function()
      local seq = DataPool().Sequences[1]
      local newcue = seq:Insert(3)
      newcue.No = "0.9"
      local part = newcue:Create(1)
      part.Name ="abcd"
    end

Participate now!

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