This commit is contained in:
syuilo
2026-03-03 10:47:36 +09:00
parent 1b2717e256
commit dc8dda3aac
3 changed files with 17 additions and 0 deletions

View File

@@ -20,6 +20,13 @@ export const pictureFrame = defineObject({
label: 'Direction',
enum: ['vertical', 'horizontal'],
},
frameThickness: {
type: 'range',
label: 'Frame thickness',
min: 0,
max: 1,
step: 0.01,
},
matHThickness: {
type: 'range',
label: 'Mat horizontal thickness',
@@ -42,6 +49,7 @@ export const pictureFrame = defineObject({
default: {
frameColor: [0.71, 0.58, 0.39],
direction: 'vertical',
frameThickness: 0.5,
matHThickness: 0.125,
matVThickness: 0.15,
customPicture: null,
@@ -105,6 +113,12 @@ export const pictureFrame = defineObject({
applyDirection();
const applyFrameThickness = () => {
frameMesh.morphTargetManager!.getTargetByName('FrameThickness')!.influence = options.frameThickness;
};
applyFrameThickness();
const applyMatThickness = () => {
matMesh.morphTargetManager!.getTargetByName('MatH')!.influence = options.matHThickness;
matMesh.morphTargetManager!.getTargetByName('MatV')!.influence = options.matVThickness;
@@ -150,6 +164,9 @@ export const pictureFrame = defineObject({
if (k === 'direction') {
applyDirection();
}
if (k === 'frameThickness') {
applyFrameThickness();
}
if (k === 'matHThickness' || k === 'matVThickness') {
applyMatThickness();
}