Tv property from IMeshMap returns wrong value format

Tv property from IMeshMap returns wrong value format

Anonymous
Not applicable
765 Views
3 Replies
Message 1 of 4

Tv property from IMeshMap returns wrong value format

Anonymous
Not applicable

Hello,

 

I tried the get vertex alpha values from a mesh using DotNet SDK, but something strange happened to me.

 

Indeed, to get theses alpha values, i need to check the mesh map at channel -2, then check its textures vertices... 

 

The problem is, the Tv (textures vertices) property in IMeshMap doesn't return the same thing than in C++ SDK. 

 

In DotNet it returns an IPoint3 instance (equivalent to UVVert), but in C++ SDK it's an Array of UVVert !

 

What do i need to do to find my values ?

 

Thank you.

0 Likes
Accepted solutions (1)
766 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Accepted solution

I have finally found a workaround. I always think there's a mistake in the DotNet wrapper about what kind of data returns the Tv property.

My workaround was to handle my mesh as a IMNMesh instead of IMesh (more functionalities but slower operations).

 

if (!triObj.Mesh.MapSupport(-2))
    triObj.Mesh.SetMapSupport(-2, true);
IMNMesh mnmesh = MaxInterfaces.Global.MNMesh.Create(triObj.Mesh);
IMNMap alphaMap = mnmesh.M(-2);
if (alphaMap.Numv > 0)
{
    for (int i = 0; i < alphaMap.Numv; i++)
    {
        MaxUtils.MxsLogger(string.Format("Alpha value for vertex {0} : {1}", i.ToString(), alphaMap.V(i).X.ToString()));
    }
}
0 Likes
Message 3 of 4

klvnk
Collaborator
Collaborator

what happens when you access them from the base mesh not through the meshmap  using?

 

mesh.mapVerts(-2);
0 Likes
Message 4 of 4

jackwakefield
Explorer
Explorer

This is still an issue in 2022. Is there a place where we can report these issues? There seems to be a lot of bugs in the .NET SDK.

0 Likes