diff --git a/src/osgPlugins/fbx/fbxRLight.cpp b/src/osgPlugins/fbx/fbxRLight.cpp index ce01fd2e0..24272a6a0 100644 --- a/src/osgPlugins/fbx/fbxRLight.cpp +++ b/src/osgPlugins/fbx/fbxRLight.cpp @@ -20,11 +20,11 @@ osgDB::ReaderWriter::ReadResult OsgFbxReader::readFbxLight(FbxNode* pNode, int& } osg::Light* osgLight = new osg::Light; - osg::LightSource* osgLightSource = new osg::LightSource; - - osgLightSource->setLight(osgLight); osgLight->setLightNum(nLightCount++); + osg::LightSource* osgLightSource = new osg::LightSource; + osgLightSource->setLight(osgLight); + FbxLight::EType fbxLightType = fbxLight->LightType.IsValid() ? fbxLight->LightType.Get() : FbxLight::ePoint;