shrinking to zero doesn't actually scales the radius to zero #96238

Closed
opened 2022-03-08 15:08:44 +01:00 by Diogo Valadares Reis dos Santos · 9 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: AMD Radeon RX 5700 XT ATI Technologies Inc. 4.5.14802 Core Profile Context 22.2.1 30.0.14023.7007

Blender Version
Broken: version: 3.2.0 Alpha, branch: master, commit date: 2022-03-04 16:11, hash: 295d5c6ef5

Short description of error
if you use alt+s and then type 0, the radius of the the curve goes to 0.001 instead of 0

Exact steps for others to reproduce the error

  • click on a curve point
  • use alt+s to shrink it
  • type 0, if you zoom in or look at the n-panel, you will not that the radius isn't 0.

2022-03-08 10-54-21.mp4
you can resize it to any number without any problem, but specifically at 0, instead of setting the radius to 0 it sets to 0.001

Extra note: This may be better reported in another thread but while reporting this bug I noticed that the status bar where you type the numbers wrongly says that the operation is shrink/flatten, but there is no such thing for curves, it probably should be something as scale point. I tried to find it in documentation and I only found that alt+s should be using "radius" but in this case the documentation would be wrong because we are not defining the radius of the point directly, we are scaling it. https://docs.blender.org/manual/en/latest/modeling/curves/editing/curve.html#radius

Summing up this extra note:
alt+s mode naming in curve edit in blender is probably wrong
the operation may also be wrong, but I'm not sure if its wrong in blender or if its wrong in the documentation

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: AMD Radeon RX 5700 XT ATI Technologies Inc. 4.5.14802 Core Profile Context 22.2.1 30.0.14023.7007 **Blender Version** Broken: version: 3.2.0 Alpha, branch: master, commit date: 2022-03-04 16:11, hash: `295d5c6ef5` **Short description of error** if you use alt+s and then type 0, the radius of the the curve goes to 0.001 instead of 0 **Exact steps for others to reproduce the error** - click on a curve point - use alt+s to shrink it - type 0, if you zoom in or look at the n-panel, you will not that the radius isn't 0. [2022-03-08 10-54-21.mp4](https://archive.blender.org/developer/F12907614/2022-03-08_10-54-21.mp4) you can resize it to any number without any problem, but specifically at 0, instead of setting the radius to 0 it sets to 0.001 Extra note: This may be better reported in another thread but while reporting this bug I noticed that the status bar where you type the numbers wrongly says that the operation is shrink/flatten, but there is no such thing for curves, it probably should be something as scale point. I tried to find it in documentation and I only found that alt+s should be using "radius" but in this case the documentation would be wrong because we are not defining the radius of the point directly, we are scaling it. https://docs.blender.org/manual/en/latest/modeling/curves/editing/curve.html#radius Summing up this extra note: alt+s mode naming in curve edit in blender is probably wrong the operation may also be wrong, but I'm not sure if its wrong in blender or if its wrong in the documentation

Added subscriber: @Diogo_Valadares

Added subscriber: @Diogo_Valadares
Member

Added subscribers: @mano-wii, @lichtwerk

Added subscribers: @mano-wii, @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

Hm, this was like that since forever.
@mano-wii : since there is no real limit in RNA, would you have an idea why transform code limits it to 0.001f?

Hm, this was like that since forever. @mano-wii : since there is no real limit in RNA, would you have an idea why transform code limits it to `0.001f`?

Added subscriber: @broken

Added subscriber: @broken

In #96238#1318809, @lichtwerk wrote:
@mano-wii : since there is no real limit in RNA, would you have an idea why transform code limits it to 0.001f?

This has been the case since when the operator was implemented in d3028ec70d.
Maybe only @broken knows the answer.

My guess is that this was done to prevent the operation from getting stuck after successive Shrink Fatten calls if one of them results in a radius of 0.0.
But that doesn't prevent this radius from being set to 0.0 from the UI.
So it doesn't seem like a valid reason to limit the value.

