本文整理汇总了C++中NiNodeRef::ClearExtraData方法的典型用法代码示例。如果您正苦于以下问题:C++ NiNodeRef::ClearExtraData方法的具体用法?C++ NiNodeRef::ClearExtraData怎么用?C++ NiNodeRef::ClearExtraData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NiNodeRef
的用法示例。
在下文中一共展示了NiNodeRef::ClearExtraData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: convertNiNode
NiNodeRef NifConvertUtility::convertNiNode(NiNodeRef pSrcNode, NiTriShapeRef pTmplNode, NiNodeRef pRootNode, NiAlphaPropertyRef pTmplAlphaProp)
{
NiNodeRef pDstNode (pSrcNode);
//pDstNode->SetName(pDstNode->GetName().replace(
string node_name_in = pDstNode->GetName();
string node_name_out = "";
for (int i = 0; i < node_name_in.length(); i++)
{
if (node_name_in[i] != '.' && node_name_in[i] != '_' && node_name_in[i] != ' ')
{
node_name_out = node_name_out + node_name_in[i];
}
}
pDstNode->SetName(node_name_out);
node_name_in = node_name_out;
if (node_name_in.compare("AttachLight") == 0)
{
Vector3 tr = pDstNode->GetLocalTranslation();
tr.z += 10.0f;
pDstNode->SetLocalTranslation(tr);
}
if (node_name_in.compare("ShadowBox") == 0)
{
cout << "Removing ShadowBox" << endl;
pDstNode->ClearChildren();
}
if (toLower(node_name_in).find("fireemit") != -1)
{
NiExtraDataRef ed = root_bsafade->GetExtraData().front();
NiIntegerExtraDataRef iref = DynamicCast<NiIntegerExtraData>(ed);
iref->SetData(147);
cout << "Adding TorchFlame Addon" << endl;
BSValueNodeRef candle_flame = new BSValueNode();
candle_flame->SetName("AddOnNode");
candle_flame->value = 46;
pDstNode->AddChild(DynamicCast<NiAVObject>(candle_flame));
}
else if (node_name_in.find("CandleFlame") != -1)
{
NiExtraDataRef ed = root_bsafade->GetExtraData().front();
NiIntegerExtraDataRef iref = DynamicCast<NiIntegerExtraData>(ed);
iref->SetData(147);
cout << "Adding CandleFlame Addon" << endl;
BSValueNodeRef candle_flame = new BSValueNode();
candle_flame->SetName("AddOnNode");
candle_flame->value = 49;
pDstNode->AddChild(DynamicCast<NiAVObject>(candle_flame));
}
vector<NiAVObjectRef> srcShapeList(pDstNode->GetChildren());
//if (!pDstNode->GetType().IsSameType(NiNode::TYPE) && !pDstNode->GetType().IsSameType(BSFadeNode::TYPE) && !pDstNode->GetType().IsSameType(NiTriShape::TYPE) && !pDstNode->GetType().IsSameType(NiTriStrips::TYPE))
{
}
// find NiAlphaProperty and use as template in sub-nodes
if (DynamicCast<NiAlphaProperty>(pDstNode->GetPropertyByType(NiAlphaProperty::TYPE)) != NULL)
{
pTmplAlphaProp = DynamicCast<NiAlphaProperty>(pDstNode->GetPropertyByType(NiAlphaProperty::TYPE));
}
// unlink protperties -> not used in new format
pDstNode->ClearProperties();
// shift extra data to new version
pDstNode->ShiftExtraData(VER_20_2_0_7);
// unlink children
pDstNode->ClearChildren();
pDstNode->ClearEffects();
pDstNode->ClearControllers();
if (!pDstNode->GetType().IsSameType(BSFadeNode::TYPE))
{
pDstNode->ClearExtraData();
}
// iterate over source nodes and convert using template
for (auto ppIter=srcShapeList.begin(), pEnd=srcShapeList.end(); ppIter != pEnd; ppIter++)
{
//DynamicCast<NiTriShape>(*ppIter) == NULL && DynamicCast<NiTriStrips>(*ppIter) == NULL ** DynamicCast<NiTriStrips>(*ppIter) != NULL
//.........这里部分代码省略.........