// UV SetAlign 0.221 // 選択1点目のU Vに合わせる。 @name "UV SetAlign" @version 2.6 @warnings @script modeler @define DESCRIPT "UV SetAlign" main { selmode(DIRECT); var SelPts = pointcount(); if(SelPts < 2){ error("Need 2pts or more"); return; } var vmap = VMap(VMTEXTURE, 0); if(vmap == nil){ error("Not Select UV Map"); return; } reqbegin("UV SetAlign"); reqsize(190,60); c0 = ctlchoice("", 1,@" U"," V"," U&V"@, false); ctlposition(c0, 4, 3, 175); return if !reqpost(); var SelType = getvalue(c0); reqend(); editbegin(); if(!vmap.isMapped(points[1])){ editend(); error("not mapped UVs. on 1st Pts."); return; } var SrcUV[2]; SrcUV = vmap.getValue(points[1]); switch(SelType){ case 1: for(i = 2; i <= SelPts; i++) vmap.setValue(points[i], SrcUV[1] ,1); break; case 2: for(i = 2; i <= SelPts; i++) vmap.setValue(points[i], SrcUV[2] ,2); break; case 3: for(i = 2; i <= SelPts; i++) vmap.setValue(points[i], SrcUV); break; default: break; } editend(); }