示例#1
0
def register():
    print("SD REGO BABY")
    addonprefs = create_addon_prefs(__package__, subaddon_names, subaddonprefs=subaddonprefs, addons=addons)
    register_class(addonprefs)
    print(addonprefs)
    print(addonprefs.bl_idname)
    handle_registration(True, addons)
示例#2
0
    def _teardown_classes(self):
        assert(self._class_store is not None)

        from bpy.utils import register_class
        for cls in self._class_store:
            register_class(cls)
        self._class_store = None
示例#3
0
def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)

    # Add "Extras" menu to the "Add Mesh" menu
    bpy.types.VIEW3D_MT_mesh_add.append(menu_func)
def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)

    bpy.types.VIEW3D_MT_curve_add.append(menu)
    bpy.types.VIEW3D_MT_edit_curve_context_menu.prepend(Simple_curve_edit_menu)
示例#5
0
def register_submodules(name, submodule_names):
    global preloaded_modules
    module = __import__(name=name, fromlist=submodule_names)
    submodules = [getattr(module, name) for name in submodule_names]
    for mod in submodules:

        # Look through the modules present when register was called. If this
        # module was already loaded, then reload it.
        if mod.__name__ in preloaded_modules:
            mod = importlib.reload(mod)

            # Prevent the module from getting reloaded more than once
            preloaded_modules.remove(mod.__name__)

        m = [(),()]
        if hasattr(mod, "classes_to_register"):
            m[0] = mod.classes_to_register
            for cls in mod.classes_to_register:
                register_class(cls)
        if hasattr(mod, "menus_to_register"):
            m[1] = mod.menus_to_register
            for menu in mod.menus_to_register:
                menu[0].append(menu[1])
        if hasattr(mod, "custom_properties_to_register"):
            for prop in mod.custom_properties_to_register:
                setattr(prop[0], prop[1], PointerProperty(type=prop[2]))
        if m[0] or m[1]:
            registered_submodules.append(m)
def register_visualiser_groups():

    vis = EnumProperty(items=(
            ("GRID", "Grid", "Create Grid Visualiser from Multi Selection"),
            ("SPIRAL", "Spiral", "Spirals, (flat, fibonacci)"),
            ("SOUNDSURFACE", "SoundSurface", "Create Sound Surface Disp Map"),
            ("CURVESURFACE", "Curve Surface", "Create Curves from Action"),
            ),
            name="Visualiser Type",
            default="GRID",
            description="Create Sound Visualisers",
            )

    bpy.types.WindowManager.visualiser_type = vis
    # Visualiser Groups

    # Grid Visualiser

    vis_prop_dic = {}

    from_channel = StringProperty(default="AA")
    to_channel = StringProperty(default="AA")
    from_target = StringProperty(default="None")
    to_target = StringProperty(default="None")
    name = StringProperty(default="Visualiser")

    vis_prop_dic["name"] = name
    vis_prop_dic["from_channel"] = from_channel
    vis_prop_dic["to_channel"] = to_channel
    vis_prop_dic["from_target"] = from_target
    vis_prop_dic["to_target"] = to_target

    scale = FloatProperty(default=1.0, name="Visualiser Scale",
                          options={'SKIP_SAVE'},
                          description="Scale the Visualiser")
    vis_prop_dic["type"] = vis
    vis_prop_dic["scale"] = scale

    rows = IntProperty(default=1, options={'SKIP_SAVE'})
    cols = IntProperty(default=1, options={'SKIP_SAVE'})
    offset = FloatVectorProperty(default=(1.0, 1.0, 0.0), size=3,
                                 options={'SKIP_SAVE'},
                                 update=re_offset)
    translate = FloatVectorProperty(size=3, options={'SKIP_SAVE'})

    prop_dic = vis_prop_dic
    prop_dic["rows"] = rows
    prop_dic["cols"] = cols
    prop_dic["offset"] = offset

    GridVis = type("GridVis", (PropertyGroup,), prop_dic)
    register_class(GridVis)

    prop_dic = {}
    prop_dic["grids"] = CollectionProperty(type=GridVis)

    Visualisers = type("Visualisers", (PropertyGroup,), prop_dic)
    register_class(Visualisers)

    bpy.types.Scene.visualisers = PointerProperty(type=Visualisers)
