public static void Animate(GameObject model, string modelName, string modelType, string authorName, string license, bool symmetrical, bool allowSystemImprovement, Action<string> onExport, Action<string, UnityWebRequest> onError)public static void Animate(GameObject model, string modelName, string modelType, string authorName, string license, bool symmetrical, bool allowSystemImprovement, Action<string> onExport, Action<string, UnityWebRequest> onError, string additionalAssetsPath = "")public class MyTestScript : MonoBehaviour
{
public GameObject myModel;
string myModelName = "My Model";
string myModelType = "Human";
string authorName = "Model Author";
string myModelLicense = "MIT";
bool myModelSymmetry = true;
bool myModelUsedForImprovement = false;
public void AnimateMyModel()
{
AnythingAnimate.Animate(
myModel,
myModelName,
myModelType,
authorName,
myModelLicense,
myModelSymmetry,
myModelUsedForImprovement,
PrintDebugWhenSuccessful,
PrintDebugWhenFail)
}
// This function will be invoked if the model has successfully been sent to Animate Anything
public void PrintDebugWhenSuccessful(string ID)
{
Debug.Log("Successfully sent my model to be animated!");
}
// This function will be invoked if an error was encountered in sending the file to Animate Anything
public void PrintDebugWhenFail(string ID, UnityWebRequest error)
{
Debug.Log("Could not send my model to be animated!");
}
}public static void Animate(string modelPath, string additionalAssetsPath, string modelName, string modelType, string authorName, string license, bool symmetrical, bool allowSystemImprovement, Action<string> onExport, Action<string, UnityWebRequest> onError)public class MyTestScript : MonoBehaviour
{
string myModelPath = "C:\Users\User\Desktop\MyModel.fbx"
string myExtraAssetsPath = "C:\Users\User\Desktop\MyModelAssets"
string myModelName = "My Model";
string myModelType = "Human";
string authorName = "Model Author";
string myModelLicense = "MIT";
bool myModelSymmetry = true;
bool myModelUsedForImprovement = false;
public void AnimateMyModel()
{
AnythingAnimate.Animate(
myModelPath,
myExtraAssetsPath,
myModelName,
myModelType,
authorName,
myModelLicense,
myModelSymmetry,
myModelUsedForImprovement,
PrintDebugWhenSuccessful,
PrintDebugWhenFail)
}
// This function will be invoked if the model has successfully been sent to Animate Anything
public void PrintDebugWhenSuccessful(string ID)
{
Debug.Log("Successfully sent my model to be animated!");
}
// This function will be invoked if an error was encountered in sending the file to Animate Anything
public void PrintDebugWhenFail(string ID, UnityWebRequest error)
{
Debug.Log("Could not send my model to be animated!");
}
}public static void Poll(Action<ModelJson> onProcessFinished, Action<string, string> onProcessFail, Action<string, string, int> onProcessPoll, string id)public static void Poll(Action<ModelJson> onProcessFinished, Action<string, string> onProcessFail, Action<string, string, int> onProcessPoll, string id, int timeout)public class MyTestScript : MonoBehaviour
{
string myModelID = "416e797468696e67476f6573";
public void PollMyModel()
{
AnythingAnimate.Poll(
PrintDebugWhenSuccessful,
PrintDebugWhenFail,
PrintDebugWhenPoll,
myModelID);
}
// This function will be invoked if the model has successfully been animated by Animate Anything
public void PrintDebugWhenSuccessful(ModelJson details)
{
Debug.Log("Model successfully animated!");
}
// This function will be invoked if an error was encountered in animating the model
public void PrintDebugWhenFail(string code, string message)
{
Debug.Log("Could not animate model!");
}
// This function will be invoked whenever the model is polled for
public void PrintDebugWhenPoll(string code, string message, int seconds)
{
Debug.Log("Polling for update on my model!");
}
}public class MyTestScript : MonoBehaviour
{
string myModelPath = "C:\Users\User\Desktop\MyModel.fbx"
string myExtraAssetsPath = "C:\Users\User\Desktop\MyModelAssets"
string myModelName = "My Model";
string myModelType = "Human";
string authorName = "Model Author";
string myModelLicense = "MIT";
bool myModelSymmetry = true;
bool myModelUsedForImprovement = false;
private void Start()
{
AnimateMyModel();
}
public void AnimateMyModel()
{
AnythingAnimate.Animate(
myModelPath,
myExtraAssetsPath,
myModelName,
myModelType,
authorName,
myModelLicense,
myModelSymmetry,
myModelUsedForImprovement,
PollMyModel,
PrintDebugWhenAnimateFail)
}
// This function will be invoked if the model has successfully been sent to Animate Anything
public void PollMyModel(string ID)
{
AnythingAnimate.Poll(
PrintDebugWhenPollSuccessful,
PrintDebugWhenPollFail,
PrintDebugWhenPoll,
ID);
}
// This function will be invoked if the model has successfully been animated by Animate Anything
public void PrintDebugWhenPollSuccessful(ModelJson details)
{
Debug.Log("Model successfully animated!");
AnythingMaker.Make(details);
}
// This function will be invoked if an error was encountered in animating the model
public void PrintDebugWhenPollFail(string code, string message)
{
Debug.LogError("Could not animate model!");
}
// This function will be invoked whenever the model is polled for
public void PrintDebugWhenPoll(string code, string message, int seconds)
{
Debug.Log("Polling for update on my model!");
}
// This function will be invoked if an error was encountered in sending the file to Animate Anything
public void PrintDebugWhenAnimateFail(string ID, UnityWebRequest error)
{
Debug.LogError("Could not send model to be animated!");
}
}