1
$\begingroup$

I created classes for a PropertyGroup and then attempted to register it in a register function.

class MyCustomPropertyGroup(bpy.types.PropertyGroup):
        #Property definitions here

def register():
        bpy.types.Scene.MyCustomProperty = bpy.types.PointerProperty(type = MyCustomPropertyGroup)

I’d followed multiple examples that suggested using PointerProperty to attach a PropertyGroup to be used in other classes, but I got the error type=bpy_struct__new__(type): expected a single argument and couldn't figure out how to get past this issue. Is this a valid function to use? I’ve tried with Blender 3.4.1 and even updated to 3.6.2 in hopes it was a bug to be resolved.

$\endgroup$

1 Answer 1

1
$\begingroup$

Turns out the function works properly if you’re actually using it. bpy.types.PointerProperty is a class. bpy.props.PointerProperty is the function to use.

$\endgroup$
1
  • 1
    $\begingroup$ Hehe I can relate, I've once lost quite a bit of time following a rabbit hole trying to solve the exact same bug to only then finally realize that was the problem. The error message could be improved I guess :) $\endgroup$
    – Gorgious
    Aug 28, 2023 at 9:35

You must log in to answer this question.

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