[Closed] [Query] UVW Relax single axis
Hi,
I was wondering if anyone could make a script to make a relax function in unwrap that would relax on a single axis. It would work like the Unfold function in Maya, witch was really useful.
I’m not sure if this is even possible to do only with maxScript or if there is already something like that, but that really speed up my work and it’d be great if someone could help me with that!
Thanks!
Hi,
Search is your best friend
http://forums.cgsociety.org/showthread.php?f=98&t=692208&highlight=relax
yeah thanks but, I saw that, but this is not the relax I’m talking about. This is to relax polygons in edit poly mode.
I’m talking about the relax tool in unwrap UVW, this script won’t work for that.
I only managed to find how to relax verts when I was looking a while ago. Here is the section of code that handles it in my script. (Still a noob at MS)
theUnw = Unwrap_UVW ()
addModifier theCopy theUnw
modPanel.setCurrentObject theCopy.modifiers[#Unwrap_UVW]
SubObjectlevel = 1
theCopy.modifiers[#unwrap_uvw].unwrap2.setIgnoreBackFaceCull off
theCopy.modifiers[#unwrap_uvw].unwrap6.selectVerticesByNode #{1..216} $
theCopy.modifiers[#unwrap_uvw].unwrap2.fitRelax 50 0.1
theCopy.modifiers[#unwrap_uvw].unwrap2.packNoParams()
theCopy.modifiers[#unwrap_uvw].unwrap6.selectVerticesByNode #{1..216} $
theCopy.modifiers[#unwrap_UVW].unwrap2.scaleSelectedCenter 0.98 0
theProj = ProjectionMod() --create a projection modifier
addModifier theCopy theProj
I hope this is of some help, and if you find a way to handle polies I’d love to know for future reference. This also handles packing and scaling as well. I’m sorry it doesn’t handle the axis issue but I’m sure it isn’t that hard to find the solution.
thanks Luke, I don’t do maxScript myself so I cannot complete this script. however I keep your code, maybe someone else will know what to do and your code will be helpful!
I’ll tell you if I find anything!
Ok yeah maybe I should read the post a bit more thoroughly. If you could give me more details I’ll have ago at what you need.
What type of object is it and what type of projection. Planar, Box etc
Which axis do you need it to scale on?
Any other details you might think relevant.
not very elegant, but how about recording all vertex positions before relaxing, relax normally on all axis, and then reload the original positions for the axis you want to keep?
yeah, the best would be to have a UI to select if you want to lock on X axis or Y axis then perform the relax accordingly.
keeping in memory vertex positions would be a good start but not sure if it would totally do it, you know sometimes relax does really weird things like sometimes with cylindrical mapping, instead of giving you a clean straight row of UV it gives you some kind of circle… thats why I want the relax to be something like unfold in maya, but maybe I’m asking too much! hehe
do you mean the align tool like in ‘unwrap tools’ ? if not what tool do you mean exactly?
I want a tool that would kind of lock the Y axis height for example and relax the uv only in width. kind of hard to explain but it’s really like unfold in Maya if you know it or go to http://www.youtube.com/watch?v=cN5dzZmg1SE at about 5:00 they start showing unfold in action