[Closed] script to export to .flt without prompt
Hello,
I am making a script that allows me to export to .flt by just clicking a button in the menu. Since I always use the same export settings, I don’t need to see the export window with all the options.
Browsing through this and other forums I came with a script to do the trick:
(snippet for the export only)
exportLocation = maxFilePath
exportFName = getFileNameFile(maxFileName)
+ "_VISUAL"
theClasses =
exporterPlugin.classes
_objIdx = findItem theClasses
OpenFltExport --RETURNS AN INTEGER AS THE ARRAY "CLASSES"
INDEX
exportFile (exportLocation + exportFName + ".flt" )
selectedOnly:True using:theClasses[_objIdx]
This works and indeed I don’t see the export window; problem is, I need to export with settings that are not the default ones for openflight export (Auto Group and Auto Object should be off, and they are on by default).
I have tried to use the .ini file to set the settings to be used during the export, but it does not work. I suspect this is not the right .ini file or I am not calling the right parameters:
(complete code as I have it so far)
theINI = objExp.getIniName()
print
theINI
setINISetting theINI "HMCfltSettings" "AutoGroup"
"OFF"
setINISetting theINI "HMCfltSettings" "AutoObject"
"OFF"
if selection.count != 0
then
(
exportLocation = maxFilePath
exportFName =
getFileNameFile(maxFileName) + "_VISUAL"
theClasses = exporterPlugin.classes
_objIdx = findItem
theClasses OpenFltExport --RETURNS AN INTEGER AS THE ARRAY "CLASSES"
INDEX
exportFile (exportLocation + exportFName + ".flt" ) selectedOnly:True using:theClasses[_objIdx]
)
else
(
print "no object
selected!"
)
)
So my question is, how do I use the .ini file in order to set the AUto Group and the Auto Object off before exporting every time?
And where do I find the file with all the possible parameters I can modify when exporting to OpenFlight?
Thank you in advance for your help!
I’ve never used the Flight Studio Exporter so I don’t know if this will work.
The FlightStudioExport interface has some methods to get/set the export options.
I assume this should work:
FlightStudioExport.SetAutoGroup false
FlightStudioExport.SetAutoObject false