C++ Importer Weirdness
C++ Importer Weirdness
I can't for the life of me figure out why Softimage is putting that [c] on the end of my importer name.
It's going to drive me crazy.
It's going to drive me crazy.
Re: C++ Importer Weirdness
Sorry! A few replies from the last few days have been lost because we had to use a 3 day old backup!
I think the [c] means compiled(??)
I think the [c] means compiled(??)
softimage resources section updated Jan 5th 2024
- Hirazi Blue
- Administrator
- Posts: 5107
- Joined: 04 Jun 2009, 12:15
Re: C++ Importer Weirdness
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).
Stay safe, sane & healthy!
Re: C++ Importer Weirdness
Hirazi Blue wrote: ↑08 Jan 2020, 11: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).
that is the correct answer. I checked the code (after searching the doc returned nothing)
Last edited by luceric on 08 Jan 2020, 18:19, edited 2 times in total.
Re: C++ Importer Weirdness
OK, thanks.
I moved the dll to C:\Users\Dude\Autodesk\Softimage_2015_SP2\Application\Plugins and it added the prefix U
"U" from "User Root" I presume.
Then I moved it to C:\Program Files\Autodesk\Softimage 2015 SP2\Application\Plugins and no prefix or postfix.
So, yeah, it's all making sense.
Next I'm going to try making an xsiaddon.
I'm using Softimage to make the transition from Python to C++.
Plus, you know, nostalgia. >-)
Python just isn't cutting it for modern game characters, i.e., 200,000 points, 1500 joints, up to 8 weights per point. •(⌚_⌚)•
I moved the dll to C:\Users\Dude\Autodesk\Softimage_2015_SP2\Application\Plugins and it added the prefix U
"U" from "User Root" I presume.
Then I moved it to C:\Program Files\Autodesk\Softimage 2015 SP2\Application\Plugins and no prefix or postfix.
So, yeah, it's all making sense.
Next I'm going to try making an xsiaddon.
I'm using Softimage to make the transition from Python to C++.
Plus, you know, nostalgia. >-)
Python just isn't cutting it for modern game characters, i.e., 200,000 points, 1500 joints, up to 8 weights per point. •(⌚_⌚)•
Re: C++ Importer Weirdness
Makes a lot of sense. the GeometryAccessor (export) and CMeshBuilder (import) were a few of the last things that were updated in XSI before development was stopped, they're really fast.
softimage resources section updated Jan 5th 2024
Re: C++ Importer Weirdness
The next challenge is the UVs.
This looks like a point VS vertex issue.
The only other importer for SI I ever made was done with Python
and I had to do some squirrely stuff for the uvs.
Not sure how to handle it in c++ though.
This looks like a point VS vertex issue.
The only other importer for SI I ever made was done with Python
and I had to do some squirrely stuff for the uvs.
Not sure how to handle it in c++ though.
Re: C++ Importer Weirdness
I have some C++ importer code here where bits of it might be useful for you
https://github.com/ReinhardC/softimage/ ... ileFormats
the OBJ_Import.cpp does something with UVs for example
https://github.com/ReinhardC/softimage/ ... ileFormats
the OBJ_Import.cpp does something with UVs for example
softimage resources section updated Jan 5th 2024
Re: C++ Importer Weirdness
It turns out I was setting the UVs the same way as you.
I briefly checked out the Wavefront format and it looks like it stores UVs the way Softimage wants to use them......I think.
So I used the face indices to take them from the point-centric way they're stored in the file to a vertex-centric format.
And then......
I realized I needed to change the vertex groups into poly groups/clusters for the materials.
(not needed for Blender)
So,.....
Fun times.
Pretty picture: https://minstryofgravy.tumblr.com/
I briefly checked out the Wavefront format and it looks like it stores UVs the way Softimage wants to use them......I think.
So I used the face indices to take them from the point-centric way they're stored in the file to a vertex-centric format.
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);
}
I realized I needed to change the vertex groups into poly groups/clusters for the materials.
(not needed for Blender)
So,.....
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;
}
Pretty picture: https://minstryofgravy.tumblr.com/
Who is online
Users browsing this forum: No registered users and 60 guests