I’m trying to figure out how a PointerPropewrty works in blender. Regardless my effords, it doesnt show. Can anyone spot the error? Blender just tells me that the script got executed.
import bpy
from bpy.types import Operator
from bpy.props import FloatVectorProperty, FloatProperty, IntProperty, StringProperty, PointerProperty
from bpy_extras.object_utils import AddObjectHelper, object_data_add
bl_info = {
"name": "TEST",
"version": (1, 0),
"blender": (2, 80, 0),
"location": "View3D > Add > Mesh > TEST",
"category": "Add Mesh",
}
class QPIE_SectionSetting(bpy.types.PropertyGroup):
size: FloatProperty(
name="size",
description="size of this piece",
default=5.0,
)
def add_object(self, context):
pass
class OBJECT_OT_add_object(Operator):
"""Create a new Mesh Object"""
bl_idname = "mesh.add_object"
bl_label = "TEST"
bl_options = {'REGISTER', 'UNDO'}
r_inner: FloatProperty(
name="R inner",
description="inner radius",
default=0.5,
min=0.0,
)
valuelist: bpy.props.PointerProperty(
type=QPIE_SectionSetting,
)
def draw(self, context):
layout = self.layout
col = layout.column()
row = col.row()
row.prop(self, "r_inner")
box = layout.box()
box.prop(self, "valuelist")
def execute(self, context):
add_object(self, context)
return {'FINISHED'}
# Registration
def add_object_button(self, context):
self.layout.operator(
OBJECT_OT_add_object.bl_idname,
text="Add Piechart",
icon='PLUGIN')
def register():
bpy.utils.register_class(OBJECT_OT_add_object)
bpy.utils.register_class(QPIE_SectionSetting)
bpy.types.VIEW3D_MT_mesh_add.append(add_object_button)
def unregister():
bpy.utils.unregister_class(OBJECT_OT_add_object)
bpy.utils.unregister_class(QPIE_SectionSetting)
bpy.types.VIEW3D_MT_mesh_add.remove(add_object_button)
if __name__ == "__main__":
register()