mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-07-19 08:41:49 -05:00
HasVertexColor で中身を見て判断する
This commit is contained in:
parent
38a3c76116
commit
8e5479772d
|
|
@ -330,9 +330,26 @@ namespace UniGLTF
|
|||
}
|
||||
}
|
||||
|
||||
// not black(0, 0, 0, 1)
|
||||
static readonly UnityEngine.Color ZERO = new UnityEngine.Color(0, 0, 0, 0);
|
||||
|
||||
public bool HasVertexColor(glTFAttributes attributes)
|
||||
{
|
||||
return attributes.COLOR_0 != -1;
|
||||
if (attributes.COLOR_0 == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var colors = GetArrayFromAccessor<UnityEngine.Color>(attributes.COLOR_0);
|
||||
foreach (var color in colors)
|
||||
{
|
||||
if (color != ZERO)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// すべて (0, 0, 0, 0) だった。使っていないと見做す。
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool MaterialHasVertexColor(int materialIndex)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user