Scale to zero in object mode unable to select #77559

Closed
opened 2020-06-07 07:33:10 +02:00 by iosif · 15 comments

System Information
Operating system: windows 8
Graphics card: Nvidia gforce gtx 570

Blender Version
Broken: 2.83 official release, 2.82a official release
Worked: 2.78 , 2.79a

Short description of error
If you scale an object to zero the object can't be selected unless you click on origin - if you are in wireframe shading, (works in solid shading).

Exact steps for others to reproduce the error
Based on the default startup or an attached .blend file (as simple as possible).
Default cube selected in object mode:
S Key - to scale
Z Key - constrain to z axis
0 Key - to flat it out
AA - to deselect it
Make sure you are in wireframe shading
You can't selected unless you click on origin or you change to solid shading!

If you go in edit mode before you scale it to zero it works.
If you scale it to zero in object mode, selected by origin or in solid shading or in outliner and apply scale it became selectable as expected.

**System Information** Operating system: windows 8 Graphics card: Nvidia gforce gtx 570 **Blender Version** Broken: 2.83 official release, 2.82a official release Worked: 2.78 , 2.79a **Short description of error** If you scale an object to zero the object can't be selected unless you click on origin - if you are in wireframe shading, (works in solid shading). **Exact steps for others to reproduce the error** Based on the default startup or an attached .blend file (as simple as possible). Default cube selected in object mode: S Key - to scale Z Key - constrain to z axis 0 Key - to flat it out AA - to deselect it Make sure you are in wireframe shading You can't selected unless you click on origin or you change to solid shading! If you go in edit mode before you scale it to zero it works. If you scale it to zero in object mode, selected by origin or in solid shading or in outliner and **apply scale** it became selectable as expected.
Author

Added subscriber: @Sisel

Added subscriber: @Sisel

Added subscriber: @dmcoder

Added subscriber: @dmcoder

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

I can confirm that the bug still persists in the master build (a39cc5ae4d).

I can confirm that the bug still persists in the master build (a39cc5ae4d).
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

I can confirm it as well.

I can confirm it as well.

Added subscribers: @brecht, @fclem

Added subscribers: @brecht, @fclem

On linux + AMD it only happens on Mesa (opensource driver) but not AMD pro driver.

Also the cube turns black in this case.

This is because the matrix is not invertible in this case and the inverse matrix is just set to zeros.

@brecht not sure what can we do in this case.

On linux + AMD it only happens on Mesa (opensource driver) but not AMD pro driver. Also the cube turns black in this case. This is because the matrix is not invertible in this case and the inverse matrix is just set to zeros. @brecht not sure what can we do in this case.

What we could do is first try to invert as normal, and if that fails use the pseudoinverse instead. We do this with pseudoinverse_m3_m3 in the transform code.

What we could do is first try to invert as normal, and if that fails use the pseudoinverse instead. We do this with `pseudoinverse_m3_m3` in the transform code.

This fixes the issue but i'm not sure about the performance impact.

@@ -143,11 +143,11 @@ void BKE_object_eval_constraints(Depsgraph *depsgraph, Scene *scene, Object *ob)
 void BKE_object_eval_transform_final(Depsgraph *depsgraph, Object *ob)
 {
   DEG_debug_print_eval(depsgraph, __func__, ob->id.name, ob);
   /* Make sure inverse matrix is always up to date. This way users of it
    * do not need to worry about recalculating it. */
-  invert_m4_m4(ob->imat, ob->obmat);
+  invert_m4_m4_safe(ob->imat, ob->obmat);
   /* Set negative scale flag in object. */
   if (is_negative_m4(ob->obmat)) {
     ob->transflag |= OB_NEG_SCALE;
   }
   else {
This fixes the issue but i'm not sure about the performance impact. ``` @@ -143,11 +143,11 @@ void BKE_object_eval_constraints(Depsgraph *depsgraph, Scene *scene, Object *ob) void BKE_object_eval_transform_final(Depsgraph *depsgraph, Object *ob) { DEG_debug_print_eval(depsgraph, __func__, ob->id.name, ob); /* Make sure inverse matrix is always up to date. This way users of it * do not need to worry about recalculating it. */ - invert_m4_m4(ob->imat, ob->obmat); + invert_m4_m4_safe(ob->imat, ob->obmat); /* Set negative scale flag in object. */ if (is_negative_m4(ob->obmat)) { ob->transflag |= OB_NEG_SCALE; } else { ```

Added subscribers: @Sergey, @ideasman42

Added subscribers: @Sergey, @ideasman42

I think it would be a good thing to invert the object matrix like this. There are many places that do this though, and they would all need to be updated (see e.g. grep -r "invert_m4_m4.*obmat" source/blender/).

@Sergey, @ideasman42, any opinion on doing this?

Could we perhaps even change invert_m4_m4 itself to always behave like invert_m4_m4_safe?

I think it would be a good thing to invert the object matrix like this. There are many places that do this though, and they would all need to be updated (see e.g. `grep -r "invert_m4_m4.*obmat" source/blender/`). @Sergey, @ideasman42, any opinion on doing this? Could we perhaps even change `invert_m4_m4` itself to always behave like `invert_m4_m4_safe`?

This issue was referenced by 5a13f682ee

This issue was referenced by 5a13f682ee5f55717c2fbc35371cd5bf58829b88

I'll commit this fix. A more global fix could be committed separately.

I'll commit this fix. A more global fix could be committed separately.

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Clément Foucault self-assigned this 2020-07-03 00:22:15 +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
No Assignees
6 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#77559
No description provided.