UV coordinates for Mesh primitives #37879

Closed
opened 2013-12-19 16:24:27 +01:00 by Brecht Van Lommel · 27 comments

Currently UV unwrapping some primitives doesn't work nicely, the option to add meshes with generated UVs would be useful.

Primitives that could have this are sphere, cone, cube, etc.

Currently UV unwrapping some primitives doesn't work nicely, the option to add meshes with generated UVs would be useful. Primitives that could have this are sphere, cone, cube, etc.
Author
Owner

Changed status to: 'Open'

Changed status to: 'Open'
Author
Owner

Added subscriber: @brecht

Added subscriber: @brecht

Added subscriber: @michaelknubben

Added subscriber: @michaelknubben

This would be very, very useful.
Another place where auto-generated UV's make sense is on a path/bezier with Bevel above 0. I often use this for quick pipes, and wish I wouldn't have to convert to a mesh to unwrap. Not only is it destructive, but it's actually a somewhat tedious shape to unwrap perfectly straight.

This would be very, very useful. Another place where auto-generated UV's make sense is on a path/bezier with Bevel above 0. I often use this for quick pipes, and wish I wouldn't have to convert to a mesh to unwrap. Not only is it destructive, but it's actually a somewhat tedious shape to unwrap perfectly straight.

Added subscriber: @kevindietrich

Added subscriber: @kevindietrich

HI,

What are exactly the files to change ? From looking at the source, changes are to be made to source/blender/editors/mesh/editmesh_add.c, right ? I believe source/blender/editors/uvedit/uvedit_unwrap_ops.c should be referenced at some point too.

If someone could point me in the right direction, that'd be lovely.

HI, What are exactly the files to change ? From looking at the source, changes are to be made to `source/blender/editors/mesh/editmesh_add.c`, right ? I believe `source/blender/editors/uvedit/uvedit_unwrap_ops.c` should be referenced at some point too. If someone could point me in the right direction, that'd be lovely. ```
Author
Owner

The option to add such UV coordinates should be added to the operators in source/blender/editors/mesh/editmesh_add.c.
The actual implementation should be in source/blender/bmesh/operators/bmo_primitive.c.
For reference on how to add UV coordinates to a mesh, source/blender/editors/uvedit/uvedit_unwrap_ops.c can be used, though it probably wouldn't be called directly.

The option to add such UV coordinates should be added to the operators in `source/blender/editors/mesh/editmesh_add.c`. The actual implementation should be in `source/blender/bmesh/operators/bmo_primitive.c`. For reference on how to add UV coordinates to a mesh, `source/blender/editors/uvedit/uvedit_unwrap_ops.c` can be used, though it probably wouldn't be called directly.

Added subscriber: @MarceloVaranda

Added subscriber: @MarceloVaranda
Kévin Dietrich self-assigned this 2014-01-28 17:37:56 +01:00
Member

Added subscriber: @PaoloAcampora

Added subscriber: @PaoloAcampora
Kévin Dietrich removed their assignment 2014-03-13 15:32:16 +01:00

Added subscriber: @tanel58

Added subscriber: @tanel58

I tried to figure this out before the Phabricator migration but was stumped after a while.
kevindietrich, if you tackled this task, please tell me what you tried, I would like to try this again.

I tried to figure this out before the Phabricator migration but was stumped after a while. kevindietrich, if you tackled this task, please tell me what you tried, I would like to try this again.

@tanel58: I don't recall exactly what I tried because I'm currently studying hard for cinema (if that makes sense), I've been for the past weeks between my home and Paris where I am right now with a slow laptop on Windows, so no programming on that one :). And that's the main reason why I placed this task up for grabs.

Anyway, IIRC at first I added a simple if statement to evey operator in source/blender/editors/mesh/editmesh_add.c that adds a UV texture to the object upon creation of it. Look at "ensure uvs". By doing so every object had some uvs but every vertex was in the same place.

Then, taking source/blender/editors/uvedit/uvedit_unwrap_ops.c as reference, I tried to add some conditions to the functions in source/blender/bmesh/operators/bmo_primitive.c to iter through the vertices of the mesh after those were generated to get the uvs. I don't remember the name of it but I think the main element was BM_MESH_ITER, something like that.

Again I didn't really had time to deeply look at it due to my studies in Paris which started beginning of February, so anyway, I hope that this time you'll get it to work :).

