engineGetModelTextures
Client-side
Server-side
Shared
This function allows you to get the textures of any model.
Important
This function creates an texture element for every texture on each call! That's why you should NEVER use it in per-frame events such as onClientRender. Additionally, when you no longer need the textures, remember to destroy them. If you only want to retrieve texture names, use engineGetModelTextureNames.
OOP Syntax Help! I don't understand this!
- Method:Engine.getModelTextures(...)
Syntax
table|false engineGetModelTextures ( string/int modelName/modelID, [ string/table textureNames = nil ] )Required Arguments
- modelName/modelID: Either the model ID or model name.
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.
- textureNames (default: nil): Only return textures with specified name(s). You can provide a single string or a table of strings. Wildcard matching e.g. "ro?ds*" can be used.
Returns
- table|false: model textures
Returns a table of texture elements [textureName, texture], false otherwise.
Code Examples
client
local textures = engineGetModelTextures(3722)iprint(textures)
-- Prevent memory leakfor _,v in pairs(textures) do destroyElement(v)endSee Also
Engine Functions
- engineAddClothingModelNew
- engineAddClothingTXDNew
- engineAddImageNew
- engineApplyShaderToWorldTexture
- engineFreeModel
- engineFreeTXDNew
- engineGetModelFlagsNew
- engineGetModelIDFromName
- engineGetModelLODDistance
- engineGetModelNameFromID
- engineGetModelPhysicalPropertiesGroup
- engineGetModelTextureNames
- engineGetModelTextures
- engineGetModelTXDIDNew
- engineGetModelVisibleTime
- engineGetObjectGroupPhysicalProperty
- engineGetPoolCapacityNew
- engineGetPoolDefaultCapacityNew
- engineGetPoolUsedCapacityNew
- engineGetSurfaceProperties
- engineGetVisibleTextureNames
- engineImageGetFileNew
- engineImageGetFilesNew
- engineImageGetFilesCountNew
- engineImageLinkDFFNew
- engineImageLinkTXDNew
- engineImportTXD
- engineLoadCOL
- engineLoadDFF
- engineLoadIFP
- engineLoadIMGNew
- engineLoadTXD
- enginePreloadWorldAreaNew
- engineRemoveImageNew
- engineRemoveShaderFromWorldTexture
- engineReplaceAnimation
- engineReplaceCOL
- engineReplaceModel
- engineRequestModel
- engineRequestTXDNew
- engineResetModelFlagsNew
- engineResetModelLODDistance
- engineResetModelTXDIDNew
- engineResetSurfaceProperties
- engineRestoreAnimation
- engineRestoreCOL
- engineRestoreDFFImageNew
- engineRestoreModel
- engineRestoreModelPhysicalPropertiesGroup
- engineRestoreObjectGroupPhysicalProperties
- engineRestoreTXDImageNew
- engineRestreamNew
- engineRestreamModelNew
- engineRestreamWorldUpdated
- engineSetAsynchronousLoading
- engineSetModelFlagNew
- engineSetModelFlagsNew
- engineSetModelLODDistanceUpdated
- engineSetModelPhysicalPropertiesGroupUpdated
- engineSetModelTXDIDNew
- engineSetModelVisibleTime
- engineSetObjectGroupPhysicalProperty
- engineSetPoolCapacityNew
- engineSetSurfaceProperties
- engineStreamingFreeUpMemory
- engineStreamingGetBufferSizeNew
- engineStreamingGetMemorySizeNew
- engineStreamingGetModelLoadStateNew
- engineStreamingGetUsedMemory
- engineStreamingReleaseModelNew
- engineStreamingRequestModelNew
- engineStreamingRestoreBufferSizeNew
- engineStreamingRestoreMemorySizeNew
- engineStreamingSetBufferSizeNew
- engineStreamingSetMemorySizeNew
- engineStreamingSetModelCacheLimitsNew