data_object Properties 24

AbsolutePath
string
The absolute path as it is on disk (ie .wav not .vsnd)
AssetType
AssetType
The type of this asset.
CanOpenInEditor
bool
Whether Editor.Asset.OpenInEditor(System.String) can do anything useful for this asset. Used to decide whether to offer an "Open" action for assets that have no file on disk (e.g. mounted resources).
CanRecompile
bool
Can this asset be recompiled?
HasCachedThumbnail
bool
HasCompiledFile
bool
True if we have a compiled file, and aren't just a source file
HasSourceFile
bool
True if we have a source file, and aren't just a _c file
HasUnsavedChanges
bool
A free-use variable for the editor to use to portray that this asset somehow has changes that need to be saved to disk.
IsCloud
bool
This asset is from the cloud, it's in the cloud folder
IsCompiled
bool
Whether the asset is compiled.
IsCompiledAndUpToDate
bool
Whether the asset is compiled and all dependencies are up to date. (Slower than IsCompiled)
IsCompileFailed
bool
Whether the asset failed to compile.
IsDeleted
bool
Whether the asset is deleted or not. This can happen after Editor.Asset.Delete was called on it, or Editor.Asset.AbsolutePath is empty.
IsProcedural
bool
If true then this asset is generated at runtime somehow. Possibly from a mount system.
IsTransient
bool
This asset is generated in the transient folder. You don't need to see it, or keep it around. It will re-generate from something else.
IsTrivialChild
bool
The asset was generated from another asset compile and has no source asset of its own. For example model break gibs .vmdl, .vtex files for materials, etc.
LastOpened
Nullable`1
When the asset was last opened through the editor.
MetaData
MetaData
Asset type specific key-value based data storage.
Name
string
Name of the asset, usually the filename.
Package
Package
If this asset was downloaded from sbox.game then this will be the package from which this asset was downloaded. If not then it'll be null.
Path
string
The relative path with the asset extension. ie .wav becomes .vsnd
Publishing
PublishSettings
Access the asset publisher config.
RelativePath
string
The relative path as it is on disk (ie .wav not .vsnd)
Tags
AssetTags
Tags for this asset, for filtering purposes in the Asset Browser.

functions Methods 29

CancelThumbBuild ()
ClearInMemoryReplacement ()
Reverse the changes of SetInMemoryReplacement
Compile (full)
bool
Forcibly recompile the asset.
CompileIfNeededAsync (timeout)
ValueTask`1
Returns a task that will resolve when the asset is compiled. If the asset is already compiled, do nothing. Does not support maps.
Delete ()
bool
Delete this asset. Will send files to the recycle bin.
DumpThumbnail ()
Task
Renders the thumbnail and then saves it to disk.
FindStringEditInfo (name)
string
GetAdditionalContentFiles ()
List`1
Gets additional content-side related files. This includes like .rect files for materials, all .fbx and .lxo files for models, etc.
GetAdditionalGameFiles ()
List`1
Gets additional game-side files to be packaged (e.g. navdata). These are files that are loaded by managed code, not as native resources.
GetAssetThumb (generateIfNotInCache)
Pixmap
Returns the asset preview thumbnail, with fallback to the asset type icon if there is no preview.
GetCompiledFile (absolute)
string
Returns the compiled file path, if the asset is compiled.
GetDependants (deep)
List`1
Returns assets that depend/use this asset.
GetInputDependencies ()
List`1
Gets input dependencies for an asset. This'll be tga's for a texture and stuff like that.
GetParents (deep)
List`1
Returns assets that are parents of this asset (i.e. this asset is a compiled child resource of the returned assets).
GetPreviewModel ()
Model
Try to create a preview model if we're fbx, obj, etc
GetReferences (deep)
List`1
Returns assets that this asset references/uses.
GetSourceFile (absolute)
string
Returns the source file path, if the sources are present.
GetUnrecognizedReferencePaths ()
List`1
Unrecognized reference paths listed by the data that could not be resolved into Asset*s
LoadResource ()
Resource
Try to load this asset as an automatically determined resource type. If this isn't a resource type (like an Image) then it will return null.
LoadUserTags ()
OpenInEditor (nativeEditor)
Try to open this asset in a supported editor. You can specify nativeEditor to open in a specific editor.
OverrideThumbnail (pixmap)
Override the Assets thumbnail with given one.
ReadJson ()
string
Try to get the raw Json string, for a managed asset type (a GameResource)
RebuildThumbnail (startBuild)
Delete existing cached thumbnail, optionally queuing for building a new one ASAP.
RecordOpened ()
Tell asset system that this asset was opened. Sticks it on the recent opened list.
RenderThumb ()
Task`1
Immediately render a preview thumbnail for this asset, and return it.
SaveToDisk (obj)
bool
Save a game resource instance to disk. This is used internally by asset inspector and for asset creation.
SetInMemoryReplacement (sourceData)
bool
Set data for this asset which will be compiled in memory. This is used to preview asset changes (like materials) before committing to disk.
TryLoadResource (obj)
bool
Try to load this asset as a Sandbox.Resource of given type.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.