[Closed] Transfer UV's problem
I have two models and I want to transfer UV form one to other but I get wrong result. Both objects have the same topology ei. verts count.
I try first with save and load UV from Unwrap modifier and Copy-paste Uv channel from ChannelInfo but result is not correct.
This happens when I unwrap model in different software and import it back in max.
Can someone explain me why this happens and how can be solved.
Only solution that I find is to assigne on the Blue (original) model “Turn To Mesh” and “Turn To Poly” and then CopyPaste UV Channel from Green model to blue model
Is there a better solution to this?
I attached test scene (max2014).
Code that I used for test scene
fn transUV source target = with undo on with redraw off
(
if (getPolygonCount source) as string == (getPolygonCount target) as string do
(
addModifier target (Turn_to_Mesh())
addModifier target (Turn_to_Poly removeMidEdgeVertices:off)
ChannelInfo.CopyChannel source 3 1
ChannelInfo.PasteChannel target 3 1
)
)
source = $Head_NewUVs
target = $HeadOriginal
transUV source target
your models have different order of vertices of some polygons.
there two ways:
#1 make the same order (convert to mesh and set verts in the same order)
…
#2 reorder map face verts in the way of geo verts
fn XChangeUV target source channel:1 =
(
polyop.setmapsupport source channel on
polyop.defaultmapfaces source channel
polyop.setnummapverts source channel (polyop.getnummapverts target channel)
for f=1 to (polyop.getnumfaces target) do
(
tvv = (polyop.getfaceverts target f)
svv = (polyop.getfaceverts source f)
ttv = polyop.getmapface target channel f
stv = for v in svv collect
(
ttv[finditem tvv v]
)
polyop.setmapface source channel f stv
)
for v=1 to (polyop.getnummapverts target channel) do
(
polyop.setmapvert source channel v (polyop.getmapvert target channel v)
)
update source
)
XChangeUV $Head_NewUVs $HeadOriginal
do a code optimization and foolproofing yourself