Gets observer history for this asset.
Gets value at path. See the Asset overview for a full list of properties.
The path
The value
Checks if path exists. See the Asset overview for a full list of properties.
The path
True if path exists
Inserts value in array at path, at specified index. See the Asset overview for a full list of properties.
The path
The value
The index (if undefined the value will be inserted in the end)
Whether the value was inserted
Creates an instance of this template asset. Assumes this asset is a template asset.
The parent entity
Options
Extra data passed to the backend. Used by the Editor on specific cases.
Whether to record a history action.
The desired index under the parent to instantiate the template.
Whether to select the new entity.
The new entity.
Remove value from array at path. See the Asset overview for a full list of properties.
The path
The value
Whether the value was removed
Replaces any references to this asset with references to the new asset specified.
The new asset.
Options.
Whether to record a history action.
Sets value at path. See the Asset overview for a full list of properties.
The path
The value
Whether the value was set
Unsets value at path. See the Asset overview for a full list of properties.
The path
Whether the value was unset
Static
get
Represents an Asset.
What follows is a reference for all possible asset paths that can be passed to functions such as Asset#get and Asset#set.
Common Asset Properties:
data
object
exclude
boolean
file
object
file.variants
object
[read-only]
Properties for the different variants of the asset file.file.variants.basis
object
[read-only]
Properties for the BASIS variant of the asset filefile.variants.dxt
object
[read-only]
Properties for the DXT variant of the asset filefile.variants.etc1
object
[read-only]
Properties for the ETC1 variant of the asset filefile.variants.etc2
object
[read-only]
Properties for the ETC2 variant of the asset filefile.variants.pvr
object
[read-only]
Properties for the PVR variant of the asset filei18n
object
id
.id
number
[read-only]
The asset id. This id is the same across different branches.meta
object
[read-only]
Asset properties that depend on the type of the asset. Meta properties are available in the PlayCanvas Editor but not at runtime.name
string
[read-only]
The name of the assetpath
Array<number>
[read-only]
An array of folder assetid
's that represent the full path of the asset, if the asset is under one or more folders.preload
boolean
source
boolean
[read-only]
Whether this is a source asset. A source asset is not included at runtime (e.g. FBX) but may have target assets that are generated from it (e.g. model assets).source_asset_id
string
[read-only]
Theid
of the source asset that generated this asset.tags
Array<string>
type
string
[read-only]
The type of the asset. Can be: various types listed.uniqueId
number
[read-only]
The asset's unique id. This id is different across different branches.Animation Asset Properties:
data.events
object
{}
data.events.*.name
string
data.events.*.number
number
data.events.*.string
string
data.events.*.time
number
Animstategraph Asset Properties:
data.layers
object
{"0":{"name":"Base","states":[0,1,2,3],"transitions":[0],"blendType":"OVERWRITE","weight":1}}
data.layers.*.blendType
string
pc.ANIM_LAYER_OVERWRITE
,pc.ANIM_LAYER_ADDITIVE
.data.layers.*.name
string
data.layers.*.states
Array<number>
data.layers.*.transitions
Array<number>
data.layers.*.weight
number
data.parameters
object
{}
data.parameters.*.name
string
data.parameters.*.type
string
pc.ANIM_PARAMETER_INTEGER
,pc.ANIM_PARAMETER_FLOAT
,pc.ANIM_PARAMETER_BOOLEAN
,pc.ANIM_PARAMETER_TRIGGER
.data.parameters.*.value
mixed
data.states
object
{"0":{"name":"START","id":0,"posX":50,"posY":100,"nodeType":3},"1":{"name":"ANY","id":1,"posX":50,"posY":150,"nodeType":4},"2":{"name":"END","id":2,"posX":50,"posY":200,"nodeType":5},"3":{"name":"Initial State","id":3,"speed":1,"loop":true,"posX":400,"posY":50,"nodeType":1}}
data.states.*.defaultState
boolean
data.states.*.id
number
data.states.*.loop
boolean
data.states.*.name
string
data.states.*.nodeType
number
data.states.*.posX
number
data.states.*.posY
number
data.states.*.speed
number
data.transitions
object
{"0":{"from":0,"to":3,"defaultTransition":true,"edgeType":1,"conditions":{}}}
data.transitions.*.conditions.*.parameterName
string
data.transitions.*.conditions.*.predicate
string
pc.ANIM_GREATER_THAN
,pc.ANIM_LESS_THAN
,pc.ANIM_GREATER_THAN_EQUAL_TO
,pc.ANIM_LESS_THAN_EQUAL_TO
,pc.ANIM_EQUAL_TO
,pc.ANIM_NOT_EQUAL_TO
.data.transitions.*.conditions.*.value
mixed
data.transitions.*.defaultTransition
boolean
data.transitions.*.edgeType
number
data.transitions.*.exitTime
number
data.transitions.*.from
number
data.transitions.*.interruptionSource
string
pc.ANIM_INTERRUPTION_NONE
,pc.ANIM_INTERRUPTION_PREV
,pc.ANIM_INTERRUPTION_NEXT
,pc.ANIM_INTERRUPTION_PREV_NEXT
,pc.ANIM_INTERRUPTION_NEXT_PREV
.data.transitions.*.priority
number
data.transitions.*.time
number
data.transitions.*.to
number
data.transitions.*.transitionOffset
number
Bundle Asset Properties:
data.assets
Array<number>
id
's contained in the bundle.[]
Cubemap Asset Properties:
data.anisotropy
number
pc.GraphicsDevice
propertymaxAnisotropy
.data.magFilter
number
pc.FILTER_NEAREST
,pc.FILTER_LINEAR
,pc.FILTER_NEAREST_MIPMAP_NEAREST
,pc.FILTER_LINEAR_MIPMAP_NEAREST
,pc.FILTER_NEAREST_MIPMAP_LINEAR
,pc.FILTER_LINEAR_MIPMAP_LINEAR
.data.minFilter
number
pc.FILTER_NEAREST
,pc.FILTER_LINEAR
,pc.FILTER_NEAREST_MIPMAP_NEAREST
,pc.FILTER_LINEAR_MIPMAP_NEAREST
,pc.FILTER_NEAREST_MIPMAP_LINEAR
,pc.FILTER_LINEAR_MIPMAP_LINEAR
.data.rgbm
boolean
data.textures
Array<number>
id
's that represent the faces of the cubemap.data.textures.*
number
Font Asset Properties:
data.chars
object
data.chars.*.height
number
data.chars.*.id
number
data.chars.*.letter
string
data.chars.*.range
number
data.chars.*.scale
number
data.chars.*.width
number
data.chars.*.x
number
data.chars.*.xadvance
number
data.chars.*.xoffset
number
data.chars.*.y
number
data.chars.*.yoffset
number
data.info
object
data.info.face
string
data.info.height
number
data.info.width
number
data.intensity
number
data.kerning
object
data.version
number
Material Asset Properties:
data.alphaFade
number
opacityFadesSpecular
is false).1
data.alphaTest
number
alphaTest
reference value will be discarded.0
data.alphaToCoverage
boolean
false
data.ambient
Array<number>
[0,0,0]
data.ambientTint
boolean
false
data.anisotropy
number
0
data.aoMap
number
id
of an ambient occlusion texture asset containing pre-baked ambient occlusion.null
data.aoMapChannel
string
"r"
data.aoMapOffset
Array<number>
[0,0]
data.aoMapTiling
Array<number>
[1,1]
data.aoMapUv
number
0
data.aoMapVertexColor
boolean
false
data.blendType
number
pc.BLEND_SUBTRACTIVE
,pc.BLEND_ADDITIVE
, etc.3
data.bumpMapFactor
number
1
data.clearCoat
number
0
data.clearCoatBumpiness
number
1
data.clearCoatGlossMap
number
id
of the clear coat gloss map that specifies a per-pixel intensity value. The clear coat gloss map is modulated by the clearCoat property.null
data.clearCoatGlossMapChannel
string
"r"
data.clearCoatGlossMapOffset
Array<number>
[0,0]
data.clearCoatGlossMapTiling
Array<number>
[1,1]
data.clearCoatGlossMapUv
number
0
data.clearCoatGlossVertexColor
boolean
false
data.clearCoatGlossVertexColorChannel
string
"r"
data.clearCoatGlossiness
number
1
data.clearCoatMap
number
null
data.clearCoatMapChannel
string
"r"
data.clearCoatMapOffset
Array<number>
clearCoatMap
. Each component is between 0 and 1.[0,0]
data.clearCoatMapTiling
Array<number>
clearCoatMap
.[1,1]
data.clearCoatMapUv
number
0
data.clearCoatNormalMap
number
id
of the normal map that specifies the per-pixel surface normals for the clear coat layer. The normal map is modulated by the 'Bumpiness' property.null
data.clearCoatNormalMapOffset
Array<number>
[0,0]
data.clearCoatNormalMapTiling
Array<number>
[1,1]
data.clearCoatNormalMapUv
number
0
data.clearCoatVertexColor
boolean
false
data.clearCoatVertexColorChannel
string
"r"
data.conserveEnergy
boolean
true
data.cubeMap
number
id
of a cube map asset that approximates environment reflection. If the scene has a SkyBox set, then it will be used as the default cubeMap.null
data.cubeMapProjection
number
cubeMap
property, with options:pc.CUBEPROJ_NONE
andpc.CUBEPROJ_BOX
. Set to Box to enable world-space axis-aligned projection of cubemap based on bounding box.0
data.cubeMapProjectionBox
object
{"center":[0,0,0],"halfExtents":[0.5,0.5,0.5]}
data.cubeMapProjectionBox.center
Array<number>
data.cubeMapProjectionBox.halfExtents
Array<number>
data.cull
number
pc.CULLFACE_NONE
,pc.CULLFACE_BACK
,pc.CULLFACE_FRONT
,pc.CULLFACE_FRONTANDBACK
.1
data.depthTest
boolean
true
data.depthWrite
boolean
true
data.diffuse
Array<number>
[1,1,1]
data.diffuseMap
number
id
of the diffuse map that specifies the per-pixel diffuse material color. If no diffuse map is set, the diffuse color is used instead.null
data.diffuseMapChannel
string
"rgb"
data.diffuseMapOffset
Array<number>
diffuseMap
. Each component is between 0 and 1.[0,0]
data.diffuseMapTiling
Array<number>
diffuseMap
.[1,1]
data.diffuseMapTint
boolean
false
data.diffuseMapUv
number
0
data.diffuseMapVertexColor
boolean
false
data.emissive
Array<number>
[0,0,0]
data.emissiveIntensity
number
1
data.emissiveMap
number
id
of the emissive map that specifies the per-pixel emissive color. If no emissive map is set, the emissive color is used instead.null
data.emissiveMapChannel
string
"rgb"
data.emissiveMapOffset
Array<number>
emissiveMap
. Each component is between 0 and 1.[0,0]
data.emissiveMapTiling
Array<number>
emissiveMap
.[1,1]
data.emissiveMapTint
boolean
false
data.emissiveMapUv
number
0
data.emissiveMapVertexColor
boolean
false
data.enableGGXSpecular
boolean
false
data.fresnelModel
number
pc.FRESNEL_NONE
,pc.FRESNEL_SCHLICK
.0
data.glossMap
number
id
of the gloss map that specifies a per-pixel shininess value. The gloss map is modulated by the shininess property.null
data.glossMapChannel
string
"r"
data.glossMapOffset
Array<number>
glossMap
. Each component is between 0 and 1.[0,0]
data.glossMapTiling
Array<number>
glossMap
.[1,1]
data.glossMapUv
number
0
data.glossMapVertexColor
boolean
false
data.heightMap
number
id
of the height map that specifies the per-pixel strength of the parallax effect. White is full height and black is zero height.null
data.heightMapChannel
string
"r"
data.heightMapFactor
number
1
data.heightMapOffset
Array<number>
heightMap
. Each component is between 0 and 1.[0,0]
data.heightMapTiling
Array<number>
heightMap
.[1,1]
data.heightMapUv
number
0
data.lightMap
number
id
of the lightmap texture that contains pre-baked diffuse lighting. The lightmap usually is applied to the second UV set.null
data.lightMapChannel
string
"rgb"
data.lightMapOffset
Array<number>
[0,0]
data.lightMapTiling
Array<number>
[1,1]
data.lightMapUv
number
1
data.lightMapVertexColor
boolean
false
data.metalness
number
1
data.metalnessMap
number
id
of the map that specifies per-pixel metalness values. A value of 1 is metal and a value of 0 is non-metal.null
data.metalnessMapChannel
string
"r"
data.metalnessMapOffset
Array<number>
[0,0]
data.metalnessMapTiling
Array<number>
[1,1]
data.metalnessMapUv
number
0
data.metalnessMapVertexColor
boolean
false
data.normalMap
number
id
of the normal map that specifies the per-pixel surface normals. The normal map is modulated by the 'Bumpiness' property.null
data.normalMapOffset
Array<number>
normalMap
. Each component is between 0 and 1.[0,0]
data.normalMapTiling
Array<number>
normalMap
.[1,1]
data.normalMapUv
number
0
data.occludeSpecular
number
1
data.opacity
number
1
data.opacityFadesSpecular
boolean
true
data.opacityMap
number
id
of the opacity map that specifies the per-pixel opacity. The opacity map is modulated by theopacity
property.null
data.opacityMapChannel
string
"r"
data.opacityMapOffset
Array<number>
opacityMap
. Each component is between 0 and 1.[0,0]
data.opacityMapTiling
Array<number>
opacityMap
.[1,1]
data.opacityMapUv
number
0
data.opacityMapVertexColor
boolean
false
data.reflectivity
number
1
data.refraction
number
0
data.refractionIndex
number
0.6666666666666666
data.shininess
number
32
data.specular
Array<number>
[0.23,0.23,0.23]
data.specularAntialias
boolean
true
data.specularMap
number
id
of the specular map that specifies the per-pixel specular color. If no specular map is set, the specular color is used instead.null
data.specularMapChannel
string
"rgb"
data.specularMapOffset
Array<number>
specularMap
. Each component is between 0 and 1.[0,0]
data.specularMapTiling
Array<number>
specularMap
.[1,1]
data.specularMapTint
boolean
false
data.specularMapUv
number
0
data.specularMapVertexColor
boolean
false
data.sphereMap
number
id
of a sphere map texture asset that approximates environment reflection.null
data.useFog
boolean
true
data.useGammaTonemap
boolean
true
data.useLighting
boolean
true
data.useMetalness
boolean
false
data.useSkybox
boolean
true
Model Asset Properties:
data.mapping
Array<object>
data.mapping.*
object
Render Asset Properties:
data.containerAsset
number
id
of the container asset.data.renderIndex
number
Script Asset Properties:
data.loading
boolean
data.loadingType
number
data.scripts
object
data.scripts.*.attributes
object
data.scripts.*.attributes.*.array
boolean
data.scripts.*.attributes.*.assetType
string
data.scripts.*.attributes.*.color
string
data.scripts.*.attributes.*.curves
Array<string>
data.scripts.*.attributes.*.default
mixed
data.scripts.*.attributes.*.description
string
data.scripts.*.attributes.*.enum
object
data.scripts.*.attributes.*.enum.options
object
data.scripts.*.attributes.*.enum.order
Array<string>
data.scripts.*.attributes.*.max
number
data.scripts.*.attributes.*.min
number
data.scripts.*.attributes.*.placeholder
mixed
data.scripts.*.attributes.*.precision
number
data.scripts.*.attributes.*.schema
Array<object>
data.scripts.*.attributes.*.schema.*
object
data.scripts.*.attributes.*.step
number
data.scripts.*.attributes.*.title
string
data.scripts.*.attributes.*.type
string
data.scripts.*.attributesOrder
Array<string>
Sprite Asset Properties:
data.pixelsPerUnit
number
data.renderMode
number
pc.SPRITE_RENDERMODE_SIMPLE
,pc.SPRITE_RENDERMODE_SLICED
,pc.SPRITE_RENDERMODE_TILED
data.textureAtlasAsset
number
id
of the texture atlas asset that contains all the frames that this asset is referencing.Texture Asset Properties:
data.addressu
string
data.addressv
string
data.anisotropy
number
pc.GraphicsDevice
propertymaxAnisotropy
.data.magfilter
string
data.minfilter
string
data.mipmaps
boolean
data.rgbm
boolean
TextureAtlas Asset Properties:
data.addressu
string
data.addressv
string
data.anisotropy
number
pc.GraphicsDevice
propertymaxAnisotropy
.data.frames
object
data.frames.*.border
Array<number>
data.frames.*.name
string
data.frames.*.pivot
Array<number>
data.frames.*.rect
Array<number>
data.magfilter
string
data.minfilter
string
data.mipmaps
boolean
data.rgbm
boolean
Wasm Asset Properties:
data.fallbackScriptId
number
id
of the fallback script asset to be used if wasm modules are not supported.null
data.glueScriptId
number
id
of the script asset with the JavaScript glue code that implements the JavaScript interface to the wasm functions.null
data.moduleName
string