Thanks Fragmo- Thanks for being very patient
I tried that - but with my very limited understanding of how to implement things - I've had no luck.
How do you use below is where I think I'm going wrong. I persume you put them in the brackets, but do you put Group or the group ID or name etc.
Group* pgroup,
BOOL bSelect,
MultiSelect multi
I'll go back and have another go.
I have been able to select the individual groups manually, using the Group Selection Tool with select vertices and select object ticked and then I can get the vertex and facecounts for each group, but I'm stuck on how the get a script to work throught the groups in the mesh to extract info per group.
editChar:ClearOutput();
local mesh = editChar:GetSelMesh();
local mesh1 = mesh:GetSelVertexCount();
local mesh2 = mesh:GetSelFaceCount();
print (mesh1);
print(mesh2);
This is where I'm at with the face extraction and textures uv and vertex, the problem is when I iterate through the faces I get too many texture uv coords and vertex points
editChar:ClearOutput();
local pAnim = IUserObject(editChar:GetSelAnimation()); --get pointer to the selected animation (IAnimation)
local mainModel = editChar:GetModel();
myMesh = editChar:GetDefaultMesh();
local verts, vert_count, faces, face_count = myMesh:LockMesh();
allGroups = mainModel:GetGroups();
currentGroup = allGroups:GetFirstChild();
while currentGroup:isSet() do
currGroupName = currentGroup.Name;
print("["..currGroupName.."]");
local tex =editChar:GetSelection();
local texmap = tex:GetName();
print("MAT "..texmap);
local group = 0;
for f = 0, face_count-1, 1 do
if faces[f].groupID == currentGroup:GetID() then
print("f".."["..faces[f].index[0]..","..faces[f].index[1]..","..faces[f].index[2].."]");
group = group + 1;
end
end
if group > 0 then
print("facecount "..group);
for f = 0, face_count-1, 1 do
print("tv".."["..faces[f].uv[0].x..","..faces[f].uv[1].y..", 0]");
end
local vertc = 0;
for i = 0, vert_count-1, 1 do
if faces[i].groupID == currentGroup:GetID() then
print("v".."["..verts[i].x..","..verts[i].y..","..verts[i].z.."]");
vertc = vertc + 1;
end
end
if vertc > 0 then
print("vertcount "..vertc);
end
end
currentGroup = currentGroup:GetNextSibling();
end
myMesh:UnlockMesh();
Basically to get the exporter to work I need to extract the mats, textures, faces, texture verts, verts, normals, and smooth groups per group and animation mesh matrix per frame per group.
Long way to go yet but I'm in for the long run.
