Is there a way to quickly setup a scene to show one object each frame? ie object A to render on frame 1, object B to object on frame 2, etc...(I just want to change a group of objects, but want the ground/room setting untouched). Thanks!
-
1$\begingroup$ Mention the roto-scope stuff. The more detail the better. Eg some example of a couple done manually. Is this targeted toward 2.8? Collections would be ideal for this, one unlinked to scene with all the special objects, one linked to scene to swap objects in and out of (via frame change as shown below for instance). $\endgroup$– batFINGERCommented May 15, 2019 at 12:35
1 Answer
You can use script for it, with scene.frame.current
combine with bpy.app.handlers.frame_change_post.append()
Here is a simple script work in Blender 2.80, paste in text block and run it, it will loop the object hide value with the current frame:
import bpy
def ani_handler(scene):
name = 'Cube'
objs = [obj for obj in scene.objects.values() if name in obj.name]
for i, obj in enumerate(objs):
obj.hide_set(i != ((scene.frame_current-1) % len(objs))) # Blender 2.80
# obj.hide = (i != ((scene.frame_current-1) % len(objs))) #Blender 2.79b
bpy.app.handlers.frame_change_pre.append(ani_handler)
if you want to try in Blender 2.79b below, change the #
in head from 2.79b to line 2.80.
Change the 'Cube'
to the name you want to specified (''
means no limit), if the object name contain the name, it will count toward this script.
Also if you run a previous script before, restart your blender to the clear the handlers.
-
$\begingroup$ This is great! thank you very much!. How do I limit the script to a group of objects? Here's what I did: I rotoscoped manually a sequence of images, then I got a processing sketch that created a 3D cube for every black pixel at x distance, I exported that to an OBJ and now I'm importing those objs as a sequence. The script you did is great but it turns off the ground plane. Can I limit the script to a specific name sequence? $\endgroup$ Commented May 15, 2019 at 2:18
-
$\begingroup$ @AlanEstrada You should edit your question for these detail, I have edited my answer for it. $\endgroup$– HikariTWCommented May 15, 2019 at 3:02