当前位置: 首页>>代码示例>>C++>>正文


C++ IDerivedObject::GetModifier方法代码示例

本文整理汇总了C++中IDerivedObject::GetModifier方法的典型用法代码示例。如果您正苦于以下问题:C++ IDerivedObject::GetModifier方法的具体用法?C++ IDerivedObject::GetModifier怎么用?C++ IDerivedObject::GetModifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDerivedObject的用法示例。


在下文中一共展示了IDerivedObject::GetModifier方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FindSkinModifier

ISkin* MaxExportPlugin::FindSkinModifier(INode* node)
{
	Object* object = node->GetObjectRef();

	if (!object)
		return 0;

	while (object->SuperClassID() == GEN_DERIVOB_CLASS_ID && object)
	{
		IDerivedObject* derivedObject = (IDerivedObject*)object;

		int modStackId = 0;
		while (modStackId < derivedObject->NumModifiers())
		{
			Modifier* mod = derivedObject->GetModifier(modStackId);

			//file << "MODIFIER: " << std::to_wstring(mod->ClassID().PartA()) << " " << std::to_wstring(mod->ClassID().PartB()) << "\n";
			if (mod->ClassID() == SKIN_CLASS_ID)
			{
				return (ISkin*)(mod->GetInterface(I_SKIN));
			}
			modStackId++;
		}
		object = derivedObject->GetObjRef();
	}

	return 0;
}
开发者ID:MegaMilkX,项目名称:Comet,代码行数:28,代码来源:MaxExportPlugin.cpp

示例2: FindSkinModifier

