Skip to content

Commit 075a9cc

Browse files
committed
Merge branch 'dev'
2 parents 3704018 + 2da24b7 commit 075a9cc

File tree

4 files changed

+38
-53
lines changed

4 files changed

+38
-53
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -135,27 +135,18 @@ jobs:
135135
- name: Compile & release Electron app
136136
uses: samuelmeuli/action-electron-builder@v1
137137
env:
138-
# AWS Credentials for S3 publishing
139-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
140-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
141-
AWS_REGION: ${{ secrets.AWS_REGION }} # Use the region secret
142-
# GitHub Token for creating GitHub releases (if still needed)
138+
# GitHub Token for creating GitHub releases
143139
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144140
VITE_APP_VERSION: ${{ needs.draft.outputs.version }}
145141
with:
146142
github_token: ${{ secrets.GITHUB_TOKEN }}
147143
build_script_name: build
148-
args: --config electron-builder.yml --publish always # Ensure publishing is triggered
149-
# release: true # Set to false if you ONLY want to publish to S3 and not create a GitHub Release artifact
144+
args: --config electron-builder.yml
150145
max_attempts: 3
151146

152147
build_web:
153148
needs: [draft]
154149
runs-on: ubuntu-latest
155-
env:
156-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
157-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
158-
AWS_REGION: ${{ secrets.AWS_REGION }}
159150

160151
steps:
161152
- uses: actions/checkout@v3
@@ -177,22 +168,6 @@ jobs:
177168
zip -r ../../open-llm-vtuber-web-${{ needs.draft.outputs.version }}.zip .
178169
cd ../.. # Go back to the workspace root
179170
180-
- name: Upload Web App Zip to S3
181-
run: |
182-
aws s3 cp ./open-llm-vtuber-web-${{ needs.draft.outputs.version }}.zip s3://open-llm-vtuber-frontend/open-llm-vtuber-web-${{ needs.draft.outputs.version }}.zip
183-
echo "Web app zip uploaded. Public access depends on S3 bucket policy/settings."
184-
185-
- name: Configure AWS Credentials
186-
uses: aws-actions/configure-aws-credentials@v4
187-
with:
188-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
189-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
190-
aws-region: ${{ secrets.AWS_REGION }}
191-
192-
- name: Upload web build to S3
193-
run: |
194-
aws s3 sync ./dist/web s3://open-llm-vtuber-frontend/web --delete
195-
196171
- name: Deploy to GitHub Pages
197172
uses: JamesIves/github-pages-deploy-action@v4
198173
with:

src/renderer/WebSDK/src/lappadapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class LAppAdapter {
7070
}
7171

7272
public getExpressionName(index: number): string {
73-
return this.getModel()?._modelSetting.getExpressionName(index);
73+
return this.getModel()?._modelSetting?.getExpressionName(index) ?? '';
7474
}
7575

7676
public setExpression(name: string): void {

src/renderer/src/components/canvas/live2d.tsx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,26 +56,26 @@ export const Live2D = memo(
5656
}, [aiState, modelInfo, resetExpression]);
5757

5858
// Expose setExpression for console testing
59-
useEffect(() => {
60-
const testSetExpression = (expressionValue: string | number) => {
61-
const lappAdapter = (window as any).getLAppAdapter?.();
62-
if (lappAdapter) {
63-
setExpression(expressionValue, lappAdapter, `[Console Test] Set expression to: ${expressionValue}`);
64-
} else {
65-
console.error('[Console Test] LAppAdapter not found.');
66-
}
67-
};
59+
// useEffect(() => {
60+
// const testSetExpression = (expressionValue: string | number) => {
61+
// const lappAdapter = (window as any).getLAppAdapter?.();
62+
// if (lappAdapter) {
63+
// setExpression(expressionValue, lappAdapter, `[Console Test] Set expression to: ${expressionValue}`);
64+
// } else {
65+
// console.error('[Console Test] LAppAdapter not found.');
66+
// }
67+
// };
6868

69-
// Expose the function to the window object
70-
(window as any).testSetExpression = testSetExpression;
71-
console.log('[Debug] testSetExpression function exposed to window.');
69+
// // Expose the function to the window object
70+
// (window as any).testSetExpression = testSetExpression;
71+
// console.log('[Debug] testSetExpression function exposed to window.');
7272

73-
// Cleanup function to remove the function from window when the component unmounts
74-
return () => {
75-
delete (window as any).testSetExpression;
76-
console.log('[Debug] testSetExpression function removed from window.');
77-
};
78-
}, [setExpression]);
73+
// // Cleanup function to remove the function from window when the component unmounts
74+
// return () => {
75+
// delete (window as any).testSetExpression;
76+
// console.log('[Debug] testSetExpression function removed from window.');
77+
// };
78+
// }, [setExpression]);
7979

8080
const handlePointerDown = (e: React.PointerEvent) => {
8181
handlers.onMouseDown(e);

src/renderer/src/hooks/canvas/use-live2d-expression.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ export const useLive2DExpression = () => {
4747
if (!lappAdapter) return;
4848

4949
try {
50+
// Check if model is loaded and has expressions
51+
const model = lappAdapter.getModel();
52+
if (!model || !model._modelSetting) {
53+
console.log('Model or model settings not loaded yet, skipping expression reset');
54+
return;
55+
}
56+
5057
// If model has a default emotion defined, use it
5158
if (modelInfo?.defaultEmotion !== undefined) {
5259
setExpression(
@@ -55,13 +62,16 @@ export const useLive2DExpression = () => {
5562
`Reset expression to default: ${modelInfo.defaultEmotion}`,
5663
);
5764
} else {
58-
// If no default is defined, use the first expression (index 0)
59-
const defaultExpressionName = lappAdapter.getExpressionName(0);
60-
if (defaultExpressionName) {
61-
setExpression(
62-
defaultExpressionName,
63-
lappAdapter,
64-
);
65+
// Check if model has any expressions before trying to get the first one
66+
const expressionCount = lappAdapter.getExpressionCount();
67+
if (expressionCount > 0) {
68+
const defaultExpressionName = lappAdapter.getExpressionName(0);
69+
if (defaultExpressionName) {
70+
setExpression(
71+
defaultExpressionName,
72+
lappAdapter,
73+
);
74+
}
6575
}
6676
}
6777
} catch (error) {

0 commit comments

Comments
 (0)