本文整理汇总了C++中IDerivedObject::GetModContext方法的典型用法代码示例。如果您正苦于以下问题:C++ IDerivedObject::GetModContext方法的具体用法?C++ IDerivedObject::GetModContext怎么用?C++ IDerivedObject::GetModContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDerivedObject
的用法示例。
在下文中一共展示了IDerivedObject::GetModContext方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindModContext
ModContext* FindModContext(INode* pNode, Modifier* mod)
{
IDerivedObject *derivObj;
if( pNode->GetObjectRef()->SuperClassID() == GEN_DERIVOB_CLASS_ID )
derivObj = (IDerivedObject*)pNode->GetObjectRef();
else return NULL;
int i=0, count=derivObj->NumModifiers();
for( i=0; i<count; i++ )
if( (derivObj->GetModifier(i)) == mod ) break;
if( i==count ) return NULL; //the search failed
return derivObj->GetModContext(i);
}
示例2:
PaintDefromModData *PaintDeformTest::GetPMD(INode *pNode)
{
ModContext *mc = NULL;
Object* pObj = pNode->GetObjectRef();
if (!pObj) return NULL;
while (pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID && mc == NULL)
{
IDerivedObject* pDerObj = (IDerivedObject *)(pObj);
int Idx = 0;
while (Idx < pDerObj->NumModifiers())
{
// Get the modifier.
Modifier* mod = pDerObj->GetModifier(Idx);
if (mod->ClassID() == PAINTDEFORMTEST_CLASS_ID)
{
// is this the correct Physique Modifier based on index?
PaintDeformTest *pmod = (PaintDeformTest*)mod;
if (pmod == this)
{
mc = pDerObj->GetModContext(Idx);
break;
}
}
Idx++;
}
pObj = pDerObj->GetObjRef();
}
if(!mc) return NULL;
if ( !mc->localData ) return NULL;
PaintDefromModData *bmd = (PaintDefromModData *) mc->localData;
return bmd;
}
示例3: NotifyPostCollapse
// We want to survive a collapsed stack so we reapply ourselves here
void EditFaceDataMod::NotifyPostCollapse(INode *node,Object *obj, IDerivedObject *derObj, int index) {
if (mCollapsable) return;
Object *bo = node->GetObjectRef();
IDerivedObject *derob = NULL;
if(bo->SuperClassID() != GEN_DERIVOB_CLASS_ID) {
derob = CreateDerivedObject(obj);
node->SetObjectRef(derob);
} else derob = (IDerivedObject*) bo;
// Add ourselves to the top of the stack
derob->AddModifier(this,NULL,derob->NumModifiers());
// Reinsert our local mod data
ModContext* mc = derob->GetModContext(derob->NumModifiers()-1);
mc->localData = mpModDataCollapseCache;
mpModDataCollapseCache = NULL;
// Reengage modification:
mDisabled = false;
}
示例4:
//---------------------------------------------------------------
ISkinContextData *ControllerExporter::getISkinContextInterface(SkinController* skinController)
{
if (!skinController )
return 0;
IDerivedObject* derivedObject = skinController->getDerivedObject();
if ( !derivedObject )
return 0;
ModContext * modContext = derivedObject->GetModContext(skinController->getModifierIndex());
if ( !modContext )
return 0;
LocalModData* localModData = modContext->localData;
if ( !localModData )
return 0;
return (BoneModData *)localModData;
}
示例5: RecursePipeAndMatch
BOOL RecursePipeAndMatch(LocalPatchData *smd, Object *obj)
{
SClass_ID sc;
IDerivedObject* dobj;
Object *currentObject = obj;
if ((sc = obj->SuperClassID()) == GEN_DERIVOB_CLASS_ID)
{
dobj = (IDerivedObject*)obj;
while (sc == GEN_DERIVOB_CLASS_ID)
{
for (int j = 0; j < dobj->NumModifiers(); j++)
{
ModContext *mc = dobj->GetModContext(j);
if (mc->localData == smd)
{
return TRUE;
}
}
dobj = (IDerivedObject*)dobj->GetObjRef();
currentObject = (Object*) dobj;
sc = dobj->SuperClassID();
}
}
int bct = currentObject->NumPipeBranches(FALSE);
if (bct > 0)
{
for (int bi = 0; bi < bct; bi++)
{
Object* bobj = currentObject->GetPipeBranch(bi,FALSE);
if (RecursePipeAndMatch(smd, bobj)) return TRUE;
}
}
return FALSE;
}