5
$\begingroup$

I want to clarify that I know the use of bpy.app.handlers.

I have been wondering for some time what this handler is really for, what is its example of use? For what purpose?

I would like to have an example of this

$\endgroup$
2
  • 1
    $\begingroup$ if i understand this discussion developer.blender.org/D761 correctly, i would say (i don't know but i assume) that it is called if your blend file/add-on is called with another Blender version and might be incompatible so you can "upgrade" e.g. your data. $\endgroup$
    – Chris
    Aug 24, 2021 at 11:34
  • $\begingroup$ looking at github.com/dfelinto/blender/blob/master/intern/cycles/blender/… makes me wonder if it is intended so addons can self update or by some construct as code can be on home pages / git / etc might be handy. $\endgroup$
    – Peter
    Aug 26, 2021 at 14:49

1 Answer 1

4
+25
$\begingroup$

https://docs.blender.org/api/current/bpy.app.handlers.html#module-bpy.app.handlers

triggers an action after the versioning check that happens when blender launches (or the addon), for other variants those can be per frame render. The way i understand its a callback handler outwards to python getting out out of the c code.

its coded in here https://github.com/dfelinto/blender/blob/master/source/blender/python/intern/bpy_app_handlers.c

although i lost the location (you could do a text search over blendcers python code) there is some code that can set default versions for specific blender versions, so if some file is pre blender 2.5 you can overide the blender internal render for eve such stuff, or alter clamp values based upon blender executable, it offers some flexibility i believe towards upgrading blender. if something depends on some value, but trhough improvements of blender the value can be lower or higher then its possible to do it on this property (that rarely happens for addons though(blenders current code has no such overrides for generic addons, ea flipfluid, rigify, .. .. etc), though it is possible.

$\endgroup$
1
  • $\begingroup$ Yes thanks your right its better to put people to the right official sources, i put it in $\endgroup$
    – Peter
    Aug 27, 2021 at 7:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .