Try to support cmb rigging
This commit is contained in:
parent
2f328a2664
commit
317e4f7367
@ -278,7 +278,7 @@ namespace FirstPlugin
|
||||
mat = Materials[mesh.MaterialIndex];
|
||||
|
||||
CmbMeshWrapper genericMesh = new CmbMeshWrapper(mat);
|
||||
genericMesh.Text = $"Mesh {MeshIndex++}";
|
||||
genericMesh.Text = $"Mesh_{MeshIndex++}";
|
||||
genericMesh.MaterialIndex = mesh.MaterialIndex;
|
||||
|
||||
//Wow this is long
|
||||
@ -349,14 +349,14 @@ namespace FirstPlugin
|
||||
&& shape.BoneIndices.Type == CmbDataType.UByte; //Noclip checks the type for ubyte so do the same
|
||||
|
||||
bool HasWeights = shape.Primatives[0].SkinningMode == SkinningMode.SMOOTH_SKINNING;
|
||||
/*
|
||||
|
||||
if (shape.BoneIndices.VertexData != null && HasSkinning && shape.BoneIndices.VertexData.Length > v)
|
||||
{
|
||||
var BoneIndices = shape.BoneIndices.VertexData[v];
|
||||
for (int j = 0; j < shape.boneDimension; j++)
|
||||
{
|
||||
ushort index = shape.Primatives[0].BoneIndexTable[(uint)BoneIndices[j]];
|
||||
vert.boneIds.Add((int)index);
|
||||
// ushort index = shape.Primatives[0].BoneIndexTable[(uint)BoneIndices[j]];
|
||||
vert.boneIds.Add((int)BoneIndices[j]);
|
||||
}
|
||||
}
|
||||
if (shape.BoneWeights.VertexData != null && HasWeights && shape.BoneWeights.VertexData.Length > v)
|
||||
@ -366,7 +366,7 @@ namespace FirstPlugin
|
||||
{
|
||||
vert.boneWeights.Add(BoneWeights[j]);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
genericMesh.vertices.Add(vert);
|
||||
}
|
||||
|
@ -852,15 +852,17 @@ namespace Toolbox.Library.Collada
|
||||
|
||||
public string GetUniqueID(string id)
|
||||
{
|
||||
if (AttributeIdList.ContainsKey(id))
|
||||
string name = id.Replace(" ", string.Empty);
|
||||
|
||||
if (AttributeIdList.ContainsKey(name))
|
||||
{
|
||||
AttributeIdList[id]++;
|
||||
return $"{id}_{AttributeIdList[id]}";//
|
||||
AttributeIdList[name]++;
|
||||
return $"{name}_{AttributeIdList[name]}";//
|
||||
}
|
||||
else
|
||||
{
|
||||
AttributeIdList.Add(id, 0);
|
||||
return id;
|
||||
AttributeIdList.Add(name, 0);
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user