0

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

在此处输入图像描述

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):
        ...

我想在 Data 1 上方添加一行文本,其中包含与对话框长度相同的消息。这是可能的?

4

1 回答 1

1

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

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

这是标签文档

于 2020-09-10T20:56:18.687 回答