From ca7f2f18b94520a27d13822358bd64038aba1704 Mon Sep 17 00:00:00 2001 From: TremblingMoeNew <39522864+TremblingMoeNew@users.noreply.github.com> Date: Sun, 27 Sep 2026 00:16:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B4=B4=E5=9B=BE?= =?UTF-8?q?=E9=A2=84=E8=BD=BD=E5=AF=BC=E8=87=B4=E7=9A=84Cubism=202?= =?UTF-8?q?=E7=AB=8B=E7=BB=98=E6=98=BE=E7=A4=BA=E9=94=99=E4=B9=B1=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Core/controller/stage/pixi/assets/live2dAssets.ts | 5 ++++- packages/webgal/src/Core/live2DCore.ts | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/webgal/src/Core/controller/stage/pixi/assets/live2dAssets.ts b/packages/webgal/src/Core/controller/stage/pixi/assets/live2dAssets.ts index 274520385..1abebd84b 100644 --- a/packages/webgal/src/Core/controller/stage/pixi/assets/live2dAssets.ts +++ b/packages/webgal/src/Core/controller/stage/pixi/assets/live2dAssets.ts @@ -27,9 +27,12 @@ export async function loadLive2dResources(url: string, load: LoadDependency): Pr const settings = await load(url, 'json'); const files = settings.FileReferences; const resolve = (file: string) => new URL(file, url).href; - const textures = await Promise.all( + const rawTextures = await Promise.all( (files?.Textures ?? settings.textures ?? []).map((file) => load(resolve(file), 'texture')), ); + const adaptor = Live2D.createCubism2Texture; + const textures = files?.Moc || !adaptor ? rawTextures : rawTextures.map((texture) => adaptor(texture)); + const model = files?.Moc ?? settings.model; if (model) await load(resolve(model), 'binary'); // 可选动作损坏不应让本来能显示的模型加载失败;SDK 会在使用时重试。 diff --git a/packages/webgal/src/Core/live2DCore.ts b/packages/webgal/src/Core/live2DCore.ts index 3f3a812d0..50280b9c7 100644 --- a/packages/webgal/src/Core/live2DCore.ts +++ b/packages/webgal/src/Core/live2DCore.ts @@ -1,3 +1,4 @@ +import { Texture } from 'pixi.js'; import { installLive2dAssetCache } from './controller/stage/pixi/assets/live2dAssetCache'; /** 眨眼参数,毫秒 */ export interface BlinkParam { @@ -36,6 +37,8 @@ export class Live2DCore { public SoundManager: any; public Config: any; + public createCubism2Texture?: (texture: Texture) => Texture; + // 临时记录未初始化前的数据 // 旧版表情混合模式 private _legacyExpressionBlendMode = false; @@ -62,7 +65,7 @@ export class Live2DCore { console.warn('live2d plugin load failed'); return; } - const { Live2DModel, SoundManager, config, Live2DLoader, ModelSettings } = await import( + const { Live2DModel, SoundManager, config, Live2DLoader, ModelSettings, createCubism2Texture } = await import( 'pixi-live2d-display-webgal' ); installLive2dAssetCache({ Live2DLoader, ModelSettings }); @@ -70,6 +73,7 @@ export class Live2DCore { this.SoundManager = SoundManager; this.Config = config; this.isAvailable = true; + this.createCubism2Texture = createCubism2Texture; console.log('Live2D plugin load success'); this.initConfig(); }) From 67949e5bba79d95b4a9fac88756cb3d55c18fcc2 Mon Sep 17 00:00:00 2001 From: Mahiru Date: Sun, 27 Sep 2026 10:24:38 +0800 Subject: [PATCH 2/2] update pldw --- packages/webgal/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/webgal/package.json b/packages/webgal/package.json index 67a5ef52b..4790dffa4 100644 --- a/packages/webgal/package.json +++ b/packages/webgal/package.json @@ -24,7 +24,7 @@ "mitt": "^3.0.0", "modern-css-reset": "^1.4.0", "pixi-filters": "^4.2.0", - "pixi-live2d-display-webgal": "^0.5.12", + "pixi-live2d-display-webgal": "^0.5.16", "pixi.js": "^6.3.0", "popmotion": "^11.0.5", "react": "^17.0.2", diff --git a/yarn.lock b/yarn.lock index 0b733b019..fc2d5369d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4993,10 +4993,10 @@ pixi-filters@^4.2.0: "@pixi/filter-twist" "4.2.0" "@pixi/filter-zoom-blur" "4.2.0" -pixi-live2d-display-webgal@^0.5.12: - version "0.5.12" - resolved "https://registry.yarnpkg.com/pixi-live2d-display-webgal/-/pixi-live2d-display-webgal-0.5.12.tgz#f920f926e37bacf222c77343782b5b6fc3d209ab" - integrity sha512-93UDIM8ducia8zIgVtidqxlDamxlwEK4+ddUnl/8XcEKBinbr2Qlu0bBN9i1f4c5rzX5OPgEKc0DhjlDa7fJVg== +pixi-live2d-display-webgal@^0.5.16: + version "0.5.16" + resolved "https://registry.yarnpkg.com/pixi-live2d-display-webgal/-/pixi-live2d-display-webgal-0.5.16.tgz#eddc6a4a478f9fef51fce942d0a21faccc2a7074" + integrity sha512-dKKWLHRdC70FUGyo10R0oNtB0fH4q1sCmJxFr3DhHDlUI+rPtsCiGag5PJ8yF6KG9HX+rUpe6R2GrvuHk3N5PA== dependencies: gh-pages "^4.0.0"