Working with the XSIFTK v3.6.3 and dotXSI 3.0 format, I'm trying to include an XSI_CustomPSet template under the SI_Model template... and populate it with specific game information so the game compiler can take this info and create a game shader file for the character mesh.
Here's an example of what the data should look like in the XSI_CustomPSet template (from reading legacy dotXSI files):
Code: Select all
//*********************************************************
SI_Model MDL-hips {
.
.
.
XSI_CustomPSet hips.Game {
"NODE",
1,
"Shader","Text","models/players/kyle/kyle_legs.tga",
}
.
.
.
}
//*********************************************************
Code: Select all
//*********************************************************
SI_Model MDL-hips {
.
.
.
XSI_CustomPSet hips.Game {
"NODE",
0,
}
.
.
.
}
//*********************************************************
Here is my actual C++ class method:
Code: Select all
//---------------------------------------------------------------------------
CdotXSITemplates* CdotXSIMapper::ExportGameData ( MAX2XSI_PARAMS )
{
ADD_XSI_TEMPLATE ( l_pCustomPSet, "XSI_CustomPSet" );
CSIBCString l_CustomPSetName = ( GetNodeName ( in_pNode ) );
l_CustomPSetName.Concat( _T(".Game") );
l_pCustomPSet->SetInstanceName( l_CustomPSetName );
SetTemplateParam ( l_pCustomPSet, XSI_CUSTOM_PSET_PROPAGATION, "NODE" );
SetTemplateParam ( l_pCustomPSet, XSI_CUSTOM_PSET_NUM_PARAMS, 1 );
SetTemplateParam ( l_pCustomPSet, "field_count", 1 );
SetTemplateParam ( l_pCustomPSet, "field_name", _T("Shader") );
SetTemplateParam ( l_pCustomPSet, "field_type", "Text" );
Mtl* l_material = in_pNode->GetMtl();
TSTR l_matEdSlot = _T('"') + l_material->GetName() + _T('"');
CSIBCString l_MatName;
l_MatName.SetText( l_matEdSlot.data() );
SetTemplateParam ( l_pCustomPSet, "field_value", _T( l_MatName.GetText() ) );
return NULL;
}
//---------------------------------------------------------------------------
#define MAX2XSI_PARAMS INode *in_pNode, CdotXSITemplates *in_pTemplateGroup
l_material->GetName() is a 3ds Max function that returns a TSTR (typedef for CStr).
So I'm not sure why the SetTemplateParam statements are failing to populate correctly... please, can anyone tell me what am I doing wrong???