Skip to content

ExecuteCustomScript

maybites edited this page Nov 8, 2022 · 2 revisions

screenshot

this datapath and format:

datapath: exec("f=bpy.data.texts['my_script'].as_module()\nf.my_function('{0}','{1}')")

format: address, args

is referencing the text object called 'my_script' with the function called 'my_function', passing on the address and the arguments array:

'''
functions used by message handlers
'''
import bpy
def my_function(address, args):
    
    print("my_function received :",address, args)