Skip to content

Commit

Permalink
Merge pull request #78 from horyu/blendShapeMaster-blendShapeGroups-m…
Browse files Browse the repository at this point in the history
…aterialValues-fix-style

style: fix style
  • Loading branch information
il-masaru-yamagishi authored Apr 25, 2022
2 parents b9d5adc + 13ef109 commit 50c01e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/material-value-binding-merger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ type SupportedMaterial = MToonMaterial | PBRMaterial;
*/
type Setter = (value: number, firstValue: boolean) => void;


const PBRMaterialTextureMap: {[propertyName: string]: keyof PBRMaterial} = {
_MainTex: 'albedoTexture',
};
Expand Down Expand Up @@ -90,10 +89,10 @@ export class MaterialValueBindingMerger {
const valueName = materialValue.propertyName;
// Unity と座標系が異なるため、テクスチャの vOffset を反転する
if (material instanceof PBRMaterial) {
if (Object.keys(PBRMaterialTextureMap).some(k => valueName.startsWith(k))) {
if (Object.keys(PBRMaterialTextureMap).some((k) => valueName.startsWith(k))) {
targetValue.w *= -1;
}
} else if (Object.keys(MToonMaterialTextureMap).some(k => valueName.startsWith(k))) {
} else if (Object.keys(MToonMaterialTextureMap).some((k) => valueName.startsWith(k))) {
targetValue.w *= -1;
}
if (valueName.endsWith('_ST_S')) {
Expand Down Expand Up @@ -233,7 +232,7 @@ export class MaterialValueBindingMerger {
return this.convertColorIntoVector4(material[MToonMaterialColorMap[key]], material.alpha);
}
return null;
};
}

/**
* Texture を Vector4 に変換する
Expand Down Expand Up @@ -281,7 +280,7 @@ export class MaterialValueBindingMerger {
if (key === '_Color') {
material.alpha = value.w;
}
this.updateColor(material[PBRMaterialColorMap[key]], value)
this.updateColor(material[PBRMaterialColorMap[key]], value);
}
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/vrm-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export class VRMManager {
this.materialValueBindingMergerMap[g.name] = new MaterialValueBindingMerger(
materials,
g.materialValues
)
);
});
}

Expand Down

0 comments on commit 50c01e7

Please sign in to comment.