Fix #103469: Update UV Sphere Projection with Seam support. #104847
No reviewers
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#104847
Loading…
Reference in New Issue
No description provided.
Delete Branch "Chris_Blackbourn/blender:uv-sphere-seam"
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?
Also updates UV Cylinder projection in same way.
@ -1509,1 +1512,4 @@
static const EnumPropertyItem seam_items[] = {
{SEAM_IGNORE, "IGNORE", 0, "Ignore", "Seams are ignored"},
{SEAM_RESPECT, "RESPECT", 0, "Respect", "Existing seams are respected"},
A brief explanation of what it means to use seams should be included.
Changed to bools, comment is now:
@ -1520,6 +1529,7 @@ static void uv_transform_properties(wmOperatorType *ot, int radius)
"Align",
"How to determine rotation around the pole");
RNA_def_enum(ot->srna, "pole", pole_items, PINCH, "Pole", "How to handle faces at the poles");
RNA_def_enum(ot->srna, "seam", seam_items, SEAM_IGNORE, "Seam", "How to handle seams");
Existing operations that support delimiting use booleans, think this could be a boolean too because even if other delimiters are added, those would be booleans too which could be toggled individually.
Changed to
RNA_def_boolean
@ -2797,3 +2807,3 @@
}
static void uv_sphere_project(BMFace *efa,
static void uv_sphere_project(const Scene *scene,
This implements it's own face-group detection, unless there is some reason not to -
BM_mesh_calc_face_groups
avoids inlining this logic.BM_mesh_calc_face_groups
does not record the connectivity of the faces which are visited.For example, a single rectangular ribbon made of many faces can wrap around a cylinder multiple times, but only produce one island. We need to know how the faces are locally connected to extend out the UVs in a consistent manner.
Functionality seems useful, but commit log and tooltips should mention what it means to use seams in the context of projections.
Fix #103469: Update UV Sphere Projection to Preserve Seams
Note: Applies to both UV Sphere Projection and UV Cylinder Projection.
Adds a new boolean option "Preserve Seams" to UV Sphere Projection.
With "Preserve Seams" active, the Sphere projection will do a greedy flood fill over the 3D topology, stopping at 3D boundaries and also stopping at edges where "Mark Seam" has been used in the 3D Viewport.
During the flood fill, each face is mapped using the spherical projection and then adjusted along the
U
axis so the UV map is continuous across the shared edge.With careful seam placement, this allows for the creation of a spiral-cut-orange-peel unwrap, where a sphere can be unwrapped into a single long continuous strip, wrapping multiple times around the object.
Finally, if the flood fill process creates multiple UV Islands, they are spaced along the
U
axis, to prevent overlaps.@ -1311,2 +1311,4 @@
#define FAN 1
#define SEAM_IGNORE 0
#define SEAM_RESPECT 1
I'll remove these two #defines, they're no longer needed.
The patch should include a user-level description on how this works, some comments inline, otherwise I don't see a need for extra review iterations.
@ -2804,0 +2811,4 @@
const BMUVOffsets offsets,
const bool only_selected_uvs,
const bool use_seams,
float branch)
The way this is used as an argument and re-assigned I find a bit confusing, could call
const float branch_init
, then usebranch
for values inline.@ -2815,0 +2818,4 @@
return max_u;
}
blender::Vector<BMFace *> consider_stack;
Is there any reason not to use a single vector (storing a Face pointer and branch value for each item)? Avoids having to keep the arrays in sync and I'd expect would read better.
@ -2966,0 +3103,4 @@
const bool use_seams = RNA_boolean_get(op->ptr, "seam");
if (use_seams) {
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
BM_mesh_elem_hflag_disable_all(bm, BM_FACE, BM_ELEM_TAG, false);
can be used here.Fix 103469: Update UV Sphere Projection with Seam support.to Fix #103469: Update UV Sphere Projection with Seam support.