Blender crash when add Smoth modifier on Lattice. #47737

Closed
opened 2016-03-09 17:30:00 +01:00 by sungreen sungreen · 20 comments

Blender crash when add Smooth modifier on any Lattice object.

После добавления модификатора Smooth на объект Lattice происходит аварийное прекращение работы Blender. Это проявляется во всех версиях 2.5x-2.7x. в Windows и Linux. Очевидно этот модификатор не должен быть доступен для объектов типа Lattice.

Blender 2.76 (sub 0), Commit date: 2015-11-03 10:56, Hash f337fea

bpy.ops.object.select_all(action='TOGGLE') # Оператор
bpy.ops.object.select_all(action='TOGGLE') # Оператор
bpy.ops.object.delete(use_global=False) # Оператор
bpy.ops.object.add(radius=1, type='LATTICE', view_align=False, enter_editmode=False, location=(0, 0, 0), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False)) # Оператор
bpy.context.space_data.context = 'DATA' # Свойство
bpy.context.space_data.context = 'MODIFIER' # Свойство
bpy.context.space_data.context = 'DATA' # Свойство
bpy.context.space_data.context = 'MODIFIER' # Свойство
bpy.ops.object.modifier_add(type='LATTICE') # Оператор
bpy.ops.object.modifier_remove(modifier="Lattice") # Оператор
bpy.ops.object.modifier_add(type='SMOOTH') # Оператор

backtrace

_SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender(BLI_system_backtrace+0x1d) [0x1a3e71d]
_SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender() [0x1056944]
_SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender() [0x1056b21]
/lib64/libc.so.6(+0x33390) [0x7f11f3332390]
_SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender() [0x12a94a3]
_SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender() [0x12a99aa]
_SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender(BKE_lattice_modifiers_calc+0x12c) [0x16d416c]
_SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender(BKE_object_handle_data_update+0x3bf) [0x178916f]
_SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender(BKE_object_handle_update_ex+0x19e) [0x1657a4e]
_SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender() [0x1641cba]
_SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender(BLI_task_pool_work_and_wait+0xeb) [0x1a6f45b]
_SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender() [0x1642bcf]
_SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender(BKE_scene_update_tagged+0xb5) [0x1643105]
_SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender(wm_event_do_notifiers+0x49a) [0x1075b8a]
_SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender(WM_main+0x20) [0x105f130]
_SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender(main+0x556) [0x10596c6]
/lib64/libc.so.6(__libc_start_main+0xf0) [0x7f11f331f5a0]
_SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender() [0xf5b471]

Blender crash when add Smooth modifier on any Lattice object. После добавления модификатора Smooth на объект Lattice происходит аварийное прекращение работы Blender. Это проявляется во всех версиях 2.5x-2.7x. в Windows и Linux. Очевидно этот модификатор не должен быть доступен для объектов типа Lattice. # Blender 2.76 (sub 0), Commit date: 2015-11-03 10:56, Hash f337fea bpy.ops.object.select_all(action='TOGGLE') # Оператор bpy.ops.object.select_all(action='TOGGLE') # Оператор bpy.ops.object.delete(use_global=False) # Оператор bpy.ops.object.add(radius=1, type='LATTICE', view_align=False, enter_editmode=False, location=(0, 0, 0), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False)) # Оператор bpy.context.space_data.context = 'DATA' # Свойство bpy.context.space_data.context = 'MODIFIER' # Свойство bpy.context.space_data.context = 'DATA' # Свойство bpy.context.space_data.context = 'MODIFIER' # Свойство bpy.ops.object.modifier_add(type='LATTICE') # Оператор bpy.ops.object.modifier_remove(modifier="Lattice") # Оператор bpy.ops.object.modifier_add(type='SMOOTH') # Оператор # backtrace _SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender(BLI_system_backtrace+0x1d) [0x1a3e71d] _SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender() [0x1056944] _SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender() [0x1056b21] /lib64/libc.so.6(+0x33390) [0x7f11f3332390] _SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender() [0x12a94a3] _SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender() [0x12a99aa] _SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender(BKE_lattice_modifiers_calc+0x12c) [0x16d416c] _SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender(BKE_object_handle_data_update+0x3bf) [0x178916f] _SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender(BKE_object_handle_update_ex+0x19e) [0x1657a4e] _SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender() [0x1641cba] _SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender(BLI_task_pool_work_and_wait+0xeb) [0x1a6f45b] _SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender() [0x1642bcf] _SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender(BKE_scene_update_tagged+0xb5) [0x1643105] _SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender(wm_event_do_notifiers+0x49a) [0x1075b8a] _SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender(WM_main+0x20) [0x105f130] _SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender(main+0x556) [0x10596c6] /lib64/libc.so.6(__libc_start_main+0xf0) [0x7f11f331f5a0] _SOFT/blender/blender-2.76b-linux-glibc211-x86_64/blender() [0xf5b471]

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @Nikolaysungreen

