View Full Version : dotXSI user data writing to ASCII file
louisfeng
03-09-2008, 03:09 AM
I'm trying to store some user data for a mesh (eventually I may want to attach them to each vertex). I'm using crosswalk 2.5. When I try to write the data to dotXSI file, the user data are not written out.
Example code:
if (pThisModel->GetPrimitiveType() == CSLModel::XSI_MESH){
// Attach data
if(pThisModel->AttachUserData("MyUserData", "this is user data.") == SI_SUCCESS) {
cout << "data attached" << endl;
}
// Save scene to dotXSI
m_xsiScene.Write(const_cast<char *>(fileName.c_str()));
}Is there anything missing?
ChristopherC
03-10-2008, 08:05 PM
Well, almost everything is missing.
In fact, the 'AttachUserData' method is used to store temporary user data in memory, but not to write any additional information to the file. To illustrate this, look at the dotXSIConverter source code; while the program runs a first pass to populate the objects to export, it stores some user data (like the CGeometryAccessor object for polygon meshes) to the FTK node. Then, this data can be retrieved during the other next passes with the 'GetUserData' method.
To add some additional data, you should create a new template, but after spending days and days trying to figure out how to do this, I gave up... The best I did was to sometime correctly writing the data to the file, and sometime just miserably crashing XSI.
Without any decent documentation, it's difficult.
Crosswalk is a good tool when you follow the path it was designed for (simple generic data transfer over applications), but when you try to get something more custom or deep, it's over.
If you have enough resources, and you are going to use thoses files as a base for your pipeline, just think about developing your own Crosswalk (seriously).
Cheers,
Christopher.
louisfeng
03-11-2008, 01:30 AM
Well, almost everything is missing.
In fact, the 'AttachUserData' method is used to store temporary user data in memory, but not to write any additional information to the file. To illustrate this, look at the dotXSIConverter source code; while the program runs a first pass to populate the objects to export, it stores some user data (like the CGeometryAccessor object for polygon meshes) to the FTK node. Then, this data can be retrieved during the other next passes with the 'GetUserData' method.
To add some additional data, you should create a new template, but after spending days and days trying to figure out how to do this, I gave up... The best I did was to sometime correctly writing the data to the file, and sometime just miserably crashing XSI.
Without any decent documentation, it's difficult.
Crosswalk is a good tool when you follow the path it was designed for (simple generic data transfer over applications), but when you try to get something more custom or deep, it's over.
If you have enough resources, and you are going to use thoses files as a base for your pipeline, just think about developing your own Crosswalk (seriously).
Cheers,
Christopher.
Haha, thank you Christopher. I too have spent a lot of time trying to figure these things out and due to my time constrain I've gave up on using dotXSI as the main format to transfer my data between various tools.
When XSI SDK/FTK first came out many years ago, I was impressed by the goal and design of the format, but over the years it seems Softimage has lost the momentum to keep the documentation up to date and provide more examples of using FTK in a more serious setting. Extracting vertex, polygon data from the dotXSI 5.0 format is a pain and totally non-intuitive.
Good examples of robust libraries with clear documentations: CGAL, Qt, Boost, PRMan, I might even add Maya here.
Softimage is seriously lacking on the documentation side. I can only imagine how much pain it is to use it in a real production setting.
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.