home *** CD-ROM | disk | FTP | other *** search
/ Xentax forum attachments archive / xentax.7z / 11218 / CryRyseImport_fix35.7z / ui_.ms
Encoding:
Text File  |  2016-07-01  |  40.3 KB  |  1,079 lines

  1. --joqqyhez@gmail.com
  2.  
  3. --/////////////////////////////////////////  Notes /////////////////////////////////////// 
  4.  
  5. -- C:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\CRYENGINE_5.0\Code\CryEngine\CryCommon\CryFile.h:
  6. -- //////////////////////////////////////////////////////////////////////////
  7. -- // Defines for CryEngine filetypes extensions.
  8. -- //////////////////////////////////////////////////////////////////////////
  9. -- #define CRY_GEOMETRY_FILE_EXT                                        "cgf"
  10. -- #define CRY_SKEL_FILE_EXT                                                "chr" //will be a SKEL soon
  11. -- #define CRY_SKIN_FILE_EXT                                                "skin"
  12. -- #define CRY_CHARACTER_ANIMATION_FILE_EXT                     "caf"
  13. -- #define CRY_CHARACTER_DEFINITION_FILE_EXT                    "cdf"
  14. -- #define CRY_CHARACTER_LIST_FILE_EXT                              "cid"
  15. -- #define CRY_ANIM_GEOMETRY_FILE_EXT                               "cga"
  16. -- #define CRY_ANIM_GEOMETRY_ANIMATION_FILE_EXT             "anm"
  17. -- #define CRY_COMPILED_FILE_EXT                                        "(c)"
  18. -- #define CRY_BINARY_XML_FILE_EXT                                      "binxml"
  19. -- #define CRY_XML_FILE_EXT                                                 "xml"
  20. -- #define CRY_CHARACTER_PARAM_FILE_EXT                             "chrparams"
  21. -- #define CRY_GEOM_CACHE_FILE_EXT                                      "cax"
  22.  
  23. --////////////////////////////////////////////////////////////////////////////////////////
  24.  
  25. global scriptsDefault         = getdir #scripts
  26. global g_max_version         = ((MaxVersion())[1])/1000
  27.  
  28. if  g_max_version >= 19 then
  29. (
  30.     clearlistener()
  31.     
  32.     Format "Max Version: %\n" g_max_version
  33.     
  34.     ----------------------------------------------------------------------
  35.     resetMaxFile #noPrompt
  36.     actionMan.executeAction 0 "40829"             -- show statistics
  37.     actionMan.executeAction -844228238 "12"      -- Viewport Lighting and Shadows: High Quality
  38.     ----------------------------------------------------------------------
  39.     escapeEnable
  40.     ----------------------------------------------------------------------
  41.  
  42.     if GetQuietMode() then
  43.     (
  44.         SetQuietMode false --we want prompts enabled
  45.     )
  46.  
  47.     --//////////////////////////////// Script Checker (Runs on Startup ////////////////////////////////
  48.     --///////////////////////////////////////////////////////////////////////////////////////////////
  49.     ---------------------------------------- ini Global - hardcoded filename ----------------------------------------
  50.     global g_iniFileName                 = "cryimport_v3.ini"
  51.     global g_iniFile                         = (    pathConfig.ResolvePathSymbols (pathConfig.AppendPath     sysInfo.tempdir     g_iniFileName)    )
  52.     -------------------------------------------------------------------------------------------------------------------    
  53.     global g_dirpath                 = "" -- Path to the GameSDK ( WITHOUT the slash \ or / )
  54.     global g_scriptRoot             = ""
  55.     global g_includePath         = ""    
  56.     --/////////////////////////////////////////////////////////////////////////////////////////
  57.     try
  58.     (
  59.         g_dirPath                     = getINISetting     g_iniFile     "paths"     "g_dirpath"
  60.         g_scriptRoot                 = getINISetting     g_iniFile     "paths"     "scriptRoot"
  61.         g_includePath                 = getINISetting     g_iniFile     "paths"     "g_includePath"
  62.         
  63.         setINISetting     ::g_iniFile         "paths" "scriptsDefault"         ::scriptsDefault
  64.     )
  65.     catch()
  66.     --/////////////////////////////////////////////////////////////////////////////////////////
  67.  
  68.     
  69.     
  70.     g_dirpath                         = getINISetting     g_iniFile     "paths" "g_dirpath"    
  71.     if g_dirpath == "" then
  72.     (
  73.         local set_dirPath = queryBox "You will now be asked to navigate to the root of your game folder (you will only do this once)...continue?"
  74.         
  75.         if set_dirPath then
  76.         (
  77.             ::g_dirpath         = getSavePath caption:"Choose the Root for the Game (example \GameSDK\Ryse)"                    
  78.             if ::g_dirpath != undefined AND pathConfig.isLegalPath g_dirpath then
  79.             (
  80.                 setINISetting ::g_iniFile "paths" "g_dirpath" ::g_dirpath
  81.             )
  82.             else
  83.             (
  84.                 ::g_dirpath             = ""
  85.             )
  86.         )
  87.         else
  88.         (
  89.             ::g_dirpath             = ""
  90.         )
  91.     )
  92.     -------------------------------------------------------------------------------------------------------------------
  93.  
  94.     if doesfileexist g_dirpath then
  95.     (
  96.         ::g_scriptRoot                 = getINISetting     ::g_iniFile     "paths"     "scriptRoot"
  97.         ::g_includePath                 = getINISetting     ::g_iniFile     "paths"     "g_includePath"
  98.  
  99.         if ::g_scriptRoot == "" OR ::g_includePath == ""  then
  100.         (
  101.             local set_scriptPath = queryBox "Navigate to the folder which contains this script that you are just running(you will only do this once)...continue?" beep:true
  102.             
  103.             if set_scriptPath then
  104.             (
  105.                 ::g_scriptRoot             = pathConfig.resolvePathSymbols ((getSavePath caption:"Choose Script Root Directory (the dir where you placed the scripts)" initialDir:sysinfo.currentDir))
  106.                 ::g_includePath             = pathConfig.resolvePathSymbols (::g_scriptRoot + "\\include")
  107.                 
  108.                 if ::g_scriptRoot != undefined AND ::g_includePath != undefined then
  109.                 (    
  110.                     if     doesFileExist ::g_includePath AND \            
  111.                         doesFileExist (    pathConfig.resolvePathSymbols (::g_scriptRoot + "\\ui_.ms")    ) then
  112.                     (
  113.                         setINISetting     ::g_iniFile     "paths" "scriptRoot"             ::g_scriptRoot
  114.                         setINISetting     ::g_iniFile     "paths" "g_includePath"     ::g_includePath
  115.                         
  116.                         messageBox "All set, you are now ready to go - all settings are saved" title:"Success" beep:false
  117.                     )
  118.                 )
  119.                 else
  120.                 (
  121.                     ::g_scriptRoot             = ""
  122.                     ::g_includePath             = ""
  123.                 )
  124.             )
  125.             else
  126.             (
  127.                 ::g_scriptRoot             = ""
  128.                 ::g_includePath             = ""
  129.             )
  130.         )
  131.     )
  132.     --/////////////////////////////////////////////////////////////////////////////////////////////////
  133.     --/////////////////////////////////////////////////////////////////////////////////////////////////
  134.  
  135.  
  136.     --////////////////////// Preprocessing - Checks that our includes do indeed exist //////////////////////
  137.     fn includes_Exist \
  138.                             includeDir: \                        
  139.                             &include_files: = --we pass a pointer here
  140.     (
  141.         local files = getFiles (includeDir + "*.*")
  142.         
  143.         for f in files do
  144.         (
  145.             local fname = filenamefrompath f --strip the filename from the path (so we get only the filename + its suffix)
  146.                 
  147.             for inclF in include_files do
  148.             (
  149.                 --At least one fail, will be enough to terminate the whole execution of this importer script
  150.                 if (stricmp fname inclF) != 0 then
  151.                 (
  152.                     --//////////// We do a few backup checks, to keep it less rigorous and more tolerant ////////////
  153.                     local deepCheck = findItem files fname
  154.                     if deepCheck != 0 then
  155.                     (
  156.                         continue;
  157.                     )
  158.                     else --even less rigorous
  159.                     (
  160.                         local backupCheck = (matchpattern inclF pattern:"*"+fname+"*")
  161.                         if backupCheck then
  162.                         (
  163.                             continue;
  164.                         )                        
  165.                     )
  166.                     --Being less tolerant than the above is not desired
  167.                     --///////////////////////////////////////////////////////////////////////////////////////////
  168.                     
  169.                     ------------------------------------------------ *** *** ***--------------------------------------------------
  170.                     --*** *** *** Every check failed and the script will not be able to continue, because reaching this point, will lead to dependencies loading failure! *** *** ***
  171.                     --*** *** *** This is serious, and will lead to a sure failure *** *** ***
  172.                     format "WARNING - We could not confirm the existence of the include files - execution will be aborted\n"                    
  173.                     return false;
  174.                     ------------------------------------------------ *** *** ***--------------------------------------------------
  175.                 )
  176.             )            
  177.         )
  178.         --if we came here, then all the include files are present, and we can include them
  179.         return true;
  180.     )
  181.     --//////////////////////////////////////////////////////////////////////////////////////////////////
  182.  
  183.  
  184.     if     doesFileExist ::g_includePath AND \
  185.         doesFileExist ( pathConfig.resolvePathSymbols (::g_scriptRoot + "\\ui_.ms") ) AND \
  186.         (isDirectoryWriteable sysInfo.tempdir) then
  187.     (
  188.         try
  189.         (
  190.             ----------------------------------------------------
  191.             --set the system script path to the chosen one (otherwise, the included files will not be found)
  192.             if (setdir #scripts ::g_includePath)    then
  193.             (
  194.                 ----------------------------------------------------                
  195.                 format "::g_includePath: %\n" ::g_includePath        
  196.                 --If we add more includes to our project (see include calls below), we must add them to this array as well
  197.                 local include_files = #(
  198.                                                     "HEADER_.ms", \
  199.                                                     "general_functions_.ms", \
  200.                                                     "CryMat_XML_headers_.ms", \
  201.                                                     "CryMat_XML_.ms", \
  202.                                                     
  203.                                                     "create_bones_.ms", \
  204.                                                     "load_cryHeaders_.ms", \
  205.                                                     "load_cryFile_.ms", \                                            
  206.                                                     "CAF_headers_.ms", \
  207.                                                     "load_CAF_.ms", \
  208.                                                     "cryFile_btn_loader_.ms" \
  209.                                                 )        
  210.                 
  211.                 local FOUND_DEPENDENCIES = includes_Exist \
  212.                                                                                 includeDir:        (::g_includePath) \
  213.                                                                                 include_files:    &include_files                
  214.                 
  215.                 --Preprocessing - Checks that our includes do indeed exist        
  216.                 if FOUND_DEPENDENCIES AND \
  217.                     (getdir #scripts) == ::g_includePath  then
  218.                 (            
  219.                     --////////////////// Include //////////////////
  220.                     include "HEADER_.ms"
  221.                     include "general_functions_.ms"
  222.                     include "CryMat_XML_headers_.ms"
  223.                     include "CryMat_XML_.ms"
  224.                     --////////////////////////////////////////////
  225.  
  226.                     try
  227.                     (
  228.                         --/////// Destroy dialogs and rollout clauses if applicable ///////                    
  229.                         if ::cryImport != undefined then
  230.                         (
  231.                             if iskindof ::cryImport RolloutClass then
  232.                             (
  233.                                 DestroyDialog             ::cryImport
  234.                             )
  235.                         )
  236.                         if ::rollout_options != undefined then
  237.                         (
  238.                             if iskindof ::rollout_options RolloutClass then
  239.                             (
  240.                                 DestroyDialog             ::rollout_options
  241.                             )
  242.                         )
  243.                         if ::rollout_Report != undefined then
  244.                         (
  245.                             if iskindof ::rollout_Report RolloutClass then
  246.                             (
  247.                                 DestroyDialog             ::rollout_Report
  248.                             )
  249.                         )
  250.                         if ::rollout_animation != undefined then
  251.                         (
  252.                             if iskindof ::rollout_animation RolloutClass then
  253.                             (
  254.                                 DestroyDialog             ::rollout_animation
  255.                             )
  256.                         )
  257.                         if ::rollout_About != undefined then
  258.                         (
  259.                             if iskindof ::rollout_About RolloutClass then
  260.                             (
  261.                                 DestroyDialog             ::rollout_About
  262.                             )
  263.                         )
  264.                         if ::rollout_Alert != undefined then
  265.                         (
  266.                             if iskindof ::rollout_Alert RolloutClass then
  267.                             (
  268.                                 DestroyDialog             ::rollout_Alert
  269.                             )
  270.                         )
  271.                         ----------------------------The Rollout Floater ----------------------------
  272.                         if ::CRYOP != undefined then
  273.                         (
  274.                             if iskindof ::CRYOP RolloutFloater then
  275.                             (
  276.                                 closeRolloutFloater              ::CRYOP
  277.                             )
  278.                         )
  279.                         --//// End of  Destroy dialogs and rollout clauses if applicable ////                        
  280.                     )
  281.                     catch
  282.                     (
  283.                         format "\n*** *** *** *** *** *** Could not destroy dialogs *** *** *** *** *** ***\n"
  284.                         format "%" (getCurrentException())
  285.                         format "*** *** *** *** *** *** END OF Could not destroy dialogs *** *** *** *** *** *** ***\n"
  286.                     )
  287.  
  288.                     rollout cryImport "Cryengine Importer" width:290 height:170 category:3
  289.                     (
  290.                         label 'lbl_version' "Cryengine Importer v 1.0" pos:[20,8] width:130 height:19 align:#left
  291.                         button 'btn_gameDir' "Set Game Directory (GameSDK)..." pos:[8,37] width:265 height:25 toolTip:"This must be the root of your GameSDK for example ...\GameSDK\Ryse (note - do this only if you want to change the dir, this should be set correctly already" align:#left
  292.                         button 'btn_Set_SkeletonListXML' "Set SkeletonList.xml..." pos:[8,62] width:265 height:25 toolTip:"This is done automatically - Default for example is ...\GameSDK\Ryse\Animations\SkeletonList.xml" align:#left
  293.                         label 'lbl_skeletonList_Loaded' "" pos:[11,89] width:260 height:17 align:#left
  294.                         button 'btn_import' "LOAD CryFile..." pos:[8,118] width:265 height:40 toolTip:"Load CryFile (.cgf, .cgfm, .chr, .chrm, .skin, .skinm, .cdf)" align:#left
  295.                         button 'btn_view_ini' "View ini" pos:[177,4] width:96 height:25 align:#left
  296.                         button 'btn_delete_ini' "del" pos:[152,4] width:25 height:25 align:#left tooltip:"Delete ini file" images:#((    (getdir #maxSysIcons) + "Dark\\Grips\\Cancel_24.png"    ), (    (getdir #maxSysIcons) + "Dark\\Grips\\Cancel_24.png"    ), 1, 1, 1, 1, 1, false)
  297.                         button 'btn_Load_CDF' "LOAD Character Definition..." pos:[8,158] width:265 height:40 toolTip:"This loads the Character Definition File ( .cdf )" align:#left
  298.                         checkbox 'chk_Dont_Load_Skeleton' "Don't Load Skeleton" pos:[13,199] width:259 height:19 enabled:true checked:false align:#left
  299.                         checkbox 'chk_Skip_LOD_Materials' "Skip $Lod Materials" pos:[13,217] width:252 height:19 enabled:true checked:true align:#left                
  300.                         button 'btn_xmlB_Reader' "xmlB Reader..." pos:[8,250] width:133 height:25 toolTip:"Examine an xmlB file" align:#left
  301.                         button 'btn_CAF_reader' "CAF Reader..." pos:[142,250] width:133 height:25 enabled:false toolTip:"Not implemented yet" align:#left
  302.                         dropdownList 'ddl_CryGame' "CryEngine Game" pos:[8,300] width:265 height:40 items:#("Ryse", "Crysis", "Crysis 2", "Crysis 3", "Crysis Warhead", "Crysis Wars", "State of Decay") align:#left enabled:false    
  303.                         
  304.                         
  305.                         --////////////////// Include //////////////////
  306.                         include "create_bones_.ms"
  307.                         include "load_cryHeaders_.ms"
  308.                         include "load_cryFile_.ms"
  309.                         
  310.                         include "CAF_headers_.ms"
  311.                         include "load_CAF_.ms"
  312.                         include "cryFile_btn_loader_.ms"
  313.                         --/////////////////////////////////////////////
  314.                         
  315.                         
  316.                         on cryImport open do
  317.                         (
  318.                             setdir #scripts ::scriptsDefault
  319.                             
  320.                             format "-----------------------------::g_scriptRoot: % -----------------------------\n" ::g_scriptRoot
  321.                             
  322.                             ::g_CryGame_dropDown_selection     = ddl_CryGame.items[ddl_CryGame.selection]
  323.                             ::g_skip_Lod_Materials                    = chk_skip_Lod_Materials.state
  324.                             ::g_Dont_Load_Skeleton                = chk_Dont_Load_Skeleton.state
  325.                             ::g_dirpath                                     = getINISetting ::g_iniFile "paths" "g_dirpath"
  326.                             
  327.                             local skeleton_xml_path = ""                    
  328.                             
  329.                             --////////////////////////// Set SkeletonList.xml and also attempt to read it into an array ///////////////////////////
  330.                             if pathConfig.isLegalPath ::g_dirpath then
  331.                             (
  332.                                 local skeleton_xml_path         = pathConfig.appendPath     ::g_dirpath         ::g_SkeletonList_xml_NAME                        
  333.                                 
  334.                                 if skeleton_xml_path != undefined then
  335.                                 (
  336.                                     format "Will try to find and read: %\n" skeleton_xml_path
  337.                                     
  338.                                     if doesfileexist skeleton_xml_path then
  339.                                     (
  340.                                         setINISetting     ::g_iniFile     "paths" "SkeletonList"     skeleton_xml_path                    
  341.                                         
  342.                                         inst_xmlB_PROCESSOR = xmlB_PROCESSOR()
  343.                                         --XML
  344.                                         if (stricmp (getFilenameType skeleton_xml_path) ".xml") == 0 then
  345.                                         (
  346.                                             if Binary_XML_check skeleton_xml_path then
  347.                                             (
  348.                                                 global g_inst_stored_SkeletonList_XML    = stored_SkeletonList_XML ()    
  349.                                                 format "Attempting to read: %\n" (getFilenameType skeleton_xml_path)
  350.                                                 inst_xmlB_PROCESSOR.cry_general_xmlB_ReaderV \
  351.                                                                                                                     xmlBFile:                    skeleton_xml_path \
  352.                                                                                                                     inst_s_OPTIONS:        inst_s_OPTIONS \
  353.                                                                                                                     type:                        ".xml"
  354.                                                 
  355.                                                 skeleton_xml_path = ""
  356.                                                 ::cryImport.lbl_skeletonList_Loaded.text = "Skeleton List has been loaded"
  357.                                             )
  358.                                             else
  359.                                             (
  360.                                                 format "This is not a valid xmlB file, aborting!: %\n" skeleton_xml_path
  361.                                                 ::cryImport.lbl_skeletonList_Loaded.text = "Could not locate the Skeleton List"
  362.                                             )
  363.                                         )
  364.                                         else
  365.                                         (
  366.                                             format "The suffix of the SkeletonList is not .xml: %\n" skeleton_xml_path
  367.                                             ::cryImport.lbl_skeletonList_Loaded.text = "Could not locate the Skeleton List"
  368.                                         )
  369.                                     )
  370.                                     else
  371.                                     (
  372.                                         format "Cannot find: %\n" skeleton_xml_path
  373.                                         ::cryImport.lbl_skeletonList_Loaded.text = "Could not locate the Skeleton List"
  374.                                     )
  375.                                 )
  376.                                 else
  377.                                 (
  378.                                     format "Could not find: %\n" skeleton_xml_path
  379.                                     ::cryImport.lbl_skeletonList_Loaded.text = "Could not locate the Skeleton List"
  380.                                 )            
  381.                             )
  382.                             --///////////////////////////////////////////////////////////////////////////////////////////////////////////////////        
  383.                             
  384.                             format "g_skip_Lod_Materials: %\n"                             ::g_skip_Lod_Materials
  385.                             format "\nGame selected: --------- % ---------\n"         ::g_CryGame_dropDown_selection
  386.                             format "Skeleton List Path: %\n"                                 (pathConfig.appendPath ::g_dirpath ::g_SkeletonList_xml_NAME)
  387.                             format "g_Dont_Load_Skeleton: %\n"                             ::g_Dont_Load_Skeleton
  388.                             format "======= GameSDK path: % =======\n"             ::g_dirpath
  389.                         )
  390.                         on cryImport close do
  391.                         (
  392.                             setdir #scripts ::scriptsDefault
  393.                         )
  394.                         on cryImport rolledUp state do
  395.                         (
  396.                             if NOT state then
  397.                             (
  398.                                  --closed
  399.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]-cryImport.height]
  400.                             )
  401.                             else
  402.                             (
  403.                                  --open
  404.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]+cryImport.height]
  405.                             )
  406.                         )                        
  407.                         on btn_delete_ini pressed do
  408.                         (
  409.                             if (queryBox "This will delete your settings, are you sure you want to continue?") then
  410.                             (
  411.                                 if (deleteFile ::g_iniFile) then
  412.                                 (
  413.                                     format "% deleted!\n" ::g_iniFile
  414.                                 )
  415.                                 else
  416.                                 (
  417.                                     format "Could not delete % \n" ::g_iniFile
  418.                                 )
  419.                             )
  420.                         )
  421.                         on btn_gameDir pressed do
  422.                         (
  423.                             startDir = undefined
  424.                         
  425.                             g_dirpath             = getINISetting ::g_iniFile "paths" "g_dirpath"
  426.                         
  427.                             if pathConfig.isLegalPath g_dirpath then
  428.                             (
  429.                                 startDir = g_dirpath
  430.                                 ::g_dirpath         = getSavePath caption:"Choose Game directory" initialDir:startDir
  431.                             )
  432.                             else
  433.                             (
  434.                                 ::g_dirpath         = getSavePath caption:"Choose Game directory"
  435.                             )
  436.                             
  437.                             --Reread Skeleton List
  438.                             if ::g_dirpath != undefined then
  439.                             (
  440.                                 if pathConfig.isLegalPath g_dirpath  then
  441.                                 (
  442.                                     setINISetting ::g_iniFile "paths" "g_dirpath" ::g_dirpath                                    
  443.                                     local skeleton_xml_path         = pathConfig.appendPath     ::g_dirpath         ::g_SkeletonList_xml_NAME                        
  444.                                     
  445.                                     if skeleton_xml_path != undefined then
  446.                                     (
  447.                                         format "Will try to find and read: %\n" skeleton_xml_path
  448.                                         
  449.                                         if doesfileexist skeleton_xml_path then
  450.                                         (
  451.                                             setINISetting     ::g_iniFile     "paths" "SkeletonList"     skeleton_xml_path                    
  452.                                             
  453.                                             inst_xmlB_PROCESSOR = xmlB_PROCESSOR()
  454.                                             --XML
  455.                                             if (stricmp (getFilenameType skeleton_xml_path) ".xml") == 0 then
  456.                                             (
  457.                                                 if Binary_XML_check skeleton_xml_path then
  458.                                                 (
  459.                                                     ::g_inst_stored_SkeletonList_XML    = stored_SkeletonList_XML ()    
  460.                                                     format "Attempting to read: %\n" (getFilenameType skeleton_xml_path)
  461.                                                     inst_xmlB_PROCESSOR.cry_general_xmlB_ReaderV \
  462.                                                                                                                         xmlBFile:                    skeleton_xml_path \
  463.                                                                                                                         inst_s_OPTIONS:        inst_s_OPTIONS \
  464.                                                                                                                         type:                        ".xml"
  465.                                                     
  466.                                                     skeleton_xml_path = ""
  467.                                                     ::cryImport.lbl_skeletonList_Loaded.text = "Skeleton List has been loaded"
  468.                                                 )    
  469.                                             )            
  470.                                         )
  471.                                     )
  472.                                 )
  473.                             )
  474.                             
  475.                         )
  476.                         on btn_Set_SkeletonListXML pressed do
  477.                         (
  478.                             startDir = undefined
  479.                             ::g_dirpath = getINISetting ::g_iniFile "paths" "g_dirpath"
  480.                         
  481.                             if pathConfig.isLegalPath ::g_dirpath then
  482.                             (
  483.                                 startDir = ::g_dirpath
  484.                                 
  485.                                 SkeletonList_xml_PATH = getOpenFileName \
  486.                                 caption:"cgf/chr/cgfm Model File" \
  487.                                 types:"CryTek Model File (*.xml)|*.xml" historyCategory:"CryTek ObjectPresets" initialDir:startDir
  488.                                 
  489.                                 if SkeletonList_xml_PATH != undefined then
  490.                                 (
  491.                                     if doesfileexist SkeletonList_xml_PATH then
  492.                                     (
  493.                                         setINISetting     ::g_iniFile     "paths" "SkeletonList"     SkeletonList_xml_PATH                        
  494.                                         ::g_SkeletonList_xml_NAME = filenameFromPath SkeletonList_xml_PATH
  495.                                     )
  496.                                 )
  497.                             )
  498.                             else
  499.                             (
  500.                                 ::g_dirpath = getSavePath caption:"Choose Game directory"
  501.                                 
  502.                                 if ::g_dirpath != undefined AND pathConfig.isLegalPath g_dirpath then
  503.                                 (
  504.                                     setINISetting ::g_iniFile "paths" "g_dirpath" ::g_dirpath
  505.                                     
  506.                                     startDir = ::g_dirpath
  507.                                     
  508.                                     SkeletonList_xml_PATH = getOpenFileName \
  509.                                     caption:"cgf/chr/cgfm Model File" \
  510.                                     types:"CryTek Model File (*.xml)|*.xml" historyCategory:"CryTek ObjectPresets" initialDir:startDir
  511.                                     
  512.                                     if SkeletonList_xml_PATH != undefined then
  513.                                     (
  514.                                         if doesfileexist SkeletonList_xml_PATH then
  515.                                         (
  516.                                             setINISetting     ::g_iniFile     "paths" "SkeletonList"     SkeletonList_xml_PATH                        
  517.                                             ::g_SkeletonList_xml_NAME = filenameFromPath SkeletonList_xml_PATH
  518.                                         )                    
  519.                                     )
  520.                                 )
  521.                             )
  522.                         )
  523.                         on btn_import pressed do
  524.                         (        
  525.                             g_dirpath = getINISetting ::g_iniFile "paths" "g_dirpath"
  526.                             
  527.                             if NOT (doesfileexist g_dirpath) then
  528.                             (
  529.                                 confirm = yesNoCancelBox "You must choose a root game directory, do you want to do it now?" \
  530.                                                                     title:"WARNING" \
  531.                                                                     beep:true        
  532.                                 if confirm == #yes then
  533.                                 (
  534.                                     g_dirpath = getSavePath caption:"Choose Game directory"
  535.                                     
  536.                                     if g_dirpath != undefined AND pathConfig.isLegalPath g_dirpath then
  537.                                     (
  538.                                         setINISetting ::g_iniFile "paths" "g_dirpath" ::g_dirpath
  539.                                     )
  540.                                 )
  541.                             )                    
  542.                             else
  543.                             (
  544.                                 g_cryFile = getOpenFileName \
  545.                                 caption:"cgf/chr/cgfm Model File" \
  546.                                 types:"CryTek Model File (*.cgf)|*.cgf|(*.cgfm)|*.cgfm|(*.chr)|*.chr|(*.cdf)|*.cdf| \
  547.                                 (*.skin)|*.skin|(*.skinm)|*.skinm|(*.chrm)|*.chrm|(*.caf)|*.caf|(*.img)|*.img|All (*.*)|*.*" \
  548.                                 historyCategory:"CryTek ObjectPresets"
  549.                                 
  550.                                 if g_cryFile != undefined then
  551.                                 (
  552.                                     if doesfileexist g_cryFile then
  553.                                     (
  554.                                         if ((getFilenameType g_cryFile) == ".cgf") OR ((getFilenameType g_cryFile) == ".cgfm") then
  555.                                         (
  556.                                             if  NOT (Binary_CryTek_check File:g_cryFile) then --if the xml file is not Crytek Binary XML
  557.                                             (
  558.                                                 format "This is not a valid CryTek file, aborting!\n"
  559.                                             )
  560.                                             else
  561.                                             (
  562.                                                 setINISetting     ::g_iniFile     "boneinfo" "has_bones"     "0"                    
  563.                                                 cryFile_loader g_cryFile:g_cryFile
  564.                                             )                    
  565.                                         )
  566.                                         else if ((getFilenameType g_cryFile) == ".skin") OR ((getFilenameType g_cryFile) == ".skinm") then
  567.                                         (
  568.                                             if  NOT (Binary_CryTek_check File:g_cryFile) then --if the xml file is not Crytek Binary XML
  569.                                             (
  570.                                                 format "This is not a valid CryTek file, aborting!\n"
  571.                                             )
  572.                                             else
  573.                                             (
  574.                                                 cryFile_loader g_cryFile:g_cryFile
  575.                                             )                            
  576.                                         )
  577.                                         else if ((getFilenameType g_cryFile) == ".chr") OR ((getFilenameType g_cryFile) == ".chrm") then
  578.                                         (
  579.                                             if  NOT (Binary_CryTek_check File:g_cryFile) then --if the xml file is not Crytek Binary XML
  580.                                             (
  581.                                                 format "This is not a valid CryTek file, aborting!\n"
  582.                                             )
  583.                                             else
  584.                                             (
  585.                                                 cryFile_loader g_cryFile:g_cryFile
  586.                                             )
  587.                                         )
  588.                                         else if ((getFilenameType g_cryFile) == ".caf") then
  589.                                         (
  590.                                             if  NOT (Binary_CryTek_check File:g_cryFile) then --if the xml file is not Crytek Binary XML
  591.                                             (
  592.                                                 format "This is not a valid CryTek file, aborting!\n"
  593.                                             )
  594.                                             else
  595.                                             (
  596.                                                 cryFile_loader \
  597.                                                                     g_cryFile:    g_cryFile \
  598.                                                                     caller:        (getFilenameType g_cryFile)
  599.                                             )
  600.                                         )
  601.                                         else if ((getFilenameType g_cryFile) == ".img") then
  602.                                         (
  603.                                             if  NOT (Binary_CryTek_check File:g_cryFile) then --if the xml file is not Crytek Binary XML
  604.                                             (
  605.                                                 format "This is not a valid CryTek file, aborting!\n"
  606.                                             )
  607.                                             else
  608.                                             (
  609.                                                 cryFile_loader \
  610.                                                                     g_cryFile:    g_cryFile \
  611.                                                                     caller:        (getFilenameType g_cryFile)
  612.                                             )
  613.                                         )
  614.                                         else if (getFilenameType g_cryFile) == ".cdf" then
  615.                                         (
  616.                                             if  NOT (Binary_XML_check g_cryFile) then --if the xml file is not Crytek Binary XML
  617.                                             (
  618.                                                 format "This is not a valid CryXmlB file, aborting!\n"
  619.                                             )
  620.                                             else
  621.                                             (
  622.                                                 cryxmlB_loader()
  623.                                             )                
  624.                                         )
  625.                                     )
  626.                                 )
  627.                             )
  628.                         )
  629.                         on btn_view_ini pressed do
  630.                         (
  631.                             try
  632.                             (
  633.                                 ShellLaunch "notepad.exe" ::g_iniFile
  634.                             )
  635.                             catch()
  636.                         )
  637.                         on btn_Load_CDF pressed do
  638.                         (        
  639.                             g_dirpath = getINISetting ::g_iniFile "paths" "g_dirpath"
  640.                             
  641.                             if NOT (doesfileexist g_dirpath) then
  642.                             (
  643.                                 confirm = yesNoCancelBox "You must choose a root game directory, do you want to do it now?" \
  644.                                                                     title:"WARNING" \
  645.                                                                     beep:true        
  646.                                 if confirm == #yes then
  647.                                 (
  648.                                     ::g_dirpath = getSavePath caption:"Choose Game directory"
  649.                                 )
  650.                             )                    
  651.                             else
  652.                             (
  653.                                 g_cryFile = getOpenFileName \
  654.                                 caption:"cgf/chr/cgfm Model File" \
  655.                                 types:"CryTek Character Definition File (*.cdf)|*.cdf|(*.chrparams)|*.chrparams|(*.xml)|*.xml|All (*.*)|*.*" \
  656.                                 historyCategory:"CryTek ObjectPresets"
  657.                                 
  658.                                 if g_cryFile != undefined then
  659.                                 (            
  660.                                     if doesfileexist g_cryFile then
  661.                                     (
  662.                                         if (stricmp (getFilenameType g_cryFile) ".cdf" ) == 0 OR \
  663.                                             (stricmp (getFilenameType g_cryFile) ".chrparams" ) == 0 then
  664.                                         (
  665.                                             if  (Binary_XML_custom_check file:g_cryFile type:"CryXmlB") then --if the xml file is not Crytek Binary XML                
  666.                                             (
  667.                                                 cryFile_CDF_loader g_cryFile:g_cryFile                                                
  668.                                             )
  669.                                             else
  670.                                             (
  671.                                                 format "This is not a valid CryXmlB file, aborting!\n"
  672.                                             )
  673.                                         )
  674.                                         else
  675.                                         (
  676.                                             format "Seem that this is not a valid CDF file, aborting! \nIf you are trying to read an xmlB file, then use the button \"xmlB Reader...\" instead.\n"
  677.                                         )
  678.                                     )
  679.                                 )
  680.                             )
  681.                         )
  682.                         on chk_Dont_Load_Skeleton changed arg do
  683.                         (
  684.                             ::g_Dont_Load_Skeleton = chk_Dont_Load_Skeleton.state
  685.                             
  686.                             format "% g_Dont_Load_Skeleton\n"             ::g_Dont_Load_Skeleton
  687.                         )
  688.                         on chk_Skip_LOD_Materials changed arg do
  689.                         (
  690.                             ::g_skip_Lod_Materials = chk_Skip_LOD_Materials.state
  691.                             
  692.                             format "% g_skip_Lod_Materials\n"             ::g_skip_Lod_Materials
  693.                         )
  694.                         on btn_xmlB_Reader pressed do
  695.                         (
  696.                             g_dirpath = getINISetting ::g_iniFile "paths" "g_dirpath"
  697.                             
  698.                             if NOT (doesfileexist g_dirpath) then
  699.                             (
  700.                                 confirm = yesNoCancelBox "You must choose a root game directory, do you want to do it now?" \
  701.                                                                     title:"WARNING" \
  702.                                                                     beep:true
  703.                             
  704.                                 if confirm == #yes then
  705.                                 (
  706.                                     ::g_dirpath = getSavePath caption:"Choose Game directory"
  707.                                 )
  708.                             )
  709.                             
  710.                             g_cryFile = getOpenFileName \
  711.                             caption:"cgf/chr/cgfm Model File" \
  712.                             types:"CryTek MTL (*.mtl)|*.mtl|(*.xml)|*.xml|(*.cdf)|*.cdf|(*.chrparams)|*.chrparams| \
  713.                             All (*.*)|*.*" \
  714.                             historyCategory:"CryTek ObjectPresets"
  715.                             
  716.                             if ::g_cryFile != undefined AND doesfileexist g_cryFile then
  717.                             (
  718.                                 setINISetting ::g_iniFile "paths" "last_loaded" g_cryFile
  719.                                 cryxmlB_loader()
  720.                             )
  721.                         )
  722.                         on btn_CAF_reader pressed do
  723.                         (
  724.                             --Not implemented yet
  725.                         )
  726.                         on ddl_CryGame selected arg do
  727.                         (
  728.                             ::g_CryGame_dropDown_selection = ddl_CryGame.items[arg]
  729.                             format "% selected\n" ::g_CryGame_dropDown_selection
  730.                         )
  731.                     )
  732.                     
  733.                     rollout rollout_options "Material Options" width:290 height:100 category:1
  734.                     (
  735.                         checkbox 'chk_Physical_Material' "Physical Material" pos:[14,5] width:248 height:22 checked:true toolTip:"If unchecked, Standard Material is used instead" align:#left
  736.                         GroupBox 'grp_Options' "Texture Rename" pos:[9,60] width:264 height:55 align:#left
  737.                         checkbox 'chk_dds' "Rename .tif* to .dds" pos:[17,79] width:114 height:21 enabled:true checked:true align:#left
  738.                         checkbox 'chk_UVW_Flip_V' "UVW - Flip V" pos:[15,31] width:107 height:16 checked:true align:#left
  739.                         spinner 'spn_Spec_Map_Amount' "Specular Map Output Amount: " pos:[15,130] width:112 height:16 enabled:false range:[-100,100,-17] type:#float scale:0.1 align:#left
  740.                         
  741.                         on rollout_options open do
  742.                         (    
  743.                             setdir #scripts ::scriptsDefault
  744.                             
  745.                             ::g_dds                         = chk_dds.state
  746.                             ::g_Physical_Material    = chk_Physical_Material.state
  747.                             ::g_UVW_Flip_V            = chk_UVW_Flip_V.state
  748.                             
  749.                             format "\n-----Material Options: -----\n"
  750.                             format "g_dds % \n"                                         ::g_dds
  751.                             format "g_Physical_Material % \n"                         ::g_Physical_Material
  752.                             format "chk_UVW_Flip_V % \n"                             ::g_UVW_Flip_V
  753.                             
  754.                             if ::g_Physical_Material then
  755.                             (
  756.                                 spn_Spec_Map_Amount.enabled = true
  757.                             )
  758.                             else
  759.                             (
  760.                                 spn_Spec_Map_Amount.enabled = false
  761.                             )
  762.                             ::inst_PHYS_MAT_ADJUST.spec_output_amount = spn_Spec_Map_Amount.value
  763.                         )
  764.                         on rollout_options close do
  765.                         (
  766.                             setdir #scripts ::scriptsDefault
  767.                         )
  768.                         on rollout_options rolledUp state do
  769.                         (
  770.                             if NOT state then
  771.                             (
  772.                                  --closed
  773.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]-rollout_options.height]
  774.                             )
  775.                             else
  776.                             (
  777.                                  --open
  778.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]+rollout_options.height]
  779.                             )
  780.                         )
  781.                         on chk_Physical_Material changed arg do
  782.                         (
  783.                             ::g_Physical_Material                                         = chk_Physical_Material.state        
  784.                             format "Physical Material: %\n"                             ::g_Physical_Material 
  785.                             
  786.                             if ::g_Physical_Material then
  787.                             (
  788.                                 spn_Spec_Map_Amount.enabled = true
  789.                             )
  790.                             else
  791.                             (
  792.                                 spn_Spec_Map_Amount.enabled = false
  793.                             )
  794.                             ::inst_PHYS_MAT_ADJUST.spec_output_amount = spn_Spec_Map_Amount.value
  795.                         )
  796.                         on spn_Spec_Map_Amount changed arg do
  797.                         (
  798.                             ::inst_PHYS_MAT_ADJUST.spec_output_amount = spn_Spec_Map_Amount.value
  799.                         )
  800.                         on chk_dds changed arg do
  801.                         (
  802.                             ::g_dds                                                             = chk_dds.state        
  803.                             format "Treat .tiff as .dds: %\n"                         ::g_dds
  804.                         )
  805.                         on chk_UVW_Flip_V changed arg do
  806.                         (
  807.                             ::g_UVW_Flip_V                                                 = chk_UVW_Flip_V.state        
  808.                             format "chk_UVW_Flip_V % \n"                             ::g_UVW_Flip_V
  809.                         )
  810.                     )
  811.  
  812.                     rollout rollout_Report "Report" width:290 height:150 category:9
  813.                     (
  814.                         checkbox 'chk_Mesh_Report' "Mesh Report" pos:[17,11] width:80 height:20 align:#left
  815.                         checkbox 'chk_xmlB_Report' "xmlB Report" pos:[17,31] width:78 height:20 checked:false align:#left
  816.                         checkbox 'chk_xmlB_Report_v2' "xmlB Report v2" pos:[17,50] width:110 height:20 checked:true align:#left
  817.                         checkbox 'chk_xmlB_Debug_Report' "xmlB Debug Report" pos:[17,69] width:113 height:20 align:#left
  818.                         checkbox 'chk_Build_Material_Report' "Build Material Report" pos:[17,89] width:122 height:18 enabled:true checked:false align:#left                        
  819.                         checkbox 'chk_Read_Comp_cryBones_Report' "Read Compiled Crybones Report" pos:[17,107] width:175 height:20 align:#left
  820.                         checkbox 'chk_Create_Bones_Report' "Create Bones Report" pos:[17,127] width:175 height:20 checked:false align:#left    
  821.                         checkbox 'chk_CDF_Report' "CDF Report" pos:[17,147] width:175 height:20 checked:false align:#left
  822.                         checkbox 'chk_Anim_Report' "Animation Report" pos:[17,167] width:175 height:20 checked:false align:#left
  823.                         checkbox 'chk_Heuristic_Report' "Heuristic Report" pos:[17,187] width:175 height:20 checked:false align:#left
  824.                         
  825.                         on rollout_Report open do
  826.                         (    
  827.                             setdir #scripts ::scriptsDefault
  828.                             
  829.                             ::g_xmlB_Report_v2                             = chk_xmlB_Report_v2.state        
  830.                             ::g_xmlB_Debug_Report                     = chk_xmlB_Debug_Report.state
  831.                             ::g_Build_Material_Report                     = chk_Build_Material_Report.state
  832.                             ::g_xmlB_Report                                 = chk_xmlB_Report.state
  833.                             ::g_Mesh_Report                                 = chk_Mesh_Report.state
  834.                             ::g_Read_Comp_cryBones_Report         = chk_Read_Comp_cryBones_Report.state
  835.                             ::g_Read_Create_Bones_Report             = chk_Create_Bones_Report.state
  836.                             ::g_CDF_Report                                 = chk_CDF_Report.state            
  837.                             
  838.                             format "\n-----Report Options: -----\n"        
  839.                             format "g_xmlB_Report_v2 % \n"                         ::g_xmlB_Report_v2
  840.                             format "g_xmlB_Debug_Report % \n"                     ::g_xmlB_Debug_Report
  841.                             format "g_Build_Material_Report % \n"                     ::g_Build_Material_Report
  842.                             format "g_xmlB_Report % \n"                                 ::g_xmlB_Report
  843.                             format "g_Mesh_Report % \n"                             ::g_Mesh_Report
  844.                             format "g_Read_Comp_cryBones_Report % \n"         ::g_Read_Comp_cryBones_Report
  845.                             format "g_Read_Create_Bones_Report % \n"         ::g_Read_Create_Bones_Report
  846.                             format "g_CDF_Report % \n"                                 ::g_CDF_Report
  847.                             
  848.                             format "chk_Anim_Report % \n"                             chk_Anim_Report.state
  849.                             format "chk_Anim_Report % \n"                             chk_Heuristic_Report.state
  850.                             
  851.                         )
  852.                         on rollout_Report close do
  853.                         (
  854.                             setdir #scripts ::scriptsDefault
  855.                         )
  856.                         on rollout_Report rolledUp state do
  857.                         (
  858.                             if NOT state then
  859.                             (
  860.                                  --closed
  861.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]-rollout_Report.height]
  862.                             )
  863.                             else
  864.                             (
  865.                                  --open
  866.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]+rollout_Report.height]
  867.                             )
  868.                         )
  869.                         on chk_xmlB_Report_v2 changed arg do
  870.                         (
  871.                             ::g_xmlB_Report_v2 = chk_xmlB_Report_v2.state        
  872.                             format "chk_xmlB_Report_v2: %\n" ::g_xmlB_Report_v2
  873.                         )
  874.                         on chk_xmlB_Debug_Report changed arg do
  875.                         (
  876.                             ::g_xmlB_Debug_Report = chk_xmlB_Debug_Report.state        
  877.                             format "chk_xmlB_Debug_Report: %\n" ::g_xmlB_Debug_Report
  878.                         )
  879.                         on chk_Build_Material_Report changed arg do
  880.                         (
  881.                             ::g_Build_Material_Report = chk_Build_Material_Report.state        
  882.                             format "chk_Build_Material_Report: %\n" ::g_Build_Material_Report
  883.                         )
  884.                         on chk_xmlB_Report changed arg do
  885.                         (
  886.                             ::g_xmlB_Report = chk_xmlB_Report.state        
  887.                             format "chk_xmlB_Report: %\n" ::g_xmlB_Report
  888.                         )
  889.                         on chk_Mesh_Report changed arg do
  890.                         (
  891.                             ::g_Mesh_Report = chk_Mesh_Report.state        
  892.                             format "chk_Mesh_Report: %\n" ::g_Mesh_Report
  893.                         )
  894.                         on chk_Read_Comp_cryBones_Report changed arg do
  895.                         (
  896.                             ::g_chk_Comp_cryBones_Report = chk_Read_Comp_cryBones_Report.state        
  897.                             format "chk_Read_Comp_cryBones_Report: %\n" ::g_chk_Comp_cryBones_Report
  898.                         )
  899.                         on chk_Create_Bones_Report changed arg do
  900.                         (
  901.                             ::g_Create_Bones_Report = chk_Create_Bones_Report.state        
  902.                             format "chk_Create_Bones_Report: %\n" ::g_Create_Bones_Report
  903.                         )
  904.                         on chk_CDF_Report changed arg do
  905.                         (
  906.                             ::g_Create_Bones_Report = chk_Create_Bones_Report.state        
  907.                             format "chk_Create_Bones_Report: %\n" ::g_Create_Bones_Report
  908.                         )
  909.                         on chk_CDF_Report changed arg do
  910.                         (
  911.                             ::g_CDF_Report = chk_CDF_Report.state        
  912.                             format "chk_Create_Bones_Report: %\n" ::g_CDF_Report
  913.                         )
  914.                         on chk_Anim_Report changed arg do
  915.                         (                        
  916.                             format "chk_Anim_Report: %\n" arg
  917.                         )
  918.                         on chk_Heuristic_Report changed arg do
  919.                         (                        
  920.                             format "chk_Heuristic_Report: %\n" arg
  921.                         )
  922.                         
  923.                     )
  924.  
  925.                     rollout rollout_animation "Animation" width:290 height:95 category:4
  926.                     (
  927.                         checkbox 'chk_Use_Skin_Wrap' "Use Skin_Wrap" pos:[16,17] width:255 height:21 align:#left enabled:false    
  928.                         
  929.                         on rollout_animation open do
  930.                         (
  931.                             setdir #scripts ::scriptsDefault
  932.                         )
  933.                         on rollout_animation close do
  934.                         (
  935.                             setdir #scripts ::scriptsDefault
  936.                         )
  937.                         on chk_Use_Skin_Wrap changed arg do
  938.                         (
  939.                             ::g_Use_Skin_Wrap = chk_Use_Skin_Wrap.state        
  940.                             format "chk_Use_Skin_Wrap: %\n" ::g_Use_Skin_Wrap
  941.                         )
  942.                         on rollout_animation rolledUp state do
  943.                         (
  944.                             if NOT state then
  945.                             (
  946.                                  --closed
  947.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]-rollout_animation.height]
  948.                             )
  949.                             else
  950.                             (
  951.                                  --open
  952.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]+rollout_animation.height]
  953.                             )
  954.                         )
  955.                     )
  956.  
  957.                     rollout rollout_About "About" width:290 height:50 category:10
  958.                     (
  959.                         label 'lbl_About' "joqqyhez@gmail.com  2016" pos:[14,13] width:263 height:19 align:#left
  960.                         label 'lbl_trademark' "CRYENGINE is a Trademark of Crytek GmbH" pos:[13,35] width:266 height:20 align:#left                        
  961.                         
  962.                         on rollout_About open do
  963.                         (
  964.                             setdir #scripts ::scriptsDefault
  965.                         )    
  966.                         on rollout_About close do
  967.                         (
  968.                             setdir #scripts ::scriptsDefault
  969.                         )                        
  970.                         on rollout_About rolledUp state do
  971.                         (                            
  972.                             if NOT state then
  973.                             (
  974.                                  --closed
  975.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]-rollout_About.height]
  976.                             )
  977.                             else
  978.                             (
  979.                                  --open
  980.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]+rollout_About.height]
  981.                             )
  982.                         )
  983.                     )
  984.  
  985.                     rollout rollout_Alert "Alert" width:290 height:85 category:8
  986.                     (
  987.                         listBox 'lbx_Message_Alert' "Message Alert" pos:[12,20] width:267 height:7 align:#left                        
  988.                         
  989.                         on rollout_Alert open do
  990.                         (
  991.                             setdir #scripts ::scriptsDefault
  992.                         )    
  993.                         on rollout_Alert close do
  994.                         (
  995.                             setdir #scripts ::scriptsDefault
  996.                         )    
  997.                         on rollout_Alert rolledUp state do
  998.                         (
  999.                             if NOT state then
  1000.                             (
  1001.                                  --closed
  1002.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]-rollout_Alert.height]
  1003.                             )
  1004.                             else
  1005.                             (
  1006.                                  --open
  1007.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]+rollout_Alert.height]
  1008.                             )
  1009.                         )
  1010.                     )
  1011.                     
  1012.                     rollout rollout_AnimationTracks "Animation Tracks" width:100 height:20 category:5
  1013.                     (
  1014.                         dropdownList 'ddl_Animation_Tracks' "Animation Tracks" pos:[8,20] width:265 height:30 items:#() align:#left
  1015.                         
  1016.                         on rollout_AnimationTracks open do
  1017.                         (
  1018.                             setdir #scripts ::scriptsDefault
  1019.                         )
  1020.                         on rollout_AnimationTracks close do
  1021.                         (
  1022.                             setdir #scripts ::scriptsDefault
  1023.                         )    
  1024.                         on rollout_AnimationTracks rolledUp state do
  1025.                         (
  1026.                             if NOT state then
  1027.                             (
  1028.                                  --closed
  1029.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]-rollout_AnimationTracks.height]
  1030.                             )
  1031.                             else
  1032.                             (
  1033.                                  --open
  1034.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]+rollout_AnimationTracks.height]
  1035.                             )
  1036.                         )
  1037.                     )
  1038.  
  1039.                     --/////////////////////////////// Instanciate the rollouts ///////////////////////////////
  1040.                     CRYOP = newRolloutFloater "CryEngine Importer v 1.0" 290 585
  1041.  
  1042.                     addRollout             ::rollout_options         ::CRYOP  rolledUp:true
  1043.                     addRollout             ::rollout_Report         ::CRYOP rolledUp:true
  1044.                     addRollout             ::cryImport             ::CRYOP rolledUp:false
  1045.                     addRollout             ::rollout_animation     ::CRYOP rolledUp:true
  1046.                     -- addRollout             ::rollout_Alert             ::CRYOP rolledUp:false --set runtime instead inside CryMat_XML_.ms
  1047.                     addRollout             ::rollout_About         ::CRYOP rolledUp:true
  1048.  
  1049.                     CreateDialog         ::cryImport     rolledUp:false width:120 height:200        
  1050.                     --//////////////////////////////////////////////////////////////////////////////////////
  1051.                 )
  1052.                 else
  1053.                 (
  1054.                     MessageBox "Cannot find or load the include files, cannot continue, aborting!" title:"Startup Error" beep:false
  1055.                 )
  1056.             )
  1057.             else
  1058.             (
  1059.                 format "Could not set the #scripts path - include files will not load - aborting!\n"
  1060.             )    
  1061.         )
  1062.         catch
  1063.         (
  1064.             format "\n\n\n\n*** *** *** *** *** ***  Could not load include files ***  *** *** *** *** *** ***\n"
  1065.             format "%" (getCurrentException())
  1066.             format "\n*** *** *** *** *** *** END OF Could not load include files *** *** *** *** *** *** ***\n\n\n\n"
  1067.         )
  1068.     )
  1069.     else
  1070.     (
  1071.         MessageBox "Cannot find scriptpath, cannot continue, aborting!" title:"Startup Error" beep:false    
  1072.     )
  1073.  
  1074.     gc()
  1075. )
  1076. else
  1077. (
  1078.     MessageBox "This script requires 3DS Max 2017 or higher!" title:"Startup Error" beep:true
  1079. )