And here is the code below this description
Just copy the code.
Create a text file on your computer and paste the code into it. Then re-name the text file to AMLScriptEditor.hta
the only important part of the name is .hta. Name the rest what ever you want
<html>
<head>
<style>
select
{
width:100%;
}
input{
width:100%;
}
td{
vertical-align:top;
}
</style>
<script language=jscript>
var objFSO; var animLocation;var luaAnimLocation;
var personaFile;
var performanceCommandsList; var thisPerformancesCount; var performanceCount; var performanceID; var performanceName;
var clipLocationsList; var thisClipsCount; var clipLocation;
window.onload=function()
{
objFSO = new ActiveXObject("Scripting.FileSystemObject");
}
function folderLoactionEntered()
{
animLocation=window.clipboardData.getData('text');
luaAnimLocation=''
var pathArray=animLocation.split("\\")
for(var c=0;c < pathArray.length;c++)
{
luaAnimLocation=luaAnimLocation + pathArray[c] + '\\\\'
}
thisPerformancesCount='last'; thisClipsCount='last'
var objFolder = objFSO.GetFolder(animLocation);
var colFiles = new Enumerator(objFolder.files);
var s='<table id=tblAnimList border=1>';
var flName;
var n=0
for (; !colFiles.atEnd(); colFiles.moveNext())
{
s=s + '<tr>'
s=s + '<td width="10"><input type=checkbox checked /></td>'
flName=colFiles.item().name
s=s + '<td>' + flName + '</td>'
s=s + '<td><input id=nme' + n + ' value="' + flName.replace('.iMotion','') + '" /></td>'
s=s + '</tr>';
n=n+1
}
var s=s+'</table>'
document.getElementById("tdAnimList").innerHTML=s
}
function createPersonaFile()
{
var fileLoc=document.getElementById('txtsaveFileTo').value;
var fileName=document.getElementById('txtFileName').value;
if(fileLoc==""){
alert('You must identify where to save the Persona file your creating');
}else if(fileName==""){
alert('You must enter the name of the Persona file your creating');
}else if(document.getElementById('txtAnimLocation').value==''){
alert('You must identify where the animations you want to add to the Persona file exist');
}else{
var personaFile = objFSO.CreateTextFile(fileLoc + "\\" + fileName + ".lua", false);
performanceCommandsList=''; clipLocationsList="";
createFileLists();
personaFile.writeline('iObject = {');
personaFile.writeline(' Commands = {');
personaFile.writeline(' Perform = {');
personaFile.writeline(' PerformCommand = {');
personaFile.writeline(performanceCommandsList);
personaFile.writeline(' };');
personaFile.writeline(' };');
personaFile.writeline(' };');
personaFile.writeline(' Clips = {');
personaFile.writeline(' AnimationClip = {');
personaFile.writeline(clipLocationsList);
personaFile.writeline(' };');
personaFile.writeline(' };');
personaFile.writeline('};');
personaFile.Close();
}
}
function createFileLists()
{
var tbl = document.getElementById("tblAnimList");
performanceCount=0
for (var i = 0, row; row = tbl.rows[i]; i++)
{
performanceCount=performanceCount + 1;
performanceName=document.getElementById('nme' + i).value;
performanceID=row.cells[1].innerHTML
clipLocation=luaAnimLocation + row.cells[1].innerHTML;
personaAddPerfomanceCommand()
personaAddAnimationClip()
}
}
function personaAddPerfomanceCommand()
{
var s='';
s=s+' [ ' + performanceCount + ' ] = {' + '\n';
s=s+' ID = "' + performanceID + '";' + '\n';
s=s+' DisplayName = "' + performanceName + '";' + '\n';
s=s+' Persist = false;' + '\n';
s=s+' RightMenu = true;' + '\n';
s=s+' HotkeyID = "None";' + '\n';
s=s+' ClipSeq = {' + '\n';
s=s+' [ 1 ] = {' + '\n';
s=s+' ID = "' + performanceID + '";' + '\n';
s=s+' RefClipID = "' + performanceID + '";' + '\n';
s=s+' Delay = 0.000000;' + '\n';
s=s+' Loop = 1.000000;' + '\n';
s=s+' };' + '\n';
s=s+' };' + '\n';
s=s+' };';
if(thisPerformancesCount=='last'){ s=s+ '\n'; }
performanceCommandsList=performanceCommandsList + s;
}
function personaAddAnimationClip()
{
var s='';
s=s+' [ ' + performanceCount + ' ] = {' + '\n';
s=s+' ID = "' + performanceID + '";' + '\n';
s=s+' TargetType = "Character";' + '\n';
s=s+' TargetNode = "$";' + '\n';
s=s+' ClipType = "Motion";' + '\n';
s=s+' ClipLocation = "' + clipLocation + '";' + '\n';
s=s+' ZeroRoot = true;' + '\n';
s=s+' Priority = {' + '\n';
s=s+' [ 1 ] = {' + '\n';
s=s+' ID = "01";' + '\n';
s=s+' Node = "$";' + '\n';
s=s+' Value = 200.000000;' + '\n';
s=s+' };' + '\n';
s=s+' };' + '\n';
s=s+' };';
if(thisPerformancesCount=='last'){ s=s+ '\n'; }
clipLocationsList=clipLocationsList + s;
}
</script>
</head>
<body>
<table width=100%>
<tr><td width='1%'>SOURCE</td><td colspan=3><input id=txtAnimLocation onpaste="folderLoactionEntered()" onchange="folderLoactionEntered()" value=''></input></td></tr>
<tr><td width='1%' nowrap>SAVE TO</td><td><input id=txtsaveFileTo value=''></input></td>
<td width='1%' nowrap>FILE NAME</td><td width='20%'><input id=txtFileName value="" ></input></td>
<td width='1%'><input type=button value="CREATE FILE" onclick="createPersonaFile()" ></input></td></tr>
</table>
<table id=ScriptEditor width='100%' height='100%' border=1>
<tr height='1%'><td id=tdAnimList rowspan=2></td><td></td></tr>
<tr height='50%'><td></td></tr>
</table>
</body>
</html>
i7-3770 3.4GHz CPU 16 GB Ram
GeForce GTX1080 TI 11GB
Windows 10 Pro 64bit
Edited
5 Years Ago by
Delerna