import bpy from bpy.props import * from bpy.app.translations import contexts as i18n_contexts class PropGroupTest(bpy.types.PropertyGroup): index: IntProperty(name="Index", default=0) class HelloWorldPanel(bpy.types.Panel): bl_label = "Hello World Panel" bl_idname = "OBJECT_PT_hello" bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "scene" def draw(self, context): layout = self.layout flow = layout.grid_flow() col = flow.column(align=True) col.label(text="Bool Property") col.prop(context.scene, "bool_property") col.prop(context.scene, "bool_property_context") col = flow.column(align=True) col.label(text="Bool Vector Property") col.prop(context.scene, "bool_vector_property") col.prop(context.scene, "bool_vector_property_context") col = flow.column(align=True) col.label(text="Collection Property") # col.label(text=context.scene.collection_property.name) col.prop(context.scene, "collection_property") # col.label(text=context.scene.collection_property_context.name) col.prop(context.scene, "collection_property_context") col = flow.column(align=True) col.label(text="Enum Property") col.prop(context.scene, "enum_property") col.prop(context.scene, "enum_property_context") col = flow.column(align=True) col.label(text="Float Property") col.prop(context.scene, "float_property") col.prop(context.scene, "float_property_context") col = flow.column(align=True) col.label(text="Float Vector Property") col.prop(context.scene, "float_vector_property") col.prop(context.scene, "float_vector_property_context") col = flow.column(align=True) col.label(text="Int Property") col.prop(context.scene, "int_property") col.prop(context.scene, "int_property_context") col = flow.column(align=True) col.label(text="Int Vector Property") col.prop(context.scene, "int_vector_property") col.prop(context.scene, "int_vector_property_context") col = flow.column(align=True) col.label(text="Pointer Property") col.prop(context.scene, "pointer_property") col.prop(context.scene, "pointer_property_context") col = flow.column(align=True) col.label(text="String Property") col.prop(context.scene, "string_property") col.prop(context.scene, "string_property_context") def register(): bpy.utils.register_class(PropGroupTest) bpy.utils.register_class(HelloWorldPanel) bpy.types.Scene.bool_property = BoolProperty(name="Area") bpy.types.Scene.bool_property_context = BoolProperty(name="Area", translation_context=i18n_contexts.amount) bpy.types.Scene.bool_vector_property = BoolVectorProperty(name="Area") bpy.types.Scene.bool_vector_property_context = BoolVectorProperty(name="Area", translation_context=i18n_contexts.amount) bpy.types.Scene.collection_property = CollectionProperty(name="Area", type=PropGroupTest) bpy.types.Scene.collection_property_context = CollectionProperty(name="Area", translation_context=i18n_contexts.amount, type=PropGroupTest) bpy.types.Scene.enum_property = EnumProperty(name="Area", items=(("A", "A", "A"), ("B", "B", "B")), default="A") bpy.types.Scene.enum_property_context = EnumProperty(name="Area", translation_context=i18n_contexts.amount, items=(("A", "A", "A"), ("B", "B", "B")), default="A") bpy.types.Scene.float_property = FloatProperty(name="Area") bpy.types.Scene.float_property_context = FloatProperty(name="Area", translation_context=i18n_contexts.amount) bpy.types.Scene.float_vector_property = FloatVectorProperty(name="Area") bpy.types.Scene.float_vector_property_context = FloatVectorProperty(name="Area", translation_context=i18n_contexts.amount) bpy.types.Scene.int_property = IntProperty(name="Area") bpy.types.Scene.int_property_context = IntProperty(name="Area", translation_context=i18n_contexts.amount) bpy.types.Scene.int_vector_property = IntVectorProperty(name="Area") bpy.types.Scene.int_vector_property_context = IntVectorProperty(name="Area", translation_context=i18n_contexts.amount) bpy.types.Scene.pointer_property = PointerProperty(name="Area", type=PropGroupTest) bpy.types.Scene.pointer_property_context = PointerProperty(name="Area", translation_context=i18n_contexts.amount, type=PropGroupTest) bpy.types.Scene.string_property = StringProperty(name="Area") bpy.types.Scene.string_property_context = StringProperty(name="Area", translation_context=i18n_contexts.amount) if __name__ == "__main__": register()