Torque3D/Engine/source/T3D/assets/assetImporter_ScriptBinding.h

151 lines
5.7 KiB
C
Raw Normal View History

#pragma once
#include "console/engineAPI.h"
#include "assetImporter.h"
//Console Functions
DefineEngineMethod(AssetImportConfig, loadImportConfig, void, (Settings* configSettings, String configName), (nullAsType<Settings*>(), ""),
"Loads the provided import config to the importer.\n"
"@param configSettings A Settings object containing the import configs.\n"
"@param configName The specific name of the config to be used.")
{
return object->loadImportConfig(configSettings, configName);
}
DefineEngineMethod(AssetImporter, setTargetPath, void, (String path), (""),
"Sets the target path the importing assets will be put into.\n"
"@param A string of the target path.")
{
return object->setTargetPath(path);
}
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
DefineEngineMethod(AssetImporter, resetImportSession, void, (bool forceResetSession), (false),
"Resets the importer's import session. All existing import items, logs, etc will be cleared.")
{
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
return object->resetImportSession(forceResetSession);
}
DefineEngineMethod(AssetImporter, dumpActivityLog, void, (), ,
"Dumps the import activity log. If the importer is set to, it will save to file, otherwise dump to console.")
{
return object->dumpActivityLog();
}
DefineEngineMethod(AssetImporter, getActivityLogLineCount, S32, (),,
"Gets the number of lines in the import activity log.\n"
"@return The number of lines in the import activity log.")
{
return object->getActivityLogLineCount();
}
DefineEngineMethod(AssetImporter, getActivityLogLine, String, (S32 index), (0),
"Gets a specific line in the import activity log.\n"
"@param index The index of the line to be returned.\n"
"@return The string of the requested line of the activity log")
{
return object->getActivityLogLine(index);
}
DefineEngineMethod(AssetImporter, autoImportFile, String, (String path, String typeHint), ("", ""),
"Run the full import process on a specific file.\n"
"@return If import is successful, the assetId of the new asset. If it failed, an empty string.")
{
return object->autoImportFile(path, typeHint);
}
DefineEngineMethod(AssetImporter, addImportingFile, AssetImportObject*, (String path), (""),
"Adds a filepath to the current importing session.\n"
"@param path The path to the file to be imported.\n"
"@return The AssetImportObject from the import session.")
{
return object->addImportingFile(path);
}
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
DefineEngineMethod(AssetImporter, addImportingAssetItem, void, (AssetImportObject* assetItem, AssetImportObject* parentItem), (nullAsType< AssetImportObject*>(), nullAsType< AssetImportObject*>()),
"Adds an existing AssetImportObject to the current improting session.\n"
"@param assetItem The AssetImportObject to be added to the import session.\n"
"@param parentItem An AssetImportObject that to act as the parent of the item being added.")
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
{
return object->addImportingAssetItem(assetItem, parentItem);
}
DefineEngineMethod(AssetImporter, processImportingAssets, void, (), ,
"Processes the importing assets.")
{
return object->processImportAssets();
}
DefineEngineMethod(AssetImporter, hasImportIssues, bool, (), ,
"Validates the status of the importing items.\n"
"@return False if there are no issues, true if there are importing issues")
{
return object->validateAssets();
}
DefineEngineMethod(AssetImporter, resolveAssetItemIssues, void, (AssetImportObject* assetItem), (nullAsType< AssetImportObject*>()),
"Runs the issue resolver to attempt to correct any simple issues, such as utilizing the config's settings to resolve collisions.")
{
object->resolveAssetItemIssues(assetItem);
}
DefineEngineMethod(AssetImporter, importAssets, void, (),,
"Runs the actual import action on the items.")
{
object->importAssets();
object->acquireAssets();
}
DefineEngineMethod(AssetImporter, getAssetItemCount, S32, (),,
"Gets the number of importing asset items.\n"
"@return The number of importing asset items")
{
return object->getAssetItemCount();
}
DefineEngineMethod(AssetImporter, getAssetItem, AssetImportObject*, (S32 index), (0),
"Gets a specific import asset item.\n"
"@param index The index of the AssetImportObject to be returned.\n"
"@return AssetImportObject")
{
return object->getAssetItem(index);
}
DefineEngineMethod(AssetImporter, getAssetItemChildCount, S32, (AssetImportObject* assetItem), (nullAsType< AssetImportObject*>()),
"Gets number of child items for a given importing asset item.\n"
"@param assetItem The AssetImportObject to get the number of children of.\n"
"@return The number of child items")
{
if (assetItem == nullptr)
return 0;
return object->getAssetItemChildCount(assetItem);
}
DefineEngineMethod(AssetImporter, getAssetItemChild, AssetImportObject*, (AssetImportObject* assetItem, S32 index), (nullAsType< AssetImportObject*>(), 0),
"Gets a specific child item of a given importing asset item.\n"
"@param assetItem The AssetImportObject to get the child from.\n"
"@param index The index of the child to get.\n"
"@return The child AssetImportObect")
{
if (assetItem == nullptr)
return nullptr;
return object->getAssetItemChild(assetItem, index);
}
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
DefineEngineMethod(AssetImporter, deleteImportingAsset, void, (AssetImportObject* assetItem), (nullAsType< AssetImportObject*>()),
"Deletes an importing AssetImportObject from the import session.\n"
"@param assetItem The AssetImportObject to delete.")
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
{
return object->deleteImportingAsset(assetItem);
}
DefineEngineMethod(AssetImporter, setImportConfig, void, (AssetImportConfig* importConfig), (nullAsType< AssetImportConfig*>()),
"Sets the import config to be used via a AssetImportConfig object.\n"
"@param importConfig The AssetImportConfig object to use.")
{
return object->setImportConfig(importConfig);
}