//// FindSkinModifier ///////////////////////////////////////////////////////
//  Given an INode, gets the ISkin object of that node, or nil if there is
//  none. Taken from the Max4 SDK, ISkin.h
ISkin* plMaxNodeBase::FindSkinModifier()
{
    int modStackIndex;

    // Get object from node. Abort if no object.
    Object *pObj = GetObjectRef();
    if( pObj == nil )
        return nil;

    // Is derived object ?
    while( pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID )
    {
        IDerivedObject *pDerObj = (IDerivedObject *)pObj;

        // Iterate over all entries of the modifier stack.
        for( modStackIndex = 0; modStackIndex < pDerObj->NumModifiers(); modStackIndex++ )
        {
            // Get current modifier.
            Modifier *mod = pDerObj->GetModifier( modStackIndex );

            // Is this Skin ?
            if( mod->ClassID() == SKIN_CLASSID )
            {
                ISkin* skin = (ISkin*)mod->GetInterface(I_SKIN);
                if( skin->GetNumBones() > 0 )
                    return skin;
            }
        }
        pObj = pDerObj->GetObjRef();
    }

    // Not found.
    return nil;
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:37,代码来源:plMaxNodeBase.cpp

示例3: while

Modifier *CMaxMesh::FindSkinModifier(INode *pINode)
{
#if MAX_RELEASE >= 4000
    // get the object reference of the node
    Object *pObject;
    pObject = pINode->GetObjectRef();
    if(pObject == 0) return 0;

    // loop through all derived objects
    while(pObject->SuperClassID() == GEN_DERIVOB_CLASS_ID)
    {
        IDerivedObject *pDerivedObject;
        pDerivedObject = static_cast<IDerivedObject *>(pObject);

        // loop through all modifiers
        int stackId;
        for(stackId = 0; stackId < pDerivedObject->NumModifiers(); stackId++)
        {
            // get the modifier
            Modifier *pModifier;
            pModifier = pDerivedObject->GetModifier(stackId);

            // check if we found the skin modifier
            if(pModifier->ClassID() == SKIN_CLASSID) return pModifier;
        }

        // continue with next derived object
        pObject = pDerivedObject->GetObjRef();
    }
#endif

    return 0;
}
开发者ID:imvu,项目名称:cal3d,代码行数:33,代码来源:MaxMesh.cpp

示例4: CollectModifiers

//----------------------------------------------------------------------------
void SceneBuilder::CollectModifiers (INode *node, 
								 std::vector<Modifier*> &modifiers)
{
	// 确定这个节点是否有修改器。如果有,存储起来。
	//
	// node:
	//		Max场景中节点指针。
	// modifiers:
	//		存储所有修改器指针。

	Object *obj = node->GetObjectRef();
	if (!obj)
		return;

	while (obj->SuperClassID() == GEN_DERIVOB_CLASS_ID)
	{
		IDerivedObject* derObj = static_cast<IDerivedObject*>(obj);

		int modStackIndex = 0;
		while (modStackIndex < derObj->NumModifiers())
		{
			Modifier *mod = derObj->GetModifier(modStackIndex);
			if (mod)
			{
				modifiers.push_back(mod);
			}

			modStackIndex++;
		}

		obj = derObj->GetObjRef();
	}
}
开发者ID:SylviaTanenbaum,项目名称:3d-simulation-and-game,代码行数:34,代码来源:PX2SceneBuilderModifier.cpp

示例5: FindModifier

Modifier* SGP_MaxInterface::FindModifier(INode *pINode, Class_ID id)
{
	// get the object reference of the node
	Object *pObject;
	pObject = pINode->GetObjectRef();
	if(pObject == NULL) 
		return NULL;

	// loop through all derived objects
	while(pObject->SuperClassID() == GEN_DERIVOB_CLASS_ID)
	{
		IDerivedObject *pDerivedObject;
		pDerivedObject = static_cast<IDerivedObject *>(pObject);

		// loop through all modifiers
		int stackId;
		for(stackId = 0; stackId < pDerivedObject->NumModifiers(); stackId++)
		{
			// get the modifier
			Modifier *pModifier;
			pModifier = pDerivedObject->GetModifier(stackId);

			// check if we found the modifier
			if(pModifier->ClassID() == id) 
				return pModifier;
		}

		// continue with next derived object
		pObject = pDerivedObject->GetObjRef();
	}

	return NULL;
}
开发者ID:phoenixzz,项目名称:SGPEngine,代码行数:33,代码来源:SGP_MAX9Interface.cpp

示例6: findPhysiqueModifier

Modifier* PhyExportUtil::findPhysiqueModifier( INode* node )
{
	// Get object from node. Abort if no object.
	::Object* obj = node->GetObjectRef();
	if ( !obj ) 
		return 0;

	// Is derived object ?
	while ( obj->SuperClassID() == GEN_DERIVOB_CLASS_ID && obj )
	{
		// Yes -> Cast.
		IDerivedObject* derivedObj = static_cast<IDerivedObject*>( obj );
						
		// Iterate over all entries of the modifier stack.
		for ( int modStackIndex = 0 ; modStackIndex < derivedObj->NumModifiers() ; ++modStackIndex )
		{
			// Get current modifier.
			Modifier* modPtr = derivedObj->GetModifier( modStackIndex );

			// Is this Physique ?
			if ( modPtr->ClassID() == Class_ID(PHYSIQUE_CLASS_ID_A, PHYSIQUE_CLASS_ID_B) )
			{
				// Yes -> Exit.
				return modPtr;
			}
		}
		obj = derivedObj->GetObjRef();
	}

	// Not found.
	return 0;
}
开发者ID:TheRyaz,项目名称:c_reading,代码行数:32,代码来源:PhyExportUtil.cpp

示例7: FindPhysiqueModifier

// ================================================== FindPhysiqueModifier()
// Find if a given node contains a Physique Modifier
// DerivedObjectPtr requires you include "modstack.h" from the MAX SDK
Modifier* FindPhysiqueModifier (INode* nodePtr)
{
	// Get object from node. Abort if no object.
	Object* ObjectPtr = nodePtr->GetObjectRef();

	if ( NULL == ObjectPtr) return NULL;

	// Is derived object ?
	if (ObjectPtr->SuperClassID() == GEN_DERIVOB_CLASS_ID){
		// Yes -> Cast.
		IDerivedObject* DerivedObjectPtr = static_cast<IDerivedObject*>(ObjectPtr);

		// Iterate over all entries of the modifier stack.
		int ModStackIndex = 0;
		while (ModStackIndex < DerivedObjectPtr->NumModifiers()){
			// Get current modifier.
			Modifier* ModifierPtr = DerivedObjectPtr->GetModifier(ModStackIndex);
			Class_ID clsid = ModifierPtr->ClassID();
			// Is this Physique ?
			if (ModifierPtr->ClassID() == Class_ID(PHYSIQUE_CLASS_ID_A, PHYSIQUE_CLASS_ID_B))
			{
				// Yes -> Exit.
				return ModifierPtr;
			}

			// Next modifier stack entry.
			ModStackIndex++;
		}
	}

	// Not found.
	return NULL;
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:36,代码来源:Exporter.cpp

示例8: 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);
}
开发者ID:2asoft,项目名称:xray,代码行数:16,代码来源:bendmanip.cpp

