2
$\begingroup$

I'm trying to automate an application that involves a lot of objects appearing and disappearing, then a thought in using python to do this bot I don't know the specific command to create a keyframe for the viewport render, somebody help me please

By the way, what I trying to do is creating a bezier curve that can moves, so I'm thinking in create a sphere in every point of the curve and then move the spheres, make it pop ups and so on, something like that https://www.youtube.com/watch?v=aVwxzDHniEw

$\endgroup$

1 Answer 1

1
$\begingroup$

This line will set a keyframe on visibility for an object called "Torus" at keyframe 1:

bpy.data.objects['Torus'].keyframe_insert("hide_render", frame=1)

So, if you wanted to change this to something more generic, the steps are:

  • Select the object you want to hide
  • Set its hide_render value to True or False
  • Select the frame number you want the keyframe on
  • enter a statement like the above.

If I wanted to keyframe the value to True on the active object at frame 17:

bpy.context.active_object.hide_render = True
bpy.context.active_object.keyframe_insert("hide_render", frame=17)
$\endgroup$

You must log in to answer this question.

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