Fix #127077: Edit voxel size op unpredictable with large/small meshes #127109
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#127109
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "lichtwerk/blender:127077"
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?
If voxel sizes were big, code could run into clamping at 1.0f, making it
look like nothing was happening, also even though the "step size" was
taking into account the initial voxels size (only in relative mode,
absolute mode was, well... absolute, no matter what object this was
happening on, also see
5946ea938a
).So previously, a reasonable voxels size could not achieved using this
operator for e.g. a terrain-size mesh.
Now code allows for bigger/smaller meshes to behave predictably.
This is done by storing a reasonable min and max voxel size (this is
taken from the bounding plane which is also displayed to the user),
making the max the length of the longer side of the bounding plane and
the min a fraction of it (based on
VOXEL_SIZE_EDIT_MAX_GRIDS_LINES
--smaller voxels would not display anyways...)
Based on the above, we can have a reasonable range to base the change on
which is done moving the mouse.
Because this is more predictable than before, we can even remove the
relative
mode (dont think it makes too much sense now anymore).Minor nits, still need to test this behaviorally though
@ -415,3 +406,1 @@
d = d * 0.0005f;
cd->relative_mode = false;
}
d *= cd->voxel_size_min * 0.25f;
Was this
0.25f
value just determined experimentally?This gives the same "speed" for the default cube.
cd->voxel_size_min
is0.002f
for the default cube and previously we multiplied (hardcoded) with0.0005f
@ -516,6 +506,12 @@ static int voxel_size_edit_invoke(bContext *C, wmOperator *op, const wmEvent *ev
}
}
/* Set reasonable min/max voxel sizes to clamp to. */
As is this comment doesn't seem particularly helpful; I think if any part warrants a comment it'd be stating that we cap the min size based on the point where we cant visually display any more info.
Behavior here seems sane to me in testing both the provided mesh in the bug report and on a default cube. I think I'd still prefer if @JulienKaspar took a look as well before merging this in case there is some reason we would want to keep the old "Relative Mode" or if this behaves weirdly for some other usecases that I'm unaware of.
@blender-bot package
Package build started. Download here when ready.
I think this works well. It's true that the relative mode is not really needed anymore then.