Added subscriber: @Nikolaysungreen

Added subscriber: @mano-wii

Added subscriber: @mano-wii

It is strange that option is available for Lattice, since a lattice has no DerivedMesh.

It is strange that option is available for Lattice, since a lattice has no DerivedMesh.
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

can confirm this, maybe a simple D1842 will do?
(even though a more thorough checking in BKE_object_support_modifier_type_check() would not hurt either? -- just saying, because there are a couple of modifiers which dont really "make sense" on a lattice but still pass this check... [without crashing though])

can confirm this, maybe a simple [D1842](https://archive.blender.org/developer/D1842) will do? (even though a more thorough checking in `BKE_object_support_modifier_type_check()` would not hurt either? -- just saying, because there are a couple of modifiers which dont really "make sense" on a lattice but still pass this check... [without crashing though])

Added subscriber: @mont29

Added subscriber: @mont29

Lattice do support a subset of (deform only) modifiers.

Issue here is clearly with UI, smooth modifier expect a DM which it cannot get from lattice, so it should not be in menu I think (same for all generate, and modify ones).

Lattice do support a subset of (deform only) modifiers. Issue here is clearly with UI, smooth modifier expect a DM which it cannot get from lattice, so it should not be in menu I think (same for all generate, and modify ones).
Member

before I look into this: would a new flag (e.g. eModifierTypeFlag_RequiresDerrivedMesh) be acceptable in ModifierTypeFlag enum?

before I look into this: would a new flag (e.g. `eModifierTypeFlag_RequiresDerrivedMesh`) be acceptable in ModifierTypeFlag enum?
Member

How about D1846?
(maybe not the most elegant solution but doesnt need a new flag on modifiers...)

How about [D1846](https://archive.blender.org/developer/D1846)? (maybe not the most elegant solution but doesnt need a new flag on modifiers...)

@lichtwerk I like your first suggestion much much better :P

Problem is, even if Smooth may be the only one crashing, more than half modifiers proposed for lattice objects make absolutely no sense (all generative ones, like subsurf etc., and the modify ones). BKE_lattice_modifiers_calc() explicitly skips all non-deform-only modifiers, but then being able to select them in UI is pure non-sense.

What I would propose is to add that 'expect dm' flag, then use it in BKE_object_support_modifier_type_check(), and then, most importantly, to call that function from all 'modifiers_calc' ones (to try to harmonize between UI and actual evaluation code).

Other point to check, what is exactly that eModifierTypeFlag_AcceptsCVs flag, not obvious neither from code nor name, could use a comment here (would guess it's related to curves but...).

@lichtwerk I like your first suggestion much much better :P Problem is, even if Smooth may be the only one crashing, more than half modifiers proposed for lattice objects make absolutely no sense (all generative ones, like subsurf etc., and the modify ones). `BKE_lattice_modifiers_calc()` explicitly skips all non-deform-only modifiers, but then being able to select them in UI is pure non-sense. What I would propose is to add that 'expect dm' flag, then use it in `BKE_object_support_modifier_type_check()`, and then, most importantly, to call that function from all 'modifiers_calc' ones (to try to harmonize between UI and actual evaluation code). Other point to check, what is exactly that `eModifierTypeFlag_AcceptsCVs` flag, not obvious neither from code nor name, could use a comment here (would guess it's related to curves but...).
Member

@mont29: D1846: fix #47737: exclude modfiers that wont work with lattices from the UI and evaluation was already skipping all non-deform-only modifiers (checking against eModifierTypeType_OnlyDeform), so that would already harmonize UI and evaluation for lattices. But I can prepare another patch using a new modifier flag [propably tomorrow] to see if that would work nicely...
Also need to check the meshcache-modifier (suppose this one wont work with lattices either -- this modifier also slips through the eModifierTypeType_OnlyDeform-test)

@mont29: [D1846: fix #47737: exclude modfiers that wont work with lattices from the UI and evaluation](https://archive.blender.org/developer/D1846) was already skipping all non-deform-only modifiers (checking against `eModifierTypeType_OnlyDeform`), so that would already harmonize UI and evaluation for lattices. But I can prepare another patch using a new modifier flag [propably tomorrow] to see if that would work nicely... Also need to check the meshcache-modifier (suppose this one wont work with lattices either -- this modifier also slips through the `eModifierTypeType_OnlyDeform`-test)
Member

some more thoughts:

  • only OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_LATTICE accept modifiers

  • OB_MESH, OB_FONT, OB_CURVE, OB_SURF can provide a DerrivedMesh reliably, right? [OB_LATTICE is the 'misfit' in modifier-dm-land in that regard :)]

  • that said, eModifierTypeType_OnlyDeform modifiers work well with lattices (even MeshCache in some regard -- when you export caches of a mesh with same 'topology' as a lattice, you can apply it to a lattice :))

  • only 'misfit' of eModifierTypeType_OnlyDeform modifiers in concert with lattices is "Smooth" [because it depends on the DerrivedMesh edges]

  • my conclusion:

    • we should bring UI and evaluation for lattices in synch (by excluding non eModifierTypeType_OnlyDeform modifiers) for sure (see D1846)
    • we have a **single**case that needs special handling [lattice + "Smooth"] --> lets introduce eModifierTypeFlag_RequiresDerrivedMesh, BUT:
    • checking for eModifierTypeFlag_RequiresDerrivedMesh from all over the place is overkill, no?
  [a check for this would pass all the time -- except lattice + "Smooth"... Or is there a situation where getting a DM for OB_MESH, OB_FONT, OB_CURVE, OB_SURF could fail?]
  • Anyhow: I suggest to just check eModifierTypeFlag_RequiresDerrivedMesh flag for lattices (see updated D1846)?

@mont29: what do you think?

some more thoughts: - only OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_LATTICE accept modifiers - OB_MESH, OB_FONT, OB_CURVE, OB_SURF can provide a DerrivedMesh reliably, right? [OB_LATTICE is the 'misfit' in modifier-dm-land in that regard :)] - that said, eModifierTypeType_OnlyDeform modifiers work well with lattices (even MeshCache in some regard -- when you export caches of a mesh with same 'topology' as a lattice, you can apply it to a lattice :)) - only 'misfit' of eModifierTypeType_OnlyDeform modifiers in concert with lattices is "Smooth" [because it depends on the DerrivedMesh edges] - my conclusion: - we should bring UI and evaluation for lattices in synch (by excluding non eModifierTypeType_OnlyDeform modifiers) for sure (see [D1846](https://archive.blender.org/developer/D1846)) - we have a **_single_**case that needs special handling [lattice + "Smooth"] --> lets introduce `eModifierTypeFlag_RequiresDerrivedMesh`, BUT: - checking for eModifierTypeFlag_RequiresDerrivedMesh from all over the place is overkill, no? ``` [a check for this would pass all the time -- except lattice + "Smooth"... Or is there a situation where getting a DM for OB_MESH, OB_FONT, OB_CURVE, OB_SURF could fail?] ``` - Anyhow: I suggest to just check eModifierTypeFlag_RequiresDerrivedMesh flag for lattices (see updated [D1846](https://archive.blender.org/developer/D1846))? @mont29: what do you think?
Member

one more alternative: we could introduce a flag called eModifierTypeFlag_AcceptsLattice (a little less reusable, but more in line with the other 'Accepts' flags...)?

one more alternative: we could introduce a flag called `eModifierTypeFlag_AcceptsLattice` (a little less reusable, but more in line with the other 'Accepts' flags...)?

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Yeah… well, don’t have strong opinion here, both flags would be valid imho.

Main important point is to use same checks in UI whene generating list of available modifiers, and in objetc's stack evaluation later on (lattice were obviously broken on that matter, but would be nice to also check the curve familly ;) ).

So yes, your plan above sounds good to me. :)

Just realize @ideasman42 is not associated here, could use his advice too.

Yeah… well, don’t have strong opinion here, both flags would be valid imho. Main important point is to use same checks in UI whene generating list of available modifiers, and in objetc's stack evaluation later on (lattice were obviously broken on that matter, but would be nice to also check the curve familly ;) ). So yes, your plan above sounds good to me. :) Just realize @ideasman42 is not associated here, could use his advice too.
Member

updated D1846: fix #47737: exclude modfiers that wont work with lattices from the UI and evaluation -- new version uses eModifierTypeFlag_AcceptsLattice

updated [D1846: fix #47737: exclude modfiers that wont work with lattices from the UI and evaluation](https://archive.blender.org/developer/D1846) -- new version uses eModifierTypeFlag_AcceptsLattice

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

This issue was referenced by 7a8bd2eaea

This issue was referenced by 7a8bd2eaea379bf60b09c110fc9810041359b0e9
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
7 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#47737
No description provided.