PyAPI: Some modifier properties have wrong subtype #89213
Labels
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#89213
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce RTX 2070 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.89
Blender Version
Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-05-27 17:53, hash:
0a83f32d79
Worked: -
Short description of error
Reading the subtype of some properties gives a warning in the console.
Shrinkwrap
offset: "", WARN (bpy.rna): C:\Users\blender\git\blender-vdev\blender.git\source\blender\python\intern\bpy_rna.c:1505 pyrna_enum_to_py: current value '65536' matches no enum in 'FloatProperty', 'offset', 'subtype'
project_limit: "", WARN (bpy.rna): C:\Users\blender\git\blender-vdev\blender.git\source\blender\python\intern\bpy_rna.c:1505 pyrna_enum_to_py: current value '65536' matches no enum in 'FloatProperty', 'project_limit', 'subtype'
Warp
falloff_radius: "", WARN (bpy.rna): C:\Users\blender\git\blender-vdev\blender.git\source\blender\python\intern\bpy_rna.c:1505 pyrna_enum_to_py: current value '65567' matches no enum in 'FloatProperty', 'falloff_radius', 'subtype'
Looking at the code in rna_modifier.c:
In rna_def_modifier_shrinkwrap:
prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_UNIT_LENGTH); <-- last argument is subtype and PROP_UNIT_LENGTH is not a subtype
prop = RNA_def_property(srna, "project_limit", PROP_FLOAT, PROP_UNIT_LENGTH); <-- same thing here
In rna_def_modifier_warp:
prop = RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_UNSIGNED | PROP_DISTANCE);
The reason I came across these is that I need to go through all modifier properties in my addon to recreate the properties for addon preferences. That way I can have a UI for defining default settings for modifiers to have when they are added. Rare use of the API, I pressume...
Exact steps for others to reproduce the error
Added subscriber: @Symstract
Added subscribers: @JacquesLucke, @mano-wii
Changed status from 'Needs Triage' to: 'Confirmed'
In fact the use of
PROP_UNIT_LENGTH
as subtype doesn't seem right, (even more so with those warnings).The other subtypes listed must also be wrong.
The first was implemented in
f17afe69
(so @JacquesLucke can take a look?)(confirming)
Thanks for the report, but reviewing it, only the first 3 examples are actually errors.
The last 2 are not bugs. "COORDS" is the shortened name chosen for
PROP_COORDS
andPROP_VELOCITY
is not limited to arrays.So I'll edit the description if you don't mind.
This issue was referenced by
8f05520083
Changed status from 'Confirmed' to: 'Resolved'
Thanks for the fix. But...
In the API docs :
bpy.props.FloatVectorProperty, subtype (string) – Enumerator in [‘COLOR’, ‘TRANSLATION’, ‘DIRECTION’, ‘VELOCITY’, ‘ACCELERATION’, ‘MATRIX’, ‘EULER’, ‘QUATERNION’, ‘AXISANGLE’, ‘XYZ’, ‘XYZ_LENGTH’, ‘COLOR_GAMMA’, ‘COORDINATES’, ‘LAYER’, ‘LAYER_MEMBER’, ‘NONE’].
No 'COORDS'? (It's 'COORDINATES'.)
bpy.props.FloatProperty, subtype (string) – Enumerator in [‘PIXEL’, ‘UNSIGNED’, ‘PERCENTAGE’, ‘FACTOR’, ‘ANGLE’, ‘TIME’, ‘DISTANCE’, ‘DISTANCE_CAMERA’, ‘POWER’, ‘TEMPERATURE’, ‘NONE’].
No 'VELOCITY'?
Just curious, it's not a big deal.