void LinkAnimatedParamCommonFloat(const fm::string& semantic, FCDEffectParameterFloat* param, FCDGeometryInstance* geometry, FCDMaterial* material, FCDEffect* effect, FCDEffectProfile* profile) { const fm::string& reference = param->GetReference(); if (reference.empty()) return; FCDEffectParameter* geometryParam = FindEffectParameterBySemantic(geometry, semantic); FCDEffectParameter* materialParam = FindEffectParameterByReference(material, reference, true); FCDEffectParameter* effectParam = FindEffectParameterByReference(effect, reference, true); FCDEffectParameter* profileParam = FindEffectParameterByReference(profile, reference, false); if (!geometryParam && !materialParam && !effectParam && !profileParam) return; // If there's ANIMATORS, link them. if (geometryParam && geometryParam->GetType() == FCDEffectParameter::FLOAT) { FCDEffectParameterFloat* animatedParam = (FCDEffectParameterFloat*) geometryParam; if (materialParam && materialParam->GetType() == FCDEffectParameter::FLOAT) { FCDEffectParameterFloat* floatParam = (FCDEffectParameterFloat*) materialParam; animatedParam->SetValue(floatParam->GetValue()); } else if (effectParam && effectParam->GetType() == FCDEffectParameter::FLOAT) { FCDEffectParameterFloat* floatParam = (FCDEffectParameterFloat*) effectParam; animatedParam->SetValue(floatParam->GetValue()); } else if (profileParam && profileParam->GetType() == FCDEffectParameter::FLOAT) { FCDEffectParameterFloat* floatParam = (FCDEffectParameterFloat*) profileParam; animatedParam->SetValue(floatParam->GetValue()); } } }
FCDParameterAnimatableFloat* GetAnimatedFloat(FCDGeometryInstance* geometryInstance, FCDMaterial* material, const fm::string& semantic) { //Find the different classes that are needed. //FCDMaterial* material = materialInstance->GetMaterial(); if (material == NULL) return NULL; FCDEffect* effect = material->GetEffect(); if (effect == NULL) return NULL; FCDEffectProfile* effectProfile = effect->FindProfile(FUDaeProfileType::COMMON); if (effectProfile == NULL) return NULL; FCDEffectStandard* effectStandard = (FCDEffectStandard*) effectProfile; bool isFloat = true; //Find out if the parameter is animated FCDEffectParameter* effectStandardParam = effectStandard->GetParam(semantic, &isFloat); if (!effectStandardParam) return NULL; const fm::string& reference = effectStandardParam->GetReference(); if (reference.empty()) { if (isFloat) return &(((FCDEffectParameterFloat*)effectStandardParam)->GetValue()); else return NULL; } FCDEffectParameter* geometryParam = geometryInstance != NULL ? FindEffectParameterBySemantic(geometryInstance, semantic) : NULL; FCDEffectParameter* materialParam = FindEffectParameterByReference(material, reference, true); FCDEffectParameter* effectParam = FindEffectParameterByReference(effect, reference, true); FCDEffectParameter* effectProfileParam = FindEffectParameterByReference(effectProfile, reference, false); if (isFloat) { if (geometryParam) { if (geometryParam->GetType() != FCDEffectParameter::FLOAT) return NULL; else return &((FCDEffectParameterFloat*)geometryParam)->GetValue(); } //From this on out, could call GetDefaultFloat... and return that? else if (materialParam) { if (materialParam->GetType() != FCDEffectParameter::FLOAT) return NULL; else return &((FCDEffectParameterFloat*)materialParam)->GetValue(); } else if (effectParam) { if (effectParam->GetType() != FCDEffectParameter::FLOAT) return NULL; else return &((FCDEffectParameterFloat*)effectParam)->GetValue(); } else if (effectProfileParam) { if (effectProfileParam->GetType() != FCDEffectParameter::FLOAT) return NULL; else return &((FCDEffectParameterFloat*)effectProfileParam)->GetValue(); } else return &((FCDEffectParameterFloat*)effectStandardParam)->GetValue(); } else return NULL; }
float* GetDefaultFloat(FCDMaterial* material, const fm::string& semantic) { //Find the different classes that are needed. FCDEffect* effect = material->GetEffect(); FCDEffectProfile* effectProfile = effect->FindProfile(FUDaeProfileType::COMMON); FCDEffectStandard* effectStandard = (FCDEffectStandard*) effectProfile; bool isFloat = true; //Find out if the parameter is animated FCDEffectParameter* effectStandardParam = effectStandard->GetParam(semantic, &isFloat); if (!effectStandardParam) return NULL; const fm::string& reference = effectStandardParam->GetReference(); if (reference.empty()) { if (isFloat) return &(float&) ((FCDEffectParameterFloat*)effectStandardParam)->GetValue(); else return NULL; } FCDEffectParameter* materialParam = FindEffectParameterByReference(material, reference, true); FCDEffectParameter* effectParam = FindEffectParameterByReference(effect, reference, true); FCDEffectParameter* effectProfileParam = FindEffectParameterByReference(effectProfile, reference, false); if (isFloat) { if (materialParam) { if (materialParam->GetType() != FCDEffectParameter::FLOAT) return NULL; else return &(float&) ((FCDEffectParameterFloat*)materialParam)->GetValue(); } else if (effectParam) { if (effectParam->GetType() != FCDEffectParameter::FLOAT) return NULL; else return &(float&) ((FCDEffectParameterFloat*)effectParam)->GetValue(); } else if (effectProfileParam) { if (effectProfileParam->GetType() != FCDEffectParameter::FLOAT) return NULL; else return &(float&) ((FCDEffectParameterFloat*)effectProfileParam)->GetValue(); } else return &(float&) ((FCDEffectParameterFloat*)effectStandardParam)->GetValue(); } else return NULL; }
bool CModelConverter::ReadDAE(const tstring& sFilename) { if (m_pWorkListener) m_pWorkListener->BeginProgress(); FCollada::Initialize(); FCDocument* pDoc = FCollada::NewTopDocument(); if (m_pWorkListener) m_pWorkListener->SetAction("Reading file", 0); if (FCollada::LoadDocumentFromFile(pDoc, convert_to_fstring(sFilename))) { size_t i; FCDocumentTools::StandardizeUpAxisAndLength(pDoc, FMVector3(0, 1, 0)); FCDMaterialLibrary* pMatLib = pDoc->GetMaterialLibrary(); size_t iEntities = pMatLib->GetEntityCount(); if (m_pWorkListener) m_pWorkListener->SetAction("Reading materials", iEntities); for (i = 0; i < iEntities; ++i) { FCDMaterial* pColladaMaterial = pMatLib->GetEntity(i); FCDEffect* pEffect = pColladaMaterial->GetEffect(); size_t iMaterial = m_pScene->AddMaterial(convert_from_fstring(pColladaMaterial->GetName())); CConversionMaterial* pMaterial = m_pScene->GetMaterial(iMaterial); if (pEffect->GetProfileCount() < 1) continue; FCDEffectProfile* pEffectProfile = pEffect->GetProfile(0); FUDaeProfileType::Type eProfileType = pEffectProfile->GetType(); if (eProfileType == FUDaeProfileType::COMMON) { FCDEffectStandard* pStandardProfile = dynamic_cast<FCDEffectStandard*>(pEffectProfile); if (pStandardProfile) { pMaterial->m_vecAmbient = Vector((float*)pStandardProfile->GetAmbientColor()); pMaterial->m_vecDiffuse = Vector((float*)pStandardProfile->GetDiffuseColor()); pMaterial->m_vecSpecular = Vector((float*)pStandardProfile->GetSpecularColor()); pMaterial->m_vecEmissive = Vector((float*)pStandardProfile->GetEmissionColor()); pMaterial->m_flShininess = pStandardProfile->GetShininess(); } } for (size_t j = 0; j < pEffectProfile->GetEffectParameterCount(); j++) { FCDEffectParameter* pEffectParameter = pEffectProfile->GetEffectParameter(j); FCDEffectParameter::Type eType = pEffectParameter->GetType(); if (eType == FCDEffectParameter::SAMPLER) { FCDEffectParameterSampler* pSampler = dynamic_cast<FCDEffectParameterSampler*>(pEffectParameter); if (pSampler) { FCDEffectParameterSurface* pSurface = pSampler->GetSurface(); if (pSurface) { if (pSurface->GetImageCount()) { // Christ Collada why do you have to make things so damn complicated? FCDImage* pImage = pSurface->GetImage(0); pMaterial->m_sDiffuseTexture = convert_from_fstring(pImage->GetFilename()); // Fix up a bug in the Max Collada exporter if (pMaterial->m_sDiffuseTexture.startswith("\\\\C\\")) pMaterial->m_sDiffuseTexture = "C:\\" + pMaterial->m_sDiffuseTexture.substr(4); else if (pMaterial->m_sDiffuseTexture.startswith("\\\\D\\")) pMaterial->m_sDiffuseTexture = "D:\\" + pMaterial->m_sDiffuseTexture.substr(4); } } } } } if (m_pWorkListener) m_pWorkListener->WorkProgress(i+1); } FCDGeometryLibrary* pGeoLib = pDoc->GetGeometryLibrary(); iEntities = pGeoLib->GetEntityCount(); if (m_pWorkListener) m_pWorkListener->SetAction("Loading entities", iEntities); for (i = 0; i < iEntities; ++i) { FCDGeometry* pGeometry = pGeoLib->GetEntity(i); if (pGeometry->IsMesh()) { size_t j; size_t iMesh = m_pScene->AddMesh(convert_from_fstring(pGeometry->GetName())); CConversionMesh* pMesh = m_pScene->GetMesh(iMesh); pMesh->AddBone(convert_from_fstring(pGeometry->GetName())); FCDGeometryMesh* pGeoMesh = pGeometry->GetMesh(); FCDGeometrySource* pPositionSource = pGeoMesh->GetPositionSource(); size_t iVertexCount = pPositionSource->GetValueCount(); for (j = 0; j < iVertexCount; j++) { const float* pflValues = pPositionSource->GetValue(j); pMesh->AddVertex(pflValues[0], pflValues[1], pflValues[2]); } FCDGeometrySource* pNormalSource = pGeoMesh->FindSourceByType(FUDaeGeometryInput::NORMAL); if (pNormalSource) { iVertexCount = pNormalSource->GetValueCount(); for (j = 0; j < iVertexCount; j++) { const float* pflValues = pNormalSource->GetValue(j); pMesh->AddNormal(pflValues[0], pflValues[1], pflValues[2]); } } FCDGeometrySource* pUVSource = pGeoMesh->FindSourceByType(FUDaeGeometryInput::TEXCOORD); if (pUVSource) { iVertexCount = pUVSource->GetValueCount(); for (j = 0; j < iVertexCount; j++) { const float* pflValues = pUVSource->GetValue(j); pMesh->AddUV(pflValues[0], pflValues[1]); } } for (j = 0; j < pGeoMesh->GetPolygonsCount(); j++) { FCDGeometryPolygons* pPolygons = pGeoMesh->GetPolygons(j); FCDGeometryPolygonsInput* pPositionInput = pPolygons->FindInput(FUDaeGeometryInput::POSITION); FCDGeometryPolygonsInput* pNormalInput = pPolygons->FindInput(FUDaeGeometryInput::NORMAL); FCDGeometryPolygonsInput* pUVInput = pPolygons->FindInput(FUDaeGeometryInput::TEXCOORD); size_t iPositionCount = pPositionInput->GetIndexCount(); uint32* pPositions = pPositionInput->GetIndices(); size_t iNormalCount = 0; uint32* pNormals = NULL; if (pNormalInput) { iNormalCount = pNormalInput->GetIndexCount(); pNormals = pNormalInput->GetIndices(); } size_t iUVCount = 0; uint32* pUVs = NULL; if (pUVInput) { iUVCount = pUVInput->GetIndexCount(); pUVs = pUVInput->GetIndices(); } fm::stringT<fchar> sMaterial = pPolygons->GetMaterialSemantic(); size_t iCurrentMaterial = pMesh->AddMaterialStub(convert_from_fstring(sMaterial)); if (pPolygons->TestPolyType() == 3) { // All triangles! for (size_t k = 0; k < iPositionCount; k+=3) { size_t iFace = pMesh->AddFace(iCurrentMaterial); pMesh->AddVertexToFace(iFace, pPositions[k+0], pUVs?pUVs[k+0]:~0, pNormals?pNormals[k+0]:~0); pMesh->AddVertexToFace(iFace, pPositions[k+1], pUVs?pUVs[k+1]:~0, pNormals?pNormals[k+1]:~0); pMesh->AddVertexToFace(iFace, pPositions[k+2], pUVs?pUVs[k+2]:~0, pNormals?pNormals[k+2]:~0); } } else if (pPolygons->TestPolyType() == 4) { // All quads! for (size_t k = 0; k < iPositionCount; k+=4) { size_t iFace = pMesh->AddFace(iCurrentMaterial); pMesh->AddVertexToFace(iFace, pPositions[k+0], pUVs?pUVs[k+0]:~0, pNormals?pNormals[k+0]:~0); pMesh->AddVertexToFace(iFace, pPositions[k+1], pUVs?pUVs[k+1]:~0, pNormals?pNormals[k+1]:~0); pMesh->AddVertexToFace(iFace, pPositions[k+2], pUVs?pUVs[k+2]:~0, pNormals?pNormals[k+2]:~0); pMesh->AddVertexToFace(iFace, pPositions[k+3], pUVs?pUVs[k+3]:~0, pNormals?pNormals[k+3]:~0); } } else { size_t iFaces = pPolygons->GetFaceCount(); for (size_t k = 0; k < iFaces; k++) { size_t iFace = pMesh->AddFace(iCurrentMaterial); size_t o = pPolygons->GetFaceVertexOffset(k); size_t iFaceVertexCount = pPolygons->GetFaceVertexCount(k); for (size_t v = 0; v < iFaceVertexCount; v++) pMesh->AddVertexToFace(iFace, pPositions[o+v], pUVs?pUVs[o+v]:~0, pNormals?pNormals[o+v]:~0); } } } } if (m_pWorkListener) m_pWorkListener->WorkProgress(i+1); } FCDVisualSceneNodeLibrary* pVisualScenes = pDoc->GetVisualSceneLibrary(); iEntities = pVisualScenes->GetEntityCount(); for (i = 0; i < iEntities; ++i) { FCDSceneNode* pNode = pVisualScenes->GetEntity(i); size_t iScene = m_pScene->AddScene(convert_from_fstring(pNode->GetName())); ReadDAESceneTree(pNode, m_pScene->GetScene(iScene)); } } else { printf("Oops! Some kind of error happened!\n"); return false; } m_pScene->SetWorkListener(m_pWorkListener); m_pScene->CalculateExtends(); for (size_t i = 0; i < m_pScene->GetNumMeshes(); i++) { if (m_bWantEdges) m_pScene->GetMesh(i)->CalculateEdgeData(); if (m_pScene->GetMesh(i)->GetNumNormals() == 0) m_pScene->GetMesh(i)->CalculateVertexNormals(); m_pScene->GetMesh(i)->CalculateVertexTangents(); } pDoc->Release(); FCollada::Release(); if (m_pWorkListener) m_pWorkListener->EndProgress(); return true; }
void LinkAnimatedParamCommonVector(const fm::string& semantic, FCDEffectParameterColor4* param, FCDGeometryInstance* geometry, FCDMaterial* material, FCDEffect* effect, FCDEffectProfile* profile) { //Change this to account for the animated params in geometryInstance list. const fm::string& reference = param->GetReference(); if (reference.empty()) return; FCDEffectParameter* geometryParam = FindEffectParameterBySemantic(geometry, semantic); FCDEffectParameter* materialParam = FindEffectParameterByReference(material, reference, true); FCDEffectParameter* effectParam = FindEffectParameterByReference(effect, reference, true); FCDEffectParameter* profileParam = FindEffectParameterByReference(profile, reference, false); if (!geometryParam && !materialParam && !effectParam && !profileParam) return; if (geometryParam && geometryParam->GetType() == FCDEffectParameter::FLOAT3) { FCDEffectParameterFloat3* animatedParam = (FCDEffectParameterFloat3*) geometryParam; if (materialParam && materialParam->GetType() == FCDEffectParameter::FLOAT3) { FCDEffectParameterFloat3* float3Param = (FCDEffectParameterFloat3*) materialParam; animatedParam->SetValue(float3Param->GetValue()); return; } else if (materialParam && materialParam->GetType() == FCDEffectParameter::VECTOR) { FCDEffectParameterColor4* vectorParam = (FCDEffectParameterColor4*) materialParam; animatedParam->SetValue(FMVector3((const FMVector4&) vectorParam->GetValue())); return; } else if (effectParam && effectParam->GetType() == FCDEffectParameter::FLOAT3) { FCDEffectParameterFloat3* float3Param = (FCDEffectParameterFloat3*) effectParam; animatedParam->SetValue(float3Param->GetValue()); return; } else if (effectParam && effectParam->GetType() == FCDEffectParameter::VECTOR) { FCDEffectParameterColor4* vectorParam = (FCDEffectParameterColor4*) effectParam; animatedParam->SetValue(FMVector3((const FMVector4&) vectorParam->GetValue())); return; } else if (profileParam && profileParam->GetType() == FCDEffectParameter::FLOAT3) { FCDEffectParameterFloat3* float3Param = (FCDEffectParameterFloat3*) profileParam; animatedParam->SetValue(float3Param->GetValue()); return; } else if (profileParam && profileParam->GetType() == FCDEffectParameter::VECTOR) { FCDEffectParameterColor4* vectorParam = (FCDEffectParameterColor4*) profileParam; animatedParam->SetValue(FMVector3((const FMVector4&) vectorParam->GetValue())); return; } } else if (geometryParam && geometryParam->GetType() == FCDEffectParameter::VECTOR) { FCDEffectParameterColor4* animatedParam = (FCDEffectParameterColor4*) geometryParam; if (materialParam && materialParam->GetType() == FCDEffectParameter::FLOAT3) { FCDEffectParameterFloat3* float3Param = (FCDEffectParameterFloat3*) materialParam; animatedParam->SetValue(FMVector4(float3Param->GetValue(), 1.0f)); return; } else if (materialParam && materialParam->GetType() == FCDEffectParameter::VECTOR) { FCDEffectParameterColor4* vectorParam = (FCDEffectParameterColor4*) materialParam; animatedParam->SetValue(vectorParam->GetValue()); return; } else if (effectParam && effectParam->GetType() == FCDEffectParameter::FLOAT3) { FCDEffectParameterFloat3* float3Param = (FCDEffectParameterFloat3*) effectParam; animatedParam->SetValue(FMVector4(float3Param->GetValue(), 1.0f)); return; } else if (effectParam && effectParam->GetType() == FCDEffectParameter::VECTOR) { FCDEffectParameterColor4* vectorParam = (FCDEffectParameterColor4*) effectParam; animatedParam->SetValue(vectorParam->GetValue()); return; } else if (profileParam && profileParam->GetType() == FCDEffectParameter::FLOAT3) { FCDEffectParameterFloat3* float3Param = (FCDEffectParameterFloat3*) profileParam; animatedParam->SetValue(FMVector4(float3Param->GetValue(), 1.0f)); return; } else if (profileParam && profileParam->GetType() == FCDEffectParameter::VECTOR) { FCDEffectParameterColor4* vectorParam = (FCDEffectParameterColor4*) profileParam; animatedParam->SetValue(vectorParam->GetValue()); return; } } }
FMVector4* GetDefaultColor(FCDMaterial* material, const fm::string& semantic, bool* isFloat3) { //Find the different classes that are needed. FCDEffect* effect = material->GetEffect(); FCDEffectProfile* effectProfile = effect->FindProfile(FUDaeProfileType::COMMON); FCDEffectStandard* effectStandard = (FCDEffectStandard*) effectProfile; bool isFloat = true; //Find out if the parameter is animated FCDEffectParameter* effectStandardParam = effectStandard->GetParam(semantic, &isFloat); if (!effectStandardParam) return NULL; const fm::string& reference = effectStandardParam->GetReference(); if (reference.empty()) { if (isFloat) return NULL; else return &(FMVector4&)(((FCDEffectParameterColor4*)effectStandardParam)->GetValue()); } FCDEffectParameter* materialParam = FindEffectParameterByReference(material, reference, true); FCDEffectParameter* effectParam = FindEffectParameterByReference(effect, reference, true); FCDEffectParameter* effectProfileParam = FindEffectParameterByReference(effectProfile, reference, false); //Do the figuring out .. ;) if (isFloat) return NULL; else { // Don't look at the geometry instance parameters: these are only used for animations! if (materialParam) { if (materialParam->GetType() == FCDEffectParameter::FLOAT3) { *isFloat3 = true; FCDEffectParameterFloat3* tempParam = (FCDEffectParameterFloat3*) materialParam; return (FMVector4*) &(FMVector3&) tempParam->GetValue(); } else if (materialParam->GetType() == FCDEffectParameter::VECTOR) { *isFloat3 = false; return &(FMVector4&) ((FCDEffectParameterColor4*)materialParam)->GetValue(); } else return NULL; } else if (effectParam) { if (effectParam->GetType() == FCDEffectParameter::FLOAT3) { *isFloat3 = true; FCDEffectParameterFloat3* tempParam = (FCDEffectParameterFloat3*) effectParam; return (FMVector4*) &(FMVector3&) tempParam->GetValue(); } else if (effectParam->GetType() == FCDEffectParameter::VECTOR) { *isFloat3 = false; return &(FMVector4&) ((FCDEffectParameterColor4*)effectParam)->GetValue(); } else return NULL; } else if (effectProfileParam) { if (effectProfileParam->GetType() == FCDEffectParameter::FLOAT3) { *isFloat3 = true; FCDEffectParameterFloat3* tempParam = (FCDEffectParameterFloat3*) effectProfileParam; return (FMVector4*) &(FMVector3&) tempParam->GetValue(); } else if (effectProfileParam->GetType() == FCDEffectParameter::VECTOR) { *isFloat3 = false; return &(FMVector4&) ((FCDEffectParameterColor4*)effectProfileParam)->GetValue(); } else return NULL; } else { *isFloat3 = true; return &(FMVector4&) ((FCDEffectParameterColor4*)effectStandardParam)->GetValue(); } } }
FCDParameterAnimatableColor4* GetAnimatedColor(FCDGeometryInstance* geometryInstance, FCDMaterial* material, const fm::string& semantic, bool* isFloat3) { //Find the different classes that are needed. //FCDMaterial* material = materialInstance->GetMaterial(); if (material == NULL) return NULL; FCDEffect* effect = material->GetEffect(); if (effect == NULL) return NULL; FCDEffectProfile* effectProfile = effect->FindProfile(FUDaeProfileType::COMMON); if (effectProfile == NULL) return NULL; FCDEffectStandard* effectStandard = (FCDEffectStandard*) effectProfile; bool isFloat = true; //Find out if the parameter is animated FCDEffectParameter* effectStandardParam = effectStandard->GetParam(semantic, &isFloat); if (effectStandardParam == NULL) return NULL; const fm::string& reference = effectStandardParam->GetReference(); if (reference.empty()) { if (isFloat) return NULL; else return &(((FCDEffectParameterColor4*)effectStandardParam)->GetValue()); } FCDEffectParameter* geometryParam = geometryInstance != NULL ? FindEffectParameterBySemantic(geometryInstance, semantic) : NULL; FCDEffectParameter* materialParam = FindEffectParameterByReference(material, reference, true); FCDEffectParameter* effectParam = FindEffectParameterByReference(effect, reference, true); FCDEffectParameter* effectProfileParam = FindEffectParameterByReference(effectProfile, reference, false); //Do the figuring out .. ;) if (isFloat) return NULL; else { if (geometryParam) { if (geometryParam->GetType() == FCDEffectParameter::FLOAT3) { *isFloat3 = true; FCDEffectParameterFloat3* tempParam = (FCDEffectParameterFloat3*) geometryParam; return (FCDParameterAnimatableColor4*) &tempParam->GetValue(); } else if (geometryParam->GetType() == FCDEffectParameter::VECTOR) { *isFloat3 = false; return &((FCDEffectParameterColor4*)geometryParam)->GetValue(); } else return NULL; } //Could call GetDefaultColor from here on out... else if (materialParam) { if (materialParam->GetType() == FCDEffectParameter::FLOAT3) { *isFloat3 = true; FCDEffectParameterFloat3* tempParam = (FCDEffectParameterFloat3*) materialParam; return (FCDParameterAnimatableColor4*) &tempParam->GetValue(); } else if (materialParam->GetType() == FCDEffectParameter::VECTOR) { *isFloat3 = false; return &((FCDEffectParameterColor4*)materialParam)->GetValue(); } else return NULL; } else if (effectParam) { if (effectParam->GetType() == FCDEffectParameter::FLOAT3) { *isFloat3 = true; FCDEffectParameterFloat3* tempParam = (FCDEffectParameterFloat3*) effectParam; return (FCDParameterAnimatableColor4*) &tempParam->GetValue(); } else if (effectParam->GetType() == FCDEffectParameter::VECTOR) { *isFloat3 = false; return &((FCDEffectParameterColor4*)effectParam)->GetValue(); } else return NULL; } else if (effectProfileParam) { if (effectProfileParam->GetType() == FCDEffectParameter::FLOAT3) { *isFloat3 = true; FCDEffectParameterFloat3* tempParam = (FCDEffectParameterFloat3*) effectProfileParam; return (FCDParameterAnimatableColor4*) &tempParam->GetValue(); } else if (effectProfileParam->GetType() == FCDEffectParameter::VECTOR) { *isFloat3 = false; return &((FCDEffectParameterColor4*)effectProfileParam)->GetValue(); } else return NULL; } else { *isFloat3 = true; return &((FCDEffectParameterColor4*)effectStandardParam)->GetValue(); } } }