示例9:

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;

}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:47,代码来源:PaintDeformTest.cpp

示例10: MeshModStackIsValid

bool RBExport::MeshModStackIsValid( INode* node )
{
    Object* pObj = node->GetObjectRef();
    if (pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID)
    {
        IDerivedObject* pDerivedObj = (IDerivedObject*)pObj;
        int nMod = pDerivedObj->NumModifiers();
        if (nMod == 0) return true;
        if (nMod > 1) return false;
        Class_ID id = pDerivedObj->GetModifier( 0 )->ClassID(); 
        return (id == SKIN_CLASSID || id == Class_ID( PHYSIQUE_CLASS_ID_A, PHYSIQUE_CLASS_ID_B ));
    }
    else
    {
        return true;
    }
    return false;
} // RBExport::MeshModStackIsValid
开发者ID:skopp,项目名称:rush,代码行数:18,代码来源:mesh.cpp

示例11: getISkinPtr

ISkin* CExporter::getISkinPtr(Object* object)
{
	assert(object != NULL);
	while (GEN_DERIVOB_CLASS_ID == object->SuperClassID())
	{
		IDerivedObject* pDerObj = static_cast<IDerivedObject*>(object);

		for (int i = 0; i < pDerObj->NumModifiers(); ++i)
		{
			Modifier* mod = pDerObj->GetModifier(i);
			if (SKIN_CLASSID == mod->ClassID())
			{
				return (ISkin*)(mod->GetInterface(I_SKIN));
			}
		}
		object = pDerObj->GetObjRef();
	}
	return NULL;
}
开发者ID:ColinGilbert,项目名称:grandpa-animation,代码行数:19,代码来源:Exporter_Mesh.cpp

示例12: HandleRagdollOnNonAccum

void HavokImport::HandleRagdollOnNonAccum(INode* accumChild, INode* ragdollParent)
{
	const int MaxChar = 512;
	char buffer[MaxChar];

	//Fix for nonaccumNodes

	//TSTR name(A2THelper(buffer, parent->GetName().c_str(), _countof(buffer)));
	ragdollParent->SetName(FormatText(TEXT("Ragdoll_%s"), accumChild->GetName()));

	Object *Obj = ragdollParent->GetObjectRef();

	if (Obj->SuperClassID() == GEN_DERIVOB_CLASS_ID)
	{
		while (Obj->SuperClassID() == GEN_DERIVOB_CLASS_ID) {
		
			IDerivedObject *DerObj = static_cast<IDerivedObject *> (Obj);
			const int nMods = DerObj->NumModifiers();
			for (int i = 0; i < nMods; i++)
			{
				Modifier *Mod = DerObj->GetModifier(i);
				if (Mod->ClassID() == HK_RIGIDBODY_MODIFIER_CLASS_ID)
				{
					ICustAttribContainer* cc = Mod->GetCustAttribContainer();
					if (cc)
					{
					//reset
						Mod->DeleteCustAttribContainer();

					}
					Mod->AllocCustAttribContainer();
					cc = Mod->GetCustAttribContainer();
					CustAttrib* c = (CustAttrib*)CreateInstance(CUST_ATTRIB_CLASS_ID, Class_ID(0x6e663460, 0x32682c72));
					IParamBlock2* custModParameters = c->GetParamBlock(0);
					custModParameters->SetValue(0, 0, accumChild, 0);

					cc->InsertCustAttrib(0, c);
				}
			}
			Obj = DerObj->GetObjRef();
		}
	}
}
开发者ID:aerisarn,项目名称:nif-havok-max2010-plugin,代码行数:43,代码来源:HavokHelper.cpp

