I'm trying to use scripting to create jumpy cone for fire purpose, and the loop works only for 4 frames, any idea why? Thanks in advance
import bpy
import random
for object in bpy.data.objects:
bpy.ops.object.select_all(action = 'DESELECT')
string1 = object.name
for o in string1:
if (string1.find("Cone",0)!=(-1)):
object.select = True
c = 2
a = random.randrange(10,30)
b = random.randrange(3,6)
a /= b
# make each object that string1 find, "ACTIVE"
bpy.context.scene.objects.active = bpy.data.objects[object.name]
object.scale.z = a
bpy.context.scene.frame_current = c
bpy.ops.anim.keyframe_insert_menu(type='Scaling')
c += 1
for o in "Cone"
will give values of o of"C", "o", "n", "e"
Added an answer with what I think is the result you are after. Or there was only 4 objects in your bpy.data, hard to tell as there is a syntax error aroundfor o in string1:
$\endgroup$pass
body? $\endgroup$