WIP: Fix #93103: modifier iterations can be set to a negative value #110916
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
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#110916
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "lichtwerk/blender:93103"
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?
Sanitize "iterations" in a couple of modifiers (namely Smooth, Corrective
Smooth, Laplacian Smooth & Laplacian Deform) to always
have a hard limit of 0.
Putting in negative values does not make sense (and could have caused an
infinite loop since the negative value is cast to unsigned internally in
the case of the 'Corrective Smooth' modifier).
This came up again in chat (was already on phabricator, see https://archive.blender.org/developer/D13240)
LGTM, but think there should also be hard-coded clamping in the modifiers code itself? Especially given the fact that DNA values are
short
, notunsigned short
... And evenSHRT_MAX
is likely waaaaayyyy to high as absolute max value, think hard-coded clamping in the[0, 1000]
range would be a reasonable value?Dont think we are going the extra route of clamping theoretical DNA values in the modifiers code elsewhere (if we already "clamp" in RNA)? We dont do this in SubD for example. Not saying this would be bad to do, but then we should also do everywhere else?
No strong opinion about the range, in the worst case, this is just wasting compute time, dont think this will actually cause issues running out of memory etc? And I do recall cases were we lifted "arbitrary" range limits again (for folks who were actually in need to have higher limits) -- but like I said, no strong opinion about changing that to
[0, 1000]
...Most of these modifiers applied to production data with too many iterations will lead to Blender freezing for minutes, if not hours.
Also since so far there was no limit, if you do not want to do a hard clamping in modifiers code itself, then you need at least to do a do-version, otherwise older files can still have negative (or insanely high positive) values...
IMHO it's way simpler and safer here to have same hard-clamping applied in modifiers code, as the one defined in RNA (can even use defines from DNA file actually, to be sure they always remain in sync).
And indeed could see other similar cases needing similar handling, yes.
Fix #93103: modifier iterations can be set to a negative valueto WIP: Fix #93103: modifier iterations can be set to a negative valueI would not add the clamping to the modifiers code when it exists in RNA, I think this is fine as is. Or even if that clamping is wanted by some, it should be discussed and added later. This will fix the crash.
Checkout
From your project repository, check out a new branch and test the changes.