Add_reference - help!


I’m building a little script for a Motion Vectors template (flame 2021), but I’m currently struggling to add a reference frame for my surface (I’m also new to Python API so be gentle!)

The idea is to set my reference frame to whatever frame I’m currently parked - this is my partial script

frame = flame.batch.create_node(“Action”)
media =

reference =[0]

this is the bit I can’t figure out. I understand that using the above, then the name becomes a string and loses its attributes, but I can’t figure out a way to use add_reference on a media.

reference = reference.add_reference(frame)

Sorry, I know the solution should be fairly simple, but I can’t get my head around it - Thank you!

I’ve figured out

attributes should come from action.nodes instead of media.layers (string)

Thanks anyway - hope this can help someone!