mayamel

How to open Game Exporter with mel script?


I use Game Exporter to export my animation a lot. But I'm tired of selecting File > Game Exporter from the main menu.

Can I use mel script to open Game Exporter? Or even better, can I use the mel script to automatically generate the input for Game Exporter (For example: automatically input Export path, Animation name, Export selection only,...)?


Solution

  • Can I use mel script to open Game Exporter?

    Open game exporter

    gameFbxExporter;
    

    Or even better, can I use the mel script to automatically generate the input for Game Exporter (For example: automatically input Export path, Animation name, Export selection only,...)?

    Export path

    (Set to "E:/aaa")

    setAttr -type "string" gameExporterPreset2.exportPath "E:/aaa";
    

    Animation name

    (Set to "aaa")

    gameExp_SetUniqueAnimationClipName 0"aaa"gameExporterWindow|gameExporterTabFormLayout|gameExporterTabLayout|gameExporterAnimationTab|anim_gameExporterMainFormLayout|anim_gameExporterExportTypeFormLayout|formLayout344|anim_gameFbxExporterAnimClipFrameLayout|anim_gameFbxExporterAnimClipFormLayout|anim_gameFbxExporterScrollLayout|formLayout345|textField20;
    

    But this is not really effective, because of the hard code: formLayout344|, formLayout345|textField20. Must find a way to make it dynamic.

    So use this instead

    setAttr -type "string" gameExporterPreset2.exportFilename "aaa";
    

    Export selection only

    setAttr("gameExporterPreset2.exportSetIndex") 2;
    gameExp_CreateExportTypeUIComponents;
    

    Here is how I figure it out: I check all the records of Mel.