Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

error when morph target don't have NORMAL attribute #57

Open
iCyP opened this issue Nov 17, 2018 · 1 comment
Open

error when morph target don't have NORMAL attribute #57

iCyP opened this issue Nov 17, 2018 · 1 comment

Comments

@iCyP
Copy link

iCyP commented Nov 17, 2018

モーフターゲットが下記例のようにPOSITION要素のみを持ち、NORMAL要素を持たないとき、

targets:[
    {"POSITION":1}, 
    {"POSITION":2}, ...
]

if (blendShape.Positions.Count == mesh.vertexCount)
{
mesh.AddBlendShapeFrame(blendShape.Name, FRAME_WEIGHT,
blendShape.Positions.ToArray(),
(meshContext.normals != null && meshContext.normals.Length == mesh.vertexCount) ? blendShape.Normals.ToArray() : null,
null
);

あたりで頂点数が違うというエラーが出てVRM がロード出来ません。

@ousttrue
Copy link
Owner

フィードバックありがとうございます。

mesh.AddBlendShapeFrame
の挙動を確認して、空のnormalを許容するようにします。
position必須、normalはあってもなくてもよい が意図した動作です。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants