bpy.ops.object.particle_system_add()
bpy.data.particles[-1].type = 'HAIR'
bpy.data.particles[-1].count = 0
bpy.ops.particle.particle_edit_toggle()
bpy.context.scene.tool_settings.particle_edit.brush.count = 1
area = bpy.context.area
old_type = area.type
area.type = 'VIEW_3D'
bpy.ops.particle.brush_edit(stroke=[{"name":"", "location":(0, 0, 0), "mouse":(374, 316), "pressure":0, "size":0, "pen_flip":False, "time":0, "is_start":False}])
area.type = old_type
```
Asked
Active
Viewed 235 times
0
Raqun Bob
- 13
- 3
bpy.ops.particle.brush_edit(stroke=[{"name":"", "location":(0, 0, 0), "mouse":(374, 316), "pressure":0, "size":0, "pen_flip":False, "time":0, "is_start":False}])you can see the error – Raqun Bob May 05 '20 at 04:29poll()fails forbrush_edit()(you have to pass the correct context members), Further reading: https://blender.stackexchange.com/questions/6101/poll-failed-context-incorrect-example-bpy-ops-view3d-background-image-add – brockmann May 08 '20 at 13:34