0
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ Consider using low-level functions: blender.stackexchange.com/a/1417/31447 Otherwise have a look into: blender.stackexchange.com/questions/6101/… $\endgroup$
    – brockmann
    Jan 26, 2021 at 11:55
  • $\begingroup$ 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 ! $\endgroup$
    – n1cK
    Jan 26, 2021 at 12:06

1 Answer 1

0
$\begingroup$

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

$\endgroup$

Not the answer you're looking for? Browse other questions tagged .