0
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
```
Raqun Bob
  • 13
  • 3
  • if you comment the line before last line which is 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:29
  • If you think that's a bug, please file a bug report. Main menu > Help > Report a bug. – brockmann May 05 '20 at 09:36
  • It is already a reported bug from 2015 on another website about blender, alas they did not fix it; it says we "should not use" functions that mouse is required or similiar – Raqun Bob May 06 '20 at 11:38
  • Again, this website is a Q&A site and not the right place to report a bug. To get the ball rolling: it seems to work in Blender 2.8x: https://pastebin.com/qNCRWKqm Remaining issue is that poll() fails for brush_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

0 Answers0