Exemplo n.º 1
0
def register():
    bpy.utils.register_module(__name__)

    from . import translations
    bpy.app.translations.register(__name__, translations.translations)

    bpy.types.INFO_MT_file_import.append(menu_func_import)
    bpy.types.INFO_MT_file_export.append(menu_func_export)
    bpy.types.MESH_MT_shape_key_specials.append(menu_func_shapekeys)
    bpy.types.TEXT_MT_edit.append(menu_func_textedit)
    hook_scene_update()
    bpy.app.handlers.load_post.append(scene_load_post)
    scene_update_post.append(scene_load_post)  # handles enabling the add-on after the scene is loaded

    try:
        bpy.ops.wm.addon_disable('EXEC_SCREEN', module="io_smd_tools")
    except:
        pass

    def make_pointer(prop_type):
        return PointerProperty(name=get_id("settings_prop"), type=prop_type)

    bpy.types.Scene.vs = make_pointer(ValveSource_SceneProps)
    bpy.types.Object.vs = make_pointer(ValveSource_ObjectProps)
    bpy.types.Armature.vs = make_pointer(ValveSource_ArmatureProps)
    bpy.types.Group.vs = make_pointer(ValveSource_GroupProps)
    bpy.types.Mesh.vs = make_pointer(ValveSource_MeshProps)
    bpy.types.SurfaceCurve.vs = make_pointer(ValveSource_SurfaceProps)
    bpy.types.Curve.vs = make_pointer(ValveSource_CurveProps)
    bpy.types.Text.vs = make_pointer(ValveSource_TextProps)
Exemplo n.º 2
0
def hook_scene_update():
    if not scene_update in scene_update_post:
        scene_update_post.append(scene_update)
Exemplo n.º 3
0
def AddHandler():
    RemoveHandler()
    #load the scene update handler
    scene_update_post.append(frame_handler)
    driver_namespace[handler_key] = frame_handler
Exemplo n.º 4
0
def hook_scene_update():
    if not scene_update in scene_update_post:
        scene_update_post.append(scene_update)
Exemplo n.º 5
0
def register():
    scene_update_post.append(update)