Skip to content

Commit

Permalink
Merge pull request #448 from umasteeringgroup/Feature-13
Browse files Browse the repository at this point in the history
Fixed color loading.  Fixed bonemapping. Fixed default renderer not b…
  • Loading branch information
Jaimi authored Jul 19, 2024
2 parents 9f698b9 + 1de1a53 commit b9d80a4
Show file tree
Hide file tree
Showing 63 changed files with 20,202 additions and 6,647 deletions.
Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -351,20 +351,23 @@ private bool ShowEditorCustomizationGUI()
}
}
}
if (GUILayout.Button("Save AvatarDef"))
if (!EditorApplication.isPlayingOrWillChangePlaymode)
{
string fileName = EditorUtility.SaveFilePanel("Save Avatar Definition File", "", "", "umaDef");
if (!string.IsNullOrEmpty(fileName))
if (GUILayout.Button("Save AvatarDef"))
{
try
{
string charstr = thisDCA.GetAvatarDefinition(false, false).ToCompressedString("|");
System.IO.File.WriteAllText(fileName, charstr);
}
catch (Exception ex)
string fileName = EditorUtility.SaveFilePanel("Save Avatar Definition File", "", "", "adf");
if (!string.IsNullOrEmpty(fileName))
{
Debug.LogException(ex);
EditorUtility.DisplayDialog("Error", "Error writing avatar definition file: " + ex.Message, "OK");
try
{
string charstr = thisDCA.GetAvatarDefinition(false, true).ToCompressedString("|");
System.IO.File.WriteAllText(fileName, charstr);
}
catch (Exception ex)
{
Debug.LogException(ex);
EditorUtility.DisplayDialog("Error", "Error writing avatar definition file: " + ex.Message, "OK");
}
}
}
}
Expand All @@ -373,8 +376,7 @@ private bool ShowEditorCustomizationGUI()
{
UpdateCharacter();
}
EditorGUILayout.BeginHorizontal();
EditorGUILayout.EndHorizontal();


if (EditorApplication.isPlayingOrWillChangePlaymode)
{
Expand All @@ -386,7 +388,7 @@ private bool ShowEditorCustomizationGUI()
{
try
{
AvatarDefinition adf = thisDCA.GetAvatarDefinition(false, false);
AvatarDefinition adf = thisDCA.GetAvatarDefinition(false, true);
string charstr = adf.ToCompressedString("|");
System.IO.File.WriteAllText(fileName, charstr);
}
Expand Down Expand Up @@ -1115,6 +1117,10 @@ private int DoColorsGUI(SerializedProperty newCharacterColors, int n_origArraySi
{
SerializedProperty currentColor = newCharacterColors.GetArrayElementAtIndex(i);
// What a hack.
if (i >= thisDCA.characterColors._colors.Count)
{
break;
}
var col = thisDCA.characterColors._colors[i];
if (col == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,20 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
if (name.isExpanded)
{
EditorGUILayout.PropertyField(property.FindPropertyRelative("name"));
EditorGUILayout.PropertyField(property.FindPropertyRelative("isBaseColor"));
EditorGUILayout.PropertyField(property.FindPropertyRelative("isBaseColor"));
EditorGUILayout.PropertyField(displayColor);

if (ocd != null)
if (ocd != null)
{
string Name = property.FindPropertyRelative("name").stringValue;
int ChannelCount = EditorGUILayout.IntSlider(Channels, ocd.channelCount, 0, 16);
if (ChannelCount != ocd.channelCount)
{
ocd.SetChannels(ChannelCount);
if (dca != null)
{
EditorUtility.SetDirty(dca);
}
if (dca != null)
{
EditorUtility.SetDirty(dca);
}
}
}

Expand Down Expand Up @@ -117,22 +117,22 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
GUILayout.Space(5);
}
if (ocd != null)
{
{
if (ocd.PropertyBlock != null)
{
{
if (UMAMaterialPropertyBlockDrawer.OnGUI(ocd.PropertyBlock))
{
{
if (dca != null)
{
EditorUtility.SetDirty(dca);
AssetDatabase.SaveAssets();
}
}
EditorUtility.SetDirty(dca);
AssetDatabase.SaveAssets();
}
}
}
else
{
{
if (GUILayout.Button("Add Properties Block"))
{
{
ocd.PropertyBlock = new UMAMaterialPropertyBlock();
EditorUtility.SetDirty(dca);
AssetDatabase.SaveAssets();
Expand All @@ -143,25 +143,17 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
}
else
{
if (mask.arraySize > 0)
{
EditorGUILayout.PropertyField(mask.GetArrayElementAtIndex(0), new GUIContent("BaseColor"));
if (additive.arraySize >= 3)
{
EditorGUILayout.PropertyField(additive.GetArrayElementAtIndex(2), new GUIContent("Metallic/Gloss", "Color is metallicness (Black is not metallic), Alpha is glossiness (Black is not glossy)"));
}
else
{
//color didn't have a metallic gloss channel so show button to add one?
}
}
EditorGUILayout.PropertyField(displayColor);
if (mask.arraySize > 0)
{
EditorGUILayout.PropertyField(mask.GetArrayElementAtIndex(0), new GUIContent("BaseColor"));
}
EditorGUILayout.PropertyField(displayColor);

// if (ocd.HasProperties)
// {
// EditorGUILayout.LabelField("Has Properties");
// }
}
// if (ocd.HasProperties)
// {
// EditorGUILayout.LabelField("Has Properties");
// }
}
EditorGUILayout.Space();
EditorGUI.EndProperty();
}
Expand Down
Loading

0 comments on commit b9d80a4

Please sign in to comment.