Lattice options crash #55223

Closed
opened 2018-05-28 11:54:03 +02:00 by Julien Kaspar · 6 comments
Member

Blender Version
Broken: 95c5d1193f

Short description of error
When creating a new lattice, going to object data and changing any amount of points in any of the 3 dimensions, Blender crashes.

**Blender Version** Broken: 95c5d1193f1 **Short description of error** When creating a new lattice, going to object data and changing any amount of points in any of the 3 dimensions, Blender crashes.
Author
Member

Added subscriber: @JulienKaspar

Added subscriber: @JulienKaspar

Added subscriber: @mano-wii

Added subscriber: @mano-wii
Sergey Sharybin was assigned by Germano Cavalcante 2018-05-28 20:06:20 +02:00

I'm not sure what the curve_cache is for lattice..
One solution would be to use the evaluated object. The curve_cache is only part of the evaluated object. (I also wonder if using the original obmat is correct in BKE_lattice_resize).
Another solution is to skip cleaning the curve_cache->disp:

diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 2a60bd94d10..dfa59168576 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -211,8 +211,10 @@ void BKE_lattice_resize(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb)
 		/* works best if we force to linear type (endpoints match) */
 		lt->typeu = lt->typev = lt->typew = KEY_LINEAR;
 
-		/* prevent using deformed locations */
-		BKE_displist_free(&ltOb->curve_cache->disp);
+		if (!DEG_depsgraph_use_copy_on_write()) {
+			/* prevent using deformed locations */
+			BKE_displist_free(&ltOb->curve_cache->disp);
+		}
 
 		copy_m4_m4(mat, ltOb->obmat);
 		unit_m4(ltOb->obmat);

I'm not sure what the `curve_cache` is for lattice.. One solution would be to use the evaluated object. The `curve_cache` is only part of the evaluated object. (I also wonder if using the original `obmat` is correct in `BKE_lattice_resize`). Another solution is to skip cleaning the `curve_cache->disp`: ``` diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index 2a60bd94d10..dfa59168576 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -211,8 +211,10 @@ void BKE_lattice_resize(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb) /* works best if we force to linear type (endpoints match) */ lt->typeu = lt->typev = lt->typew = KEY_LINEAR; - /* prevent using deformed locations */ - BKE_displist_free(&ltOb->curve_cache->disp); + if (!DEG_depsgraph_use_copy_on_write()) { + /* prevent using deformed locations */ + BKE_displist_free(&ltOb->curve_cache->disp); + } copy_m4_m4(mat, ltOb->obmat); unit_m4(ltOb->obmat); ```

@mano-wii , code outside of depsgraph should not make decisions based on whether copy-on-write is enabled or not (there is one exception, which gives issues and likely be changed anyway). Here it seems like you want to check curve_cache to be not-NULL. And then also tag the object for update, so all existing copies gets updated as well.

@mano-wii , code outside of depsgraph should not make decisions based on whether copy-on-write is enabled or not (there is one exception, which gives issues and likely be changed anyway). Here it seems like you want to check curve_cache to be not-NULL. And then also tag the object for update, so all existing copies gets updated as well.

This issue was referenced by 00dc1c08aa

This issue was referenced by 00dc1c08aacf46546883a41068a9e6aad1fe3c04

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
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
4 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#55223
No description provided.