RE: Merge UVs

Date : Fri, 4 Nov 2005 09:55:07 -0500
To : <XSI(at)Softimage.COM>
From : Jérôme Couture-Gagnon <jcgagnon(at)Softimage.COM>
Subject : RE: Merge UVs
Hi Patrick,
 
I just tried something in case it would work, and it worked OK, at least for my simple example. I hope that it works in a more complex case (my feeling is that it will work because of the way the UV transfer of merge works):
 
1) Create one mesh per material cluster (Create->PolygonMesh->Extract - keep). Each will have all the UVs.
2) Hide the original object, merge all the pieces together, and transfer the attributes (big button for UVs & materials).
3) If you are lucky, as I was, the material clusters will all be magically referencing the first UV set, so you can delete the other ones.
 
This should be easy to automate with a script...
 
Ex:
 
'Creation of the mesh with 2 UVs, one used per polygon cluster
NewScene
CreatePrim "Sphere", "MeshSurface"
SetSelFilter "Polygon"
SelectGeometryComponents "sphere.poly[5-7,13-15,21-23,29-31,37-39,45-47,53-55,61-LAST]"
ApplyShader , , , , siLetLocalMaterialsOverlap
SIApplyShaderToCnxPoint "Image", "Sources.Materials.DefaultLib.Material.Phong.diffuse"
CreateProjection "sphere", siTxtPlanarXY, siTxtDefaultSpherical, "Texture_Support", "Texture_Projection"
SetInstanceDataValue , "Sources.Materials.DefaultLib.Material.Phong.Image.tspace_id", "Texture_Projection"
SelectGeometryComponents "sphere.poly[0-4,8-12,16-20,24-28,32-36,40-44,48-52,56-60]"
ApplyShader , , , , siLetLocalMaterialsOverlap
SIApplyShaderToCnxPoint "Image", "Sources.Materials.DefaultLib.Material1.Phong.diffuse"
CreateProjection "sphere", siTxtCylindrical, siTxtDefaultSpherical, "Texture_Support", "Texture_Projection1"
SetInstanceDataValue , "Sources.Materials.DefaultLib.Material1.Phong.Image.tspace_id", "Texture_Projection1"
ActivateObjectSelTool
FreezeObj
SetDisplayMode "Camera", "textured"
SetDisplayMode "Camera", "texturedecal"
 
'Creation of an object with 1 UV set using an extract pass and a merge pass
SelectObj "sphere.polymsh.cls.Polygon"
ExtractFromComponents "ExtractPolygonsOp", "sphere.polymsh.cls.Polygon", "polymsh_extracted", , siPersistentOperation, siKeepGenOpInputs
SelectObj "sphere.polymsh.cls.Polygon1"
ExtractFromComponents "ExtractPolygonsOp", "sphere.polymsh.cls.Polygon1", "polymsh_extracted", , siPersistentOperation, siKeepGenOpInputs
SelectObj "polymsh_extracted,polymsh_extracted1", , True
FreezeObj
ApplyGenOp "MeshMerge", , "polymsh_extracted,polymsh_extracted1", 3, siPersistentOperation, siKeepGenOpInputs
TransferAllPropertiesAcrossGenOp "polymsh.polymsh.mergemesh", "polymsh", , True
SelectObj "polymsh.polymsh.cls.Texture_Coordinates_AUTO.Texture_Projection1"
DeleteObj "polymsh.polymsh.cls.Texture_Coordinates_AUTO.Texture_Projection1"
SelectObj "polymsh_extracted,polymsh_extracted1", , True
DeleteObj "polymsh_extracted,polymsh_extracted1"


From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of PL - Patrick Vier
Posted At: Friday, November 04, 2005 9:39 AM
Posted To: xsi
Conversation: Merge UVs
Subject: Re: Merge UVs

Merci, Bernard, for your answer.
But we got the mesh from "Image Modler" (realViz) and the Uvs are completly mad...
36 clusters,36 pictures, 36 UV... and Taddamm .. 1 UV with all Uvs inside... AAARRRGGGHHHH !!!!
because of that crazy stuff, i thing is better to make a quick UV on the model (mt_pelt, for example) and a rendermap....
A bientôt on 3dvf... or xsilounge...

Patrick :)

Bernard Lebel a écrit :
Salut Patrick,

Yes you can. The UVs of the entire object are present in the cluster
texture projection, but the UVs that are "outside" the cluster are not
exposed in the Texture Editor.

So select the first cluster texture projection, open a texture editor,
and lock it.
Then select the second cluster, select the UVs, copy, paste in the
first texture editor.
Repeat for each additional cluster.

The "first" cluster may not be the top one in the stack though. You'll
have to do a couple of tests before tracking down the right one.


Cheers
Bernard


On 11/4/05, PL - Patrick Vier <patrick(at)post-logic.com> wrote:
  
Bonjour à tous,

Just wondering if is possible to merge many UV who come from many clusters.
I found a workaround :
Dupli the model, kill alll clusters, and unfold the mesh... get an UV
and copy it in the first model mesh.
lauch a rendermap and choose the new UV...
Ok it seems work good... But if there is a solution to get 1 UV (from
the UVs from the clusters) it will so cool.
Thank

Patrick :)

--
**********************************
Patrick Vier - POST LOGIC        |
Web   : www.post-logic.com       |
------------                     |
Phone : 33 1 46 37 77 61         |
Mail  : patrick(at)post-logic.com   |
Msn   : kenjaman_xsi(at)hotmail.com |
**********************************


---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi

    

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


  

-- 
**********************************
Patrick Vier - POST LOGIC        |
Web   : www.post-logic.com       |
------------                     |
Phone : 33 1 46 37 77 61         |
Mail  : patrick(at)post-logic.com   |
Msn   : kenjaman_xsi(at)hotmail.com |
**********************************
  • Follow-Ups:
    • Re: Merge UVs
      • From: PL - Patrick Vier <patrick(at)post-logic.com>

Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.