With small units, cannot adjust Normals so well. #41308

Closed
opened 2014-08-04 02:34:51 +02:00 by Charlieb000 · 7 comments
Charlieb000 commented 2014-08-04 02:34:51 +02:00 (Migrated from localhost:3001)

Set the units to Metric and scale to 0.001 (milimeters) on the properties toolbar (scene)
create a torus (well its worse on that) then go show the normals and adjust their size by dragging the arrows - even with the shift key it isnt good. Can the size of the normal lines be dependant on the size of the face, ie %. This way it wont go nutty and gives visual priority to the larger faces. (sorry this is a bit of an idea besides a bug).

By the way, how can i always enable normals?

Set the units to Metric and scale to 0.001 (milimeters) on the properties toolbar (scene) create a torus (well its worse on that) then go show the normals and adjust their size by dragging the arrows - even with the shift key it isnt good. Can the size of the normal lines be dependant on the size of the face, ie %. This way it wont go nutty and gives visual priority to the larger faces. (sorry this is a bit of an idea besides a bug). By the way, how can i always enable normals?
Charlieb000 commented 2014-08-04 02:34:51 +02:00 (Migrated from localhost:3001)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Charlieb000 commented 2014-08-04 02:34:51 +02:00 (Migrated from localhost:3001)
Author

Added subscriber: @Charlieb000

Added subscriber: @Charlieb000
Charlieb000 commented 2014-08-04 02:39:10 +02:00 (Migrated from localhost:3001)
Author

Ah. it seems i cannot "always enable" but if i add things while in edit mode with the normals enabled beforehand then it will be created with normals enabled.

Ah. it seems i cannot "always enable" but if i add things while in edit mode with the normals enabled beforehand then it will be created with normals enabled.
Bastien Montagne self-assigned this 2014-08-04 10:59:36 +02:00

Normals are always enabled, the only thing you can control is their visualization in Edit mode. And adding in Edit mode means you add some geometry to current object, instead of adding a new object, this is not the same thing at all.

As for normals, I'll see whether it’s possible to set them from bbox dimensions, would make sense imho.

Normals are always enabled, the only thing you can control is their visualization in Edit mode. And adding in Edit mode means you add some geometry to current object, instead of adding a new object, this is not the same thing at all. As for normals, I'll see whether it’s possible to set them from bbox dimensions, would make sense imho.

For the record, here is a patch weighting normal size from global mesh's dimensions… Rejected for now though (can have bad effects in some corner cases too).

P113: #41308

diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 8d39632..a4c0ef4 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -2138,6 +2138,21 @@ static void drawSelectedVertices(DerivedMesh *dm, Mesh *me)
  * logic!!!
  */
 
