I just started yesterday with python scripts in blender but im using blender for 2 years now.
After I finished my Sound Visualizer yesterday, i thought it does look kinda boring with just moving bars.
Therefore I decided to try to create a code for a sound visualizer, at which each bar which would previously scale along the z axis would be replaced by a plane which does emit particles. My goal is it to make the particles lifetime change according to the way in which the bars got sclaed along the z axis previously.
Here’s my code in its current state:
import bpy bars = 50 startframe = 1 endframe = 4250 c = 1 for i in range(0, bars): bpy.ops.mesh.primitive_plane_add(location = (c, 1, 0)) bpy.context.active_object.scale.x = 0.5 bpy.context.active_object.scale.y = 0.5 bpy.ops.object.particle_system_add() ParticleSettings.count = 100000 ParticleSettings.frame_start = startframe ParticleSettings.frame_end = endframe ParticleSettings.normal_factor = 100 ParticleSettings.random_factor = 5 ParticleSettings.material = 1 bpy.ops.anim.keyframe_insert_menu(type=) c += 1
My problems are:
neither ParticleSettings.count = 100000 (and the following lines) nor bpy.data.particles(“ParticleSetting.001”).count = 100000 does work.
I got no Idea how to create a keyframe for the lifetime of particles via python. In my first Visualizer I could just use bpy.ops.anim.keyframe_insert_menu(type=‘Scaling’), but i guess thats not working now ;). Therefore i tought bpy.ops.anim.keyframe_insert_button() might work, but i dont find/know any syntax on how to use it …
I hope my very bad english didnt kept you from understanding what im talking about every help would be really apreciated