Page MenuHome

Distributes selected UV vertices evenly in the Horizontal and Vertical directions.
Closed, ArchivedPublicPATCH

Description

Project: Blender Extensions
Tracker: Py Scripts Upload
Blender: 2.61
Category: UV
Python: 3.2
Script name: UVDistribute
Author(s): Dan Wheeler (Quizkid)
Status: Open

Features:
Distributes selected UV vertices evenly in the Horizontal and Vertical directions.

Setup:
Install like any other Python addon, by using the button at File>User Preferences>Addons>Install Addon... After installation, check the checkbox in the Addon Category "Mesh>UVDistribute"

Manual:
Sometimes the UV unwrap feature will warp the spacing of UVs along edges. In Blender 2.61 (and perhaps earlier), there are new tools to align UVs in the X and Y direction, but sometimes alignment is not enough. Sometimes the UVs become bunched up at one end or the other, or in some way become not distributed evenly. This script fixes that. To be honest, I'm surprised Blender does not come with this rather simple feature. Without it, it's hard or impossible to model certain UV mappings, such as mapping "grip tape" that is spiral wound around a tennis racquet handle, or sword handle (using the screw modifier). Unwrapping the spiral object tends to cause the UVs to get distorted.

To use, select 3 or more UV vertices in the UV Editor, and select "UVDistribute" from the UVs/Weld/Align menu. The vertices will be spaced out evenly, in both the X and Y direction.

Workflow: Select an object in the 3D window, go into edit mode, then perform a UV Unwrap. This will cause the vertices to show up in the UV Editor window. Usually you will want to select UVs that are on an edge (by Alt-LMB clicking an edge of vertices for example), then align them in the X or Y axis using UVs>Weld/Align>AlignX or Y. At this point the UV vertices are lined up, but may not be equally distributed. If installed correctly, select "UVDistribute" from the same UVs/Weld/Align menu. The vertices will be spaced out evenly, in both the X and Y direction.

Note - this merely evenly spaces out the vertices, it does NOT attempt to force them into a line - that is what AlignX or AlignY is for.

Event Timeline

Hi,
Due to changes to the api including the merging of bmesh, several addons are outdated.
Please, if you are the author of an addon check your script with blender revision 44256 or newer.
That is builds made After blender 2.62 official release.
I would ask that updates be made to your addon before the Blender 2.63 release.
6-8 weeks away.
This allows time for the api to become more exposed & bmesh to stablize furthur.
If you need help, drop into irc freenode #blenderpython or #blendercoders & feel welcome to ask questions.
At the time of 2.63 release, scripts that are not repaired or in active developement will have their tracker page marked "Closed"
this will not affect your links to the tracker, similar to closing scripts in 2.49b, the page will be still availible & can be re-opened.

Thanks for your understanding & patience during these Exciting Times.
Brendon.

I find this an ESSENTIAL TOOL for many UV projects, this should REALLY BE IN TRUNK, however, at least there is this addon. Sadly, however, it doesnt work in the latest 2.63 builds.

I get the following error in the latest 2.63 trunk builds:


blenderfoundation.blender: Traceback (most recent call last):
blenderfoundation.blender: File "/Users/username/Library/Application Support/Blender/2.62/scripts/addons_extern/uvDistribute.py", line 68, in invoke
blenderfoundation.blender: return {self.execute(context)}
blenderfoundation.blender: File "/Users/username/Library/Application Support/Blender/2.62/scripts/addons_extern/uvDistribute.py", line 74, in execute
blenderfoundation.blender: uvDistribute(self,context.active_object)
blenderfoundation.blender: File "/Users/username/Library/Application Support/Blender/2.62/scripts/addons_extern/uvDistribute.py", line 110, in uvDistribute
blenderfoundation.blender: uvCount = len(uvTexture.data[i].uv)
blenderfoundation.blender: AttributeError: 'MeshTexturePoly' object has no attribute 'uv'
blenderfoundation.blender: location:<unknown location>:-1
blenderfoundation.blender: location:<unknown location>:-1


if anyone knows how to fix this, and can post a fixed version of this very useful script, it would be appreciated.

Thanks for your kind notes. I didn't know that anyone was using it except me!

I'll take a look at how my UVDistribute script works with the new Blender version ASAP and provide an update as soon as I can.

Thanks for your great contribution to Blender Dan :-)
I'm looking forward to being able to use this VERY useful script again in a post-Bmesh build

It sounds like a good script, but again with current version of the Blender 2.63 seems it doesn't work.

Traceback (most recent call last):
File "C:\Users\Zexell\Dropbox\blender_scripts\addons_extern\uvDistribute.py", line 68, in invoke
return {self.execute(context)}
File "C:\Users\Zexell\Dropbox\blender_scripts\addons_extern\uvDistribute.py", line 74, in execute
uvDistribute(self,context.active_object)
File "C:\Users\Zexell\Dropbox\blender_scripts\addons_extern\uvDistribute.py", line 110, in uvDistribute
uvCount = len(uvTexture.data[i].uv)
AttributeError: 'MeshTexturePoly' object has no attribute 'uv'

location:<unknown location>:-1

Thanks for the error trace. I've begun looking at this this evening. it looks like it will take me at least a few days, because it appears that the underlying data structures for Blender have changed a lot.

Like "blendif icus" said in an earlier post, something like this really belongs in Blender. There should be both "alignment" and "distribute" tools built in to Blender as a part of the regular UV tools. They did add "alignment," but distribute is still missing.

So I'll keep working on this as I have time.

I've completed a version that will work with Blender 2.63. However I can't figure out how to upload it here. Hopefully I'll finish this 6/8/2012.

hi,
to upload, in attachments add the script location, but don't submit.
then go back to comments page, add comment & submit.
this will load your attachment as you need to comment too

New version that works with version 2.63. Thanks to Brian for providing feedback that helped get this working.

I haven't fully tested this with objects that use bmesh. If you find an example that it doesn't work with, if you could send me the blender file, That would be helpful.

Thank you!! I SO needed this! Works perfectly with 2.69

Brendon Murphy (meta-androcto) changed the task status from Unknown Status to Unknown Status.Sep 2 2015, 8:05 AM

closing as archived, this task is over 3 years old.
Currently there's UV Align/Distribute in contrib.
Dan Wheeler (quizkid)
feel free to contribute patches to UV Align/Distribute in contrib.