MCPcopy Create free account
hub / github.com/MergHQ/CRYENGINE / SetAttachmentCGF

Method SetAttachmentCGF

Code/CryEngine/CryEntitySystem/ScriptBind_Entity.cpp:2249–2275  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

2247
2248//////////////////////////////////////////////////////////////////////////
2249int CScriptBind_Entity::SetAttachmentCGF(IFunctionHandler* pH, int characterSlot, const char* attachmentName, const char* filePath)
2250{
2251 GET_ENTITY;
2252
2253 ICharacterInstance* pCharacter = pEntity->GetCharacter(characterSlot);
2254
2255 if (!pCharacter)
2256 return pH->EndFunction();
2257
2258 IAttachmentManager* pIAttachmentManager = pCharacter->GetIAttachmentManager();
2259 IAttachment* pIAttachment = pIAttachmentManager->GetInterfaceByName(attachmentName);
2260
2261 if (!pIAttachment)
2262 return pH->EndFunction();
2263
2264 if (IStatObj* pIStatObj = gEnv->p3DEngine->LoadStatObj(filePath))
2265 {
2266 CCGFAttachment* pStatAttachment = new CCGFAttachment();
2267 pStatAttachment->pObj = pIStatObj;
2268
2269 pIAttachment->AddBinding(pStatAttachment);
2270 }
2271
2272 pIAttachment->HideAttachment(0);
2273
2274 return pH->EndFunction();
2275}
2276
2277//////////////////////////////////////////////////////////////////////////
2278int CScriptBind_Entity::SetAttachmentLight(IFunctionHandler* pH, int characterSlot, const char* attachmentName, SmartScriptTable lightTable, int flags)

Callers

nothing calls this directly

Calls 6

GetInterfaceByNameMethod · 0.80
AddBindingMethod · 0.80
GetCharacterMethod · 0.45
EndFunctionMethod · 0.45
LoadStatObjMethod · 0.45
HideAttachmentMethod · 0.45

Tested by

no test coverage detected