Ejemplo n.º 1
0
def register():
    from . import properties

    bpy.utils.register_module(__name__)

    # CUSTOM ICONS INITIALIZATION
    _icons.init()

    # PROPERTIES REGISTRATION
    bpy.types.Object.scs_object_look_inventory = CollectionProperty(
        type=properties.object.ObjectLooksInventoryItem)

    bpy.types.Object.scs_object_part_inventory = CollectionProperty(
        type=properties.object.ObjectPartInventoryItem)

    bpy.types.Object.scs_object_variant_inventory = CollectionProperty(
        type=properties.object.ObjectVariantInventoryItem)

    bpy.types.Object.scs_object_animation_inventory = CollectionProperty(
        type=properties.object.ObjectAnimationInventoryItem)

    bpy.types.World.scs_globals = PointerProperty(
        name="SCS Tools Global Variables",
        type=properties.world.GlobalSCSProps,
        description="SCS Tools global variables",
    )

    bpy.types.Object.scs_props = PointerProperty(
        name="SCS Tools Object Variables",
        type=properties.object.ObjectSCSTools,
        description="SCS Tools object variables",
    )

    bpy.types.Scene.scs_props = PointerProperty(
        name="SCS Tools Scene Variables",
        type=properties.scene.SceneSCSProps,
        description="SCS Tools scene variables",
    )

    bpy.types.Mesh.scs_props = PointerProperty(
        name="SCS Tools Mesh Variables",
        type=properties.mesh.MeshSCSTools,
        description="SCS Tools Mesh variables",
    )

    bpy.types.Material.scs_props = PointerProperty(
        name="SCS Tools Material Variables",
        type=properties.material.MaterialSCSTools,
        description="SCS Tools Material variables",
    )

    bpy.types.Action.scs_props = PointerProperty(
        name="SCS Tools Action Variables",
        type=properties.action.ActionSCSTools,
        description="SCS Tools Action variables",
    )

    # REGISTER DYNAMIC PROPERTIES
    properties.object_dynamic.register()
    properties.scene_dynamic.register()

    # PERSISTENT HANDLERS
    _persistent_callback.enable()

    # MENU REGISTRATION
    bpy.types.INFO_MT_file_import.append(menu_func_import)
    bpy.types.INFO_MT_file_export.append(menu_func_export)
    bpy.types.INFO_MT_add.prepend(add_menu_func)
Ejemplo n.º 2
0
def register():
    from . import properties

    bpy.utils.register_module(__name__)

    # CUSTOM ICONS CLEANUP
    _icons.init()

    # PROPERTIES REGISTRATION
    bpy.types.Object.scs_object_look_inventory = CollectionProperty(
        type=properties.object.ObjectLooksInventoryItem
    )

    bpy.types.Object.scs_object_part_inventory = CollectionProperty(
        type=properties.object.ObjectPartInventoryItem
    )

    bpy.types.Object.scs_object_variant_inventory = CollectionProperty(
        type=properties.object.ObjectVariantInventoryItem
    )

    bpy.types.Object.scs_object_animation_inventory = CollectionProperty(
        type=properties.object.ObjectAnimationInventoryItem
    )

    bpy.types.World.scs_shader_presets_inventory = CollectionProperty(
        type=properties.world.ShaderPresetsInventoryItem
    )

    bpy.types.World.scs_globals = PointerProperty(
        name="SCS Tools Global Variables",
        type=properties.world.GlobalSCSProps,
        description="SCS Tools global variables",
    )

    bpy.types.Object.scs_props = PointerProperty(
        name="SCS Tools Object Variables",
        type=properties.object.ObjectSCSTools,
        description="SCS Tools object variables",
    )

    bpy.types.Scene.scs_props = PointerProperty(
        name="SCS Tools Scene Variables",
        type=properties.scene.SceneSCSProps,
        description="SCS Tools scene variables",
    )

    bpy.types.Mesh.scs_props = PointerProperty(
        name="SCS Tools Mesh Variables",
        type=properties.mesh.MeshSCSTools,
        description="SCS Tools Mesh variables",
    )

    bpy.types.Material.scs_props = PointerProperty(
        name="SCS Tools Material Variables",
        type=properties.material.MaterialSCSTools,
        description="SCS Tools Material variables",
    )

    bpy.types.Action.scs_props = PointerProperty(
        name="SCS Tools Action Variables",
        type=properties.action.ActionSCSTools,
        description="SCS Tools Action variables",
    )

    # REGISTER DYNAMIC PROPERTIES
    properties.object_dynamic.register()
    properties.scene_dynamic.register()

    # PERSISTENT HANDLERS
    _persistent_callback.enable()

    # MENU REGISTRATION
    bpy.types.INFO_MT_file_import.append(menu_func_import)
    bpy.types.INFO_MT_file_export.append(menu_func_export)