Page MenuHome

Misleading TypeError message when registering CollectionProperty wtihout kwarg "type"
Closed, ResolvedPublic

Description

>>> bpy.types.Scene.coll = bpy.props.CollectionProperty(bpy.types.PropertyGroup)

Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
TypeError: Required argument 'attr' (pos 1) not found

Docs:

CollectionProperty(items, type="", description="", options={'ANIMATABLE'})

There is no "items" in fact, and the keyword argument for type uses "type " as key, not "attr".

Event Timeline

codemanx created this task.May 14 2014, 9:02 AM
codemanx raised the priority of this task from to 90.
codemanx updated the task description. (Show Details)
codemanx edited a custom field.
codemanx updated the task description. (Show Details)
codemanx added a subscriber: codemanx.
Bastien Montagne (mont29) lowered the priority of this task from 90 to Low.

This whole props doc needs cleanup ;)

Will commit a cleanup of doc of props (many things were missing, and a few ones were wrong). Please note though that it won't 'fix' exactly that report, there is some complex python magic here, and all the props funcs do have a first 'attr' parameter.

That’s why all parameters to these funcs must be passed as keywords!

Bastien Montagne (mont29) changed the task status from Unknown Status to Resolved.May 14 2014, 5:56 PM

Closed by commit rB6b2689c3f2d2.