Misleading TypeError message when registering CollectionProperty wtihout kwarg "type" #40191

Closed
opened 2014-05-14 09:02:46 +02:00 by CodeManX · 7 comments
Member
>>> 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".

``` >>> 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".
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @CodeManX

Added subscriber: @CodeManX
Bastien Montagne self-assigned this 2014-05-14 13:24:29 +02:00

This whole props doc needs cleanup ;)

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!

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!

This issue was referenced by blender/blender@6b2689c3f2

This issue was referenced by blender/blender@6b2689c3f2d2e0c4c684662de805440e48a2d67e

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit blender/blender@6b2689c3f2.

Closed by commit blender/blender@6b2689c3f2.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#40191
No description provided.