I am having some trouble. Basically, when I load up this script, I see a panel drawn with a simple value that can be changed.

The value shows as expected in the UI, and the propertygroup I see exists as expected under bpy.data.scenes['Scene']['PerspectiveSettings'], but not the LineCount value. My expectation is that when the PropertyGroup is registered, it would register the properties with their default values (not sure if this is a correct expectation or not)

Is there anything I can do to initialize the LineCount property under bpy.data.scenes['Scene']['PerspectiveSettings'].['LineCount'] on startup?

    import bpy
    from bpy.props import PointerProperty, EnumProperty
    class PERSPECTIVETOOLSPANEL_PT_main(bpy.types.Panel):
        bl_idname = "PERSPECTIVEGRID_PT_main.panel"
        bl_label = "Dummy Panel"
        bl_space_type = "VIEW_3D"
        bl_region_type = "UI"
        bl_category = "DummyTest"

    def draw(self, context):
        scene = context.scene
        layout = self.layout
        PerspectiveSettings = context.scene.PerspectiveSettings
        row1 = layout.row()
        row1.prop(PerspectiveSettings, "LineCount", text="Line Count")

class PerspectiveSettings(bpy.types.PropertyGroup):
    LineCount : bpy.props.IntProperty(
        name = "LineCount",
        description = "",
        default = 20,
        min = 1,
        max = 100

def register():
    bpy.types.Scene.PerspectiveSettings = bpy.props.PointerProperty(type=PerspectiveSettings)

def unregister():
    del bpy.types.Scene.PerspectiveSettings

if __name__ == '__main__':
  • $\begingroup$ This may help ? blender.stackexchange.com/a/227679/86891 $\endgroup$
    – Gorgious
    Aug 20, 2022 at 17:49
  • $\begingroup$ Unfortunately I don't think so, everything is drawn in the UI correctly, it just doesn't exist in blenders "insides" until the values are changed in the UI. $\endgroup$
    – NC_Sketchy
    Aug 21, 2022 at 15:20

1 Answer 1


Apparently this should be chalked up to my general lack of Python knowledge. After poking around in the Python Console I noticed that while


does not exist until the UI is modified. But,


DOES exist.

Why, no idea, but this appears to be it.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .