Skip to content

Commit aeae416

Browse files
committed
Rebuild tree lists for uncompiled models when adding keyframes
1 parent 33109be commit aeae416

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/user/user_model.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4049,8 +4049,12 @@ void mjCModel::StoreKeyframes(mjCModel* dest) {
40494049
"To prevent this, compile the child model before attaching it again.");
40504050
}
40514051

4052-
// do not change compilation quantities in case the user wants to recompile preserving the state
4052+
// rebuild tree lists so that SaveDofOffsets computes correct sizes even when including
4053+
// things like `replicate` tags.
40534054
if (!compiled) {
4055+
ResetTreeLists();
4056+
MakeTreeLists();
4057+
ProcessLists(/*checkrepeat=*/false);
40544058
SaveDofOffsets(/*computesize=*/true);
40554059
ComputeReference();
40564060
}

0 commit comments

Comments
 (0)