bool plAnimStealthNode::SetupProperties( plMaxNode *node, plErrorMsg *pErrMsg ) { fPreppedForConvert = true; plPassMtlBase *parent = GetParentMtl(); if( parent != nil && fCachedSegMap == nil ) { fCachedSegMap = GetAnimSegmentMap( parent, nil ); } return true; }
bool plAnimStealthNode::GetKeyList( INode *restrictedNode, hsTArray<plKey> &outKeys ) { if( !fPreppedForConvert ) { hsMessageBox( "This messages is to warn you that mcn screwed up in his attempt to create " "a SetupProperties() pass for materials in this scene. You should probably let him know as soon as " "possible, and also make a copy of this exact scene so that he can test with it and figure out what " "is going wrong. Thank you.", "Mathew is Stupid Error", hsMessageBoxNormal ); } GetMatAnimModKey( GetParentMtl(), (plMaxNode *)restrictedNode, GetSegmentName(), outKeys ); return true; }
bool plAnimStealthNode::IsParentUsedInScene( void ) { if( GetParentMtl() == nil ) return false; // There are two possibilities: either a node uses us and thus has a ref to us, // or a multi-sub uses us that a node has a ref to us. // Note: we could do the loop as a helper function, but we only do it twice, // so it's not *really* worth the effort... //// NOTE: the following doesn't seem to work, but keeping here in case it ever does. //// What really actually finds something is the enum dependents loop below const char *mtlName = GetParentMtl()->GetName(); DependentIterator di(this); ReferenceMaker* item = di.Next(); while( item != nil ) { TSTR s; item->GetClassName( s ); if( item->SuperClassID() == BASENODE_CLASS_ID && !CanConvertToStealth( (INode *)( item ) ) ) return true; // Horray, a node has a ref to us! else if( item->ClassID() == Class_ID(MULTI_CLASS_ID,0) ) { // Multi-sub, run the refs on that guy (we only go one up) Mtl *multisub = (Mtl *)item; DependentIterator sub(multisub); ReferenceMaker* item2 = sub.Next(); while( item2 != nil ) { if( item2->SuperClassID() == BASENODE_CLASS_ID ) return true; // Horray, a node has a ref to us! item2 = sub.Next(); } // No go, keep trying } else if( item->SuperClassID() == MATERIAL_CLASS_ID ) { int q = 0; } item = di.Next(); } // Enum dependents plGetRefs callback; ENUMDEPENDENTS(GetParentMtl(), &callback); for(int i = 0; i < callback.fList.GetCount(); i++ ) { ReferenceMaker *maker = callback.fList[ i ]; TSTR s; maker->GetClassName( s ); if( maker->SuperClassID() == BASENODE_CLASS_ID && !CanConvertToStealth( (INode *)maker ) ) return true; // Horray, a node has a ref to us! } return false; }