bl_idname:面板的内部名称。是唯一的标识符,用于在Blender内部引用面板。通常以OBJECT_PT_为前缀,后跟一个描述性名称 bl_space_type:面板所在的编辑器类型,现在这个面板在3D视图编辑器中 bl_region_type:面板所在的区域类型 bl_category:面板所属的选项卡名称 class SimplePanel(bpy.types.Panel): bl_label = "...
菜单类 bl_idname 命名为 AAA_MT_menu_name,菜单是您在界面中找到的基于行的弹出窗口,一般都在窗口上部,例如window:菜单下拉列表。系统报错:不包含带前缀和后缀的"_MT_"?面板类 bl_idname 命名为 AAA_PT_panel_name,面板是界面操作最常用区域,例如 3D 视图右边变换操作部分。系统报错:不包含带前缀和...
bl_idname = 'scene.add_new_standoff' bl_label = 'New Standoff' bl_options = { "REGISTER", "UNDO" } def execute(self, context): name = "Standoff" standoff = context.scene.Standoff # <- set in standoff_props.register() collection = context.scene.collection obj = bpy.data.objects...
bl_space_type = "VIEW_3D" bl_region_type = "UI" bl_category = "DemoRack" class StandoffPanel(DemoRackPanel, Panel): bl_idname = "DEMORACK_PT_standoff_panel" bl_label = "Standoff" def draw(self, context): layout = self.layout standoff_data = context.scene.Standoff # <- set ...
bl_idname = 'TESTPANEL_PT_panel'bl_label = 'Testpanel'bl_space_type = 'VIEW_3D'bl_region_type = 'UI'bl_category = 'Testpanel'def draw(self, context):operator = self.layout.operator('context.object.transform_apply', text='Apply Scale')operator.scale = True operator.location = False op...
bl_idname = "object.unhide_set" bl_label = "Unhide Objects from render&viewport" def execute(self, context): bpy.ops.object.hide_render_clear_all() for obj in bpy.data.objects: obj.hide_viewport = False return {'FINISHED'} def register(): ...
= active: obj.location.y = active.location.y return {'FINISHED'} class OBJECT_OT_align_z(Operator): bl_idname = "object.align_z" bl_label = "对齐Z" bl_options = {'REGISTER', 'UNDO'} def execute(self, context): selected = context.selected_objects if len(selected) < 2: self....
bl_idname = "OBJECT_PT_rotate_90_y" bl_space_type = 'VIEW_3D' bl_region_type = 'UI' bl_category = 'Tool' def draw(self, context): layout = self.layout layout.operator("object.rotate_90_y", text="Rotate 90 Degrees Y")
bl_idname = 'test.operator'bl_label = 'test'添加具有“文本”名称的字符串属性:text: bpy.props.StringProperty(name = 'text',default = '')并定义一个“执行”函数,在调用运算符时运行:def execute(self, context):print(self.text)return {'FINISHED'} 此函数打印"文本"属性的值,我们将在调用...
bl_idname = "PANEL_new"#面板所在位置 bl_space_type = 'VIEW_3D'bl_region_type = 'UI'bl_category = "案例面板在这"def draw(self, context):layout = self.layout #第一行 row = layout.row()row.label(text="我是标签")#第二行 row.operator("mesh.primitive_twisted_torus_add")def ...