美文网首页
2022-02-15

2022-02-15

作者: 刘培强 | 来源:发表于2022-02-15 09:59 被阅读0次
    import bpy
    
    
    class HelloWorldPanel(bpy.types.Panel):   
        bl_label = "Hello World Panel"
        bl_idname = "OBJECT_PT_hello"
        bl_space_type = 'VIEW_3D'
        bl_region_type = 'UI'
        bl_category = "My panel"
        #bl_context = "object"
    
        def draw(self, context):
            layout = self.layout
    
            obj = context.object
            box = layout.box()
            row = box.row()
    
            
            row.label(text="Hello world!", icon='WORLD_DATA')
    
            row = box.row()
            row.label(text="Active object is: " + obj.name)
            
            row = box.row()
            row.prop(obj, "name")
    
            row = box.row()
            row.operator("mesh.primitive_cube_add")
            
            
            
            row = box.row()
            #row.prop(animation_settings, "animated_trunk")
    
    
    def register():
        bpy.utils.register_class(HelloWorldPanel)
    
    
    def unregister():
        bpy.utils.unregister_class(HelloWorldPanel)
    
    
    if __name__ == "__main__":
        register()
    
    

    相关文章

      网友评论

          本文标题:2022-02-15

          本文链接:https://www.haomeiwen.com/subject/kmbklrtx.html