Profile Picture

Animation Persona Creation Tool

Posted By Delerna 5 Years Ago
Rated 5 stars based on 2 votes.
Author
Message
Delerna
Delerna
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 1.5K, Visits: 14.8K
I don't know if anyone else is interested in this but thought I would post it just incase others besides myself might find it helpful.
Its very simple at the moment but I will be working on adding more abilities as I progress with why I created it.
Its good to be able to create persona's but constantly manually writing the code is boring boring boring......and time consuming. 
I might explain more about why I have done just this simple version to start with rather that a completed version. Its basically because it does what I need it for right now.
The rest I will get into later. If people are interested I will post my improved codes I write but only if there is interest in it.

Anyway. Here is some images that shoes what it does now and explains how to do it.
https://forum.reallusion.com/uploads/images/9acf9e41-a74d-4de0-a23e-635c.png

https://forum.reallusion.com/uploads/images/a64e6f31-e830-4f6c-b312-b2c6.png






i7-3770 3.4GHz CPU 16 GB Ram   
GeForce GTX1080 TI 11GB
Windows 10 Pro 64bit
Delerna
Delerna
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 1.5K, Visits: 14.8K
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
Rampa
Rampa
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)

Group: Forum Members
Last Active: 56 minutes ago
Posts: 8.1K, Visits: 60.5K
Very nice Delerna! Smile

Could it be made to work for the move commands? They are a bit trickier, with having to set the speeds, as well as the beginning, ending, and looping motions.
billgucci2
billgucci2
Posted 5 Years Ago
View Quick Profile
New Member

New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)

Group: Banned Members
Last Active: 5 Years Ago
Posts: 27, Visits: 207
I have great interest in this tool.... thanks.
Very nice tool. Combines existing personas quickly. Speeds up the process immensely.

With iClones Curve Editor you have access to "Hip Trajectory", "Pelvis Twist", "Arm Swing" and more.
With iClones Dope Sheet you have access to "Foot Spacing"

Persona example;
A given walk has the hips raising a certain height (Looping)
Curve Editor: Raise the hip height adds a bounce to the walk.
Lower the hip height creates a crouching walk.

Pelvis Twist is generally (15 degrees)....
Change it to (30).... Cat Walk animation
....just swing each foot inward at the end. (X = 0)

Dope Sheet;
Change one foot's 'Tangent" from "Auto to STEP:
now you have a 'Limp" or create a stumble (step into a hole or trip over something) walk cycle.

...now the hard part.... coding it.
I know how to create persona, but not code it.
Great Job..

Edited
5 Years Ago by billgucci2
Delerna
Delerna
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 1.5K, Visits: 14.8K
Rampa (2/2/2019)
Very nice Delerna! Smile

Could it be made to work for the move commands? They are a bit trickier, with having to set the speeds, as well as the beginning, ending, and looping motions.


Not sure yet how far I am going to go but I will definitely be expanding its capabilities.
I have been organizing all the contents/animations etc etc that I have.
I have a folder named by the person who I have bought contents from and in that folder are more folders named by the content pack I bought.
I then create shortcuts of all their contents so I can organise all the contents I have in a way that makes it easy for me to find things for projects I am working on. 
I can rename the shortcuts however I want, duplicate them so they can be organised under more than one setting. But I can still tell who made it and what pack it came from by checking the properties of the shortcut. One difficulty of that though is any persona's in a character no longer work because they reference the location the developer put them in and I have them all in different folders now.
I was manually changing their locations in their persona's and that just takes so much time. That's why I have done this tool as it is now, to help me correct all the persona's in the models I have.

However soon I will be looking into making this tool so I can create animations in the persona that combines more than 1 animation. Just like the start walk, loop walk and end walk methods in many of reallusion's character persona's. And there are quite a few other capabilities for creating persona's that I will be looking into adding as well.




i7-3770 3.4GHz CPU 16 GB Ram   
GeForce GTX1080 TI 11GB
Windows 10 Pro 64bit
Edited
5 Years Ago by Delerna
Delerna
Delerna
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 1.5K, Visits: 14.8K
billgucci2

Your methods look to be progressing well. Its not something I have looked into yet but you have just raised my interest into looking into this and seeing if I can add any of these things into this tool if it might make things easier.
I don't know though because as stated its not something I have looked into yet.



i7-3770 3.4GHz CPU 16 GB Ram   
GeForce GTX1080 TI 11GB
Windows 10 Pro 64bit
Rampa
Rampa
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)

Group: Forum Members
Last Active: 56 minutes ago
Posts: 8.1K, Visits: 60.5K
Back in the day there was a tool to make Personas. It works except for some issues with path names, which is easy to fix.

Having such a thing right in iClone would be so awesome!

https://developer.reallusion.com/amleditor.aspx
https://www.reallusion.com/iclone/Help/amleditor/default.asp
Delerna
Delerna
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)Distinguished Member (8.2K reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 1.5K, Visits: 14.8K
Yes, I used it in iClone 4 but it got removed and if my memory is correct reallusion said they were going to replace it with a new version ?????
Anyway I have been waiting and waiting but decided to write my own because it doesn't seem to be coming.
I have links to those documents of how it used to work which I will be using as a guide for how I put this together in the future.

Although I do wish reallusion added something for creating them from within iClone7 like it used to be. I for one miss it.




i7-3770 3.4GHz CPU 16 GB Ram   
GeForce GTX1080 TI 11GB
Windows 10 Pro 64bit
Edited
5 Years Ago by Delerna
Rampa
Rampa
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)Distinguished Member (35.8K reputation)

Group: Forum Members
Last Active: 56 minutes ago
Posts: 8.1K, Visits: 60.5K
You can create the Performs using 3DXchange, but your system inside iClone is much more convenient, for sure!

With the AML to Lua, To Python, I suppose it is up to you and the other Python developers now.

AFAIK most everything AML could do still works. I say most because I could not get the animation only applying to specific nodes to work last time I tried. An even better solution to that would be a masking feature for motions inserted from the Content Manger. There is no longer anyway to have the "Idles" play automatically. But there are many other ways to accomplish that anyway.

I did make a "dancing" idle back in iClone 5 by assigning a bunch of dance moves with random probabilities. It worked surprisingly well!

The AML may just be legacy code that will never be removed from iClone. I don't know.
billgucci2
billgucci2
Posted 5 Years Ago
View Quick Profile
New Member

New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)

Group: Banned Members
Last Active: 5 Years Ago
Posts: 27, Visits: 207
Delerna (2/2/2019)
billgucci2

...you have just raised my interest into looking into this and seeing if I can add any of these things into this tool if it might make things easier.

You've done a great job.

Wow, I imagine a programmer could script various sliders to:
Change Hip trajectory, Pelvis Twist, Head & Shoulder Roll, Knee angle and much more.

I can rename the shortcuts however I want, duplicate them so they can be organised under more than one setting.

i can't converse code, so please excuse my ignorance....

'You KNOW" where to find the data and the skill to script the tool.
Somewhere inside there is a reference to animation data. I don't know if it's an (.ini) file or whatever.

"Editing values in this file along with your skill of scripting will provide an awesome tool for iClone."
Whether you add this to your tool or not.... your tool (AS IS) is most useful and welcomed.
Thanks!

Edited
5 Years Ago by billgucci2



Reading This Topic