techartorg / bqt

A Blender add-on to support & manage Qt Widgets in Blender (PySide2)
https://github.com/techartorg/bqt/wiki
Mozilla Public License 2.0
172 stars 25 forks source link

document operators #62

Closed hannesdelbeke closed 1 year ago

hannesdelbeke commented 1 year ago

operators cause tons of issues with bqt. try avoid them where possible (it almost always is)

TODO: document this. add utils to bqt

notes

when using operators from qt, i always use

window = bpy.context.window_manager.windows[0]
with bpy.context.temp_override(window=window):
    mycode

because when querying current window. blender will say None since not compatible with current window (qt)

some operators need more context parameters, then just add them to the override. e.g.

window = bpy.context.window_manager.windows[0]
with bpy.context.temp_override(window=window, object=obj, active_object=obj):
    mycode

but ideally avoid ever using operators. they suck and make hard bugs. almost anything can be done without operators with a bit more work from your side.

hannesdelbeke commented 1 year ago

this now lives in the wiki page

https://github.com/techartorg/bqt/wiki/Operator-issues