@tanel58: I don't recall exactly what I tried because I'm currently studying hard for cinema (if that makes sense), I've been for the past weeks between my home and Paris where I am right now with a slow laptop on Windows, so no programming on that one :). And that's the main reason why I placed this task up for grabs. Anyway, IIRC at first I added a simple if statement to evey operator in `source/blender/editors/mesh/editmesh_add.c` that adds a UV texture to the object upon creation of it. Look at "ensure uvs". By doing so every object had some uvs but every vertex was in the same place. Then, taking `source/blender/editors/uvedit/uvedit_unwrap_ops.c` as reference, I tried to add some conditions to the functions in `source/blender/bmesh/operators/bmo_primitive.c` to iter through the vertices of the mesh after those were generated to get the uvs. I don't remember the name of it but I think the main element was BM_MESH_ITER, something like that. Again I didn't really had time to deeply look at it due to my studies in Paris which started beginning of February, so anyway, I hope that this time you'll get it to work :).

Removed subscriber: @MarceloVaranda

Removed subscriber: @MarceloVaranda

Added subscriber: @CommanderCorianderSalamander

Added subscriber: @CommanderCorianderSalamander

Would it be unreasonable to do this by default instead of adding it as an option? I've never done any work on Blender and this seems like it could be an okay place to start over the next couple weeks.

Would it be unreasonable to do this by default instead of adding it as an option? I've never done any work on Blender and this seems like it could be an okay place to start over the next couple weeks.

Go ahead, I can't pick this up because I'm busy right now, but I would love to see this in Blender :)

Go ahead, I can't pick this up because I'm busy right now, but I would love to see this in Blender :)

Yes please!

Although eventually, I think the option should be provided when creating a primitive, primitives should have them by default.

Yes please! Although eventually, I think the option should be provided when creating a primitive, primitives should have them by default.

Well, in my first attempt and as far as I understood what the option was (an if statement saying "if there is no UVs, add some"), primitives had UVs by default. But I failed at getting descent UVs fore each primitive. So the option is not something you would see in the UI.

Well, in my first attempt and as far as I understood what the option was (an if statement saying "if there is no UVs, add some"), primitives had UVs by default. But I failed at getting descent UVs fore each primitive. So the option is not something you would see in the UI.

I'm not sure what you're saying, sorry. If you're wondering where it would be in the interface, it would be an option in the Operator Panel after primitive creation.

I'm not sure what you're saying, sorry. If you're wondering where it would be in the interface, it would be an option in the Operator Panel after primitive creation.
Liam Mitchell self-assigned this 2014-04-18 02:11:12 +02:00

So I've been playing around with it for a few days and managed to get default UVs for cubes working ok (yay! though they could be better... but we'll get there =D) - I guess I'll take this now. Hopefully I can get things working reasonably well in the next couple weeks =) this is my first time doing anything open source at all (much less Blender) so we'll see how it goes 0o

So I've been playing around with it for a few days and managed to get default UVs for cubes working ok (yay! though they could be better... but we'll get there =D) - I guess I'll take this now. Hopefully I can get things working reasonably well in the next couple weeks =) this is my first time doing anything open source at all (much less Blender) so we'll see how it goes 0o

Patch submitted, feel free to check it out: D481 =)

Patch submitted, feel free to check it out: [D481](https://archive.blender.org/developer/D481) =)
Liam Mitchell was unassigned by Bastien Montagne 2015-12-04 23:48:42 +01:00
Bastien Montagne self-assigned this 2015-12-04 23:48:42 +01:00

This issue was referenced by 3c6709a63c

This issue was referenced by 3c6709a63c267dc3cb3898efd9d6466c2300876c

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Added subscriber: @GabrielGazzan

Added subscriber: @GabrielGazzan

I see UVs for the Sphere primitive are really not very useful.
The idea is very good, but I think you should try to improve the UV layout to really make it useful.

You can check the differences in the following images:
Current Blender UV layout: http://a.edu.uy/blender/UVsphere_blender.png
Maya UV layout: http://a.edu.uy/blender/UVsphere_maya.png

Thanks!!

I see UVs for the Sphere primitive are really not very useful. The idea is very good, but I think you should try to improve the UV layout to really make it useful. You can check the differences in the following images: Current Blender UV layout: http://a.edu.uy/blender/UVsphere_blender.png Maya UV layout: http://a.edu.uy/blender/UVsphere_maya.png Thanks!!

Added subscriber: @CarstenWartmann

Added subscriber: @CarstenWartmann

Yep, UV not really usefull for sphere...

Carsten

Yep, UV not really usefull for sphere... Carsten
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
11 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#37879
No description provided.