Skip to content

Commit 380141b

Browse files
bugfix(htree): Handle null parent pivots and correct animation data indexing
1 parent 56afa53 commit 380141b

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

Core/Libraries/Source/WWVegas/WW3D2/htree.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,10 +643,15 @@ void HTreeClass::Anim_Update_Without_Interpolation(const Matrix3D & root,HRawAni
643643
endpivot=pivot+(NumPivots-1);
644644
lastAnimPivot = &Pivot[num_anim_pivots];
645645

646-
for (int piv_idx=1; pivot < endpivot; pivot++,nodeMotion++) {
646+
for (int piv_idx=1; pivot < endpivot; pivot++) {
647647

648648
// base pose
649-
assert(pivot->Parent != nullptr);
649+
if (pivot->Parent == nullptr)
650+
{
651+
if (pivot < lastAnimPivot)
652+
nodeMotion++;
653+
continue;
654+
}
650655
Matrix3D::Multiply(pivot->Parent->Transform, pivot->BaseTransform, &(pivot->Transform));
651656

652657
// Don't update this pivot if the HTree doesn't have animation data for it...
@@ -683,6 +688,8 @@ void HTreeClass::Anim_Update_Without_Interpolation(const Matrix3D & root,HRawAni
683688
pivot->IsVisible=(nodeMotion->Vis->Get_Bit(iframe) == 1);
684689
else
685690
pivot->IsVisible=1;
691+
692+
nodeMotion++;
686693
}
687694

688695
if (pivot->Is_Captured())

0 commit comments

Comments
 (0)