Page MenuHome

Python API overview sample code warning: class MyMaterialProps contains a property which should be an annotation!
Closed, ResolvedPublic

Description

System Information
Operating system: Windows 10
Graphics card: GeForce 1070

Blender Version
Broken: 2.81

Short description of error

The sample code in the Inter Class Dependencies section of the Python info overview produces warnings when run.

The first example produces:

Warning: class MyMaterialProps contains a property which should be an annotation!
E:\art\blender\scripting\BasicScripting.blend\CustomPropery:9
    assign as a type annotation: MyMaterialProps.my_float

The second example produces:

Warning: class MyMaterialSubProps contains a property which should be an annotation!
E:\art\blender\scripting\BasicScripting.blend\InterClassDependencies:12
    assign as a type annotation: MyMaterialSubProps.my_float
Warning: class MyMaterialGroupProps contains a property which should be an annotation!
E:\art\blender\scripting\BasicScripting.blend\InterClassDependencies:13
    assign as a type annotation: MyMaterialGroupProps.sub_group

Based on that error, it appears the example code needs to be updated per the Class Property Registration section in the Blender 2.80 Addon release notes from the wiki.

Exact steps for others to reproduce the error

Copy the code from Inter Class Dependencies into a Blender text window and then Run Script.