I have an object (a feather) with a particle system on it (little objects that turn into spaces later - boolean/difference - to make it look a little ruffled). I have duplicated the object a number of times (to create a wing). Each instance gives me the same particle system output. To randomize the particles on each duplicated object, I give it a new particle setting and change the seed value.
To be able to do this a large number of times (and many other things as well), I am creating code to automate the tasks.
Problem: the particle settings line bpy.ops.particle.new() gives me "#RuntimeError: Operator bpy.ops.particle.new.poll() failed, context is incorrect"
I am new to coding and learning fast. Dove in the documentation and read the Q&A's on this site, but hit a dead end. I am out of my depth here. Help is appreciated.
I know there is a "Button context" called "bpy.context.particle_settings", but I don't know what to do with that.
What context do I need to apply new particle settings to work (and how)? or how can I override the context?
In the snipped below one edge of the feather, containing the particle system, is selected and made active, before attempting to add new settings
bpy.ops.object.select_all(action='DESELECT') object = bpy.data.objects[edge_name] object.select = True bpy.context.scene.objects.active = bpy.data.objects[edge_name] bpy.ops.particle.new() #RuntimeError: Operator bpy.ops.particle.new.poll() failed, context is incorrect bpy.context.object.particle_systems["ParticleSystem"].seed = seed_value