I've been using Pie Menu Editor and I'd like to create one that activates only in object mode when nothing is selected. I did a lot of research but since I have no background in coding it makes it very hard for me.

The idea is to have one pie menu to create meshes when nothing is selected and another one with the same shortcut to merge two meshes together for instance.

It seems like it has to do with poll options. An example they give for instance if you want to create a pie menu that activates only while in edge mode you have to write : return C.scene.tool_settings.mesh_select_mode[1]

Thank you for your help :)


I found a way !!!

return len(bpy.context.selected_objects) == 0

This works just fine :)

|improve this answer|||||
  • $\begingroup$ It might be better to use context than bpy.context $\endgroup$ – HikariTW Sep 10 '19 at 22:48
  • 1
    $\begingroup$ May I know why ? $\endgroup$ – Poppip Sep 11 '19 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.