Ejemplo n.º 1
0
def on_load_post(context):
    global appended_py_paths

    global context_screen
    context_screen = bpy.context.screen

    props.init_properties_on_load()
    reload_blend_data()

    bpy.ops.arm.sync_proxy()

    wrd = bpy.data.worlds['Arm']
    wrd.arm_recompile = True
    arm.api.drivers = dict()

    # Load libraries
    if os.path.exists(arm.utils.get_fp() + '/Libraries'):
        libs = os.listdir(arm.utils.get_fp() + '/Libraries')
        for lib in libs:
            if os.path.isdir(arm.utils.get_fp() + '/Libraries/' + lib):
                fp = arm.utils.get_fp() + '/Libraries/' + lib
                if fp not in appended_py_paths and os.path.exists(fp + '/blender.py'):
                    appended_py_paths.append(fp)
                    sys.path.append(fp)
                    import blender
                    importlib.reload(blender)
                    blender.register()
                    sys.path.remove(fp)

        # Register newly added nodes and node categories
        arm.nodes_logic.register_nodes()

    # Show trait users as collections
    arm.utils.update_trait_collections()
    props.update_armory_world()
Ejemplo n.º 2
0
def on_load_post(context):
    global context_screen
    context_screen = bpy.context.screen

    props.init_properties_on_load()
    reload_blend_data()

    bpy.ops.arm.sync_proxy()

    wrd = bpy.data.worlds['Arm']
    wrd.arm_recompile = True
    arm.api.remove_drivers()

    load_py_libraries()

    # Show trait users as collections
    arm.utils.update_trait_collections()
    props.update_armory_world()