I wish to have objects being consecutively added to the timeline, not simply showing/hidding.
I am willing to script a growing organism.
this is the code i have been working on:
import bpy
bpy.ops.object.select_all(action=‘SELECT’)
bpy.ops.object.delete(use_global=False, confirm=False)
#bpy.context.scene.tool_settings.use_keyframe_insert_auto = True
#EMBRYO
bpy.ops.mesh.primitive_cube_add(size=2, enter_editmode=False, location=(0, 0, 0))
bpy.context.object.name = “cell”
bpy.ops.transform.rotate(value=3.14159, orient_axis=‘Z’, orient_type=‘VIEW’, orient_matrix=((-1, -0, 0), (0, 1.34359e-07, -1), (-0, 1, 1.34359e-07)), orient_matrix_type=‘VIEW’, mirror=True, use_proportional_edit=False, proportional_edit_falloff=‘SMOOTH’, proportional_size=1, use_proportional_connected=False, use_proportional_projected=False)
bpy.context.scene.cursor.location = (0.0, 0.0, 0.0)
#divisao vertical
for i in range(10):
bpy.context.scene.cursor.location = (0.0, 0.0, 0.0)
x = bpy.ops.mesh.primitive_cube_add()
bpy.ops.transform.resize(value=(2, 2, 0.01))
bpy.ops.transform.translate(value=(0, 0, i))
bpy.context.view_layer.objects.active = bpy.data.objects[‘cell’]
bpy.ops.object.modifier_add(type=‘BOOLEAN’)
bpy.context.object.modifiers[“Boolean”].object = bpy.data.objects[“Cube”]
bpy.context.object.modifiers[“Boolean”].operation = ‘DIFFERENCE’
bpy.ops.object.modifier_apply(apply_as=‘DATA’, modifier=“Boolean”)
bpy.context.view_layer.objects.active = bpy.data.objects[‘cell’]
bpy.ops.object.editmode_toggle()
bpy.ops.mesh.separate(type=‘LOOSE’)
bpy.ops.object.editmode_toggle()
bpy.context.object.name = “cell”
bpy.ops.object.select_all(action=‘DESELECT’)
bpy.data.objects[‘Cube’].select_set(True)
bpy.ops.object.delete()
bpy.data.objects[‘cell’].select_set(True)
bpy.context.scene.cursor.location = (0.0, 0.0, i)
bpy.ops.object.origin_set(type=‘ORIGIN_CURSOR’, center=‘MEDIAN’)
bpy.ops.transform.resize(value=(1, 1, 2))
bpy.context.scene.frame_current = (i+1)*10 # I wish here to have the object being added to the timeline