Fix #108737: Python error in Property Editor search menu #108795

Merged
Philipp Oeser merged 2 commits from lichtwerk/blender:108737 into blender-v3.6-release 2023-06-09 15:07:06 +02:00

2 Commits

Author SHA1 Message Date
Philipp Oeser 20734ec3a4 remove redundant checks 2023-06-09 14:33:03 +02:00
Philipp Oeser 3b64069d8d Fix #108737: Python error in Property Editor search menu
Caused by 5ca65001ea (which was already patched with ae7c71ef09 and
fa5cc84a0a)

Getting the right modifier would still fail / throw errors when not done
from the modifier extra ops dropdown.
Only there,  a 'modifier' attribute is set for context (via
`uiLayoutSetContextPointer` in `modifier_ops_extra_draw`).

So now check if a 'modifier' attribute is set for context (and fallback
to using the active modifier instead).
This way, polling errors in F3 search are gone and you can actually
execute the operators which are also in modifier extra ops dropdown from
elsewhere (e.g. F3 search).
2023-06-09 10:37:22 +02:00