Makesdna: more verbose Align struct error #110291

Merged
Sybren A. Stüvel merged 1 commits from dr.sybren/blender:pr/makesdna-align-error into main 2023-07-21 12:24:42 +02:00

I had some struggles with DNA alignment. The only way I could solve things for myself was to expand the error message from the alignment check in makesdna. This PR changes the error message from:

Align struct error: Bone color

to:

Align struct error: Bone::color (starts at 180 on the native platform;  180 % 8 = 4 bytes)

This has a few advantages:

  • The colon notation (Bone::color) makes it easier to recognise that this is about a specific struct field.
  • It makes it clear that this is about the start/offset of the inner struct.
  • It includes the math the check is actually doing, providing concrete information on how to change the code to fix the issue.
I had some struggles with DNA alignment. The only way I could solve things for myself was to expand the error message from the alignment check in `makesdna`. This PR changes the error message from: ``` Align struct error: Bone color ``` to: ``` Align struct error: Bone::color (starts at 180 on the native platform; 180 % 8 = 4 bytes) ``` This has a few advantages: - The colon notation (`Bone::color`) makes it easier to recognise that this is about a specific struct field. - It makes it clear that this is about the start/offset of the inner struct. - It includes the math the check is actually doing, providing concrete information on how to change the code to fix the issue.
Sybren A. Stüvel added 1 commit 2023-07-20 12:07:05 +02:00
Change the error message from:

```
Align struct error: Bone color
```

to:

```
Align struct error: Bone::color (starts at 180 on the native platform;
 180 % 8 = 4 bytes)
```

The colon notation (`Bone::color`) makes it easier to recognise that this
is about a specific struct field. The rest of the explanation makes it
clear that this is about the start of the struct. It includes the math
the check is actually doing, providing concrete information on how to
change the code to fix the issue.
Sybren A. Stüvel added the
Module
Core
label 2023-07-20 12:07:24 +02:00
Sybren A. Stüvel requested review from Campbell Barton 2023-07-20 12:07:31 +02:00
Campbell Barton approved these changes 2023-07-21 11:31:35 +02:00
Sybren A. Stüvel merged commit 4833dd931b into main 2023-07-21 12:24:42 +02:00
Sybren A. Stüvel deleted branch pr/makesdna-align-error 2023-07-21 12:24:43 +02:00
Member

Guys, #110145 had been waiting for review for days......

Guys, #110145 had been waiting for review for days......
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
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
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#110291
No description provided.