0
$\begingroup$

Main question:

in my addon, i create a python-thread, for do not blocking UI. (1) its wrong?)

thread created on checkbox-"on", and destroyed on "off". problem when checkbox is "on". when i close blender, blender does not close :)

i find this solutioin, but not work for me, callback not fired

i need thread for "filewatch", and do something on os "file-modified" event

how can I solve this problem?

sub question

i have a class extends from bpy.types.PropertyGroup and

checkbox-property = bpy.props.BoolProperty(
    name="Switch",
    description="",
    default=False,
    update=checkbox_update_handler
)

default=false not work in some cases.

how i can set always false, when blender\or new file startup

Thanks!

$\endgroup$
  • $\begingroup$ Properties of the window manager are not saved, and will have their default at start up.ii) adding the following bl_options = {'SKIP_SAVE'} on an operator property, makes it return to default after use. (not sure if / how it works for other props. It's been my experience that threads and blender don't play well together if you are referencing blender data from the thread. Might find this recent post interesting on auto-updating changed text files. $\endgroup$ – batFINGER Jul 19 '18 at 12:45
  • $\begingroup$ @batFINGER i no have a "operators" on checkbox i use "update-callback" function. but i moved propertyGroup to WindowManager and it helps. Thank you $\endgroup$ – noadev Jul 19 '18 at 13:53
0
$\begingroup$

I found a solution also based on atexit, but thread need property daemon=True. Then python interpreter do not wait he will complete the work and fires atexit-callback

$\endgroup$

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.