Feature: CharacterAppearancePanel Other UMA Races
echads opened this issue · 2 comments
Great project!
Feature request here.
Right now it looks like the Character Appearance Panel has one spot that is still hard coded.
If we create our own UMA Races or just play with anything other than HumanMaleDCS/HumanMale or HumanFemaleDCS/HumanFemale we presently will need to hard code something in the Core folder. If we can get some editor variables in UnitProfile or Faction or somewhere that makes sense. That would be awesome!
public void SetMale() {
//Debug.Log("CharacterCreatorPanel.SetMale()");
if (characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.DynamicCharacterAvatar.activeRace.name == "HumanMaleDCS"
|| characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.DynamicCharacterAvatar.activeRace.name == "HumanMale") {
//Debug.Log("CharacterCreatorPanel.SetMale(): already male. returning");
return;
}
femaleRecipe = characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.GetAppearanceString();
femaleButton.UnHighlightBackground();
maleButton.HighlightBackground();
//maleButton.HighlightBackground();
if (maleRecipe != string.Empty) {
//Debug.Log("CharacterCreatorPanel.SetFemale(): maleRecipe != string.Empty");
characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.DynamicCharacterAvatar.ChangeRace("HumanMaleDCS");
//characterCreatorManager.PreviewUnitController.UnitModelController.LoadSavedAppearanceSettings(maleRecipe, true);
characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.SetAppearance(maleRecipe);
} else {
//Debug.Log("CharacterCreatorPanel.SetMale(): maleRecipe == string.Empty");
//characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.DynamicCharacterAvatar.ChangeRace("HumanMaleDCS");
characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.SetAvatarDefinitionRace("HumanMaleDCS");
characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.PreloadEquipmentModels(true);
characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.ReloadAvatarDefinition();
}
}
public void SetFemale() {
//Debug.Log("CharacterCreatorPanel.SetFemale()");
if (characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.DynamicCharacterAvatar.activeRace.name == "HumanFemaleDCS"
|| characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.DynamicCharacterAvatar.activeRace.name == "HumanFemale") {
//Debug.Log("CharacterCreatorPanel.SetFemale(): already female. returning");
return;
}
//maleRecipe = characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.DynamicCharacterAvatar.GetCurrentRecipe();
maleRecipe = characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.GetAppearanceString();
maleButton.UnHighlightBackground();
femaleButton.HighlightBackground();
//femaleButton.Select();
if (femaleRecipe != string.Empty) {
//Debug.Log("CharacterCreatorPanel.SetFemale(): femaleRecipe != string.Empty");
characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.DynamicCharacterAvatar.ChangeRace("HumanFemaleDCS");
//characterCreatorManager.PreviewUnitController.UnitModelController.LoadSavedAppearanceSettings(femaleRecipe, true);
characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.SetAppearance(femaleRecipe);
} else {
//Debug.Log("CharacterCreatorPanel.SetFemale(): femaleRecipe == string.Empty");
//characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.DynamicCharacterAvatar.ChangeRace("HumanFemaleDCS");
characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.SetAvatarDefinitionRace("HumanFemaleDCS");
characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.PreloadEquipmentModels(true);
characterCreatorManager.PreviewUnitController.UnitModelController.UMAModelController.ReloadAvatarDefinition();
}
}
I've got all this set, just no way to allow the Appearance Panel to see them because it is hard coded to HumanMaleDCS/HumanMale or HumanFemaleDCS/HumanFemale, it won't see my HumanFemaleHD, but it will see and save my HumanMaleHD as that is selected as the active race. So we are close.
There is some other stuff that needs to be added to make this work properly.
-The male and female buttons are currently hard coded, so would need to read from some list of supported races
-The dropdown options (such as female hair) are also currently hard coded so those lists would need to be dynamically created more like the built-in example UMA character creator included in the UMA package.
UMA Races are no longer hard coded. The new system uses the character race scriptable object to define which male and female models are available. You can't use the native UMA race swap anymore, and need to have separate male and female models for each race, but those UMA models can be anything, including elf, stunner, etc.
This change is now available in the master branch on github.