Alex
New Member
Posts: 2
|
Post by Alex on Nov 13, 2017 15:42:36 GMT
Hello all. first off this software is absolutely fantastic to say the least. I know this is a rather weird request, but would it be possible to straighten all the uv edges into a perfect grid and then pack all the uv's on top of each other in the 1st uv slot going from 0 to 1 in space. I have an example of how this would work (or what I need it for specifically) is unwrapping a tree and all its branches and leaves. So how I do it manually is I autoseam and cut the tree, then I unfold it like normal . Once the unfold is complete I rotate all of the branches so that the base of the branchs is at the bottom on the uv space and the tip of the branch is at the top of the uv space. then I edge align all the edges to make a straight grid. Once I have done all this I stretch the uv's over the whole uv slot and then I do the same for the leaves. This isn't really an artistic feature request, its more of technical feature that I personally need for a tool I built in 3ds max. My tool uses the uv's as a way to measure and find the center of any object. It might be really useful to alot of people out there. I provided screen shots of what I mean by using a simple teapot to explain visually what I mean. Regards Alex.
|
|
|
Post by Remi Arquier on Nov 16, 2017 16:07:46 GMT
Hi Alex,
That is possible yes to do a LUA script that do that, providing that your cut line separate the islands into quad-only islands.
I also have to add a new LUA method, because it is not currently possible to know the number of islands by LUA script. I add this quicly and I come back to you.
Regards
|
|
|
Post by Remi Arquier on Nov 16, 2017 17:29:49 GMT
Hi Alex,
Important: the following work only in the version 2017.0.24
Here is a LUA script that
0- Assign all islands that are not yet assigned to a tile to the available tiles 1- Unfold all islands 2- for each island: 2.a Select it 2.b rectangularize all polygons of it 3.c rescale so that it fill the UV square totally
U3dIslandGroups({Mode="DistributeInTilesEvenly", MergingPolicy=8322, UseTileLocks=true, UseIslandLocks=true, UseIslandSelection=false, GroupPaths={ "RootGroup" }}) U3dUnfold({PrimType="Edge", MinAngle=1e-005, Mix=1, Iterations=1, PreIterations=5, StopIfOutOFDomain=false, RoomSpace=0, PinMapName="Pin", ProcessNonFlats=true, ProcessSelection=true, ProcessAllIfNoneSelected=true, ProcessJustCut=true})
for islandID=0,U3dCount("Lib.Mesh.Islands")-1 do U3dSelect({PrimType="Island", ResetBefore=true, Select=true, IDs={ islandID}, List=true}) U3dDeform({PrimType="Island", Geometrical="Horizontalize"}) U3dPack({ProcessTileSelection=false, RecursionDepth=1, RootGroup="RootGroup", Scaling={Mode=0}, Rotate={Mode=0}, LayoutScalingMode=3, ProcessIslandSelection=true, PostLayoutScalingProcessIslandSelection=true}) end
Is it answering to your needs ?
|
|
Alex
New Member
Posts: 2
|
Post by Alex on Nov 18, 2017 19:51:36 GMT
Thank you so Much Remi.
This is working perfectly! I have been working with it all weekend and I can not tell you how much I appreciate your help and taking the time to develope this script.
Again Thank you so much!
Regards Alex.
|
|
|
Post by Remi Arquier on Nov 20, 2017 10:39:35 GMT
Hi Alex
Your welcome, if you have anything to share (youtube videos of the process / pictures of it), please share it !
I am sure other would be very interested by what you are doing. If you do, you can share it in the board "Showcase".
cheers
|
|