示例#7
0
def register():
    from bpy.utils import register_class    
    for cls in classes:
        register_class(cls)
        
    bpy.types.Scene.atom_cluster = bpy.props.PointerProperty(type=
                                                  CLASS_atom_cluster_Properties)
    bpy.types.VIEW3D_MT_mesh_add.append(DEF_menu_func)
示例#8
0
def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)

    bpy.types.GRAPH_MT_channel.append(menu_func)
    bpy.types.DOPESHEET_MT_channel.append(menu_func)
    bpy.types.VIEW3D_MT_curve_add.append(menu)
def register():
    register_class(VIEW3D_PIE_template)
    register_class(PieMenuDriverPopup)
    wm = bpy.context.window_manager
    kc = wm.keyconfigs.addon
    if kc:
        km = wm.keyconfigs.addon.keymaps.new(name='3D View', space_type='VIEW_3D')
        kmi = km.keymap_items.new("wm.call_menu_pie", type='D', value='PRESS', ctrl=True)
        kmi.properties.name = "VIEW3D_PIE_template"
        addon_keymaps.append((km, kmi))
示例#10
0
def register():
	from bpy.utils import register_class
	for cls in classes:
		register_class(cls)
	
	bpy.types.TOPBAR_MT_file_import.append(menu_func_import_agr)
	bpy.types.TOPBAR_MT_file_import.append(menu_func_import_cam)
	bpy.types.TOPBAR_MT_file_export.append(menu_func_export_cam)
	bpy.types.TOPBAR_MT_file_import.append(menu_func_import_bvh)
	bpy.types.TOPBAR_MT_file_export.append(menu_func_export_bvh)
示例#11
0
def register():
    from bpy.utils import register_class
    for mod in _modules_loaded:
        for cls in mod.classes:
            register_class(cls)

    # space_userprefs.py
    from bpy.props import (
        EnumProperty,
        StringProperty,
    )
    from bpy.types import WindowManager

    def addon_filter_items(self, context):
        import addon_utils

        items = [
            ('All', "All", "All Add-ons"),
            ('User', "User", "All Add-ons Installed by User"),
            ('Enabled', "Enabled", "All Enabled Add-ons"),
            ('Disabled', "Disabled", "All Disabled Add-ons"),
        ]

        items_unique = set()

        for mod in addon_utils.modules(refresh=False):
            info = addon_utils.module_bl_info(mod)
            items_unique.add(info["category"])

        items.extend([(cat, cat, "") for cat in sorted(items_unique)])
        return items

    WindowManager.addon_search = StringProperty(
        name="Search",
        description="Search within the selected filter",
        options={'TEXTEDIT_UPDATE'},
    )
    WindowManager.addon_filter = EnumProperty(
        items=addon_filter_items,
        name="Category",
        description="Filter add-ons by category",
    )

    WindowManager.addon_support = EnumProperty(
        items=[
            ('OFFICIAL', "Official", "Officially supported"),
            ('COMMUNITY', "Community", "Maintained by community developers"),
            ('TESTING', "Testing", "Newly contributed scripts (excluded from release builds)")
        ],
        name="Support",
        description="Display support level",
        default={'OFFICIAL', 'COMMUNITY'},
        options={'ENUM_FLAG'},
    )
示例#12
0
def register():
    register_module(__name__)
    register_class(GameObjectProperty)

    Object.component_import_path = StringProperty()
    Object.component_properties = bpy.props.CollectionProperty(type=GameObjectProperty)

    handlers.append(TextBlockMonitor(REQUIRED_FILE_NAMES))
    handlers.append(ScenePropMonitor(MAINLOOP_FILE_NAME))

    for handler in handlers:
        handler.install()
def reg_screen_action_bgl():
    def index(self):
        sp = self.name.split("_")
        return int(sp[-1])

    def area(self):
        return self.id_data.areas[self.area_index]

    prop_dic = {
        "loc": IntVectorProperty(size=2, default=(0, 24), min=0),
        "color": FloatVectorProperty(subtype="COLOR_GAMMA", size=4),
        "height": IntProperty(
            default=20,
            min=10,
            max=100,
            step=1,
            subtype="PERCENTAGE",
            description="Height (Percent of View)",
            update=update_graph,
        ),
        "use_fcurve_colors": BoolProperty(default=True),
        "is_enabled": BoolProperty(default=True, description="Enable SoundVis for this Area"),
    }

    action_bgl_props = type("ActionBGL", (PropertyGroup,), prop_dic)
    register_class(action_bgl_props)
    # sa = SupportedAreas()

    propdic = {
        "area_index": property(index),
        "area": property(area),
        "area_type": StringProperty(default="VIEW3D"),  # change to ENUM
        "action_name": StringProperty(default=""),
        "use_active_action": BoolProperty(default=True),
        "channel_name": StringProperty(),
        "action": property(get_action, set_action),
        "VIEW_3D": PointerProperty(type=action_bgl_props),
        "GRAPH_EDITOR": PointerProperty(type=action_bgl_props),
        "NLA_EDITOR": PointerProperty(type=action_bgl_props),
        "SEQUENCE_EDITOR": PointerProperty(type=action_bgl_props),
        # "CONSOLE": PointerProperty(type=action_bgl_props), # for testing UI
        "TIMELINE": PointerProperty(type=action_bgl_props),
    }

    def get_sda_current(self):
        return ScreenAreaAction(self)

    SD_AreaSettings = type("SD_AreaSettings", (bpy.types.PropertyGroup,), propdic)
    bpy.utils.register_class(SD_AreaSettings)
    bpy.types.Screen.sound_driver_areas = CollectionProperty(type=SD_AreaSettings)
    bpy.types.Context.sound_vis_areas = property(get_sda_current)
示例#14
0
def register():
    register_class(SpeakerToolsAddonPreferences)
    sounddriver.register()
    driver_panels.register()
    speaker.register()
    sound.register()
    visualiser.register()
    Equalizer.register()
    EqMenu.register()
    NLALipsync.register()
    presets.register()
    graph.register()
    BGL_draw_visualiser.register()
    filter_playback.register()
def register():
    register_class(DriversManagerPanel)
    
    register_class(EditDriverPanel)
    propdic = { 
                "bl_space_type" :  'VIEW_3D',
                "bl_region_type" :  'TOOLS',
                "bl_category" :  "Drivers",
                
                }
    for collection in bpy_collections:
        propdic["collection"] = collection
        bl_idname = "SD_%s_Panel" % collection
        propdic["bl_idname"] = bl_idname

        col_ui_list = type("SD_%s_ui_list" % collection, (DRIVER_UL_driven_objects,), {})
        x = type(bl_idname, (DriverCollectionPanel,), propdic)
        register_class(x)
        register_class(col_ui_list)
    
      
    def get_dm(self):
        
        dns = bpy.app.driver_namespace
        return dns.get("DriverManager")
    
    bpy.types.Context.driver_manager = property(get_dm)
def register():
    bpy.types.WindowManager.bgl_draw_speaker = BoolProperty(
        update=start, name="Draw Details", default=False, description="Show BGL Visualiser"
    )
    register_class(BGLDrawSpeaker)
    register_class(BGL_Draw_VisualiserPanel)
    reg_screen_action_bgl()
    register_class(ScreenActionOperator)
    register_class(SelectScreenAreaOperator)

    for t in ["GRAPH_EDITOR", "VIEW_3D", "SEQUENCE_EDITOR", "NLA_EDITOR"]:
        propdic = {"bl_space_type": t}
        SettingsPanel = type("SD_SoundVis_PT_%s" % t, (SoundVisAreaPanel,), propdic)
        settings_panels.append(SettingsPanel)
        register_class(SettingsPanel)
def unregister():
    unregister_class(ClosePopupWindow)
    unregister_class(OBJECT_OT_speaker_add)
    from bpy.types import OBJECT_OT_speaker_add as AddSpeaker
    # re-register the old one
    register_class(AddSpeaker)
    unregister_class(SpeakerDataPanel)
    unregister_class(SpeakerSelectorOperator)
    unregister_class(ContextSpeakerSelectMenu)
    bpy.types.PROPERTIES_HT_header.remove(sd_popout)
    # remove property defs
    del(bpy.types.Speaker.vismode)
    del(bpy.types.Speaker.channels)
    del(bpy.types.Speaker.is_context_speaker)
    del(bpy.types.Scene.soundspeakers)
示例#18
0
def register():
    bpy.types.Speaker.is_context_speaker = BoolProperty(
        name="ContextSpeaker", description="(Un)Set context Speaker", default=False, update=toggle_context_speaker
    )
    bpy.types.PROPERTIES_HT_header.append(sd_popout)
    register_class(ClosePopupWindow)
    register_class(OBJECT_OT_speaker_add)
    register_class(SpeakerDataPanel)
    register_class(SpeakerSelectorOperator)
示例#19
0
def regdic():
    propdic = {
        "data_dic": StringProperty(),
        "index": property(get_value("index")),
        "instrument": property(get_value("instrument")),
        "is_selected": BoolProperty(default=False),
    }

    SD_MIDIFileTrack = type("SD_MIDIFileTrack", (PropertyGroup,), propdic)
    register_class(SD_MIDIFileTrack)

    propdic = {"filepath": StringProperty(subtype="FILE_PATH"), "tracks": CollectionProperty(type=SD_MIDIFileTrack)}

    SD_MIDIFile = type("SD_MIDIFile", (PropertyGroup,), propdic)
    register_class(SD_MIDIFile)

    bpy.types.Sound.midifile = PointerProperty(type=SD_MIDIFile)
示例#20
0
def register():
    for cls in classes:
        register_class(cls)

    Scene.cs_properties = PointerProperty(
        name="cs_properties",
        type=CSSceneProperties,
        description="All the scene properties needed for the add-on CubeSter"
    )

    Object.cs_properties = PointerProperty(
        name="cs_properties",
        type=CSObjectProperties,
        description="All the object properties needed for the add-on CubeSter"
    )

    app.handlers.frame_change_pre.append(frame_handler)
def register():
    bpy.types.Speaker.vismode = EnumProperty(items=vismode_panel_items,
                                name="SoundDriver",
                                description="Panel Filters",
                                options={'HIDDEN', 'ENUM_FLAG'})



    bpy.types.Speaker.is_context_speaker = BoolProperty(name="ContextSpeaker",
                                           description="(Un)Set context Speaker",
                                           default=False,
                                           update=toggle_context_speaker)
    bpy.types.PROPERTIES_HT_header.append(sd_popout)
    register_class(ClosePopupWindow)
    register_class(OBJECT_OT_speaker_add)
    register_class(SpeakerDataPanel)
    register_class(SpeakerSelectorOperator)
    register_class(ContextSpeakerSelectMenu)
def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)

    bpy.types.Scene.mhTabs = bpy.props.EnumProperty(
    name='meshOrBoneOrKinect',
    items = (
             (MESH_TAB  , "Mesh"  , "Operators related to Make Human meshes"),
             (BONE_TAB  , "Rig"  , "IK & other bone operators on Make Human skeletons"),
             (KINECT_TAB, "Kinect", "Motion Capture using Kinect V2 for converted Make Human meshes"),
        ),
    default = MESH_TAB
)

    registerImporterConstantsAndSettings()
    registerBoneConstantsAndSettings()
    registerKinectConstantsAndSettings()
示例#23
0
def register():
    #bpy.types.
    bpy.types.WindowManager.bgl_draw_speaker = BoolProperty(update=start,
                                                             name="Draw Details",
                                                             default=False,
                                                             description="Show BGL Visualiser")
    register_class(BGLDrawSpeaker)
    register_class(BGL_Draw_VisualiserPanel)
    reg_screen_action_bgl()
    register_class(ScreenActionOperator)
    register_class(SelectScreenAreaOperator)
def make_op(spaces):
    items = []
    propdic = {}

    for space in spaces:
        enum, name, desc = space.item
        items.append(space.item)
        # make a pointer from the enum.lower()
        gp = type("%sGroup" % enum, (PropertyGroup,), space.props)
        register_class(gp)
        propdic[enum.lower()] = PointerProperty(type=gp)

    propdic["space"] = EnumProperty(items=items, name="space", default="SPHERICAL", description="Use space")
    propdic["scale"] = FloatVectorProperty(
        name="scale", default=(1.0, 1.0, 1.0), subtype="TRANSLATION", description="scaling"
    )
    return type(
        "OBJECT_OT_add_object_using_space", (OBJECT_OT_add_object_using_space, Operator, AddObjectHelper), propdic
    )
示例#25
0
def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)
    
    add_curve_simple.register()
    add_curve_spirals.register()
    add_curve_aceous_galore.register()
    add_curve_torus_knots.register()
    add_curve_braid.register()
    add_curve_celtic_links.register()
    add_curve_curly.register()
    add_curve_spirofit_bouncespline.register()
    add_surface_plane_cone.register()
    
    # Add "Extras" menu to the "Add Curve" menu
    bpy.types.VIEW3D_MT_curve_add.append(menu_func)
    # Add "Extras" menu to the "Add Surface" menu
    bpy.types.VIEW3D_MT_surface_add.append(menu_surface)
示例#26
0
def register():
    from bpy.utils import register_class
    from . import ui
    from . import properties
    from . import presets
    import atexit

    # Make sure we only registered the callback once.
    atexit.unregister(engine_exit)
    atexit.register(engine_exit)

    engine.init()

    properties.register()
    ui.register()
    presets.register()

    for cls in classes:
        register_class(cls)

    bpy.app.handlers.version_update.append(version_update.do_versions)
示例#27
0
def register():
    bpy.types.Speaker.is_context_speaker = BoolProperty(name="ContextSpeaker",
                                           description="(Un)Set context Speaker",
                                           default=False,
                                           update=toggle_context_speaker)
    register_class(OBJECT_OT_speaker_add)
    register_class(SpeakerDataPanel)
    register_class(SpeakerSelectorOperator)
示例#28
0
文件: UI.py 项目: PorisulkiP/GPUCloth
def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)

    bpy.types.Scene.my_tool = PointerProperty(type=GPUCloth_Settings)
示例#29
0
def register():
    from bpy.utils import register_class
    register_class(ImportWoWOBJ)
    bpy.types.TOPBAR_MT_file_import.append(menu_func_import)
示例#30
0
def register():
    for c in cls:
        register_class(c)
    bpy.app.handlers.load_post.append(vpt_handler)
def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)
    bpy.types.TOPBAR_MT_file_import.append(menu_import_draw)
    bpy.types.TOPBAR_MT_file_export.append(menu_export_draw)
示例#32
0
def ui_register():
    for cl in classes:
        register_class(cl)
def register():
    for x in classes:
        register_class(x)
示例#34
0
def register():
    for cls in classes:
        register_class(cls)
示例#35
0
def register():
    for _ in classes:
        register_class(_)
    bpy.types.Object.actions_to_egg = bpy.props.PointerProperty(
        type=EGG_object_properties)
示例#36
0
def register():
    for x in classes:
        register_class(x)

    nodeitems_utils.register_node_categories('RENIM_MAPPING_NODES',
                                             node_categories)
示例#37
0
def register():
    from bpy.utils import register_class
    register_class(FPG_PT_ui)
示例#38
0
def register():
    lol.register()
    keymaps.register()

    for cls in classes:
        register_class(cls)
示例#39
0
 def plug_in(cls):
     register_class(cls)
     bpy.types.NODE_MT_editor_menus.append(menu_func_export)
示例#40
0
class MATERIAL_PT_freestyle_line(MaterialFreestyleButtonsPanel, Panel):
    bl_label = "Freestyle Line"
    bl_options = {'DEFAULT_CLOSED'}
    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}

    def draw(self, context):
        layout = self.layout

        mat = context.material

        row = layout.row()
        row.prop(mat, "line_color", text="")
        row.prop(mat, "line_priority", text="Priority")


classes = (
    RENDER_PT_freestyle,
    VIEWLAYER_UL_linesets,
    RENDER_MT_lineset_context_menu,
    VIEWLAYER_PT_freestyle,
    VIEWLAYER_PT_freestyle_lineset,
    VIEWLAYER_PT_freestyle_linestyle,
    MATERIAL_PT_freestyle_line,
)

if __name__ == "__main__":  # only for live edit.
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)
示例#41
0
def register():
    register_class(SUP_PT_main_panel)
    bpy.types.OUTLINER_HT_header.prepend(SUP_PT_main_panel.draw_button)
示例#42
0
def register():
    from bpy.utils import register_class

    register_class(types.SEAddonPreferences)
    register_class(types.SESceneProperties)
    register_class(types.SEObjectProperties)
    register_class(types.SEMaterialProperties)

    bpy.types.Object.space_engineers = bpy.props.PointerProperty(
        type=types.SEObjectProperties)
    bpy.types.Scene.space_engineers = bpy.props.PointerProperty(
        type=types.SESceneProperties)
    bpy.types.Material.space_engineers = bpy.props.PointerProperty(
        type=types.SEMaterialProperties)

    register_class(types.DATA_PT_spceng_scene)
    register_class(types.DATA_PT_spceng_empty)
    register_class(types.DATA_PT_spceng_material)

    register_class(export.ExportSceneAsBlock)
    register_class(export.UpdateDefinitionsFromBlockScene)
    register_class(types.CheckVersionOnline)
    register_class(mount_points.AddMountPointSkeleton)
    register_class(mount_points.SetupGrid)

    register_class(SEView3DToolsPanel)

    mount_points.enable_draw_callback()
def register():
    from bpy.utils import register_class
    register_class(export_cn6)

    bpy.types.TOPBAR_MT_file_export.append(menu_func)
示例#44
0
def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)
    bpy.types.VIEW3D_MT_mesh_add.append(menu_func_rocks)
def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)
    bpy.types.Scene.serialtool = PointerProperty(type=SerialProperties)
示例#46
0
def register():
    for c in classes:
        register_class(c)
    
    Scene.rock_gen_props = PointerProperty(type=RockGeneratorProperties)
def register():
    register_class(FREEZE_TRANSFORM_OT_freeze)
    register_class(FREEZE_TRANSFORM_OT_to_fozen)
    register_class(FREEZE_TRANSFORM_OT_reset_transform)
示例#48
0
    extrusion_vs_cage = EnumProperty(name="Extrusion vs Cage",
                                     description="",
                                     default="EXT",
                                     items=[('EXT', '', 'Extrusion',
                                             'OUTLINER_DATA_META', 0),
                                            ('CAGE', '', 'Cage',
                                             'OUTLINER_OB_LATTICE', 1)])
    extrusion = bpy.props.FloatProperty(name="Extrusion",
                                        description="",
                                        default=0.5,
                                        min=0.0)
    use_hipoly = bpy.props.BoolProperty(name="Use Hipoly", default=True)
    no_materials = bpy.props.BoolProperty(name="No Materials", default=False)