示例13: while

Modifier *FindSkinModifier (INode *node)
{
    Object* ObjectPtr = node->GetObjectRef();
    if (!ObjectPtr) return NULL;

    while (ObjectPtr->SuperClassID() == GEN_DERIVOB_CLASS_ID && ObjectPtr)
    {
        IDerivedObject *DerivedObjectPtr = (IDerivedObject *)(ObjectPtr);
        int ModStackIndex = 0;
        while (ModStackIndex < DerivedObjectPtr->NumModifiers())
        {
            Modifier* ModifierPtr = DerivedObjectPtr->GetModifier(ModStackIndex);
            if (ModifierPtr->ClassID() == SKIN_CLASSID)
                return ModifierPtr;
            ModStackIndex++;
        }
        ObjectPtr = DerivedObjectPtr->GetObjRef();
    }
    return NULL;
}
开发者ID:ApocalypseDesign,项目名称:ad_public,代码行数:20,代码来源:Utility.cpp

示例14: isSkinned

	//---------------------------------------------------------------
	bool SkinController::isSkinned( Object* object )
	{
		if ( !object )
			return false;

		IDerivedObject* derivedObject;
		Object *currentObject = object;

		SClass_ID superClassId = object->SuperClassID();
		if ( superClassId == GEN_DERIVOB_CLASS_ID || superClassId == DERIVOB_CLASS_ID || superClassId == WSM_DERIVOB_CLASS_ID)
		{
			derivedObject = (IDerivedObject*)object;
			if ( derivedObject->NumModifiers() < 1 )
				return false;
			Modifier* modifier = derivedObject->GetModifier(0);
			return  SkinController::isSkinController(modifier);
		}
		return false;

	}
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:21,代码来源:COLLADAMaxController.cpp

示例15:

Modifier *FindBonesProModifier (INode *nodePtr)
{
	// Get object from node. Abort if no object.
	Object *ObjectPtr = nodePtr->GetObjectRef();
	if (!ObjectPtr) return NULL;

	// Is derived object ?
	if (ObjectPtr->SuperClassID() == GEN_DERIVOB_CLASS_ID)
	{
		// Yes -> Cast.
		IDerivedObject *DerivedObjectPtr = static_cast<IDerivedObject*>(ObjectPtr);

		// Iterate over all entries of the modifier stack.
		int ModStackIndex = 0;
		while (ModStackIndex < DerivedObjectPtr->NumModifiers())
		{
			// Get current modifier.
			Modifier *ModifierPtr = DerivedObjectPtr->GetModifier(ModStackIndex);

			// Is this Bones Pro OSM?
			if (ModifierPtr->ClassID() == BP_CLASS_ID_OSM )
			{
				// Yes -> Exit.
				return ModifierPtr;
			}
			// Is this Bones Pro WSM?
			if (ModifierPtr->ClassID() == BP_CLASS_ID_WSM )
			{
				// Yes -> Exit.
				return ModifierPtr;
			}
			// Next modifier stack entry.
			ModStackIndex++;
		}
	}
	// Not found.
	return NULL;
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:38,代码来源:smdlexp.cpp


注:本文中的IDerivedObject::GetModifier方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。