Python API overview sample code warning: class MyMaterialProps contains a property which should be an annotation! #71877

Closed
opened 2019-11-25 04:10:37 +01:00 by Doug Richardson · 8 comments

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//.

**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 ](https://docs.blender.org/api/current/info_overview.html#inter-classes-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](https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Addons). **Exact steps for others to reproduce the error** Copy the code from [Inter Class Dependencies ](https:*docs.blender.org/api/current/info_overview.html#inter-classes-dependencies) into a Blender text window and then*Run Script//.

Added subscriber: @DougRichardson

Added subscriber: @DougRichardson

Added subscriber: @tintwotin

Added subscriber: @tintwotin

Yes, There are several things on that page which needs to be updated to 2.8+ syntax.

Yes, There are several things on that page which needs to be updated to 2.8+ syntax.

Added subscriber: @dfelinto

Added subscriber: @dfelinto

@tintwotin interested on tackling these?

@tintwotin interested on tackling these?

@dfelinto I'm sorry, I'm not a skilled enough coder for that.

@dfelinto I'm sorry, I'm not a skilled enough coder for that.
Bastien Montagne self-assigned this 2019-11-27 12:00:13 +01:00

This issue was referenced by eb798de101

This issue was referenced by eb798de101ac7946e2d719e763ad1f0fd3e26acd

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 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#71877
No description provided.