Pasting angle value with minus sign results in error #117783
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser Project (Legacy)
Interest
Asset System
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#117783
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
System Information
Operating system: win10 64
Graphics card: 1050ti
Blender Version
Broken: 3.6, 4.0.3
Short description of error
Pasting angle value with minus sign results in error:
Error evaluating number, see Info editor for details: bad operand type for unary -: 'tuple'
Exact steps for others to reproduce the error
Set X rotation to -90 deg for a Cube and copy this value with ctrl+c via cursor hover or a click
Paste it to Y rotation with math input: click cursor in the field, type "-" (minus sign w/o quotation marks), press ctrl+v then enter
But there are two
-
signs in your screenshot. Seems that this works with unitless numbers, but doesn't work when unit is used.I assume, that numbers with units are parsed as tupple, and you are effectively doing expression
-(-90, 'd')
which is invalid expression. In such case this would work as expectedActually,
--1m
is converted to(-()-(1*1 ))*1
, so the invalid part is only-()
. But the code expects a number after-
sign. So this is still working as expected. I think, there could be "find double negative" string processing stage, since it would be more consistent and quite safe though. But then values like -(-5m) still couldn't be parsed properly.@harley Can you share your opinion here? Should at least double negative be handled here?
What was your expected result? You weren't entering an "angle value with minus sign" but an angle with two minus signs. Were you expecting this would result in +90 degrees?
This error does not require any copying and pasting. You can see this result by typing values directly into the rotation input:
"90" = +90°
"-90" = -90°
"--90" = "+90°
"++90" = "+90°
"---90" = "-90°
"-------90" = -90°
The problem occurs when adding "d" or "r" after it. These work:
"90d" = +90°
"-90d" = -90°
"++90d" = +90°
"2r" = 114.592°
"-2r" = -114.592°
These do not:
"--90d" = error
"--2r" = error
Is this even something worth worrying about? It seems like an inconvenient way to enter +90° or +2r. What was the reason for pasting the negative value after entering a minus sign?
This error is caused inside of
unit_distribute_negatives
This routine puts "parentheses around blocks of values after negative signs to get rid of an implied "+" between numbers without an operation between them" The example given is this string:
"-1m50cm + 1 - 2m50cm"
becomes
"-(1m50cm) + 1 - (2m50cm)"
Guessing it was not made expecting to see multiple negatives in a row. Might be able to just repeatedly remove sequences of "--" until there are none?
I'll submit a PR for Campbell to look at
Exactly this, it is the fastest way to make positive number when dealing with math input and copied values.