home *** CD-ROM | disk | FTP | other *** search
/ Xentax forum attachments archive / xentax.7z / 11223 / CryRyseImport_fix35.7z / ui_.ms
Encoding:
Text File  |  2016-07-01  |  43.1 KB  |  1,177 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.                             if (setdir #scripts ::scriptsDefault) then
  319.                             (
  320.                                 format "Current Scripts Dir set to #scripts: %\n" (getdir #scripts)
  321.                             )
  322.                             else
  323.                             (
  324.                                 format "Current #scripts dir: %\n" (getdir #scripts)
  325.                             )
  326.                             
  327.                             format "-----------------------------::g_scriptRoot: % -----------------------------\n" ::g_scriptRoot
  328.                             
  329.                             ::g_CryGame_dropDown_selection     = ddl_CryGame.items[ddl_CryGame.selection]
  330.                             ::g_skip_Lod_Materials                    = chk_skip_Lod_Materials.state
  331.                             ::g_Dont_Load_Skeleton                = chk_Dont_Load_Skeleton.state
  332.                             ::g_dirpath                                     = getINISetting ::g_iniFile "paths" "g_dirpath"
  333.                             
  334.                             local skeleton_xml_path = ""                    
  335.                             
  336.                             --////////////////////////// Set SkeletonList.xml and also attempt to read it into an array ///////////////////////////
  337.                             if pathConfig.isLegalPath ::g_dirpath then
  338.                             (
  339.                                 local skeleton_xml_path         = pathConfig.appendPath     ::g_dirpath         ::g_SkeletonList_xml_NAME                        
  340.                                 
  341.                                 if skeleton_xml_path != undefined then
  342.                                 (
  343.                                     format "Will try to find and read: %\n" skeleton_xml_path
  344.                                     
  345.                                     if doesfileexist skeleton_xml_path then
  346.                                     (
  347.                                         setINISetting     ::g_iniFile     "paths" "SkeletonList"     skeleton_xml_path                    
  348.                                         
  349.                                         inst_xmlB_PROCESSOR = xmlB_PROCESSOR()
  350.                                         --XML
  351.                                         if (stricmp (getFilenameType skeleton_xml_path) ".xml") == 0 then
  352.                                         (
  353.                                             if Binary_XML_check skeleton_xml_path then
  354.                                             (
  355.                                                 global g_inst_stored_SkeletonList_XML    = stored_SkeletonList_XML ()    
  356.                                                 format "Attempting to read: %\n" (getFilenameType skeleton_xml_path)
  357.                                                 inst_xmlB_PROCESSOR.cry_general_xmlB_ReaderV \
  358.                                                                                                                     xmlBFile:                    skeleton_xml_path \
  359.                                                                                                                     inst_s_OPTIONS:        inst_s_OPTIONS \
  360.                                                                                                                     type:                        ".xml"
  361.                                                 
  362.                                                 skeleton_xml_path = ""
  363.                                                 ::cryImport.lbl_skeletonList_Loaded.text = "Skeleton List has been loaded"
  364.                                             )
  365.                                             else
  366.                                             (
  367.                                                 format "This is not a valid xmlB file, aborting!: %\n" skeleton_xml_path
  368.                                                 ::cryImport.lbl_skeletonList_Loaded.text = "Could not locate the Skeleton List"
  369.                                             )
  370.                                         )
  371.                                         else
  372.                                         (
  373.                                             format "The suffix of the SkeletonList is not .xml: %\n" skeleton_xml_path
  374.                                             ::cryImport.lbl_skeletonList_Loaded.text = "Could not locate the Skeleton List"
  375.                                         )
  376.                                     )
  377.                                     else
  378.                                     (
  379.                                         format "Cannot find: %\n" skeleton_xml_path
  380.                                         ::cryImport.lbl_skeletonList_Loaded.text = "Could not locate the Skeleton List"
  381.                                     )
  382.                                 )
  383.                                 else
  384.                                 (
  385.                                     format "Could not find: %\n" skeleton_xml_path
  386.                                     ::cryImport.lbl_skeletonList_Loaded.text = "Could not locate the Skeleton List"
  387.                                 )            
  388.                             )
  389.                             --///////////////////////////////////////////////////////////////////////////////////////////////////////////////////        
  390.                             
  391.                             format "g_skip_Lod_Materials: %\n"                             ::g_skip_Lod_Materials
  392.                             format "\nGame selected: --------- % ---------\n"         ::g_CryGame_dropDown_selection
  393.                             format "Skeleton List Path: %\n"                                 (pathConfig.appendPath ::g_dirpath ::g_SkeletonList_xml_NAME)
  394.                             format "g_Dont_Load_Skeleton: %\n"                             ::g_Dont_Load_Skeleton
  395.                             format "======= GameSDK path: % =======\n"             ::g_dirpath
  396.                         )
  397.                         on cryImport close do
  398.                         (
  399.                             if (setdir #scripts ::scriptsDefault) then
  400.                             (
  401.                                 format "Current Scripts Dir set to #scripts: %\n" (getdir #scripts)
  402.                             )
  403.                             else
  404.                             (
  405.                                 format "Current #scripts dir: %\n" (getdir #scripts)
  406.                             )
  407.                         )
  408.                         on cryImport rolledUp state do
  409.                         (
  410.                             if NOT state then
  411.                             (
  412.                                  --closed
  413.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]-cryImport.height]
  414.                             )
  415.                             else
  416.                             (
  417.                                  --open
  418.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]+cryImport.height]
  419.                             )
  420.                         )                        
  421.                         on btn_delete_ini pressed do
  422.                         (
  423.                             if (queryBox "This will delete your settings, are you sure you want to continue?") then
  424.                             (
  425.                                 if (deleteFile ::g_iniFile) then
  426.                                 (
  427.                                     format "% deleted!\n" ::g_iniFile
  428.                                 )
  429.                                 else
  430.                                 (
  431.                                     format "Could not delete % \n" ::g_iniFile
  432.                                 )
  433.                             )
  434.                         )
  435.                         on btn_gameDir pressed do
  436.                         (
  437.                             startDir = undefined
  438.                         
  439.                             g_dirpath             = getINISetting ::g_iniFile "paths" "g_dirpath"
  440.                         
  441.                             if pathConfig.isLegalPath g_dirpath then
  442.                             (
  443.                                 startDir = g_dirpath
  444.                                 ::g_dirpath         = getSavePath caption:"Choose Game directory" initialDir:startDir
  445.                             )
  446.                             else
  447.                             (
  448.                                 ::g_dirpath         = getSavePath caption:"Choose Game directory"
  449.                             )
  450.                             
  451.                             --Reread Skeleton List
  452.                             if ::g_dirpath != undefined then
  453.                             (
  454.                                 if pathConfig.isLegalPath g_dirpath  then
  455.                                 (
  456.                                     setINISetting ::g_iniFile "paths" "g_dirpath" ::g_dirpath                                    
  457.                                     local skeleton_xml_path         = pathConfig.appendPath     ::g_dirpath         ::g_SkeletonList_xml_NAME                        
  458.                                     
  459.                                     if skeleton_xml_path != undefined then
  460.                                     (
  461.                                         format "Will try to find and read: %\n" skeleton_xml_path
  462.                                         
  463.                                         if doesfileexist skeleton_xml_path then
  464.                                         (
  465.                                             setINISetting     ::g_iniFile     "paths" "SkeletonList"     skeleton_xml_path                    
  466.                                             
  467.                                             inst_xmlB_PROCESSOR = xmlB_PROCESSOR()
  468.                                             --XML
  469.                                             if (stricmp (getFilenameType skeleton_xml_path) ".xml") == 0 then
  470.                                             (
  471.                                                 if Binary_XML_check skeleton_xml_path then
  472.                                                 (
  473.                                                     ::g_inst_stored_SkeletonList_XML    = stored_SkeletonList_XML ()    
  474.                                                     format "Attempting to read: %\n" (getFilenameType skeleton_xml_path)
  475.                                                     inst_xmlB_PROCESSOR.cry_general_xmlB_ReaderV \
  476.                                                                                                                         xmlBFile:                    skeleton_xml_path \
  477.                                                                                                                         inst_s_OPTIONS:        inst_s_OPTIONS \
  478.                                                                                                                         type:                        ".xml"
  479.                                                     
  480.                                                     skeleton_xml_path = ""
  481.                                                     ::cryImport.lbl_skeletonList_Loaded.text = "Skeleton List has been loaded"
  482.                                                 )    
  483.                                             )            
  484.                                         )
  485.                                     )
  486.                                 )
  487.                             )
  488.                             
  489.                         )
  490.                         on btn_Set_SkeletonListXML pressed do
  491.                         (
  492.                             startDir = undefined
  493.                             ::g_dirpath = getINISetting ::g_iniFile "paths" "g_dirpath"
  494.                         
  495.                             if pathConfig.isLegalPath ::g_dirpath then
  496.                             (
  497.                                 startDir = ::g_dirpath
  498.                                 
  499.                                 SkeletonList_xml_PATH = getOpenFileName \
  500.                                 caption:"cgf/chr/cgfm Model File" \
  501.                                 types:"CryTek Model File (*.xml)|*.xml" historyCategory:"CryTek ObjectPresets" initialDir:startDir
  502.                                 
  503.                                 if SkeletonList_xml_PATH != undefined then
  504.                                 (
  505.                                     if doesfileexist SkeletonList_xml_PATH then
  506.                                     (
  507.                                         setINISetting     ::g_iniFile     "paths" "SkeletonList"     SkeletonList_xml_PATH                        
  508.                                         ::g_SkeletonList_xml_NAME = filenameFromPath SkeletonList_xml_PATH
  509.                                     )
  510.                                 )
  511.                             )
  512.                             else
  513.                             (
  514.                                 ::g_dirpath = getSavePath caption:"Choose Game directory"
  515.                                 
  516.                                 if ::g_dirpath != undefined AND pathConfig.isLegalPath g_dirpath then
  517.                                 (
  518.                                     setINISetting ::g_iniFile "paths" "g_dirpath" ::g_dirpath
  519.                                     
  520.                                     startDir = ::g_dirpath
  521.                                     
  522.                                     SkeletonList_xml_PATH = getOpenFileName \
  523.                                     caption:"cgf/chr/cgfm Model File" \
  524.                                     types:"CryTek Model File (*.xml)|*.xml" historyCategory:"CryTek ObjectPresets" initialDir:startDir
  525.                                     
  526.                                     if SkeletonList_xml_PATH != undefined then
  527.                                     (
  528.                                         if doesfileexist SkeletonList_xml_PATH then
  529.                                         (
  530.                                             setINISetting     ::g_iniFile     "paths" "SkeletonList"     SkeletonList_xml_PATH                        
  531.                                             ::g_SkeletonList_xml_NAME = filenameFromPath SkeletonList_xml_PATH
  532.                                         )                    
  533.                                     )
  534.                                 )
  535.                             )
  536.                         )
  537.                         on btn_import pressed do
  538.                         (        
  539.                             g_dirpath = getINISetting ::g_iniFile "paths" "g_dirpath"
  540.                             
  541.                             if NOT (doesfileexist g_dirpath) then
  542.                             (
  543.                                 confirm = yesNoCancelBox "You must choose a root game directory, do you want to do it now?" \
  544.                                                                     title:"WARNING" \
  545.                                                                     beep:true        
  546.                                 if confirm == #yes then
  547.                                 (
  548.                                     g_dirpath = getSavePath caption:"Choose Game directory"
  549.                                     
  550.                                     if g_dirpath != undefined AND pathConfig.isLegalPath g_dirpath then
  551.                                     (
  552.                                         setINISetting ::g_iniFile "paths" "g_dirpath" ::g_dirpath
  553.                                     )
  554.                                 )
  555.                             )                    
  556.                             else
  557.                             (
  558.                                 g_cryFile = getOpenFileName \
  559.                                 caption:"cgf/chr/cgfm Model File" \
  560.                                 types:"CryTek Model File (*.cgf)|*.cgf|(*.cgfm)|*.cgfm|(*.chr)|*.chr|(*.cdf)|*.cdf| \
  561.                                 (*.skin)|*.skin|(*.skinm)|*.skinm|(*.chrm)|*.chrm|(*.caf)|*.caf|(*.img)|*.img|All (*.*)|*.*" \
  562.                                 historyCategory:"CryTek ObjectPresets"
  563.                                 
  564.                                 if g_cryFile != undefined then
  565.                                 (
  566.                                     if doesfileexist g_cryFile then
  567.                                     (
  568.                                         if ((getFilenameType g_cryFile) == ".cgf") OR ((getFilenameType g_cryFile) == ".cgfm") then
  569.                                         (
  570.                                             if  NOT (Binary_CryTek_check File:g_cryFile) then --if the xml file is not Crytek Binary XML
  571.                                             (
  572.                                                 format "This is not a valid CryTek file, aborting!\n"
  573.                                             )
  574.                                             else
  575.                                             (
  576.                                                 setINISetting     ::g_iniFile     "boneinfo" "has_bones"     "0"                    
  577.                                                 cryFile_loader g_cryFile:g_cryFile
  578.                                             )                    
  579.                                         )
  580.                                         else if ((getFilenameType g_cryFile) == ".skin") OR ((getFilenameType g_cryFile) == ".skinm") then
  581.                                         (
  582.                                             if  NOT (Binary_CryTek_check File:g_cryFile) then --if the xml file is not Crytek Binary XML
  583.                                             (
  584.                                                 format "This is not a valid CryTek file, aborting!\n"
  585.                                             )
  586.                                             else
  587.                                             (
  588.                                                 cryFile_loader g_cryFile:g_cryFile
  589.                                             )                            
  590.                                         )
  591.                                         else if ((getFilenameType g_cryFile) == ".chr") OR ((getFilenameType g_cryFile) == ".chrm") then
  592.                                         (
  593.                                             if  NOT (Binary_CryTek_check File:g_cryFile) then --if the xml file is not Crytek Binary XML
  594.                                             (
  595.                                                 format "This is not a valid CryTek file, aborting!\n"
  596.                                             )
  597.                                             else
  598.                                             (
  599.                                                 cryFile_loader g_cryFile:g_cryFile
  600.                                             )
  601.                                         )
  602.                                         else if ((getFilenameType g_cryFile) == ".caf") then
  603.                                         (
  604.                                             if  NOT (Binary_CryTek_check File:g_cryFile) then --if the xml file is not Crytek Binary XML
  605.                                             (
  606.                                                 format "This is not a valid CryTek file, aborting!\n"
  607.                                             )
  608.                                             else
  609.                                             (
  610.                                                 cryFile_loader \
  611.                                                                     g_cryFile:    g_cryFile \
  612.                                                                     caller:        (getFilenameType g_cryFile)
  613.                                             )
  614.                                         )
  615.                                         else if ((getFilenameType g_cryFile) == ".img") then
  616.                                         (
  617.                                             if  NOT (Binary_CryTek_check File:g_cryFile) then --if the xml file is not Crytek Binary XML
  618.                                             (
  619.                                                 format "This is not a valid CryTek file, aborting!\n"
  620.                                             )
  621.                                             else
  622.                                             (
  623.                                                 cryFile_loader \
  624.                                                                     g_cryFile:    g_cryFile \
  625.                                                                     caller:        (getFilenameType g_cryFile)
  626.                                             )
  627.                                         )
  628.                                         else if (getFilenameType g_cryFile) == ".cdf" then
  629.                                         (
  630.                                             if  NOT (Binary_XML_check g_cryFile) then --if the xml file is not Crytek Binary XML
  631.                                             (
  632.                                                 format "This is not a valid CryXmlB file, aborting!\n"
  633.                                             )
  634.                                             else
  635.                                             (
  636.                                                 cryxmlB_loader()
  637.                                             )                
  638.                                         )
  639.                                     )
  640.                                 )
  641.                             )
  642.                         )
  643.                         on btn_view_ini pressed do
  644.                         (
  645.                             try
  646.                             (
  647.                                 ShellLaunch "notepad.exe" ::g_iniFile
  648.                             )
  649.                             catch()
  650.                         )
  651.                         on btn_Load_CDF pressed do
  652.                         (        
  653.                             g_dirpath = getINISetting ::g_iniFile "paths" "g_dirpath"
  654.                             
  655.                             if NOT (doesfileexist g_dirpath) then
  656.                             (
  657.                                 confirm = yesNoCancelBox "You must choose a root game directory, do you want to do it now?" \
  658.                                                                     title:"WARNING" \
  659.                                                                     beep:true        
  660.                                 if confirm == #yes then
  661.                                 (
  662.                                     ::g_dirpath = getSavePath caption:"Choose Game directory"
  663.                                 )
  664.                             )                    
  665.                             else
  666.                             (
  667.                                 g_cryFile = getOpenFileName \
  668.                                 caption:"cgf/chr/cgfm Model File" \
  669.                                 types:"CryTek Character Definition File (*.cdf)|*.cdf|(*.chrparams)|*.chrparams|(*.xml)|*.xml|All (*.*)|*.*" \
  670.                                 historyCategory:"CryTek ObjectPresets"
  671.                                 
  672.                                 if g_cryFile != undefined then
  673.                                 (            
  674.                                     if doesfileexist g_cryFile then
  675.                                     (
  676.                                         if (stricmp (getFilenameType g_cryFile) ".cdf" ) == 0 OR \
  677.                                             (stricmp (getFilenameType g_cryFile) ".chrparams" ) == 0 then
  678.                                         (
  679.                                             if  (Binary_XML_custom_check file:g_cryFile type:"CryXmlB") then --if the xml file is not Crytek Binary XML                
  680.                                             (
  681.                                                 cryFile_CDF_loader g_cryFile:g_cryFile                                                
  682.                                             )
  683.                                             else
  684.                                             (
  685.                                                 format "This is not a valid CryXmlB file, aborting!\n"
  686.                                             )
  687.                                         )
  688.                                         else
  689.                                         (
  690.                                             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"
  691.                                         )
  692.                                     )
  693.                                 )
  694.                             )
  695.                         )
  696.                         on chk_Dont_Load_Skeleton changed arg do
  697.                         (
  698.                             ::g_Dont_Load_Skeleton = chk_Dont_Load_Skeleton.state
  699.                             
  700.                             format "% g_Dont_Load_Skeleton\n"             ::g_Dont_Load_Skeleton
  701.                         )
  702.                         on chk_Skip_LOD_Materials changed arg do
  703.                         (
  704.                             ::g_skip_Lod_Materials = chk_Skip_LOD_Materials.state
  705.                             
  706.                             format "% g_skip_Lod_Materials\n"             ::g_skip_Lod_Materials
  707.                         )
  708.                         on btn_xmlB_Reader pressed do
  709.                         (
  710.                             g_dirpath = getINISetting ::g_iniFile "paths" "g_dirpath"
  711.                             
  712.                             if NOT (doesfileexist g_dirpath) then
  713.                             (
  714.                                 confirm = yesNoCancelBox "You must choose a root game directory, do you want to do it now?" \
  715.                                                                     title:"WARNING" \
  716.                                                                     beep:true
  717.                             
  718.                                 if confirm == #yes then
  719.                                 (
  720.                                     ::g_dirpath = getSavePath caption:"Choose Game directory"
  721.                                 )
  722.                             )
  723.                             
  724.                             g_cryFile = getOpenFileName \
  725.                             caption:"cgf/chr/cgfm Model File" \
  726.                             types:"CryTek MTL (*.mtl)|*.mtl|(*.xml)|*.xml|(*.cdf)|*.cdf|(*.chrparams)|*.chrparams| \
  727.                             All (*.*)|*.*" \
  728.                             historyCategory:"CryTek ObjectPresets"
  729.                             
  730.                             if ::g_cryFile != undefined AND doesfileexist g_cryFile then
  731.                             (
  732.                                 setINISetting ::g_iniFile "paths" "last_loaded" g_cryFile
  733.                                 cryxmlB_loader()
  734.                             )
  735.                         )
  736.                         on btn_CAF_reader pressed do
  737.                         (
  738.                             --Not implemented yet
  739.                         )
  740.                         on ddl_CryGame selected arg do
  741.                         (
  742.                             ::g_CryGame_dropDown_selection = ddl_CryGame.items[arg]
  743.                             format "% selected\n" ::g_CryGame_dropDown_selection
  744.                         )
  745.                     )
  746.                     
  747.                     rollout rollout_options "Material Options" width:290 height:100 category:1
  748.                     (
  749.                         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
  750.                         GroupBox 'grp_Options' "Texture Rename" pos:[9,60] width:264 height:55 align:#left
  751.                         checkbox 'chk_dds' "Rename .tif* to .dds" pos:[17,79] width:114 height:21 enabled:true checked:true align:#left
  752.                         checkbox 'chk_UVW_Flip_V' "UVW - Flip V" pos:[15,31] width:107 height:16 checked:true align:#left
  753.                         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
  754.                         
  755.                         on rollout_options open do
  756.                         (    
  757.                             if (setdir #scripts ::scriptsDefault) then
  758.                             (
  759.                                 format "Current Scripts Dir set to #scripts: %\n" (getdir #scripts)
  760.                             )
  761.                             else
  762.                             (
  763.                                 format "Current #scripts dir: %\n" (getdir #scripts)
  764.                             )
  765.                             
  766.                             ::g_dds                         = chk_dds.state
  767.                             ::g_Physical_Material    = chk_Physical_Material.state
  768.                             ::g_UVW_Flip_V            = chk_UVW_Flip_V.state
  769.                             
  770.                             format "\n-----Material Options: -----\n"
  771.                             format "g_dds % \n"                                         ::g_dds
  772.                             format "g_Physical_Material % \n"                         ::g_Physical_Material
  773.                             format "chk_UVW_Flip_V % \n"                             ::g_UVW_Flip_V
  774.                             
  775.                             if ::g_Physical_Material then
  776.                             (
  777.                                 spn_Spec_Map_Amount.enabled = true
  778.                             )
  779.                             else
  780.                             (
  781.                                 spn_Spec_Map_Amount.enabled = false
  782.                             )
  783.                             ::inst_PHYS_MAT_ADJUST.spec_output_amount = spn_Spec_Map_Amount.value
  784.                         )
  785.                         on rollout_options close do
  786.                         (
  787.                             if (setdir #scripts ::scriptsDefault) then
  788.                             (
  789.                                 format "Current Scripts Dir set to #scripts: %\n" (getdir #scripts)
  790.                             )
  791.                             else
  792.                             (
  793.                                 format "Current #scripts dir: %\n" (getdir #scripts)
  794.                             )
  795.                         )
  796.                         on rollout_options rolledUp state do
  797.                         (
  798.                             if NOT state then
  799.                             (
  800.                                  --closed
  801.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]-rollout_options.height]
  802.                             )
  803.                             else
  804.                             (
  805.                                  --open
  806.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]+rollout_options.height]
  807.                             )
  808.                         )
  809.                         on chk_Physical_Material changed arg do
  810.                         (
  811.                             ::g_Physical_Material                                         = chk_Physical_Material.state        
  812.                             format "Physical Material: %\n"                             ::g_Physical_Material 
  813.                             
  814.                             if ::g_Physical_Material then
  815.                             (
  816.                                 spn_Spec_Map_Amount.enabled = true
  817.                             )
  818.                             else
  819.                             (
  820.                                 spn_Spec_Map_Amount.enabled = false
  821.                             )
  822.                             ::inst_PHYS_MAT_ADJUST.spec_output_amount = spn_Spec_Map_Amount.value
  823.                         )
  824.                         on spn_Spec_Map_Amount changed arg do
  825.                         (
  826.                             ::inst_PHYS_MAT_ADJUST.spec_output_amount = spn_Spec_Map_Amount.value
  827.                         )
  828.                         on chk_dds changed arg do
  829.                         (
  830.                             ::g_dds                                                             = chk_dds.state        
  831.                             format "Treat .tiff as .dds: %\n"                         ::g_dds
  832.                         )
  833.                         on chk_UVW_Flip_V changed arg do
  834.                         (
  835.                             ::g_UVW_Flip_V                                                 = chk_UVW_Flip_V.state        
  836.                             format "chk_UVW_Flip_V % \n"                             ::g_UVW_Flip_V
  837.                         )
  838.                     )
  839.  
  840.                     rollout rollout_Report "Report" width:290 height:150 category:9
  841.                     (
  842.                         checkbox 'chk_Mesh_Report' "Mesh Report" pos:[17,11] width:80 height:20 align:#left
  843.                         checkbox 'chk_xmlB_Report' "xmlB Report" pos:[17,31] width:78 height:20 checked:false align:#left
  844.                         checkbox 'chk_xmlB_Report_v2' "xmlB Report v2" pos:[17,50] width:110 height:20 checked:true align:#left
  845.                         checkbox 'chk_xmlB_Debug_Report' "xmlB Debug Report" pos:[17,69] width:113 height:20 align:#left
  846.                         checkbox 'chk_Build_Material_Report' "Build Material Report" pos:[17,89] width:122 height:18 enabled:true checked:false align:#left                        
  847.                         checkbox 'chk_Read_Comp_cryBones_Report' "Read Compiled Crybones Report" pos:[17,107] width:175 height:20 align:#left
  848.                         checkbox 'chk_Create_Bones_Report' "Create Bones Report" pos:[17,127] width:175 height:20 checked:false align:#left    
  849.                         checkbox 'chk_CDF_Report' "CDF Report" pos:[17,147] width:175 height:20 checked:false align:#left
  850.                         checkbox 'chk_Anim_Report' "Animation Report" pos:[17,167] width:175 height:20 checked:false align:#left
  851.                         checkbox 'chk_Heuristic_Report' "Heuristic Report" pos:[17,187] width:175 height:20 checked:false align:#left
  852.                         
  853.                         on rollout_Report open do
  854.                         (    
  855.                             if (setdir #scripts ::scriptsDefault) then
  856.                             (
  857.                                 format "Current Scripts Dir set to #scripts: %\n" (getdir #scripts)
  858.                             )
  859.                             else
  860.                             (
  861.                                 format "Current #scripts dir: %\n" (getdir #scripts)
  862.                             )
  863.                             
  864.                             ::g_xmlB_Report_v2                             = chk_xmlB_Report_v2.state        
  865.                             ::g_xmlB_Debug_Report                     = chk_xmlB_Debug_Report.state
  866.                             ::g_Build_Material_Report                     = chk_Build_Material_Report.state
  867.                             ::g_xmlB_Report                                 = chk_xmlB_Report.state
  868.                             ::g_Mesh_Report                                 = chk_Mesh_Report.state
  869.                             ::g_Read_Comp_cryBones_Report         = chk_Read_Comp_cryBones_Report.state
  870.                             ::g_Read_Create_Bones_Report             = chk_Create_Bones_Report.state
  871.                             ::g_CDF_Report                                 = chk_CDF_Report.state            
  872.                             
  873.                             format "\n-----Report Options: -----\n"        
  874.                             format "g_xmlB_Report_v2 % \n"                         ::g_xmlB_Report_v2
  875.                             format "g_xmlB_Debug_Report % \n"                     ::g_xmlB_Debug_Report
  876.                             format "g_Build_Material_Report % \n"                     ::g_Build_Material_Report
  877.                             format "g_xmlB_Report % \n"                                 ::g_xmlB_Report
  878.                             format "g_Mesh_Report % \n"                             ::g_Mesh_Report
  879.                             format "g_Read_Comp_cryBones_Report % \n"         ::g_Read_Comp_cryBones_Report
  880.                             format "g_Read_Create_Bones_Report % \n"         ::g_Read_Create_Bones_Report
  881.                             format "g_CDF_Report % \n"                                 ::g_CDF_Report
  882.                             
  883.                             format "chk_Anim_Report % \n"                             chk_Anim_Report.state
  884.                             format "chk_Anim_Report % \n"                             chk_Heuristic_Report.state
  885.                             
  886.                         )
  887.                         on rollout_Report close do
  888.                         (
  889.                             if (setdir #scripts ::scriptsDefault) then
  890.                             (
  891.                                 format "Current Scripts Dir set to #scripts: %\n" (getdir #scripts)
  892.                             )
  893.                             else
  894.                             (
  895.                                 format "Current #scripts dir: %\n" (getdir #scripts)
  896.                             )
  897.                         )
  898.                         on rollout_Report rolledUp state do
  899.                         (
  900.                             if NOT state then
  901.                             (
  902.                                  --closed
  903.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]-rollout_Report.height]
  904.                             )
  905.                             else
  906.                             (
  907.                                  --open
  908.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]+rollout_Report.height]
  909.                             )
  910.                         )
  911.                         on chk_xmlB_Report_v2 changed arg do
  912.                         (
  913.                             ::g_xmlB_Report_v2 = chk_xmlB_Report_v2.state        
  914.                             format "chk_xmlB_Report_v2: %\n" ::g_xmlB_Report_v2
  915.                         )
  916.                         on chk_xmlB_Debug_Report changed arg do
  917.                         (
  918.                             ::g_xmlB_Debug_Report = chk_xmlB_Debug_Report.state        
  919.                             format "chk_xmlB_Debug_Report: %\n" ::g_xmlB_Debug_Report
  920.                         )
  921.                         on chk_Build_Material_Report changed arg do
  922.                         (
  923.                             ::g_Build_Material_Report = chk_Build_Material_Report.state        
  924.                             format "chk_Build_Material_Report: %\n" ::g_Build_Material_Report
  925.                         )
  926.                         on chk_xmlB_Report changed arg do
  927.                         (
  928.                             ::g_xmlB_Report = chk_xmlB_Report.state        
  929.                             format "chk_xmlB_Report: %\n" ::g_xmlB_Report
  930.                         )
  931.                         on chk_Mesh_Report changed arg do
  932.                         (
  933.                             ::g_Mesh_Report = chk_Mesh_Report.state        
  934.                             format "chk_Mesh_Report: %\n" ::g_Mesh_Report
  935.                         )
  936.                         on chk_Read_Comp_cryBones_Report changed arg do
  937.                         (
  938.                             ::g_chk_Comp_cryBones_Report = chk_Read_Comp_cryBones_Report.state        
  939.                             format "chk_Read_Comp_cryBones_Report: %\n" ::g_chk_Comp_cryBones_Report
  940.                         )
  941.                         on chk_Create_Bones_Report changed arg do
  942.                         (
  943.                             ::g_Create_Bones_Report = chk_Create_Bones_Report.state        
  944.                             format "chk_Create_Bones_Report: %\n" ::g_Create_Bones_Report
  945.                         )
  946.                         on chk_CDF_Report changed arg do
  947.                         (
  948.                             ::g_Create_Bones_Report = chk_Create_Bones_Report.state        
  949.                             format "chk_Create_Bones_Report: %\n" ::g_Create_Bones_Report
  950.                         )
  951.                         on chk_CDF_Report changed arg do
  952.                         (
  953.                             ::g_CDF_Report = chk_CDF_Report.state        
  954.                             format "chk_Create_Bones_Report: %\n" ::g_CDF_Report
  955.                         )
  956.                         on chk_Anim_Report changed arg do
  957.                         (                        
  958.                             format "chk_Anim_Report: %\n" arg
  959.                         )
  960.                         on chk_Heuristic_Report changed arg do
  961.                         (                        
  962.                             format "chk_Heuristic_Report: %\n" arg
  963.                         )
  964.                         
  965.                     )
  966.  
  967.                     rollout rollout_animation "Animation" width:290 height:95 category:4
  968.                     (
  969.                         checkbox 'chk_Use_Skin_Wrap' "Use Skin_Wrap" pos:[16,17] width:255 height:21 align:#left enabled:false    
  970.                         
  971.                         on rollout_animation open do
  972.                         (
  973.                             if (setdir #scripts ::scriptsDefault) then
  974.                             (
  975.                                 format "Current Scripts Dir set to #scripts: %\n" (getdir #scripts)
  976.                             )
  977.                             else
  978.                             (
  979.                                 format "Current #scripts dir: %\n" (getdir #scripts)
  980.                             )
  981.                         )
  982.                         on rollout_animation close do
  983.                         (
  984.                             if (setdir #scripts ::scriptsDefault) then
  985.                             (
  986.                                 format "Current Scripts Dir set to #scripts: %\n" (getdir #scripts)
  987.                             )
  988.                             else
  989.                             (
  990.                                 format "Current #scripts dir: %\n" (getdir #scripts)
  991.                             )
  992.                         )
  993.                         on chk_Use_Skin_Wrap changed arg do
  994.                         (
  995.                             ::g_Use_Skin_Wrap = chk_Use_Skin_Wrap.state        
  996.                             format "chk_Use_Skin_Wrap: %\n" ::g_Use_Skin_Wrap
  997.                         )
  998.                         on rollout_animation rolledUp state do
  999.                         (
  1000.                             if NOT state then
  1001.                             (
  1002.                                  --closed
  1003.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]-rollout_animation.height]
  1004.                             )
  1005.                             else
  1006.                             (
  1007.                                  --open
  1008.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]+rollout_animation.height]
  1009.                             )
  1010.                         )
  1011.                     )
  1012.  
  1013.                     rollout rollout_About "About" width:290 height:50 category:10
  1014.                     (
  1015.                         label 'lbl_About' "joqqyhez@gmail.com  2016" pos:[14,13] width:263 height:19 align:#left
  1016.                         label 'lbl_trademark' "CRYENGINE is a Trademark of Crytek GmbH" pos:[13,35] width:266 height:20 align:#left                        
  1017.                         
  1018.                         on rollout_About open do
  1019.                         (
  1020.                             if (setdir #scripts ::scriptsDefault) then
  1021.                             (
  1022.                                 format "Current Scripts Dir set to #scripts: %\n" (getdir #scripts)
  1023.                             )
  1024.                             else
  1025.                             (
  1026.                                 format "Current #scripts dir: %\n" (getdir #scripts)
  1027.                             )
  1028.                         )    
  1029.                         on rollout_About close do
  1030.                         (
  1031.                             if (setdir #scripts ::scriptsDefault) then
  1032.                             (
  1033.                                 format "Current Scripts Dir set to #scripts: %\n" (getdir #scripts)
  1034.                             )
  1035.                             else
  1036.                             (
  1037.                                 format "Current #scripts dir: %\n" (getdir #scripts)
  1038.                             )
  1039.                         )                        
  1040.                         on rollout_About rolledUp state do
  1041.                         (                            
  1042.                             if NOT state then
  1043.                             (
  1044.                                  --closed
  1045.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]-rollout_About.height]
  1046.                             )
  1047.                             else
  1048.                             (
  1049.                                  --open
  1050.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]+rollout_About.height]
  1051.                             )
  1052.                         )
  1053.                     )
  1054.  
  1055.                     rollout rollout_Alert "Alert" width:290 height:85 category:8
  1056.                     (
  1057.                         listBox 'lbx_Message_Alert' "Message Alert" pos:[12,20] width:267 height:7 align:#left                        
  1058.                         
  1059.                         on rollout_Alert open do
  1060.                         (
  1061.                             if (setdir #scripts ::scriptsDefault) then
  1062.                             (
  1063.                                 format "Current Scripts Dir set to #scripts: %\n" (getdir #scripts)
  1064.                             )
  1065.                             else
  1066.                             (
  1067.                                 format "Current #scripts dir: %\n" (getdir #scripts)
  1068.                             )
  1069.                         )    
  1070.                         on rollout_Alert close do
  1071.                         (
  1072.                             if (setdir #scripts ::scriptsDefault) then
  1073.                             (
  1074.                                 format "Current Scripts Dir set to #scripts: %\n" (getdir #scripts)
  1075.                             )
  1076.                             else
  1077.                             (
  1078.                                 format "Current #scripts dir: %\n" (getdir #scripts)
  1079.                             )
  1080.                         )    
  1081.                         on rollout_Alert rolledUp state do
  1082.                         (
  1083.                             if NOT state then
  1084.                             (
  1085.                                  --closed
  1086.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]-rollout_Alert.height]
  1087.                             )
  1088.                             else
  1089.                             (
  1090.                                  --open
  1091.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]+rollout_Alert.height]
  1092.                             )
  1093.                         )
  1094.                     )
  1095.                     
  1096.                     rollout rollout_AnimationTracks "Animation Tracks" width:100 height:20 category:5
  1097.                     (
  1098.                         dropdownList 'ddl_Animation_Tracks' "Animation Tracks" pos:[8,20] width:265 height:30 items:#() align:#left
  1099.                         
  1100.                         on rollout_AnimationTracks open do
  1101.                         (
  1102.                             if (setdir #scripts ::scriptsDefault) then
  1103.                             (
  1104.                                 format "Current Scripts Dir set to #scripts: %\n" (getdir #scripts)
  1105.                             )
  1106.                             else
  1107.                             (
  1108.                                 format "Current #scripts dir: %\n" (getdir #scripts)
  1109.                             )
  1110.                         )
  1111.                         on rollout_AnimationTracks close do
  1112.                         (
  1113.                             if (setdir #scripts ::scriptsDefault) then
  1114.                             (
  1115.                                 format "Current Scripts Dir set to #scripts: %\n" (getdir #scripts)
  1116.                             )
  1117.                             else
  1118.                             (
  1119.                                 format "Current #scripts dir: %\n" (getdir #scripts)
  1120.                             )
  1121.                         )    
  1122.                         on rollout_AnimationTracks rolledUp state do
  1123.                         (
  1124.                             if NOT state then
  1125.                             (
  1126.                                  --closed
  1127.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]-rollout_AnimationTracks.height]
  1128.                             )
  1129.                             else
  1130.                             (
  1131.                                  --open
  1132.                                 CRYOP.size = [CRYOP.size[1], CRYOP.size[2]+rollout_AnimationTracks.height]
  1133.                             )
  1134.                         )
  1135.                     )
  1136.  
  1137.                     --/////////////////////////////// Instanciate the rollouts ///////////////////////////////
  1138.                     CRYOP = newRolloutFloater "CryEngine Importer v 1.0" 290 585
  1139.  
  1140.                     addRollout             ::rollout_options         ::CRYOP  rolledUp:true
  1141.                     addRollout             ::rollout_Report         ::CRYOP rolledUp:true
  1142.                     addRollout             ::cryImport             ::CRYOP rolledUp:false
  1143.                     addRollout             ::rollout_animation     ::CRYOP rolledUp:true
  1144.                     -- addRollout             ::rollout_Alert             ::CRYOP rolledUp:false --set runtime instead inside CryMat_XML_.ms
  1145.                     addRollout             ::rollout_About         ::CRYOP rolledUp:true
  1146.  
  1147.                     CreateDialog         ::cryImport     rolledUp:false width:120 height:200        
  1148.                     --//////////////////////////////////////////////////////////////////////////////////////
  1149.                 )
  1150.                 else
  1151.                 (
  1152.                     MessageBox "Cannot find or load the include files, cannot continue, aborting!" title:"Startup Error" beep:false
  1153.                 )
  1154.             )
  1155.             else
  1156.             (
  1157.                 format "Could not set the #scripts path - include files will not load - aborting!\n"
  1158.             )    
  1159.         )
  1160.         catch
  1161.         (
  1162.             format "\n\n\n\n*** *** *** *** *** ***  Could not load include files ***  *** *** *** *** *** ***\n"
  1163.             format "%" (getCurrentException())
  1164.             format "\n*** *** *** *** *** *** END OF Could not load include files *** *** *** *** *** *** ***\n\n\n\n"
  1165.         )
  1166.     )
  1167.     else
  1168.     (
  1169.         MessageBox "Cannot find scriptpath, cannot continue, aborting!" title:"Startup Error" beep:false    
  1170.     )
  1171.  
  1172.     gc()
  1173. )
  1174. else
  1175. (
  1176.     MessageBox "This script requires 3DS Max 2017 or higher!" title:"Startup Error" beep:true
  1177. )