FTK Question
| Date : Fri, 1 Dec 2006 14:43:27 -0000 |
| To : <xsi(at)Softimage.COM> |
| From : "Chris Allsopp" <callsopp(at)lionhead.com> |
| Subject : FTK Question |
|
Hi guys, I’m new to
this mailing list so please forgive me if I’ve subscribed to the wrong
one in order to ask this question. I’m having
some problems with the XSI FTK and was wondering if any of you have had
experience doing similar things with it. I am trying to read
in one dotXSI file containing many meshes, parse them using the FTK, and output
multiple dotXSI files each containing just one of those aforementioned meshes. I already have a
CSLScene object that has been constructed and populated through a call to
Open() on an existing dotXSI file like so: if(mp_Scene->Open(_SI_TEXT(pathname))
== SI_SUCCESS) {
if(mp_Scene->Read() == SI_SUCCESS)
{ . . . } } I now want to
‘copy’ parts of that scene into the scene of a new dotXSI file. This new file will be
a skeleton/template, common to all of the other dotXSI files I want to write
– in other words it will have the same FileInfo, Ambiance, Coordinate
System, Angle and SceneInfo as the ‘opened scene’ but the models,
image library and material library in the skeleton/template file will be empty
and I will selectively add things to them later. I have figured out
how to create a new scene object and connect an empty image library to it like
so:
SI_Long
version_major = mp_Scene->Parser()->GetdotXSIFileVersionMajor(); SI_Long version_minor
= mp_Scene->Parser()->GetdotXSIFileVersionMinor(); if(scene.Create(path,
version_major, version_minor) != SI_SUCCESS) {
Debug::WriteLine(String::Format("Couldn't create new scene object:
\"{0}\"", path));
return false;
} CSLImageLibrary*
p_image_library = scene.CreateImageLibrary(); scene.ConnectImageLibrary(p_image_library); Now, I was hoping
that I would be able to easily copy data across from the opened scene to the template
scene without having to do something like the following (where mp_Scene is my
opened scene)... CSLFileInfo* p_source_info =
mp_Scene->FileInfo(); CSLFileInfo* p_destination_info = scene.FileInfo();
p_destination_info->SetOriginator(p_source_info->GetOriginator()); p_destination_info->SetUsername(p_source_info->GetUsername()); p_destination_info->SetProjectName(p_source_info->GetProjectName()); p_destination_info->SetSaveDateTime(p_source_info->GetSaveDateTime());
…and instead use
something like the following, whereby I am trying to connect the file info used
by the opened scene, to that of the template scene. (My template scene is
only a temporary construction that I will call Write() on – its lifetime
is much less than that of mp_Scene, so I’m presuming that it would, in
theory, be OK for me to do this). CSLFileInfo* p_old_info =
scene.ConnectFileInfo(mp_Scene->FileInfo()); However, calling this
function seems to have no effect. Indeed, the address and data of
scene.FileInfo() does not change and the ‘old’ CSLFileInfo*
structure that is supposedly returned by the function is NULL? It seems that the
Connect calls just don’t work as I would expect. If I call ConnectImage()
on my image library, and pass in an existing image from my opened scene, my
image library ends up being exported as this: XSI_ImageLibrary { 1,
} …which basically
means that the image library supposedly contains one image, but none of the
image data is there. Could anybody please
help me out here and let me know if there is an easier way of doing this, I
would be very grateful! Thanks a lot, Chris Allsopp Lionhead Studios |
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: RE: Getting correct motion vectors from a RealFlow mesh
- Next by Date: RE: Getting correct motion vectors from a RealFlow mesh
- Previous by Thread: RE: Getting correct motion vectors from a RealFlow mesh
- Next by Thread: RE: Getting correct motion vectors from a RealFlow mesh
- Index(es):
| Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available. |