0

I have a few vertices selected, obviously in edit mode.

selection

Running bpy.ops.info.select_all(action='INVERT') in the Python console gives me a RuntimeError: Operator bpy.ops.info.select_all.poll() failed, context is incorrect though ?

That's exactly the command the GUI shows me when hovering Select > Invert, and doing it though the GUI works of course.

n1cK
  • 230
  • 3
  • 9
  • Consider using low-level functions: https://blender.stackexchange.com/a/1417/31447 Otherwise have a look into: https://blender.stackexchange.com/questions/6101/poll-failed-context-incorrect-example-bpy-ops-view3d-background-image-add – brockmann Jan 26 '21 at 11:55
  • Thanks, doing it low-level would have been my next try, but fortunately I found the right command. This whole context thing is total nonsense from the point of software engineering. If I want to run a command, then do whatever it takes to run it and set some context or whatever. Thanks for your suggestions ! – n1cK Jan 26 '21 at 12:06

1 Answers1

0

Found the solution: The labeling in Blender is apparently wrong. The right command is bpy.ops.mesh.select_all(action='INVERT')

n1cK
  • 230
  • 3
  • 9