WIP: Fix #115413: Missing PropertyRNA rawtype set for some DNA types #115506
No reviewers
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#115506
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Mysteryem/blender:fix_missing_raw_type_set_pr"
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?
makesrna.cc#rna_set_raw_property
was missing support for theint8_t
,uchar
(uint8_t
) andushort
(uint16_t
) DNA types.For #115413 specifically,
27a5da4dc3
replaced thechar
fields used bythe
handle_left_type
andhandle_right_type
enum properties withuint8_t
fields. Without an RNA raw type being set for properties usinguint8_t
fields,rna_access.cc#RNA_property_raw_type
would fallback to assuming the raw type was
PROP_RAW_INT
which would then faildue to #92621.
This patch adds the missing
int8_t
,uchar
andushort
DNA types tomakesrna.cc#rna_set_raw_property
.The
int64_t
anduint64_t
DNA types remain absent frommakesrna.cc#rna_set_raw_property
because these types have nocorresponding
RawPropertyType
and these types can only be used by boolproperties (see
IS_DNATYPE_BOOLEAN_COMPAT
and the other macros inRNA_define.hh
), and bool properties usePROP_RAW_BOOLEAN
.I have doubts about unsigned data types having the same
PROP_RAW_
mapping as signed types. By readingRAW_GET
/RAW_SET
code, these feel totally incompatible with handling of unsigned values currently, since they interpret the pointers as signed ones? So the expected unsigned range cannot be properly covered.Would like to summon @brecht and/or @ideasman42 here too?
Not directly related to this patch:
[u]int_xxt
,uint
, etc) while we are at it?(u)int_64t
to RNA?This is pretty much what I did first, but I decided to keep the patch simpler and it wasn't
clear to me how
foreach_getset
should deal with unsigned types because the signed/unsigned of the raw type is not exposed to the Python API, which can make it more difficult to write performant foreach_get/set code, and there's the issue of OverflowError being raised when setting unsigned types to negative values:06abf39164
edit: Now submitted as !115761 so it can be commented on/reviewed as necessary.Thomas Barlow referenced this pull request2023-12-04 16:59:35 +01:00
I would expect any differences between signed/unsigned to be taken care of by min/max range of the property? Did you check if it does?
As long as setting those values clamps to the range, it should be ok to add the unsigned types.
There's definitely issues with the data types with this patch. The example that I've tested is accessing an
int8_t
PROP_INT
property set to-1
withforeach_get
, which returns255
because the Python ints are constructed from an array that is considered to bechar
(PROP_RAW_CHAR
) type which is unsigned in Blender. The Python ints being created inbpy_rna.cc#foreach_getset()
withitem = PyLong_FromLong(long(((char *)array)[i]));
.I expect there's similar issues using unsigned types with the existing signed raw types too.
Fix #115413: Missing PropertyRNA rawtype set for some DNA typesto WIP: Fix #115413: Missing PropertyRNA rawtype set for some DNA typesClosing in favour of !115761.
Pull request closed