Context sensitive search - is it possible?

Hi,
since Blender 2.7 or so i was wondering why the search function is not context sensitive. For example, while searching in edit mode, you get results from all other modes:

Would’nt it be easier, espcially for beginners, to show ony functions that are relevant to the task you are in? With this, you could scrool through the search terms if you do not know the name of the function, or even geht some new ideas on what to use.

Any suggestions?

Thank you!

That’s weird, I thought it was context sensitive. I’ve noticed that results for most edit mode tools don’t appear in object mode, but perhaps it’s something to do with some tools not having the right setup to be correctly identified as being out of context by the operator search menu?

Partially, it already is.

Operators usually have a thing called a poll function, which determines in what context the operator is allowed to run.

For example, the Delete Edge Loop operator is only allowed to run in Edit Mode, since it works on the edges you have selected. It cannot run in Object Mode.

If you search for this operator, it will only appear if you are in Edit Mode.

Similarly, you can only delete an edge loop from the 3D View. Being able to delete edge loops of a mesh from the Node Editor would be weird. The poll function checks for this, and at the same time hides it from the search tool if you’re in the wrong editor.

In many cases though, operators are technically allowed to run in a variety of contexts, even if it doesn’t seem 100% appropriate. E.g. Updating the audio animation cache while in edit mode is unusual, but there’s no reason you shouldn’t be able to.

While this does clutter the search tool a bit, I think it’s a good thing that Blender lets you do what you want if there’s no solid reason to prevent it.

Then again, in some cases (often in add-ons) it’s just a matter of the programmer not being careful/specific enough about what context is allowed. There seems to be a lot of Video Sequence Editor operators that require selections in the VSE (e.g. Make Meta Strip) that accessible from the 3D View, which should be prevented IMO.

1 Like

Blender 2.8’s left-click workflow will have context-sensitive right-click menus, so if you use that instead of the search box, it will show a menu of operations relevant to that mode.

In my view, the search bar can be seen as a sort of advanced tool or a place for tools to live that have not found a good spot elsewhere in the UI. However, I do see the point of at least filtering out the options that would not even function in the window type the cursor is in (but not to the point of not having operators related to face mode while in vertex mode).

Thanks for the detailed replies. I agree with Ace_Dragon, that the entries in the search menu shown should be related to the task you are in, but still regardless of the selection (e.g. search delivers all all object mode relevant functions, regardless of having an object selected or not).
On the other hand, the new context-menu on RMB delivers new possibilities. Once you got used to it, the search become less important.