-
Notifications
You must be signed in to change notification settings - Fork 18
BSFaceGenNiNode::SkinAllGeometry_1403f2990 on 1.6.640
void SkinAllGeometry(BSFaceGenNiNode *this,BSGeometry *a_geometry)
{
int boneHasValue;
BSTriShape *child_as_trishape;
BSFaceGenModelExtraData *childExtraData;
NiAVObject *boneFoundInGeometry;
BSFixedString *boneName;
ulonglong boneIndex;
ulonglong boneOffset;
uint boneIndex2;
uint childIndexPlus1;
NiAVObject *child;
uint bonesNb;
NiSkinInstance *childSkin;
NiAVObject **childSkinBones;
NiSkinData *childSkinData;
if (a_geometry != (BSGeometry *)0x0) {
boneIndex = 0;
childIndexPlus1 = 0;
if ((this->children)._freeIdx != 0) {
do {
boneOffset = 0;
boneIndex2 = (uint)boneIndex;
child = (this->children)._data[boneIndex]._ptr;
if (((((child != (NiAVObject *)0x0) &&
(child_as_trishape = (BSTriShape *)(*(code *)child->vtable->AsTriShape)(),
child_as_trishape != (BSTriShape *)0x0)) &&
(childSkin = (child_as_trishape->skinInstance)._ptr, childSkin != (NiSkinInstance *)0x0
)) && ((childSkinData = (childSkin->skinData)._ptr, childSkinData != (NiSkinData *)0x0
&& (childSkinBones = childSkin->bones, childSkinBones != (NiAVObject **)0x0))))
&& (bonesNb = childSkinData->bones, boneIndex = boneOffset, bonesNb != 0)) {
do {
childExtraData =
(BSFaceGenModelExtraData *)
NiAVObject::GetExtraDataByName_140C9AEA0(child_as_trishape,&DAT_142fa18d0);
if ((childExtraData == (BSFaceGenModelExtraData *)0x0) || (MaxNumber < (uint)boneIndex))
{
boneName = (BSFixedString *)sub_14013B000();
}
else {
boneName = childExtraData->bones + boneIndex;
}
boneHasValue = BSFixedString::HasValue_140C61750(boneName);
if (boneHasValue == 0) {
boneName = (BSFixedString *)
(*(longlong *)(boneOffset + (longlong)childSkinBones) + 0x10);
}
boneFoundInGeometry =
(NiAVObject *)(*(code *)a_geometry->vtable->getObjectByName)(a_geometry,boneName);
if (boneFoundInGeometry != (NiAVObject *)0x0) {
*(NiAVObject **)(boneOffset + (longlong)childSkin->bones) = boneFoundInGeometry;
*(NiTransform **)(boneOffset + (longlong)childSkin->boneWorldTransforms) =
&boneFoundInGeometry->world;
}
boneIndex2 = (uint)boneIndex + 1;
boneOffset = boneOffset + 8;
boneIndex = (ulonglong)boneIndex2;
} while (boneIndex2 < bonesNb);
childSkin->rootParent = (NiAVObject *)this;
boneIndex2 = childIndexPlus1;
}
childIndexPlus1 = boneIndex2 + 1;
boneIndex = (ulonglong)childIndexPlus1;
} while (childIndexPlus1 < (this->children)._freeIdx);
}
}
return;
}