1
$\begingroup$

I'm trying to add a camera marker with an empty name

import bpy
scene = bpy.data.scenes['Scene']
scene.timeline_markers.new('', frame=scene.frame_current)

while this works, it only works if the name of the scene is "Scene" if the name is something else it won't work. how can i make it so that it works on the current scene regardless of name?

$\endgroup$

1 Answer 1

3
$\begingroup$

you could access using the context instead of a name...

import bpy
scene = bpy.context.scene
scene.timeline_markers.new('', frame=scene.frame_current)
$\endgroup$
1
  • $\begingroup$ ah, thank you! this worked $\endgroup$
    – Zophiekat
    Commented Feb 28, 2022 at 0:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .