def registerProps(): """ register all existing props """ types.Scene.prop_nb_slides = props.PointerProperty(type=PropNumberSlide) types.Scene.prop_custom_motion = props.PointerProperty( type=PropCustomMotion)
class PieMenuItem(_PieMenuItem, bpy.types.PropertyGroup): operator_arguments = props.CollectionProperty(type=OperatorArgument) shift = props.PointerProperty(type=PieMenuSubItem) ctrl = props.PointerProperty(type=PieMenuSubItem)
def register(): register_module(__name__) bpy.types.Object.lightprobe = p.PointerProperty(type=ProbeProperties) bpy.types.Scene.lightprobe = p.PointerProperty(type=SceneProperties)
def register(): utils.register_class(Mafia4ds_GlobalMeshProperties) utils.register_class(Mafia4ds_MeshPropertiesPanel) types.Object.MeshProps = props.PointerProperty( type=Mafia4ds_GlobalMeshProperties)
def register(): utils.register_class(Mafia4ds_GlobalMaterialProperties) utils.register_class(Mafia4ds_MaterialPropertiesPanel) types.Material.MaterialProps = props.PointerProperty(type = Mafia4ds_GlobalMaterialProperties)
class PieMenuPreferences(addongroup.AddonGroup, bpy.types.PropertyGroup if "." in __name__ else bpy.types.AddonPreferences): bl_idname = __package__ submodules = None menus = props.CollectionProperty(type=PieMenu) font_id = props.IntProperty(name="Font ID", default=0, min=0, get=font_id_get) # 読み込み専用 font_id_mono = props.IntProperty(name="Font ID Mono", default=1, min=0) # 読み込み専用 # 中心からアイコンの円の境界まで menu_radius = props.IntProperty(name="Menu Radius", default=30, min=10) menu_radius_center = props.IntProperty(name="Menu Radius Center", default=10, min=0) # submenuに切り替えた際に中心を変えない lock_menu_location = props.BoolProperty(name="Lock Menu Location", default=False) # Itemの上下の隙間がこれより狭いならmenu_radiusを広げる item_min_space = props.IntProperty(name="MenuItem Min Space", default=4, min=0) colors = props.PointerProperty(type=PieMenu_PG_Colors) """:type: PieMenu_PG_Colors""" draw_type = props.EnumProperty(name="Draw Type", description="Default draw type", items=[('SIMPLE', "Simple", ""), ('BOX', "Box", ""), ('CIRCLE', "Circle", ""), ('SIMPLE_BOX', "Simple - Box", ""), ('SIMPLE_CIRCLE', "Simple - Circle", "")], default='BOX') def reset_menus(self): self.menus.clear() pass def draw(self, context): layout = self.layout draw_install = False try: import pie_menu except: draw_install = True else: try: mod = importlib.import_module(".".join( __name__.split(".")[:-1])) except: draw_install = True else: if pie_menu.VERSION != mod.bl_info["version"]: draw_install = True if draw_install: dst = ops.WM_OT_pie_menu_module_install.install_path() row = layout.row() row.operator(ops.WM_OT_pie_menu_module_install.bl_idname, text="Install Module") row = layout.row() row.label("Install Path: " + dst) if ops.module_installed: row = layout.row() row.label("Restart Blender !", icon='ERROR') layout.separator() super().draw(context) return colors = self.colors column = layout.column() sp = column.split() col = sp.column() col.prop(self, "draw_type") col.prop(self, "menu_radius") col.prop(self, "menu_radius_center") col = sp.column() col.prop(self, "lock_menu_location") # col.prop(self, "item_min_space") # わざわざ設定する人もいないだろう col.prop(colors, "use_theme", "Use Current Theme") split = layout.split() column = split.column() sub = column.box().column() sub.prop(colors, "line") sub.prop(colors, "separator") sub.prop(colors, "pointer") sub.prop(colors, "pointer_outline") sub.prop(colors, "pie_sel") sub.prop(colors, "item_highlight") column = split.column() sub = column.box().column() sub.active = not colors.use_theme sub.label("Menu Back:") sub.prop(colors, "menu_inner", text="Inner") sub.prop(colors, "menu_show_shaded") sub2 = sub.column(align=True) sub2.active = colors.menu_show_shaded sub2.prop(colors, "menu_shadetop") sub2.prop(colors, "menu_shadedown") sub.prop(colors, "text") column = split.column() sub = column.box().column() sub.active = not colors.use_theme sub.label("Title:") sub.prop(colors, "title_outline", text="Outline") sub.prop(colors, "title_inner", text="Inner") sub.prop(colors, "title_inner_sel", text="Inner Sel") sub.prop(colors, "title_text", text="Text") sub.prop(colors, "title_text_sel", text="Text Sel") sub.prop(colors, "title_show_shaded") sub2 = sub.column(align=True) sub2.active = colors.title_show_shaded sub2.prop(colors, "title_shadetop") sub2.prop(colors, "title_shadedown") column = split.column() sub = column.box().column() sub.active = not colors.use_theme sub.label("Item:") sub.prop(colors, "item_outline", text="Outline") sub.prop(colors, "item_inner", text="Inner") sub.prop(colors, "item_inner_sel", text="Inner Sel") sub.prop(colors, "item_text", text="Text") sub.prop(colors, "item_text_sel", text="Text Sel") sub.prop(colors, "item_show_shaded") sub2 = sub.column(align=True) sub2.active = colors.item_show_shaded sub2.prop(colors, "item_shadetop") sub2.prop(colors, "item_shadedown") column = split.column() sub = column.box().column() sub.active = not colors.use_theme sub.label("Tooltip:") sub.prop(colors, "tooltip_outline", text="Outline") sub.prop(colors, "tooltip_inner", text="Inner") sub.prop(colors, "tooltip_text", text="Text") sub.prop(colors, "tooltip_show_shaded") sub2 = sub.column(align=True) sub2.active = colors.tooltip_show_shaded sub2.prop(colors, "tooltip_shadetop") sub2.prop(colors, "tooltip_shadedown") draw_separator(layout) # Menus row = layout.row() row.label("Menus:") draw_menus(self, context, layout) draw_separator(layout) super().draw(context)