register_class(BakePair)


class BakePass(bpy.types.PropertyGroup):
    activated = bpy.props.BoolProperty(name="Activated", default=True)
    pair_counter = bpy.props.IntProperty(name="Pair Counter",
                                         description="",
                                         default=0)
    pass_name = bpy.props.EnumProperty(
        name="Pass",
        default="NORMAL",
        items=(
            ("COMBINED", "Combined", ""),
            ("MAT_ID", "Material ID", ""),
            #("Z","Depth",""),
            #("COLOR","Color",""),
示例#49
0
def register():
    for cls in classes:
        register_class(cls)
    RENDER_PT_POV_radiosity.prepend(rad_panel_func)
def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)
示例#51
0
def register():
    from bpy.utils import register_class
    register_class(CUSTOM_OT_export_format)
    bpy.types.TOPBAR_MT_file_export.append(menuItemFunc_Export)
示例#52
0
def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)
    bpy.types.VIEW3D_MT_transform.append(add_button)
示例#53
0
def register():
    register_class(BISNodesToolsAddNodeGroupIO)
    register_class(BISNodesToolsVars)
    WindowManager.bis_nodes_tools_vars = PointerProperty(type=BISNodesToolsVars)
示例#54
0
文件: C_of_G.py 项目: nerk987/C_of_G
def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)
    # print("Add Handler")
    AddHandler()
示例#55
0
                sub = row.row(align=True)
                sub.active = rbc.use_spring_ang_x
                sub.prop(rbc, "spring_stiffness_ang_x", text="Stiffness")
                sub.prop(rbc, "spring_damping_ang_x", text="Damping")

                row = col.row(align=True)
                sub = row.row(align=True)
                sub.scale_x = 0.5
                sub.prop(rbc, "use_spring_ang_y", toggle=True, text="Y Angle")
                sub = row.row(align=True)
                sub.active = rbc.use_spring_ang_y
                sub.prop(rbc, "spring_stiffness_ang_y", text="Stiffness")
                sub.prop(rbc, "spring_damping_ang_y", text="Damping")

                row = col.row(align=True)
                sub = row.row(align=True)
                sub.scale_x = 0.5
                sub.prop(rbc, "use_spring_ang_z", toggle=True, text="Z Angle")
                sub = row.row(align=True)
                sub.active = rbc.use_spring_ang_z
                sub.prop(rbc, "spring_stiffness_ang_z", text="Stiffness")
                sub.prop(rbc, "spring_damping_ang_z", text="Damping")


classes = (PHYSICS_PT_rigid_body_constraint, )

if __name__ == "__main__":  # only for live edit.
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)
示例#56
0
def register():
    from bpy.utils import register_class
    for _class in _classes:
        register_class(_class)
def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)
 def plug_in(cls):
     register_class(cls)
示例#59
0
def register():
    register_class(Exporter)
    register_class(FileHeader)
    register_class(FileBody)