Here a possible solution:

diff --git a/source/blender/editors/transform/transform_mode_curveshrinkfatten.c b/source/blender/editors/transform/transform_mode_curveshrinkfatten.c
index aa4d608de04..c9f0c949135 100644
--- a/source/blender/editors/transform/transform_mode_curveshrinkfatten.c
+++ b/source/blender/editors/transform/transform_mode_curveshrinkfatten.c
@@ -63,11 +63,10 @@ static void applyCurveShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
 
       if (td->val) {
         *td->val = td->ival * ratio;
+
         /* apply PET */
         *td->val = (*td->val * td->factor) + ((1.0f - td->factor) * td->ival);
-        if (*td->val <= 0.0f) {
-          *td->val = 0.001f;
-        }
+        CLAMP_MIN(*td->val, 0.0f);
       }
     }
   }
@@ -93,10 +92,6 @@ void initCurveShrinkFatten(TransInfo *t)
   t->num.unit_sys = t->scene->unit.system;
   t->num.unit_type[0] = B_UNIT_NONE;
 
-#ifdef USE_NUM_NO_ZERO
-  t->num.val_flag[0] |= NUM_NO_ZERO;
-#endif
-
   t->flag |= T_NO_CONSTRAINT;
 }
 

> In #96238#1318809, @lichtwerk wrote: > @mano-wii : since there is no real limit in RNA, would you have an idea why transform code limits it to `0.001f`? This has been the case since when the operator was implemented in d3028ec70d. Maybe only @broken knows the answer. My guess is that this was done to prevent the operation from getting stuck after successive Shrink Fatten calls if one of them results in a radius of 0.0. But that doesn't prevent this radius from being set to 0.0 from the UI. So it doesn't seem like a valid reason to limit the value. Here a possible solution: ``` diff --git a/source/blender/editors/transform/transform_mode_curveshrinkfatten.c b/source/blender/editors/transform/transform_mode_curveshrinkfatten.c index aa4d608de04..c9f0c949135 100644 --- a/source/blender/editors/transform/transform_mode_curveshrinkfatten.c +++ b/source/blender/editors/transform/transform_mode_curveshrinkfatten.c @@ -63,11 +63,10 @@ static void applyCurveShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) if (td->val) { *td->val = td->ival * ratio; + /* apply PET */ *td->val = (*td->val * td->factor) + ((1.0f - td->factor) * td->ival); - if (*td->val <= 0.0f) { - *td->val = 0.001f; - } + CLAMP_MIN(*td->val, 0.0f); } } } @@ -93,10 +92,6 @@ void initCurveShrinkFatten(TransInfo *t) t->num.unit_sys = t->scene->unit.system; t->num.unit_type[0] = B_UNIT_NONE; -#ifdef USE_NUM_NO_ZERO - t->num.val_flag[0] |= NUM_NO_ZERO; -#endif - t->flag |= T_NO_CONSTRAINT; } ```

I guess Matt isn't active anymore, so I don't know if we will get an answer anytime soon...
I usually like to set the radius of hair tips to 0 and the only problem I have is if I want to increase the size later, tho it can be done by manually setting the size in the N-Panel.
Having this soft limit usually gives me problems whenever I need to merge the tips of the curves.

I guess Matt isn't active anymore, so I don't know if we will get an answer anytime soon... I usually like to set the radius of hair tips to 0 and the only problem I have is if I want to increase the size later, tho it can be done by manually setting the size in the N-Panel. Having this soft limit usually gives me problems whenever I need to merge the tips of the curves.

This issue was referenced by 2d1fe736fa

This issue was referenced by 2d1fe736fabdcccdd46edfbdfc68720498c30e10

Changed status from 'Needs Developer To Reproduce' to: 'Resolved'

Changed status from 'Needs Developer To Reproduce' to: 'Resolved'
Germano Cavalcante self-assigned this 2022-07-12 15:20:13 +02:00
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
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#96238
No description provided.