SegmentMap *GetSharedAnimSegmentMap(std::vector<Animatable*>& anims, plErrorMsg *pErrorMsg) { if (anims.empty()) return nil; SegmentMap *segMap = GetAnimSegmentMap(anims[0], pErrorMsg); if (!segMap) return nil; int i; for (i = 1; i < anims.size(); i++) { SegmentMap *curSegMap = GetAnimSegmentMap(anims[i], pErrorMsg); // This node doesn't have a segmap, so we can't have any anims shared among all the nodes. if (!curSegMap) { DeleteSegmentMap(segMap); return nil; } if (segMap->begin() == segMap->end()) { DeleteSegmentMap(segMap); return nil; } SegmentMap::iterator it = segMap->begin(); while (it != segMap->end()) { if (curSegMap->find(it->second->fName) == curSegMap->end()) { SegmentMap::iterator del = it; it++; segMap->erase(del->second->fName); } else it++; } DeleteSegmentMap(curSegMap); } return segMap; }
bool plAnimStealthNode::SetupProperties( plMaxNode *node, plErrorMsg *pErrMsg ) { fPreppedForConvert = true; plPassMtlBase *parent = GetParentMtl(); if( parent != nil && fCachedSegMap == nil ) { fCachedSegMap = GetAnimSegmentMap( parent, nil ); } return true; }
void plStealthDlgProc::IInitControls( plAnimStealthNode *stealth, IParamBlock2 *pb ) { IDeleteSegMap(); if( stealth->GetParentMtl() != nil ) { fSegMap = GetAnimSegmentMap( stealth->GetParentMtl(), nil ); ILoadLoops( pb ); } else { // ?? What should we do? fSegMap = nil; hsStatusMessage( "No parent material yet in plStealthDlgProc::IInitControls()...not good..." ); } // Enable/disable the loop dropdown EnableWindow( GetDlgItem( fhWnd, IDC_LOOPS ), pb->GetInt( (ParamID)plAnimStealthNode::kPBLoop ) ); }
void plNoteTrackDlg::ICacheNoteTrack() { DeleteCache(); fSegMap = GetAnimSegmentMap(fOwner, nil); }