I have a collection of leaves in my scene which calls Lines:
Here's a little snippet that creates another leaf from leaf and randomize it:
bpy.ops.object.duplicate()
rotateX = round(uniform(-20,20), 2)
rotateY = round(uniform(10,50), 2)
scaleX = round(uniform(0.3,1), 2)
scaleY = round(uniform(0.3,1), 2)
scaleZ = round(uniform(0.3,1), 2)
bpy.context.object.scale = ( scaleX, scaleY, scaleZ )
bpy.context.active_object.rotation_euler = (radians(rotateX),radians(rotateY),radians(-90))
And here's a brief look of what my script does
From:
To:
My goal is to apply my script to other leaf objects, so I can easily generate a little procedural garden with random leaves.
I'm pretty new to blender, and I don't know of it's possibilities, and how powerful it is. If you could suggest a better option or way to solve my problem I'd be grateful! May be it's even better to use particle system, and if so, how do I randomize the scale and leaf shape if it was generated by particle system?
I want to achieve something similar to this: https://i.sstatic.net/eBXN1.jpg
^ here I manually select and make objects active to apply my script on them on by one, but I want a script that does it