|
|
@ -261,7 +261,7 @@ namespace NifOsg
|
|
|
|
|
|
|
|
|
|
|
|
osg::ref_ptr<TextKeyMapHolder> textkeys (new TextKeyMapHolder);
|
|
|
|
osg::ref_ptr<TextKeyMapHolder> textkeys (new TextKeyMapHolder);
|
|
|
|
|
|
|
|
|
|
|
|
osg::ref_ptr<osg::Node> created = handleNode(nifNode, NULL, imageManager, std::vector<int>(), 0, false, false, &textkeys->mTextKeys);
|
|
|
|
osg::ref_ptr<osg::Node> created = handleNode(nifNode, NULL, imageManager, std::vector<int>(), 0, false, false, false, &textkeys->mTextKeys);
|
|
|
|
|
|
|
|
|
|
|
|
if (nif->getUseSkinning())
|
|
|
|
if (nif->getUseSkinning())
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -463,7 +463,7 @@ namespace NifOsg
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
osg::ref_ptr<osg::Node> handleNode(const Nif::Node* nifNode, osg::Group* parentNode, Resource::ImageManager* imageManager,
|
|
|
|
osg::ref_ptr<osg::Node> handleNode(const Nif::Node* nifNode, osg::Group* parentNode, Resource::ImageManager* imageManager,
|
|
|
|
std::vector<int> boundTextures, int animflags, bool skipMeshes, bool isAnimated, TextKeyMap* textKeys, osg::Node* rootNode=NULL)
|
|
|
|
std::vector<int> boundTextures, int animflags, bool skipMeshes, bool hasMarkers, bool isAnimated, TextKeyMap* textKeys, osg::Node* rootNode=NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (rootNode != NULL && Misc::StringUtils::ciEqual(nifNode->name, "Bounding Box"))
|
|
|
|
if (rootNode != NULL && Misc::StringUtils::ciEqual(nifNode->name, "Bounding Box"))
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
@ -510,7 +510,7 @@ namespace NifOsg
|
|
|
|
if(sd->string == "MRK" && !Loader::getShowMarkers())
|
|
|
|
if(sd->string == "MRK" && !Loader::getShowMarkers())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Marker objects. These meshes are only visible in the editor.
|
|
|
|
// Marker objects. These meshes are only visible in the editor.
|
|
|
|
skipMeshes = true;
|
|
|
|
hasMarkers = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -542,7 +542,7 @@ namespace NifOsg
|
|
|
|
node->setNodeMask(0x1);
|
|
|
|
node->setNodeMask(0x1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (skipMeshes && isAnimated) // make sure the empty node is not optimized away so the physicssystem can find it.
|
|
|
|
if ((skipMeshes || hasMarkers) && isAnimated) // make sure the empty node is not optimized away so the physicssystem can find it.
|
|
|
|
{
|
|
|
|
{
|
|
|
|
node->setDataVariance(osg::Object::DYNAMIC);
|
|
|
|
node->setDataVariance(osg::Object::DYNAMIC);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -554,6 +554,10 @@ namespace NifOsg
|
|
|
|
if (nifNode->recType == Nif::RC_NiTriShape && !skipMeshes)
|
|
|
|
if (nifNode->recType == Nif::RC_NiTriShape && !skipMeshes)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const Nif::NiTriShape* triShape = static_cast<const Nif::NiTriShape*>(nifNode);
|
|
|
|
const Nif::NiTriShape* triShape = static_cast<const Nif::NiTriShape*>(nifNode);
|
|
|
|
|
|
|
|
const std::string nodeName = Misc::StringUtils::lowerCase(triShape->name);
|
|
|
|
|
|
|
|
static const std::string pattern = "tri editormarker";
|
|
|
|
|
|
|
|
if (!hasMarkers || nodeName.compare(0, pattern.size(), pattern) != 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
if (triShape->skin.empty())
|
|
|
|
if (triShape->skin.empty())
|
|
|
|
handleTriShape(triShape, node, composite, boundTextures, animflags);
|
|
|
|
handleTriShape(triShape, node, composite, boundTextures, animflags);
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -562,6 +566,7 @@ namespace NifOsg
|
|
|
|
if (!nifNode->controller.empty())
|
|
|
|
if (!nifNode->controller.empty())
|
|
|
|
handleMeshControllers(nifNode, node, composite, boundTextures, animflags);
|
|
|
|
handleMeshControllers(nifNode, node, composite, boundTextures, animflags);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(nifNode->recType == Nif::RC_NiAutoNormalParticles || nifNode->recType == Nif::RC_NiRotatingParticles)
|
|
|
|
if(nifNode->recType == Nif::RC_NiAutoNormalParticles || nifNode->recType == Nif::RC_NiRotatingParticles)
|
|
|
|
handleParticleSystem(nifNode, node, composite, animflags, rootNode);
|
|
|
|
handleParticleSystem(nifNode, node, composite, animflags, rootNode);
|
|
|
@ -598,7 +603,7 @@ namespace NifOsg
|
|
|
|
for(size_t i = 0;i < children.length();++i)
|
|
|
|
for(size_t i = 0;i < children.length();++i)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(!children[i].empty())
|
|
|
|
if(!children[i].empty())
|
|
|
|
handleNode(children[i].getPtr(), node, imageManager, boundTextures, animflags, skipMeshes, isAnimated, textKeys, rootNode);
|
|
|
|
handleNode(children[i].getPtr(), node, imageManager, boundTextures, animflags, skipMeshes, hasMarkers, isAnimated, textKeys, rootNode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|