+static float compute_normal_size(Object *ob, Scene *scene)
+{
+	float min- [x], max- [x], mat- [x][4];
+
+	INIT_MINMAX(min, max);
+	BKE_object_minmax(ob, min, max, false);
+	sub_v3_v3(max, min);
+
+	/* Bring back in global space. */
+	invert_m4_m4(mat, ob->obmat);
+	mul_mat3_m4_v3(mat, max);
+
+	return scene->toolsettings->normalsize * len_v3(max);
+}
+
 static void calcDrawDMNormalScale(Object *ob, drawDMNormal_userData *data)
 {
 	float obmat- [x][3];
@@ -2184,7 +2199,7 @@ static void draw_dm_face_normals(BMEditMesh *em, Scene *scene, Object *ob, Deriv
 	drawDMNormal_userData data;
 
 	data.bm = em->bm;
-	data.normalsize = scene->toolsettings->normalsize;
+	data.normalsize = compute_normal_size(ob, scene);
 
 	calcDrawDMNormalScale(ob, &data);
 
@@ -2249,7 +2264,7 @@ static void draw_dm_vert_normals(BMEditMesh *em, Scene *scene, Object *ob, Deriv
 	drawDMNormal_userData data;
 
 	data.bm = em->bm;
-	data.normalsize = scene->toolsettings->normalsize;
+	data.normalsize = compute_normal_size(ob, scene);
 
 	calcDrawDMNormalScale(ob, &data);
 
@@ -2643,7 +2658,7 @@ static void draw_dm_loop_normals(BMEditMesh *em, Scene *scene, Object *ob, Deriv
 	drawDMNormal_userData data;
 
 	data.bm = em->bm;
-	data.normalsize = scene->toolsettings->normalsize;
+	data.normalsize = compute_normal_size(ob, scene);
 
 	calcDrawDMNormalScale(ob, &data);
 
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 1c6d0fa..f2edf70 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -1872,11 +1872,12 @@ static void rna_def_tool_settings(BlenderRNA  *brna)
 	RNA_def_property_ui_text(prop, "Proportional Size", "Display size for proportional editing circle");
 	RNA_def_property_range(prop, 0.00001, 5000.0);
 	
-	prop = RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE);
+	prop = RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_FACTOR);
 	RNA_def_property_float_sdna(prop, NULL, "normalsize");
-	RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view");
-	RNA_def_property_range(prop, 0.00001, 1000.0);
-	RNA_def_property_ui_range(prop, 0.01, 10.0, 10.0, 2);
+	RNA_def_property_ui_text(prop, "Normal Size",
+	                         "Display size for normals in the 3D view (proportional to global mesh's size)");
+	RNA_def_property_range(prop, 0.001, 100.0);
+	RNA_def_property_ui_range(prop, 0.01, 2.0, 1.0, 2);
 	RNA_def_property_update(prop, NC_GEOM | ND_DATA, NULL);
 
 	prop = RNA_def_property(srna, "double_threshold", PROP_FLOAT, PROP_DISTANCE);

For the record, here is a patch weighting normal size from global mesh's dimensions… Rejected for now though (can have bad effects in some corner cases too). [P113: #41308](https://archive.blender.org/developer/P113.txt) ``` diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 8d39632..a4c0ef4 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -2138,6 +2138,21 @@ static void drawSelectedVertices(DerivedMesh *dm, Mesh *me) * logic!!! */ +static float compute_normal_size(Object *ob, Scene *scene) +{ + float min- [x], max- [x], mat- [x][4]; + + INIT_MINMAX(min, max); + BKE_object_minmax(ob, min, max, false); + sub_v3_v3(max, min); + + /* Bring back in global space. */ + invert_m4_m4(mat, ob->obmat); + mul_mat3_m4_v3(mat, max); + + return scene->toolsettings->normalsize * len_v3(max); +} + static void calcDrawDMNormalScale(Object *ob, drawDMNormal_userData *data) { float obmat- [x][3]; @@ -2184,7 +2199,7 @@ static void draw_dm_face_normals(BMEditMesh *em, Scene *scene, Object *ob, Deriv drawDMNormal_userData data; data.bm = em->bm; - data.normalsize = scene->toolsettings->normalsize; + data.normalsize = compute_normal_size(ob, scene); calcDrawDMNormalScale(ob, &data); @@ -2249,7 +2264,7 @@ static void draw_dm_vert_normals(BMEditMesh *em, Scene *scene, Object *ob, Deriv drawDMNormal_userData data; data.bm = em->bm; - data.normalsize = scene->toolsettings->normalsize; + data.normalsize = compute_normal_size(ob, scene); calcDrawDMNormalScale(ob, &data); @@ -2643,7 +2658,7 @@ static void draw_dm_loop_normals(BMEditMesh *em, Scene *scene, Object *ob, Deriv drawDMNormal_userData data; data.bm = em->bm; - data.normalsize = scene->toolsettings->normalsize; + data.normalsize = compute_normal_size(ob, scene); calcDrawDMNormalScale(ob, &data); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 1c6d0fa..f2edf70 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1872,11 +1872,12 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Proportional Size", "Display size for proportional editing circle"); RNA_def_property_range(prop, 0.00001, 5000.0); - prop = RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE); + prop = RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "normalsize"); - RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view"); - RNA_def_property_range(prop, 0.00001, 1000.0); - RNA_def_property_ui_range(prop, 0.01, 10.0, 10.0, 2); + RNA_def_property_ui_text(prop, "Normal Size", + "Display size for normals in the 3D view (proportional to global mesh's size)"); + RNA_def_property_range(prop, 0.001, 100.0); + RNA_def_property_ui_range(prop, 0.01, 2.0, 1.0, 2); RNA_def_property_update(prop, NC_GEOM | ND_DATA, NULL); prop = RNA_def_property(srna, "double_threshold", PROP_FLOAT, PROP_DISTANCE); ```

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

Closing this one for now - added the scene's scale/dimentional UI items issue to our TODO list.

Thanks for the report anyway.

Closing this one for now - added the scene's scale/dimentional UI items issue to our [TODO list](http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/UserInterface#UI_Widgets). Thanks for the report anyway.
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
2 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#41308
No description provided.