微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Blender-使用bpy插入一行文本

如何解决Blender-使用bpy插入一行文本

我正在为Blender 2.80插件设计一个简单的GUI。我创建了一个对话框以输入一些数据:

enter image description here

class ExportFDSCloudHPC(Operator):

    bl_idname = "..."
    bl_label = "Dialog Box"
    bl_description = "..."

    data1 = bpy.props.StringProperty(
        name = "Data 1",default = "..."
    )

    data2 = bpy.props.StringProperty(
        name = "Data 2",default = "..."
    )

    data3 = bpy.props.StringProperty(
        name = "Data 3",default = "..."
    )
    
    def draw(self,context):
        col = self.layout.column(align = True)
        col.prop(self,"data1")

        col = self.layout.column(align = True)
        col.prop(self,"data2")

        col = self.layout.column(align = True)
        col.prop(self,"data3")

    def execute(self,context):
        ...

我想在数据1上方添加一行文本,并显示一条与对话框长度相同的消息。有可能吗?

解决方法

在添加列时在label()中添加draw()

def draw(self,context):
    self.layout.label(text="text")
    col = self.layout.column(align = True)

这里是label documentation

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。