Oops.
From: owner-xsi(at)Softimage.COM
[mailto:owner-xsi(at)Softimage.COM] On Behalf Of guillaume laforge
Sent: 30 January 2008 13:05
To: XSI(at)Softimage.COM
Subject: Re: .obj import UV point order
>This isn't my code, it came
from someone at Softimage. To my shame I can't
>remember who it was. Apologies to them... Sub lmFixUVs_Execute(
InputSelection )
lmFixUVs means "La Maison" FixUVs and not "Softimage"
FixUVs :-).
1/2
Guillaume
On Jan 30, 2008 11:03 AM, kim aldis <xsi(at)kim-aldis.co.uk> wrote:
This isn't my code, it came from someone at Softimage. To my
shame I can't
remember who it was. Apologies to them.
mFixUVs_Execute selection(0)
Sub lmFixUVs_Execute( InputSelection )
' ---[ Retrieve Object & Parameters
]-------------------------------------
Set oClsProp = InputSelection
Set oCluster = oClsProp.Parent
Set oX3DObject = oCluster.Parent.Parent.Parent
aIndices = oCluster.Elements.Array
aElements = oClsProp.Elements.Array
Dim aFixed()
Redim aFixed(2,oClsProp.Elements.Count-1)
'
iUBound = oX3DObject.ActivePrimitive.Geometry.Samples.Count - 1
Dim aSamplesIdx()
Redim aSamplesIdx(iUBound)
Set oFacets = oX3DObject.ActivePrimitive.Geometry.Facets
id = 0
For Each oFacet In oFacets
For Each oSample In oFacet.Samples
aSamplesIdx(id) = oSample.Index
id = id + 1
Next
Next
'
For i = LBound(aElements,2) To UBound(aElements,2)
idx = aSamplesIdx(aIndices(i))
aFixed(0,idx) = aElements(0,i)
aFixed(1,idx) = aElements(1,i)
Next
'
oClsProp.Elements.Array = aFixed
End Sub
> Behalf Of André Adam
> Sent: 30 January 2008 08:34
> To: XSI(at)Softimage.COM
> Subject: Re: .obj import UV point order
>
> Though Kim's approach is a bit smarter, I've posted a
fix to this a
> while back on http://www.mindthink.de
called "aa_CopyUVsPerFace".
> Basically it copies the texture coordinates from a selected source mesh
> onto a selected target mesh, dealing with messed up sample indices.
>
> -André
>
>
> Mathieu Leclaire wrote:
> >
> > It seems that when importing a .obj file for a large and complex
> mesh,
> > XSI changes the order of some of the UV points. For example, if we
> > export an .obj to be used in Zbrush, UVLayout or Unfold 3D for
> > example, when we reimport the obj and we want to copy the UVs to the
> > original mesh, it won't work. Sure, we try and fix it using Gator but
> > sometimes, the results are not always liable. How do you guys deal
> > with such problem?
> >
> > Mathieu Leclaire
> >
> > R&D Programmer
> >
> > Hybride Technologies
> >
> > "Yesterday is history, tomorrow is a mystery, today is a gift
and
> that
> > is why it's called the present"
> >
>
> ---
> 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
--
Guillaume Laforge
|