It's going to drive me crazy.


Hirazi Blue wrote: 08 Jan 2020, 10:01 No, I believe luceric posted the answer and IIRC the "[c]" denotes that the plugin has been loaded from a custom plugin location (set with the XSI_PLUGINS environment variable).![]()
Code: Select all
vector<float> UV_Test;
UV_Test.reserve(faceCount2);
for (int t = 0; t < faces.size(); ++t)
{
int vertex_id = faces[t];
float u = UVs9[vertex_id].GetX();
float v = UVs9[vertex_id].GetY();
UV_Test.push_back(u);
UV_Test.push_back(v);
UV_Test.push_back(0.0);
}
if (uv_count > 0)
{
XSI::ClusterProperty uvs_0 = cpBuilder.AddUV();
uvs_0.SetValues(&UV_Test[0], UV_Test.size() / 3);
}Code: Select all
// material clusters
int c2 = 0;
for (auto g: vertexGroups)
{
int p_start = g.start;
int p_stop = g.stop;
int p_size = g.size;
XSI::CLongArray p_range;
XSI::CTriangleRefArray triarray = mesh.GetTriangles();
int cb = 0;
for (int v = 0; v < triarray.GetCount(); ++v)
{
Vector3_I pf = faces_test[v];
XSI::Triangle tri = triarray.GetItem(v);
long this_tri = tri.GetPolygonIndex();
if (pf.x >= p_start && pf.x < p_stop && pf.y >= p_start && pf.y < p_stop && pf.z >= p_start && pf.z < p_stop)
{
p_range.Add(this_tri);
++cb;
}
}
XSI::CString pee(c2);
XSI::CString poo = "mat_" + pee;
XSI::Cluster myCls;
mesh.AddCluster(XSI::siPolygonCluster, poo, p_range, myCls);
++c2;
}