@@ -31,6 +31,7 @@ class JniUserModel : public CubismUserModel {
3131 void loadModelCopy (const csmByte* buffer, csmSizeInt size) {
3232 _mocBuffer.assign (buffer, buffer + size);
3333 LoadModel (_mocBuffer.data (), (csmSizeInt)_mocBuffer.size ());
34+ if (_model) _model->SaveParameters ();
3435 }
3536
3637 void loadPhysicsCopy (const csmByte* buffer, csmSizeInt size) {
@@ -70,7 +71,6 @@ class JniUserModel : public CubismUserModel {
7071 void update (float dt) {
7172 if (!_model) return ;
7273
73- // Cleanup finished motions safely
7474 {
7575 std::lock_guard<std::mutex> lock (_pendingMutex);
7676 for (auto * m : _pendingDeletion) {
@@ -84,13 +84,7 @@ class JniUserModel : public CubismUserModel {
8484 }
8585
8686 _model->LoadParameters ();
87-
88- // Update motion and check if we are idle
89- bool isMotionPlaying = !_motionManager->IsFinished ();
90- if (isMotionPlaying) {
91- _motionManager->UpdateMotion (_model, dt);
92- }
93-
87+ _motionManager->UpdateMotion (_model, dt);
9488 _model->SaveParameters ();
9589
9690 if (_pose) _pose->UpdateParameters (_model, dt);
@@ -108,9 +102,7 @@ class JniUserModel : public CubismUserModel {
108102 _model->Update ();
109103 }
110104
111- bool isMotionFinished () {
112- return _motionManager->IsFinished ();
113- }
105+ bool isMotionFinished () { return _motionManager->IsFinished (); }
114106
115107 void notifyFinished () {
116108 JNIEnv* env = getEnv ();
0 commit comments