Page MenuHome

Property registration using ":" does not work in simple "object" classes.
Closed, InvalidPublic

Description

Blender Version
Broken: 2.80

Short description of error
It seems that blender property registration using the ":" does not work for classes that are not blender specific, ie a simple 'object' class.
Blender cannot find the property registered this way, it will work fine if registered with an '=', however.

Exact steps for others to reproduce the error
Paste the following script in a text area, and run it:

import bpy

class TestClass(object):
    test: bpy.props.BoolProperty()

testclass = TestClass()
print(testclass.test)

Blender will complain:

AttributeError: 'TestClass' object has no attribute 'test'

Details

Type
Bug

Event Timeline

hudson barkley (snuq) closed this task as Invalid.Sat, Aug 10, 1:13 AM

sorry, i guess this isnt really a bug, more of a misunderstanding on my part.