Skip to content

Commit

Permalink
Revert and Force disable next motion while speaking
Browse files Browse the repository at this point in the history
  • Loading branch information
RaSan147 committed Aug 20, 2024
1 parent 4420cc2 commit 65300f4
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 20 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ import { Live2DModel } from 'pixi-live2d-display/cubism4';


<!-- if support for both Cubism 2.1 and 4 -->
<script src="https://cdn.jsdelivr.net/gh/RaSan147/[email protected]6/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/RaSan147/[email protected]7/dist/index.min.js"></script>

<!-- if only Cubism 2.1 support-->
<script src="https://cdn.jsdelivr.net/gh/RaSan147/[email protected]6/dist/cubism2.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/RaSan147/[email protected]7/dist/cubism2.min.js"></script>

<!-- if only Cubism 4 support-->
<script src="https://cdn.jsdelivr.net/gh/RaSan147/[email protected]6/dist/cubism4.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/RaSan147/[email protected]7/dist/cubism4.min.js"></script>
```

In this way, all the exported members are available under `PIXI.live2d` namespace, such as `PIXI.live2d.Live2DModel`.
Expand Down
7 changes: 6 additions & 1 deletion dist/cubism2.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const config = {
preserveExpressionOnMotion: true,
cubism4: CubismConfig
};
const VERSION = "v0.5.0-ls-6";
const VERSION = "v0.5.0-ls-7";
const logger = {
log(tag, ...messages) {
if (config.logLevel <= config.LOG_LEVEL_VERBOSE) {
Expand Down Expand Up @@ -1101,6 +1101,11 @@ class MotionManager extends utils.EventEmitter {
if (!this.state.reserve(group, index, priority)) {
return false;
}
if (this.currentAudio) {
if (!this.currentAudio.ended && priority != MotionPriority.FORCE) {
return false;
}
}
const definition = (_a = this.definitions[group]) == null ? void 0 : _a[index];
if (!definition) {
return false;
Expand Down
7 changes: 6 additions & 1 deletion dist/cubism2.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ var __async = (__this, __arguments, generator) => {
preserveExpressionOnMotion: true,
cubism4: CubismConfig
};
const VERSION = "v0.5.0-ls-6";
const VERSION = "v0.5.0-ls-7";
const logger = {
log(tag, ...messages) {
if (config.logLevel <= config.LOG_LEVEL_VERBOSE) {
Expand Down Expand Up @@ -1103,6 +1103,11 @@ var __async = (__this, __arguments, generator) => {
if (!this.state.reserve(group, index, priority)) {
return false;
}
if (this.currentAudio) {
if (!this.currentAudio.ended && priority != MotionPriority.FORCE) {
return false;
}
}
const definition = (_a = this.definitions[group]) == null ? void 0 : _a[index];
if (!definition) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion dist/cubism2.min.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion dist/cubism4.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -7757,7 +7757,7 @@ const config = {
preserveExpressionOnMotion: true,
cubism4: CubismConfig
};
const VERSION = "v0.5.0-ls-6";
const VERSION = "v0.5.0-ls-7";
const logger = {
log(tag, ...messages) {
if (config.logLevel <= config.LOG_LEVEL_VERBOSE) {
Expand Down Expand Up @@ -8784,6 +8784,11 @@ class MotionManager extends utils.EventEmitter {
if (!this.state.reserve(group, index, priority)) {
return false;
}
if (this.currentAudio) {
if (!this.currentAudio.ended && priority != MotionPriority.FORCE) {
return false;
}
}
const definition = (_a = this.definitions[group]) == null ? void 0 : _a[index];
if (!definition) {
return false;
Expand Down
7 changes: 6 additions & 1 deletion dist/cubism4.js
Original file line number Diff line number Diff line change
Expand Up @@ -7759,7 +7759,7 @@ var __async = (__this, __arguments, generator) => {
preserveExpressionOnMotion: true,
cubism4: exports2.CubismConfig
};
const VERSION = "v0.5.0-ls-6";
const VERSION = "v0.5.0-ls-7";
const logger = {
log(tag, ...messages) {
if (config.logLevel <= config.LOG_LEVEL_VERBOSE) {
Expand Down Expand Up @@ -8786,6 +8786,11 @@ var __async = (__this, __arguments, generator) => {
if (!this.state.reserve(group, index, priority)) {
return false;
}
if (this.currentAudio) {
if (!this.currentAudio.ended && priority != MotionPriority.FORCE) {
return false;
}
}
const definition = (_a = this.definitions[group]) == null ? void 0 : _a[index];
if (!definition) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion dist/cubism4.min.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion dist/index.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const config = {
preserveExpressionOnMotion: true,
cubism4: CubismConfig
};
const VERSION = "v0.5.0-ls-6";
const VERSION = "v0.5.0-ls-7";
const logger = {
log(tag, ...messages) {
if (config.logLevel <= config.LOG_LEVEL_VERBOSE) {
Expand Down Expand Up @@ -1101,6 +1101,11 @@ class MotionManager extends utils.EventEmitter {
if (!this.state.reserve(group, index, priority)) {
return false;
}
if (this.currentAudio) {
if (!this.currentAudio.ended && priority != MotionPriority.FORCE) {
return false;
}
}
const definition = (_a = this.definitions[group]) == null ? void 0 : _a[index];
if (!definition) {
return false;
Expand Down
7 changes: 6 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ var __async = (__this, __arguments, generator) => {
preserveExpressionOnMotion: true,
cubism4: CubismConfig
};
const VERSION = "v0.5.0-ls-6";
const VERSION = "v0.5.0-ls-7";
const logger = {
log(tag, ...messages) {
if (config.logLevel <= config.LOG_LEVEL_VERBOSE) {
Expand Down Expand Up @@ -1103,6 +1103,11 @@ var __async = (__this, __arguments, generator) => {
if (!this.state.reserve(group, index, priority)) {
return false;
}
if (this.currentAudio) {
if (!this.currentAudio.ended && priority != MotionPriority.FORCE) {
return false;
}
}
const definition = (_a = this.definitions[group]) == null ? void 0 : _a[index];
if (!definition) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion dist/index.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pixi-live2d-display-lipsyncpatch",
"version": "v0.5.0-ls-6",
"version": "v0.5.0-ls-7",
"description": "Live2D plugin for PixiJS (with lipsync patch)",
"main": "dist/index.js",
"type": "module",
Expand Down
10 changes: 5 additions & 5 deletions src/cubism-common/MotionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,11 @@ export abstract class MotionManager<Motion = any, MotionSpec = any> extends util
return false;
}
// Does not start a new motion if audio is still playing
// if (this.currentAudio) {
// if (!this.currentAudio.ended && priority != MotionPriority.FORCE) {
// return false;
// }
// }
if (this.currentAudio) {
if (!this.currentAudio.ended && priority != MotionPriority.FORCE) {
return false;
}
}

const definition = this.definitions[group]?.[index];

Expand Down

0 comments on commit 65300f4

Please sign in to comment.