How to remove unused Time-Editor-clip in a scene ?

How to remove unused Time-Editor-clip in a scene ?

buonnguqua
Explorer Explorer
2,166 Views
5 Replies
Message 1 of 6

How to remove unused Time-Editor-clip in a scene ?

buonnguqua
Explorer
Explorer

If I use Trax Editor Clip, I can press Optimize Scene>Animation Clips>Optimize Now

But Time-Editor-clip not have button and function Smiley Mad

0 Likes
2,167 Views
5 Replies
Replies (5)
Message 2 of 6

mspeer
Consultant
Consultant

Hi!

This seems to be currently not possible by using the UI, do it manual or create a custom script.

0 Likes
Message 3 of 6

buonnguqua
Explorer
Explorer

Maybe you can suggest me some function from Autodesk can do it ?

0 Likes
Message 4 of 6

buonnguqua
Explorer
Explorer

timeEditor -allClips "container" only show ID of all clip ?

How to get all name Clipsource in Composition ?

Anyone can answer me ? Smiley Frustrated

0 Likes
Message 5 of 6

buonnguqua
Explorer
Explorer

After severeal days reading basic of MEL, I done it Smiley Very Happy

 

//Remove unused Time Editor Clip in a Scene
//How to used: Open Scene. Click to timeEditor=>Sources in Outliner and run Script !!!
{
//get name of all ClipSource
string $allclip[]=`ls -sl`;
print ("File have "+`size $allclip`+" clip sources\n");
print $allclip;
print ("\n");
//get ID of clips in Time Editor
int $IDclipinComp[]=`timeEditor -allClips "container"`;
print ("ID of Clips in Composition windows\n");
print ($IDclipinComp);
print ("\n");
int $j=`size $IDclipinComp`-1;
print ("In Composition track have "+$j+" clip sources\n");
int $i;
string $NameClipSourceinComp[];
for( $i = 0; $i <= $j; $i++ )
    {
        $NameClipSourceinComp[$i]=`timeEditorClip -q -animSource $IDclipinComp[$i]`;
        //print $i;
        print ($NameClipSourceinComp[$i]+"\n");
    }
string $can_xoa[] = stringArrayRemove($NameClipSourceinComp,$allclip);
delete $can_xoa;
print ("I delele it\n");
string $newallclip[]=`ls -sl`;
print ("File after clean have "+`size $newallclip`+" clip sources\n");
}

Message 6 of 6

laomusic_arts
Advocate
Advocate

Hi!

After gaving each solution here a try, what works for me in Maya 2018.7 & Arnold 4021 is:
- check our Outilner for timeEditor entry

- under Windows/Animatin Editors/TimeEditor
- delete any Composition on the drop down list

- Optimize Scene

 

Hope this helps others too!
Enjoy!
LAO

0 Likes