TorqueScript Reference
|
#include <assetManager_ScriptBinding.h>
Inherits SimObject.
String acquireAsset | ( | assetId | ) |
Acquire the specified asset Id. You must release the asset once you're finish with it using 'releaseAsset'.
assetId | The selected asset Id. |
asPrivate | Whether to acquire the asset Id as a private asset. |
Boolean addDeclaredAsset | ( | moduleDefinition | , |
assetFilePath | |||
) |
Add the specified asset against the specified module definition.
moduleDefinition | The module definition that may contain declared assets. |
Boolean addModuleDeclaredAssets | ( | moduleDefinition | ) |
Add any the declared assets specified by the module definition.
moduleDefinition | The module definition specifies the asset manifest. |
String addPrivateAsset | ( | assetObject | ) |
Adds a private asset object.
assetObject | The asset object to add as a private asset. |
Boolean compileReferencedAssets | ( | moduleDefinition | ) |
Compile the referenced assets determined by the specified module definition.
moduleDefinition | The module definition specifies the asset manifest. |
Boolean deleteAsset | ( | assetId | , |
deleteLooseFiles | , | ||
deleteDependencies | |||
) |
Deletes the specified asset Id and optionally its loose files and asset dependencies.
assetId | The selected asset Id. |
deleteLooseFiles | Whether to delete an assets loose files or not. |
deleteDependencies | Whether to delete assets that depend on this asset or not. |
void dumpDeclaredAssets | ( | ) |
Dumps a breakdown of all declared assets.
Integer findAllAssets | ( | assetQuery | ) |
Performs an asset query searching for all assets optionally ignoring internal assets.
assetQuery | The asset query object that will be populated with the results. |
ignoreInternal | Whether to ignore internal assets or not. Optional: Defaults to true. |
ignorePrivate | Whether to ignore private assets or not. Optional: Defaults to true. |
Integer findAssetAutoUnload | ( | assetQuery | , |
assetAutoUnload | |||
) |
Performs an asset query searching for the specified asset auto-unload flag.
assetQuery | The asset query object that will be populated with the results. |
assetInternal | The asset internal flag to search for. |
assetQueryAsSource | Whether to use the asset query as the data-source rather than the asset managers database or not. Doing this effectively filters the asset query. Optional: Defaults to false. |
Integer findAssetCategory | ( | assetQuery | , |
assetCategory | |||
) |
Performs an asset query searching for the specified asset category.
assetQuery | The asset query object that will be populated with the results. |
assetCategory | The asset category to search for. |
assetQueryAsSource | Whether to use the asset query as the data-source rather than the asset managers database or not. Doing this effectively filters the asset query. Optional: Defaults to false. |
Integer findAssetDependsOn | ( | assetQuery | , |
assetId | |||
) |
Performs an asset query searching for asset Ids that the specified asset Id depends on.
assetQuery | The asset query object that will be populated with the results. |
assetId | The asset Id to query for any asset Ids that it depends on. |
Integer findAssetInternal | ( | assetQuery | , |
assetInternal | |||
) |
Performs an asset query searching for the specified asset internal flag.
assetQuery | The asset query object that will be populated with the results. |
assetInternal | The asset internal flag to search for. |
assetQueryAsSource | Whether to use the asset query as the data-source rather than the asset managers database or not. Doing this effectively filters the asset query. Optional: Defaults to false. |
Integer findAssetIsDependedOn | ( | assetQuery | , |
assetId | |||
) |
Performs an asset query searching for asset Ids that depend on the specified asset Id.
assetQuery | The asset query object that will be populated with the results. |
assetId | The asset Id to query for any asset Ids that may depend on it. |
Integer findAssetLooseFile | ( | assetQuery | , |
assetLooseFile | |||
) |
Performs an asset query searching for the specified loose file.
assetQuery | The asset query object that will be populated with the results. |
assetLooseFile | The loose-file used by the asset to search for. |
assetQueryAsSource | Whether to use the asset query as the data-source rather than the asset managers database or not. Doing this effectively filters the asset query. Optional: Defaults to false. |
Integer findAssetName | ( | assetQuery | , |
assetName | |||
) |
Performs an asset query searching for the specified asset name.
assetQuery | The asset query object that will be populated with the results. |
assetName | The asset name to search for. This may be a partial name if 'partialName' is true. |
partialName | Whether the asset name is to be used as a partial name or not. Optional: Defaults to false. |
Integer findAssetPrivate | ( | assetQuery | , |
assetPrivate | |||
) |
Performs an asset query searching for the specified asset private flag.
assetQuery | The asset query object that will be populated with the results. |
assetPrivate | The asset private flag to search for. |
assetQueryAsSource | Whether to use the asset query as the data-source rather than the asset managers database or not. Doing this effectively filters the asset query. Optional: Defaults to false. |
Integer findAssetType | ( | assetQuery | , |
assetType | |||
) |
Performs an asset query searching for the specified asset type.
assetQuery | The asset query object that will be populated with the results. |
assetType | The asset type to search for. |
assetQueryAsSource | Whether to use the asset query as the data-source rather than the asset managers database or not. Doing this effectively filters the asset query. Optional: Defaults to false. |
Integer findInvalidAssetReferences | ( | assetQuery | ) |
Performs an asset query searching for invalid asset references.
assetQuery | The asset query object that will be populated with the results. |
Integer findTaggedAssets | ( | assetQuery | , |
assetTagNames | |||
) |
Performs an asset query searching for the specified asset tag name(s).
assetQuery | The asset query object that will be populated with the results. |
assetTagNames | The asset tag name or names to search for. Multiple names can be specified using comma, space, tab or newline separation. Tags use an OR operation i.e. only assets tagged with ANY of the specified tags will be returned. |
assetQueryAsSource | Whether to use the asset query as the data-source rather than the asset managers database or not. Doing this effectively filters the asset query. Optional: Defaults to false. |
String getAssetCategory | ( | assetId | ) |
Gets the asset category from the specified asset Id.
assetId | The selected asset Id. |
String getAssetDescription | ( | assetId | ) |
Gets the asset description from the specified asset Id.
assetId | The selected asset Id. |
String getAssetFilePath | ( | assetId | ) |
Gets the asset file-path from the specified asset Id.
assetId | The selected asset Id. |
String getAssetModule | ( | assetId | ) |
Gets the module definition where the the specified asset Id is located.
assetId | The selected asset Id. |
String getAssetName | ( | assetId | ) |
Gets the asset name from the specified asset Id.
assetId | The selected asset Id. |
String getAssetPath | ( | assetId | ) |
Gets the asset path (not including the asset file) from the specified asset Id.
assetId | The selected asset Id. |
Integer getAssetTags | ( | ) |
Gets the currently loaded asset tags manifest.
String getAssetType | ( | assetId | ) |
Gets the asset type from the specified asset Id.
assetId | The selected asset Id. |
Boolean getDeclaredAssetCount | ( | ) |
Gets the number of declared assets.
Boolean getLoadedExternalAssetCount | ( | ) |
Gets the number of loaded external assets.
Boolean getLoadedInternalAssetCount | ( | ) |
Gets the number of loaded internal assets.
Boolean getMaxLoadedExternalAssetCount | ( | ) |
Gets the maximum number of loaded external assets.
Boolean getMaxLoadedInternalAssetCount | ( | ) |
Gets the maximum number of loaded internal assets.
Boolean getReferencedAssetCount | ( | ) |
Gets the number of asset referenced.
Boolean isAssetAutoUnload | ( | assetId | ) |
Check whether the specified asset Id is auto-unload or not.
assetId | The selected asset Id. |
Boolean isAssetInternal | ( | assetId | ) |
Check whether the specified asset Id is internal or not.
assetId | The selected asset Id. |
Boolean isAssetLoaded | ( | assetId | ) |
Check whether the specified asset Id is loaded or not.
assetId | The selected asset Id. |
Boolean isAssetPrivate | ( | assetId | ) |
Check whether the specified asset Id is private or not.
assetId | The selected asset Id. |
Boolean isDeclaredAsset | ( | assetId | ) |
Check whether the specified asset Id is declared or not.
assetId | The selected asset Id. |
Boolean isReferencedAsset | ( | assetId | ) |
Check whether the specified asset Id is referenced or not.
assetId | The selected asset Id. |
void preloadAsset | ( | assetId | ) |
Ensures an asset is loaded even if it has no references. The asset is also set to not auto unload to prevent it from unloading. Use purgeAssets to unload the asset.
assetId | The selected asset Id. |
void purgeAssets | ( | ) |
Purge all assets that are not referenced even if they are set to not auto-unload. Assets can be in this state because they are either set to not auto-unload or the asset manager has/is disabling auto-unload.
void refreshAllAssets | ( | ) |
Refresh all declared assets.
Whether | to include currently unloaded assets in the refresh or not. Optional: Defaults to false. Refreshing all assets can be an expensive (time-consuming) operation to perform. |
void refreshAsset | ( | assetId | ) |
Refresh the specified asset Id.
assetId | The selected asset Id. |
Boolean releaseAsset | ( | assetId | ) |
Release the specified asset Id. The asset should have been acquired using 'acquireAsset'.
assetId | The selected asset Id. |
Boolean removeDeclaredAsset | ( | assetId | ) |
Remove the specified declared asset Id.
assetId | The selected asset Id. |
Boolean removeDeclaredAssets | ( | moduleDefinition | ) |
Remove any the declared assets specified by the module definition.
moduleDefinition | The module definition that may contain declared assets. |
Boolean renameDeclaredAsset | ( | assetIdFrom | , |
assetIdTo | |||
) |
Rename declared asset Id.
assetIdFrom | The selected asset Id to rename from. |
assetIdFrom | The selected asset Id to rename to. |
Boolean renameReferencedAsset | ( | assetIdFrom | , |
assetIdTo | |||
) |
Rename referenced asset Id.
assetIdFrom | The selected asset Id to rename from. |
assetIdFrom | The selected asset Id to rename to. |
Boolean restoreAssetTags | ( | ) |
Restore the currently loaded asset tags manifest from disk (replace anything in memory).
Boolean saveAssetTags | ( | ) |
Save the currently loaded asset tags manifest.