From 4e42d9e89a0cd3363a8f44edd29937f9d9da7ad0 Mon Sep 17 00:00:00 2001 From: Michael PLATINGS Date: Mon, 7 Jun 2010 15:25:18 +0000 Subject: [PATCH] Added more NURBS types to triangulate. --- src/osgPlugins/fbx/fbxRNode.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/osgPlugins/fbx/fbxRNode.cpp b/src/osgPlugins/fbx/fbxRNode.cpp index a269fdd9c..68a76b394 100644 --- a/src/osgPlugins/fbx/fbxRNode.cpp +++ b/src/osgPlugins/fbx/fbxRNode.cpp @@ -318,11 +318,23 @@ osgDB::ReaderWriter::ReadResult OsgFbxReader::readFbxNode( { if (KFbxNodeAttribute* lNodeAttribute = pNode->GetNodeAttribute()) { - if (lNodeAttribute->GetAttributeType() == KFbxNodeAttribute::eNURB || - lNodeAttribute->GetAttributeType() == KFbxNodeAttribute::ePATCH) + KFbxNodeAttribute::EAttributeType attrType = lNodeAttribute->GetAttributeType(); + switch (attrType) { - KFbxGeometryConverter lConverter(&pSdkManager); - lConverter.TriangulateInPlace(pNode); + case KFbxNodeAttribute::eNURB: + case KFbxNodeAttribute::ePATCH: + case KFbxNodeAttribute::eNURBS_CURVE: + case KFbxNodeAttribute::eNURBS_SURFACE: + { + KFbxGeometryConverter lConverter(&pSdkManager); + if (!lConverter.TriangulateInPlace(pNode)) + { + OSG_WARN << "Unable to triangulate FBX NURBS " << pNode->GetName() << std::endl; + } + } + break; + default: + break; } } @@ -467,7 +479,7 @@ osgDB::ReaderWriter::ReadResult OsgFbxReader::readFbxNode( osg::Group* pAddChildrenTo = osgGroup.get(); if (bCreateSkeleton) - { + { osgAnimation::Skeleton* osgSkeleton = getSkeleton(pNode, fbxSkeletons, skeletonMap); osgSkeleton->setDefaultUpdateCallback(); pAddChildrenTo->addChild(osgSkeleton);