示例#60
0
def register():
    from bpy.utils import register_class

    # Sub-modules.
    ui.register()
    feature_set_list.register()
    metarig_menu.register()

    # Classes.
    for cls in classes:
        register_class(cls)

    # Properties.
    bpy.types.Armature.rigify_layers = CollectionProperty(
        type=RigifyArmatureLayer)

    bpy.types.Armature.active_feature_set = EnumProperty(
        items=feature_set_list.feature_set_items,
        name="Feature Set",
        description="Restrict the rig list to a specific custom feature set")

    bpy.types.PoseBone.rigify_type = StringProperty(
        name="Rigify Type", description="Rig type for this bone")
    bpy.types.PoseBone.rigify_parameters = PointerProperty(
        type=RigifyParameters)

    bpy.types.Armature.rigify_colors = CollectionProperty(type=RigifyColorSet)

    bpy.types.Armature.rigify_selection_colors = PointerProperty(
        type=RigifySelectionColors)

    bpy.types.Armature.rigify_colors_index = IntProperty(default=-1)
    bpy.types.Armature.rigify_colors_lock = BoolProperty(default=True)
    bpy.types.Armature.rigify_theme_to_add = EnumProperty(
        items=(('THEME01', 'THEME01', ''), ('THEME02', 'THEME02', ''),
               ('THEME03', 'THEME03', ''), ('THEME04', 'THEME04', ''),
               ('THEME05', 'THEME05', ''), ('THEME06', 'THEME06', ''),
               ('THEME07', 'THEME07', ''), ('THEME08', 'THEME08', ''),
               ('THEME09', 'THEME09', ''), ('THEME10', 'THEME10',
                                            ''), ('THEME11', 'THEME11', ''),
               ('THEME12', 'THEME12', ''), ('THEME13', 'THEME13',
                                            ''), ('THEME14', 'THEME14', ''),
               ('THEME15', 'THEME15', ''), ('THEME16', 'THEME16',
                                            ''), ('THEME17', 'THEME17', ''),
               ('THEME18', 'THEME18', ''), ('THEME19', 'THEME19',
                                            ''), ('THEME20', 'THEME20', '')),
        name='Theme')

    IDStore = bpy.types.WindowManager
    IDStore.rigify_collection = EnumProperty(
        items=(("All", "All", "All"), ),
        default="All",
        name="Rigify Active Collection",
        description="The selected rig collection")

    IDStore.rigify_types = CollectionProperty(type=RigifyName)
    IDStore.rigify_active_type = IntProperty(
        name="Rigify Active Type", description="The selected rig type")

    bpy.types.Armature.rigify_advanced_generation = BoolProperty(
        name="Advanced Options",
        description=
        "Enables/disables advanced options for Rigify rig generation",
        default=False)

    def update_mode(self, context):
        if self.rigify_generate_mode == 'new':
            self.rigify_force_widget_update = False

    bpy.types.Armature.rigify_generate_mode = EnumProperty(
        name="Rigify Generate Rig Mode",
        description=
        "'Generate Rig' mode. In 'overwrite' mode the features of the target rig will be updated as defined by the metarig. In 'new' mode a new rig will be created as defined by the metarig. Current mode",
        update=update_mode,
        items=(('overwrite', 'overwrite', ''), ('new', 'new', '')))

    bpy.types.Armature.rigify_force_widget_update = BoolProperty(
        name="Force Widget Update",
        description=
        "Forces Rigify to delete and rebuild all the rig widgets. if unset, only missing widgets will be created",
        default=False)

    bpy.types.Armature.rigify_target_rig = PointerProperty(
        type=bpy.types.Object,
        name="Rigify Target Rig",
        description=
        "Defines which rig to overwrite. If unset, a new one called 'rig' will be created",
        poll=lambda self, obj: obj.type == 'ARMATURE' and obj.data is not self)

    bpy.types.Armature.rigify_rig_ui = PointerProperty(
        type=bpy.types.Text,
        name="Rigify Target Rig UI",
        description=
        "Defines the UI to overwrite. If unset, 'rig_ui.py' will be used")

    bpy.types.Armature.rigify_rig_basename = StringProperty(
        name="Rigify Rig Name",
        description=
        "Defines the name of the Rig. If unset, in 'new' mode 'rig' will be used, in 'overwrite' mode the target rig name will be used",
        default="")

    IDStore.rigify_transfer_only_selected = BoolProperty(
        name="Transfer Only Selected",
        description="Transfer selected bones only",
        default=True)

    # Update legacy on restart or reload.
    if legacy_loaded or bpy.context.preferences.addons[
            'rigify'].preferences.legacy_mode:
        bpy.context.preferences.addons['rigify'].preferences.legacy_mode = True

    bpy.context.preferences.addons['rigify'].preferences.register_feature_sets(
        True)
    bpy.context.preferences.addons['rigify'].preferences.update_external_rigs()

    # Add rig parameters
    register_rig_parameters()