I have a handler scene_update_pre
, and I need to run a script when a certain bone is selected. The script is saved as an internal text data block myscript.py
.
The problem is that I can't use any derivative of the context override method:
override = {'edit_text': bpy.data.texts['myscript.py']}
bpy.ops.text.run_script(override)
Because it's done in a scene_update_pre
handler it will crash Blender, correct?
What other methods are there to run an internal text data block?
bpy.data.texts["myscript.py"] #.run_script() #?
myscript
then running a function which it defines. $\endgroup$