Multiply and divide in item location only calculates second part of separate units. #109837

Open
opened 2023-07-07 21:51:43 +02:00 by Xen Wildman · 6 comments

System Information
Operating system:any
Graphics card:any

Blender Version
3.4+

Short description of error
When separate units (imperial) is enabled, the math (multiply/divide) in the item location field is broken.

Exact steps for others to reproduce the error

In a new blender file, set the scene units to imperial.
Check the 'Separate Units' checkbox.

In the 3d viewport, select the default cube and press G X 6.5 to move the default cube 6'6" in the X axis.
Now in the Item Tab, Transform, Item Properties, enter the X location field and add /2 or *0.5 to the end of the line.

The expected behaviour is to halve the value in the field which would result in 3'3". What happens though, is it only calculates for the inches portion of the location, resulting in a location value of 6'3".

**System Information** Operating system:any Graphics card:any **Blender Version** 3.4+ **Short description of error** When separate units (imperial) is enabled, the math (multiply/divide) in the item location field is broken. **Exact steps for others to reproduce the error** In a new blender file, set the scene units to imperial. Check the 'Separate Units' checkbox. In the 3d viewport, select the default cube and press G X 6.5 to move the default cube 6'6" in the X axis. Now in the Item Tab, Transform, Item Properties, enter the X location field and add /2 or *0.5 to the end of the line. The expected behaviour is to halve the value in the field which would result in 3'3". What happens though, is it only calculates for the inches portion of the location, resulting in a location value of 6'3".
Xen Wildman added the
Type
Report
Status
Needs Triage
Priority
Normal
labels 2023-07-07 21:51:44 +02:00
Member

Can confirm, although it is fine if you do (2m 22cm)/2, it will give you 1m 11cm. Not sure if this is intentional, but probably this is pretty overlooked when designing the in-place expression evaluation. Hard to say which way is right since it does have a space between two values.

Can confirm, although it is fine if you do `(2m 22cm)/2`, it will give you `1m 11cm`. Not sure if this is intentional, but probably this is pretty overlooked when designing the in-place expression evaluation. Hard to say which way is right since it does have a space between two values.
YimingWu added
Module
User Interface
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-07-09 04:29:58 +02:00
Author

This is still broken in Blender 4.0.

This is still broken in Blender 4.0.
Member

Looks like this is expected referring to current code. Following expression is calculated for 6ft 6in / 2 = (6*1 + (6*0.08333/2))*0.3048
0.08333 is 1 inch to feet conversion factor
0.3048 is feet to meter conversion factor

If you do (6ft 6in )/ 2 in UI, it will give correct result

Looks like this is expected referring to current code. Following expression is calculated for 6ft 6in / 2 = `(6*1 + (6*0.08333/2))*0.3048` 0.08333 is 1 inch to feet conversion factor 0.3048 is feet to meter conversion factor If you do (6ft 6in )/ 2 in UI, it will give correct result

I can see incorrectness in the fact that there is 2 separate (by space) part of one value can occur.

I can see incorrectness in the fact that there is 2 separate (by space) part of one value can occur.
Member

@mod_moder hi, can you elaborate more. I did not completely understand that 😅

@mod_moder hi, can you elaborate more. I did not completely understand that 😅

Have you seen any programming language (or just syntax parsing) that lets to you to declare value as multiple separate word (et 123 123 = 123.123, or 33 * 10^-1 55 * 10^-5). Not sure if this can be fixed, but should be restricted instead?

Have you seen any programming language (or just syntax parsing) that lets to you to declare value as multiple separate word (et `123 123` = `123.123`, or `33 * 10^-1 55 * 10^-5`). Not sure if this can be fixed, but should be restricted instead?
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
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#109837
No description provided.