Cube projection size parameter is wrong #85379

Closed
opened 2021-02-04 17:32:58 +01:00 by Ludvik Koutny · 11 comments
Contributor

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 461.09

Blender Version
Broken: version:

  • 2.93.0
  • 2.92.0
  • 2.91.0, branch: master (modified), commit date: 2020-11-25 11:06, hash: b50598bc78
    Worked: Never

Short description of error
When using Cube projection UV mapping operator, the resulting cubic projection size is actually double of the size displayed in the user interface. So when you perform a cube projection with the size 1.0, which would imply a cube of a size of 1 blender unit, which should be 1 meter, but size of the cubic projection actually ends up 2 meters wide. This is probably remnant of the old weird times when cube primitive in Blender was specified using a radius value instead of size value.

Exact steps for others to reproduce the error

  1. In an empty .blend file, create a new cube
  2. Resize the cube so that the dimensions are 1x1x1 meters and apply the scale
  3. In edit mode, select all the cube faces and run Cube projection UV operator, and set the Cube Size to 1.0
    Result: In the UV editor, the cube UV faces do not match the edges of UV space perfectly despite the size of the 3D cube in the viewport matching the Cube Size value set in Cube Projection operator.
    Expected. The UV faces in the editor match the edges of the UV space perfectly, since a Cube Projection with a size of 1.0 was applied on a Cube mesh with a size of 1.0 and 1.0 scale transform.
**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 461.09 **Blender Version** Broken: version: - 2.93.0 - 2.92.0 - 2.91.0, branch: master (modified), commit date: 2020-11-25 11:06, hash: `b50598bc78` Worked: Never **Short description of error** When using Cube projection UV mapping operator, the resulting cubic projection size is actually double of the size displayed in the user interface. So when you perform a cube projection with the size 1.0, which would imply a cube of a size of 1 blender unit, which should be 1 meter, but size of the cubic projection actually ends up 2 meters wide. This is probably remnant of the old weird times when cube primitive in Blender was specified using a radius value instead of size value. **Exact steps for others to reproduce the error** 1. In an empty .blend file, create a new cube 2. Resize the cube so that the dimensions are 1x1x1 meters and apply the scale 3. In edit mode, select all the cube faces and run Cube projection UV operator, and set the Cube Size to 1.0 Result: In the UV editor, the cube UV faces do not match the edges of UV space perfectly despite the size of the 3D cube in the viewport matching the Cube Size value set in Cube Projection operator. Expected. The UV faces in the editor match the edges of the UV space perfectly, since a Cube Projection with a size of 1.0 was applied on a Cube mesh with a size of 1.0 and 1.0 scale transform.
Author
Contributor

Added subscriber: @Rawalanche

Added subscriber: @Rawalanche

Added subscriber: @rjg

Added subscriber: @rjg

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

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

I can confirm this issue. It seems this needs adjustments in both cube_project_exec and uvedit_unwrap_cube_project.

When the cube_size is determined based on the bounds it shouldn't use cube_size = cube_size ? 2.0f / cube_size : 1.0f; in cube_project_exec. Instead the cube_size should be used as is (or set to 1.0f if zero).

The uvedit_unwrap_cube_project shouldn't need to multiply the cube_size with a 0.5f factor anymore.

I can confirm this issue. It seems this needs adjustments in both `cube_project_exec` and `uvedit_unwrap_cube_project`. When the `cube_size` is determined based on the `bounds` it shouldn't use `cube_size = cube_size ? 2.0f / cube_size : 1.0f;` in `cube_project_exec`. Instead the `cube_size` should be used as is (or set to `1.0f` if zero). The `uvedit_unwrap_cube_project` shouldn't need to multiply the `cube_size` with a `0.5f` factor anymore.
Author
Contributor

@rjg

Hi,
any reason this was not addressed and made it into final 2.92?

@rjg Hi, any reason this was not addressed and made it into final 2.92?

@Rawalanche Nobody wrote a patch for it between the confirmation of the bug (Feb 5) and release of 2.92 (Feb 25).

@Rawalanche Nobody wrote a patch for it between the confirmation of the bug (Feb 5) and release of 2.92 (Feb 25).
Robert Guetzkow self-assigned this 2021-03-01 15:34:26 +01:00
Author
Contributor

In #85379#1121496, @rjg wrote:
@Rawalanche Nobody wrote a patch for it between the confirmation of the bug (Feb 5) and release of 2.92 (Feb 25).

I was really confused mainly because right in the post above mine it seemed like you already had a solution, knew exactly what needs to be done, and at the same time it was reported three weeks before release, so time should be there. So I thought there was some deeper dependency on something else preventing this from being addressed.

> In #85379#1121496, @rjg wrote: > @Rawalanche Nobody wrote a patch for it between the confirmation of the bug (Feb 5) and release of 2.92 (Feb 25). I was really confused mainly because right in the post above mine it seemed like you already had a solution, knew exactly what needs to be done, and at the same time it was reported three weeks before release, so time should be there. So I thought there was some deeper dependency on something else preventing this from being addressed.

@Rawalanche No hidden surprise so far. Since the beginning of February I'm no longer working part-time on the bug tracker , because I have to finish my computer science degree. Thus I have limited time available to write patches and help with bug triaging.

@Rawalanche No hidden surprise so far. Since the beginning of February I'm [no longer working part-time on the bug tracker ](https://devtalk.blender.org/t/1-february-2021/17225), because I have to finish my computer science degree. Thus I have limited time available to write patches and help with bug triaging.

This issue was referenced by 8810d0cecd

This issue was referenced by 8810d0cecdd5c192d0562c62490695d22ca684d5

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Author
Contributor

It doesn't appear that https://developer.blender.org/rB8810d0cecdd5c192d0562c62490695d22ca684d5 fixed anything. Applying a cube projection of a size of 2 onto a 2x2x2 cube with 1.0 scale will still result in cubic mapping of size 1:
image.png
image.png
The fix either did not make it into the main branch or it's a placebo.

It doesn't appear that https://developer.blender.org/rB8810d0cecdd5c192d0562c62490695d22ca684d5 fixed anything. Applying a cube projection of a size of 2 onto a 2x2x2 cube with 1.0 scale will still result in cubic mapping of size 1: ![image.png](https://archive.blender.org/developer/F13179236/image.png) ![image.png](https://archive.blender.org/developer/F13179239/image.png) The fix either did not make it into the main branch or it's a placebo.
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#85379
No description provided.