Torque3D/Engine/source/T3D/assets/assetImporter_ScriptBinding.h
Areloch a3d6afc197 Corrects lookup/in-place auto import logic for ImageAssets
Fixed sizing issue for material asset ptr fields
Fixed type of comment in Particle Asset
Hooked GLSL and HLSL shader files to be proper asset loose files for PostEffectAsset
Adjusted some default values for default ImportConfig
Corrected field type of multiple fields  for the importConfig
Corrected loading of PopulateMaterialMaps config setting from config file
Corrected field types of multiple fields for AssetImportObjects
Exposed several utility fields for the Importer to script
Added ability to create an AssetImportObject in script and add it to the Importer's current session
Ensured stable naming behavior(replacing spaces, -, and . in names with _
Improved getAssetTypeByFile logical lookup so it doesn't accidentally grab cached.dts files
Added ability to hard reset an import session, wiping all inbound files for a full reset
Added ability to process DTS files to shape import so it can parse out content such as materials for associated asset imports
Added better handling for shape materials that are just colors
Added callback hook-in so if the importer doesn't have a defined function for importing a given asset type, it'll try calling down into the editor
Stabilized imageAsset processing logic when generating a material for it
Improved imageType lookup/processing logic in Importer
Improved logic for binding in associated image files to materialAssets
Improved logic for processing shapes to get related materials and images, ensuring better likelyhood of finding and associating related assets
Cleaned up validation logic
Added ability to properly look up the editor's default import config if it's set to be used for autoimport
Improved handling of originalFilePath logic, so if it's an in-place import, it doesn't bother populating the field
Set default UP axis value on shape importing to ensure better default behavior
2020-07-11 16:20:10 -05:00

154 lines
5.5 KiB
C

#pragma once
#include "console/engineAPI.h"
#include "assetImporter.h"
//Console Functions
DefineEngineMethod(AssetImportConfig, loadImportConfig, void, (Settings* configSettings, String configName), (nullAsType<Settings*>(), ""),
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
return object->loadImportConfig(configSettings, configName);
}
DefineEngineMethod(AssetImporter, setTargetPath, void, (String path), (""),
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
return object->setTargetPath(path);
}
DefineEngineMethod(AssetImporter, resetImportSession, void, (bool forceResetSession), (false),
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
return object->resetImportSession(forceResetSession);
}
DefineEngineMethod(AssetImporter, dumpActivityLog, void, (), ,
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
return object->dumpActivityLog();
}
DefineEngineMethod(AssetImporter, getActivityLogLineCount, S32, (),,
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
return object->getActivityLogLineCount();
}
DefineEngineMethod(AssetImporter, getActivityLogLine, String, (S32 i), (0),
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
return object->getActivityLogLine(0);
}
DefineEngineMethod(AssetImporter, autoImportFile, String, (String path), (""),
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
return object->autoImportFile(path);
}
DefineEngineMethod(AssetImporter, addImportingFile, AssetImportObject*, (String path), (""),
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
return object->addImportingFile(path);
}
DefineEngineMethod(AssetImporter, addImportingAssetItem, void, (AssetImportObject* assetItem, AssetImportObject* parentItem), (nullAsType< AssetImportObject*>(), nullAsType< AssetImportObject*>()),
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
return object->addImportingAssetItem(assetItem, parentItem);
}
DefineEngineMethod(AssetImporter, processImportingAssets, void, (), ,
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
return object->processImportAssets();
}
DefineEngineMethod(AssetImporter, validateImportingAssets, bool, (), ,
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
return object->validateAssets();
}
DefineEngineMethod(AssetImporter, resolveAssetItemIssues, void, (AssetImportObject* assetItem), (nullAsType< AssetImportObject*>()),
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
object->resolveAssetItemIssues(assetItem);
}
DefineEngineMethod(AssetImporter, importAssets, void, (),,
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
return object->importAssets();
}
DefineEngineMethod(AssetImporter, getAssetItemCount, S32, (),,
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
return object->getAssetItemCount();
}
DefineEngineMethod(AssetImporter, getAssetItem, AssetImportObject*, (S32 index), (0),
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
return object->getAssetItem(index);
}
DefineEngineMethod(AssetImporter, getAssetItemChildCount, S32, (AssetImportObject* assetItem), (nullAsType< AssetImportObject*>()),
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
if (assetItem == nullptr)
return 0;
return object->getAssetItemChildCount(assetItem);
}
DefineEngineMethod(AssetImporter, getAssetItemChild, AssetImportObject*, (AssetImportObject* assetItem, S32 index), (nullAsType< AssetImportObject*>(), 0),
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
if (assetItem == nullptr)
return nullptr;
return object->getAssetItemChild(assetItem, index);
}
DefineEngineMethod(AssetImporter, deleteImportingAsset, void, (AssetImportObject* assetItem), (nullAsType< AssetImportObject*>()),
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
return object->deleteImportingAsset(assetItem);
}
/*DefineEngineFunction(enumColladaForImport, bool, (const char* shapePath, const char* ctrl, bool loadCachedDts), ("", "", true),
"(string shapePath, GuiTreeViewCtrl ctrl) Collect scene information from "
"a COLLADA file and store it in a GuiTreeView control. This function is "
"used by the COLLADA import gui to show a preview of the scene contents "
"prior to import, and is probably not much use for anything else.\n"
"@param shapePath COLLADA filename\n"
"@param ctrl GuiTreeView control to add elements to\n"
"@param loadCachedDts dictates if it should try and load the cached dts file if it exists"
"@return true if successful, false otherwise\n"
"@ingroup Editors\n"
"@internal")
{
return enumColladaForImport(shapePath, ctrl, loadCachedDts);
}*/