mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 10:09:05 +02:00
move failed bone rules call, add get texture directory
This commit is contained in:
parent
41abacbc6f
commit
348ac3167f
2 changed files with 12 additions and 7 deletions
|
@ -307,9 +307,6 @@ class AvatarExporter : MonoBehaviour {
|
||||||
SetUserBoneInformation();
|
SetUserBoneInformation();
|
||||||
string textureWarnings = SetTextureDependencies();
|
string textureWarnings = SetTextureDependencies();
|
||||||
|
|
||||||
// generate the list of bone rule failure strings for any bone rules that are not satisfied by this avatar
|
|
||||||
SetFailedBoneRules();
|
|
||||||
|
|
||||||
// check if we should be substituting a bone for a missing UpperChest mapping
|
// check if we should be substituting a bone for a missing UpperChest mapping
|
||||||
AdjustUpperChestMapping();
|
AdjustUpperChestMapping();
|
||||||
|
|
||||||
|
@ -454,7 +451,7 @@ class AvatarExporter : MonoBehaviour {
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy any external texture files to the project's texture directory that are considered dependencies of the model
|
// copy any external texture files to the project's texture directory that are considered dependencies of the model
|
||||||
string texturesDirectory = Path.GetDirectoryName(exportFstPath) + "\\textures";
|
string texturesDirectory = GetTextureDirectory(exportFstPath);
|
||||||
if (!CopyExternalTextures(texturesDirectory)) {
|
if (!CopyExternalTextures(texturesDirectory)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -487,7 +484,7 @@ class AvatarExporter : MonoBehaviour {
|
||||||
File.Copy(assetPath, exportModelPath);
|
File.Copy(assetPath, exportModelPath);
|
||||||
|
|
||||||
// create empty Textures and Scripts folders in the project directory
|
// create empty Textures and Scripts folders in the project directory
|
||||||
string texturesDirectory = projectDirectory + "\\textures";
|
string texturesDirectory = GetTextureDirectory(projectDirectory);
|
||||||
string scriptsDirectory = projectDirectory + "\\scripts";
|
string scriptsDirectory = projectDirectory + "\\scripts";
|
||||||
Directory.CreateDirectory(texturesDirectory);
|
Directory.CreateDirectory(texturesDirectory);
|
||||||
Directory.CreateDirectory(scriptsDirectory);
|
Directory.CreateDirectory(scriptsDirectory);
|
||||||
|
@ -499,7 +496,6 @@ class AvatarExporter : MonoBehaviour {
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy any external texture files to the project's texture directory that are considered dependencies of the model
|
// copy any external texture files to the project's texture directory that are considered dependencies of the model
|
||||||
texturesDirectory = texturesDirectory.Replace("\\\\", "\\");
|
|
||||||
if (!CopyExternalTextures(texturesDirectory)) {
|
if (!CopyExternalTextures(texturesDirectory)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -613,6 +609,9 @@ class AvatarExporter : MonoBehaviour {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// generate the list of bone rule failure strings for any bone rules that are not satisfied by this avatar
|
||||||
|
SetFailedBoneRules();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void TraverseUserBoneTree(Transform modelBone) {
|
static void TraverseUserBoneTree(Transform modelBone) {
|
||||||
|
@ -897,6 +896,12 @@ class AvatarExporter : MonoBehaviour {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static string GetTextureDirectory(string basePath) {
|
||||||
|
string textureDirectory = Path.GetDirectoryName(basePath) + "\\textures";
|
||||||
|
textureDirectory = textureDirectory.Replace("\\\\", "\\");
|
||||||
|
return textureDirectory;
|
||||||
|
}
|
||||||
|
|
||||||
static string SetTextureDependencies() {
|
static string SetTextureDependencies() {
|
||||||
string textureWarnings = "";
|
string textureWarnings = "";
|
||||||
dependencyTextures.Clear();
|
dependencyTextures.Clear();
|
||||||
|
@ -910,7 +915,7 @@ class AvatarExporter : MonoBehaviour {
|
||||||
string textureName = Path.GetFileName(dependencyPath);
|
string textureName = Path.GetFileName(dependencyPath);
|
||||||
if (dependencyTextures.ContainsKey(textureName)) {
|
if (dependencyTextures.ContainsKey(textureName)) {
|
||||||
textureWarnings += "There is more than one texture with the name " + textureName +
|
textureWarnings += "There is more than one texture with the name " + textureName +
|
||||||
" referenced in the selected avatar.\n\n";
|
" referenced in the selected avatar.\n\n";
|
||||||
} else {
|
} else {
|
||||||
dependencyTextures.Add(textureName, dependencyPath);
|
dependencyTextures.Add(textureName, dependencyPath);
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Loading…
Reference in a new issue