2
$\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

3
$\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$
2
  • 2
    $\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
    Commented Aug 28, 2023 at 9:35
  • $\begingroup$ I really wish they'd fix the error message on this. It happens so many times while I'm trying to actually get stuff done instead of wasting my time fiddling with sadistic naming conventions... $\endgroup$ Commented May 7 at 18:50

You must log in to answer this question.

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