mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-13 22:09:53 -05:00
Fixed preview for ST_S and ST_T
This commit is contained in:
parent
c7212d16d4
commit
d63517babe
|
|
@ -22,7 +22,7 @@ namespace VRM
|
|||
{
|
||||
using (new EditorGUI.PropertyScope(position, label, property))
|
||||
{
|
||||
EditorGUIUtility.labelWidth = 80;
|
||||
//EditorGUIUtility.labelWidth = 80;
|
||||
|
||||
position.height = EditorGUIUtility.singleLineHeight;
|
||||
|
||||
|
|
|
|||
|
|
@ -201,27 +201,48 @@ namespace VRM
|
|||
return rect;
|
||||
}
|
||||
|
||||
static float[] v2 = new float[2];
|
||||
static GUIContent[] l2 = new GUIContent[]{
|
||||
new GUIContent("x"),
|
||||
new GUIContent("y")
|
||||
};
|
||||
static Vector4 TilingOffset(Rect rect, string label, Vector4 src)
|
||||
{
|
||||
/*
|
||||
var style = new GUIStyle()
|
||||
{
|
||||
alignment = TextAnchor.MiddleRight,
|
||||
};
|
||||
*/
|
||||
|
||||
var quad = rect.width / 10;
|
||||
var quad = (rect.width - 56);
|
||||
var x = rect.x;
|
||||
//EditorGUIUtility.labelWidth = 18;
|
||||
|
||||
EditorGUI.LabelField(AdvanceRect(ref x, rect.y, quad * 2, rect.height), "Tiling X", style);
|
||||
src.x = EditorGUI.FloatField(AdvanceRect(ref x, rect.y, quad, rect.height), src.x);
|
||||
EditorGUI.LabelField(AdvanceRect(ref x, rect.y, 40, rect.height), "Tiling");
|
||||
v2[0] = src.x;
|
||||
v2[1] = src.y;
|
||||
EditorGUI.MultiFloatField(AdvanceRect(ref x, rect.y, quad, rect.height), l2, v2);
|
||||
src.x = v2[0];
|
||||
src.y = v2[1];
|
||||
|
||||
EditorGUI.LabelField(AdvanceRect(ref x, rect.y, quad, rect.height), "Y", style);
|
||||
src.y = EditorGUI.FloatField(AdvanceRect(ref x, rect.y, quad, rect.height), src.y);
|
||||
//EditorGUI.LabelField(AdvanceRect(ref x, rect.y, quad, rect.height), "Y", style);
|
||||
//src.y = EditorGUI.FloatField(AdvanceRect(ref x, rect.y, quad, rect.height), "Y", src.y);
|
||||
|
||||
EditorGUI.LabelField(AdvanceRect(ref x, rect.y, quad * 2, rect.height), "Offset X", style);
|
||||
src.z = EditorGUI.FloatField(AdvanceRect(ref x, rect.y, quad, rect.height), src.z);
|
||||
rect.y += EditorGUIUtility.singleLineHeight;
|
||||
x = rect.x;
|
||||
EditorGUI.LabelField(AdvanceRect(ref x, rect.y, 40, rect.height), "Offset");
|
||||
v2[0] = src.z;
|
||||
v2[1] = src.w;
|
||||
EditorGUI.MultiFloatField(AdvanceRect(ref x, rect.y, quad, rect.height), l2, v2);
|
||||
src.z = v2[0];
|
||||
src.w = v2[1];
|
||||
|
||||
EditorGUI.LabelField(AdvanceRect(ref x, rect.y, quad, rect.height), "Y", style);
|
||||
src.w = EditorGUI.FloatField(AdvanceRect(ref x, rect.y, quad, rect.height), src.w);
|
||||
//EditorGUI.LabelField(AdvanceRect(ref x, rect.y, quad * 2, rect.height), "Offset X", style);
|
||||
//src.z = EditorGUI.FloatField(AdvanceRect(ref x, rect.y, quad, rect.height), "X", src.z);
|
||||
|
||||
//EditorGUI.LabelField(AdvanceRect(ref x, rect.y, quad, rect.height), "Y", style);
|
||||
//src.w = EditorGUI.FloatField(AdvanceRect(ref x, rect.y, quad, rect.height), "Y", src.w);
|
||||
|
||||
return src;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -254,8 +254,17 @@ namespace VRM
|
|||
PropItem prop;
|
||||
if (item.PropMap.TryGetValue(x.ValueName, out prop))
|
||||
{
|
||||
var value = x.BaseValue + (x.TargetValue - x.BaseValue) * bake.Weight;
|
||||
item.Material.SetColor(x.ValueName, value);
|
||||
var valueName = x.ValueName;
|
||||
if (valueName.EndsWith("_ST_S")
|
||||
|| valueName.EndsWith("_ST_T"))
|
||||
{
|
||||
valueName = valueName.Substring(0, valueName.Length - 2);
|
||||
}
|
||||
|
||||
var value = item.Material.GetVector(valueName);
|
||||
Debug.LogFormat("{0} => {1}", valueName, x.TargetValue);
|
||||
value += ((x.TargetValue - x.BaseValue) * bake.Weight);
|
||||
item.Material.SetColor(valueName, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user