I would find it useful to be able to search all of the tabs in the properties panel for the label text. So for example I could search "mist" and have the tab highlighted that include the word "mist" in the label text. Does this ability exist? Sounds crazy I know but I think it would help me become less frustrated finsing stuff.
-
1$\begingroup$ Is this just a feature request (which would be off-topic) or are you asking how you would go about implementing this? $\endgroup$– Ray MairlotCommented Dec 30, 2018 at 13:57
-
$\begingroup$ I was really asking if there was a way of easily doing it already - and it seems the only was is using python directly. $\endgroup$– Starfury359Commented Jan 5, 2019 at 11:28
1 Answer
Some of the way there.
Here is a script that looks at all the panel classes in the 'PROPERTIES' ui area. Technically I've looked at all modules in bl_ui
having a name beginning with "properties_". Conveniently each of these modules will have a classes list.
Alternateively could have looked for panel types in bpy.types
and checked if the bl_space_type == 'PROPERTIES'
If the panel's label doesn't contain the word (lower case check) then it is unregistered
Result of running search on "collections"
import bpy
from importlib import import_module
def search_mark(self, context):
layout = self.layout
layout.label(text="FOUND", icon='INFO')
search_str = "mist"
import bl_ui
pmods = [m for m in dir(bl_ui) if m.startswith("properties_")]
for pm in pmods:
mod = import_module("bl_ui.%s" % pm)
for cls in mod.classes:
if cls.__name__.find("_PT_") == -1:
continue
if getattr(cls, "bl_label", "").lower().find(search_str) > -1:
cls.prepend(search_mark)
print(cls.__name__, cls.bl_label)
else:
bpy.utils.unregister_class(cls)
the output searching for "mist"
EEVEE_WORLD_PT_mist Mist Pass
there is a mist pass panel, somewhere I have no idea where lol.
To UNDO this, type the following command into python console
bpy.ops.script.reload()
to reinstate all panels.
Result on searching for "vertex"
DATA_PT_gpencil_vertexpanel Vertex Groups
DATA_PT_vertex_groups Vertex Groups
DATA_PT_vertex_colors Vertex Colors
PARTICLE_PT_vertexgroups Vertex Groups
for these could grab the lhs of name, eg 'DATA' and for a properties space, set the context tab via
space.context = 'DATA'
or via a py console example, will set one of the properties area's context to 'DATA'
>>> for a in C.screen.areas:
... if a.type == 'PROPERTIES':
... break
...
>>> a.spaces.active.context = 'DATA'
Finally adding a panel with a search string input and a reload button would finish this off. Apart from hacking the icons, I'm not aware of any method to highlight the tabs.
-
$\begingroup$ Thank you very much for this - I will give this a go. $\endgroup$ Commented Jan 5, 2019 at 11:27