示例#1
0
bool XRefObjFinder::Proc(INode * pNode)
{
    TSTR workstring;
	
    // NOTE: We dump all info into one big string
    // Not super realistic, and probably won't work with
    // a scene with lots of XRef objects, but in a real exporter
    // situation, you'd be dumping out to a file pointer anyway
	
    if (!pNode || !m_buffer) return false;
    Object *obj = pNode->GetObjectRef();
    if (obj && obj->SuperClassID()==SYSTEM_CLASS_ID && 
		obj->ClassID()==XREFOBJ_CLASS_ID) {
        IXRefObject *ix = (IXRefObject *)obj;
        // if pNode refs an XRef object, let's pull some info out of it
        workstring.printf(_T("Node <%s> XREF <%s> filename:<%s> proxy:<%s> anim-off:<%s> update-mats:<%s> \x0D\x0A"),
            pNode->GetName(), ix->GetCurObjName(), ix->GetCurFile().GetFileName(), 
            (ix->GetUseProxy()) ? _T("T") : _T("F"),
            (ix->GetIgnoreAnim()) ? _T("T") : _T("F"),
            (ix->GetUpdateMats()) ? _T("T") : _T("F"));
        m_buffer->append(workstring);
    }
    return true;
}