KeyFrame.handle_left_type/handle_right_type cannot be used with foreach_get/foreach_set #115413
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#115413
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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: NVIDIA GeForce GTX 1070 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 536.40
Blender Version
Broken: version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash:
rB0f45cab862b8
and 4.1.0aWorked: 2.90.1, branch: master, commit date: 2020-09-23 06:43, hash:
rB3e85bb34d0d7
Short description of error
Attempting to use foreach_set (seemingly does nothing) or foreach_get (reads garbage) with the
handle_left_type
orhandle_right_type
properties does not work.Possible cause:
27a5da4dc3
The
h1
andh2
fields of theBezTriple
struct were changed fromchar
type touint8_t
type. I suspect the issue may be caused bymakesrna.cc#rna_set_raw_property()
not being updated to support theuint8_t
type (many other types appear to be missing too, some of which can be seen in theIS_DNATYPE_INT_COMPAT
andIS_DNATYPE_BOOLEAN_COMPAT
macros inRNA_define.hh
).This is similar to #92621, but I think this is a separate issue with similar symptoms because the example in #92621 uses an
int
field.Exact steps for others to reproduce the error
Open the attached .blend, run the two scripts and observe the output in the System Console.
The first script runs foreach_get with the
handle_left_type
,handle_right_type
,interpolation
andeasing
enum properties and a Python list and prints the result of each.The second script runs foreach_get again, but with buffers that print a message when they are accessed as a sequence. From these messages, the C type that
bpy_rna.cc#foreach_getset()
thinks is compatible with each property can be determined.In 2.90, it thinks all the properties are compatible with
'b'
(signed char
), but in 2.91, it thinks thehandle_left_type
andhandle_right_type
properties are instead compatible with'i'
(int
).My suspicion for why 2.91+ thinks these are now
'i'
compatible is thatrna_access.cc#RNA_property_raw_type
returnsPROP_RAW_INT
forPROP_ENUM
whoserawtype
isPROP_RAW_UNSET
.I've been looking into how to update the FBX IO addon to more accurately import FBX animation curves (reading the correct tangents/interpolation instead of always assuming linear interpolation is used) and maybe to export Blender animation curves directly without baking, and this issue will be a blocker due to animation import/export being far too slow without foreach_get/foreach_set.
I will try to investigate this more and test some of my suspicions.
My suspicions appear to be correct, though rather than the fields being
uint8_t
, they get remapped touchar
. I'll see about putting a PR together to fix this tomorrow.Notably,
int8_t
,ushort
,int64_t
anduint64_t
are also unaccounted for inmakesrna.cc#rna_set_raw_property()
, though the 64 bit types don't have an equivalentRawPropertyType
. The full list of types appears to be those inmakes_dna.cc#make_structDNA
.Thomas Barlow referenced this issue2023-12-04 16:59:35 +01:00
Since
e503536775
adds support for enum properties that don't have raw array access, this issue is fixed now too.Adding the missing raw types would make accessing
handle_left_type
/handle_right_type
faster, but since that falls under an improvement rather than a bug, I think this issue can be closed.Thomas Barlow referenced this issue2023-12-20 02:11:22 +01:00