3.2
vs安装插件
搜一下就好
bl_info = {
"name" : "Test",
"author" : "test",
"description" : "",
"blender" : (2, 80, 0),
"version" : (0, 0, 1),
"location" : "View3D > N",
"warning" : "",
"category" : "Add Mesh"
}
import bpy
class ButtonOp(bpy.types.Operator):
bl_idname = "print.sddsdsdaa"
bl_label = "sssssssss"
def execute(self, context):
print("sssssssss")
return {'FINISHED'}
class CustomPanel(bpy.types.Panel):
bl_label = "Randddd"
bl_idname = "print.sddsdsdaa2211"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "ImportFBXTest"
def draw(self, context):
layout = self.layout
obj = context.object
row = layout.row()
row.operator(ButtonOp.bl_idname, text="Generate", icon="SPHERE")
_classes = [
ButtonOp,
CustomPanel
]
def register():
print("hello")
for cls in _classes:
bpy.utils.register_class(cls)
def unregister():
print("bye")
for cls in _classes:
bpy.utils.unregister_class(cls)
if __name__ == "__main__":
register()