GPv3: Refactor root_group to be a pointer in DNA #110007

Merged
Falk David merged 5 commits from filedescriptor/blender:gpv3-refactor-root-group into main 2023-07-13 18:24:27 +02:00
Member

This turns the embedded group into a pointer.

Note: This will break files from opening if they have a OB_GREASE_PENCIL in them!

This turns the embedded group into a pointer. Note: This will break files from opening if they have a `OB_GREASE_PENCIL` in them!
Falk David added 1 commit 2023-07-12 12:37:54 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
d134f98aff
GPv3: Refactor root_group to be a pointer in DNA
Author
Member

@blender-bot build

@blender-bot build
Falk David requested review from Bastien Montagne 2023-07-12 12:40:11 +02:00
Author
Member

@mont29 Should I try to do versioning this change? Or is it ok to break files that use the experimental feature?

@mont29 Should I try to do versioning this change? Or is it ok to break files that use the experimental feature?

@filedescriptor no strict need for versioning changes in experimental features no... Nice to have if possible and easy, otherwise just let things break ;)

@filedescriptor no strict need for versioning changes in experimental features no... Nice to have if possible and easy, otherwise just let things break ;)

Not sure why opening older files would break though? They should just show as an empty GP?

Not sure why opening older files would break though? They should just show as an empty GP?
Bastien Montagne approved these changes 2023-07-12 13:04:57 +02:00
Bastien Montagne left a comment
Owner

From a quick check changes look fine.

From a quick check changes look fine.
Author
Member

@mont29 It crashes because the root_group pointer can't be read (so it's nullptr), but all the code assumes that there always is a root group. The active_layer pointer still points to valid stuff though.
I could allocate an empty group if root_group could not be read I guess, but then accessing the active_layer pointer will crash anyway.
And just clearing it will work, but then leak memory...

I think technically you could reconstruct the whole thing with the active layer pointer, but it seems not worth it to do that.

@mont29 It crashes because the `root_group` pointer can't be read (so it's nullptr), but all the code assumes that there always is a root group. The `active_layer` pointer still points to valid stuff though. I could allocate an empty group if `root_group` could not be read I guess, but then accessing the active_layer pointer will crash anyway. And just clearing it will work, but then leak memory... I think technically you could reconstruct the whole thing with the active layer pointer, but it seems not worth it to do that.

@mont29 It crashes because the root_group pointer can't be read (so it's nullptr), but all the code assumes that there always is a root group. The active_layer pointer still points to valid stuff though.
I could allocate an empty group if root_group could not be read I guess, but then accessing the active_layer pointer will crash anyway.
And just clearing it will work, but then leak memory...

I think technically you could reconstruct the whole thing with the active layer pointer, but it seems not worth it to do that.

I would at least generate an empty root_group then, and clear (and free) active_layer. Not conserving data from experimental feature is okay, but would really try to avoid any crash.

> @mont29 It crashes because the `root_group` pointer can't be read (so it's nullptr), but all the code assumes that there always is a root group. The `active_layer` pointer still points to valid stuff though. > I could allocate an empty group if `root_group` could not be read I guess, but then accessing the active_layer pointer will crash anyway. > And just clearing it will work, but then leak memory... > > I think technically you could reconstruct the whole thing with the active layer pointer, but it seems not worth it to do that. I would at least generate an empty `root_group` then, and clear (and free) `active_layer`. Not conserving data from experimental feature is okay, but would really try to avoid any crash.
Bastien Montagne requested changes 2023-07-12 19:16:10 +02:00
Bastien Montagne left a comment
Owner

Think crash should be avoided at least.

Think crash should be avoided at least.
Falk David added 2 commits 2023-07-13 14:50:57 +02:00
Falk David requested review from Bastien Montagne 2023-07-13 14:51:17 +02:00
Falk David added 1 commit 2023-07-13 17:00:37 +02:00
Falk David added 1 commit 2023-07-13 17:03:44 +02:00
Bastien Montagne approved these changes 2023-07-13 17:22:01 +02:00
Bastien Montagne left a comment
Owner

LGTM now.

LGTM now.
Falk David merged commit f2f0426980 into main 2023-07-13 18:24:27 +02:00
Falk David deleted branch gpv3-refactor-root-group 2023-07-13 18:24:28 +02:00
Sign in to join this conversation.
No reviewers
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
2 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#110007
No description provided.