User Tools

Site Tools


DzAsset

An abstraction between the presentation of a content file and the file on disk.

More...

Inherits :

Inherited By : DzNotInstalledProductAsset

Properties

Methods

Signals

voidassetImageChanged ( DzAsset asset )

Detailed Description

An “Asset” serves as an abstraction between the presentation of a content file and the actual file that resides on disk; it is a “container” for information about a content file.

At a minimum, an asset contains a reference to the relative path and filename of a file.

Metadata

When the Content Management System (CMS) is active, an asset provides an interface to its metadata within the content database. This metadata includes information such as what type of asset it is, what it is used for, what it is compatible with, which category(ies) it is presented to the user in, etc.

Conceptually, each asset belongs to exactly one “Product”. By default, and until/unless modified, all newly created assets are assigned to the “LOCAL USER” product. An asset is uniquely identified within a product by the combination of its relative path and filename. While any number of products can reference a file with the same relative path and filename combination, each product's concept of that combination is unique (even if their metadata is identical).

The metadata for a given asset is divided into 2 distinct types; that which is owned and/or maintained by the vendor (the originating source), and that which is owned and/or maintained by the end-user. Unless the metadata component (e.g., userKeywords, userNotes, etc), the product (e.g., “LOCAL USER”), or the store (e.g., “LOCAL USER”) indicate “user” in their name, any assumption (if there is to be one) about which type the data is should be that which is owned and/or maintained by the vendor.

The metadata for an asset that is “installed” and which belongs to a product associated with a “Store” (source) other than the “LOCAL USER” store is owned by the vendor. Conversely, the metadata for an asset that is created by the user and/or belongs to a product associated with the “LOCAL USER” store is owned by the user. The exceptions to this are those attributes which integrate “user” into their name; which in fact always belong to the user.

The significance of the distinction between the 2 types of metadata comes down to how the data is handled during an update and whether or not an effort is made to preserve it. Metadata that is owned and/or maintained by the vendor can be summarily purged during an update. This provides a vendor with the means to clean up all potential prior versions of the metadata without being faced with complex bookkeeping tasks.

See Also:

Properties


Object : assetID

Holds the asset identifier for this asset. (Read Only)


String : assetName

Holds the name for this asset. (Read Only)


Number : audience

Holds the vendor intended audience for this asset.

Since:

  • 4.8.1.97

Array : categories

Holds a list of all categories that this asset is in. (Read Only)

Since:

  • 4.9.0.2

Boolean : companionIsScript

Holds whether the companion file (if any) is a DAZ Script. (Read Only)


String : companionPath

Holds the full path to the folder the companion file is in. (Read Only)


Array : compatibilities

Holds a list of all compatibility bases that this asset is compatible with. (Read Only)

Since:

  • 4.9.0.2

String : compatibilityBase

Holds the [vendor] compatibility base for this asset.

Since:

  • 4.8.1.97

String : contentType

Holds the [vendor] content type for this asset.

Since:

  • 4.8.1.97

Date : dateCreated

Holds the date this asset was created. (Read Only)

Since:

  • 4.9.0.2

Date : dateLastModified

Holds the date this asset was last modified. (Read Only)

Since:

  • 4.9.0.2

String : description

Holds the vendor description for this asset.

Since:

  • 4.8.1.97

String : displayName

Holds the name displayed to the user for this asset. (Read Only)

Since:

  • 4.9.0.20

Number : groupId

Holds the group identifier for this asset. 0 = default, < 0 = app defined, > 0 = user defined.

Since:

  • 4.9.0.11

Boolean : hasCloudMetadata

Holds whether this asset has metadata provided by the cloud. (Read Only)

Since:

  • 4.9.0.2

Return Value:

  • true if metadata for this asset came from the cloud, otherwise false.

Since:

  • 4.9.0.2

Boolean : hasCompanion

Holds whether this asset is a non-native file and a DAZ Script or native file with the same basename exists in the same directory. (Read Only)


Boolean : hasCompanionScript

Holds whether this asset is a non-native file and a DAZ Script with the same basename exists in the same directory. (Read Only)


Boolean : hidden

Holds whether this asset should be hidden in asset views.

Since:

  • 4.9.0.2

Pixmap : icon

Holds the icon path for this asset. (Read Only)


Boolean : isCloudInstallable

Holds whether this asset can be installed from the cloud. (Read Only)

Since:

  • 4.9.0.20

Boolean : isCloudInstalled

Holds whether this asset is installed from the cloud. (Read Only)

Since:

  • 4.9.0.20

Boolean : isCloudOwned

Holds whether this asset is managed by the cloud. (Read Only)

Since:

  • 4.9.0.2

Return Value:

  • true if this asset is installed by the cloud, otherwise false.

Since:

  • 4.9.0.2

Boolean : isInstalled

Holds whether this asset is installed in the database. (Read Only)

Since:

  • 4.9.0.20

Boolean : isMetadataValid

Holds whether the metadata for this asset is valid. (Read Only)

Since:

  • 4.9.0.2

Return Value:

  • true if the metadata is valid, otherwise false.

Since:

  • 4.8.1.97

Boolean : isNative

Holds whether this asset is a native DAZ Studio file. (Read Only)


Boolean : isScript

Holds whether this asset is a native DAZ Studio script file. (Read Only)


Boolean : isSymLink

Holds whether this asset is a symbolic link. (Read Only)

Return Value:

  • true if this asset is a symbolic link, otherwisefalse.

Boolean : isVendor

Holds whether this asset is owned by a vendor or by the user. (Read Only)

Since:

  • 4.9.0.2

Boolean : needsCloudInstall

Holds whether this asset needs to be installed from the cloud. (Read Only)

Since:

  • 4.9.0.20

Boolean : needsCloudUpdate

Holds whether this asset needs to be updated from the cloud. (Read Only)

Since:

  • 4.9.0.2

Return Value:

  • true if this asset has an update available from the cloud, otherwise false.

Since:

  • 4.9.0.2

String : notes

Holds the user notes for this asset.

Since:

  • 4.12.2.15

String : originalFilename

Holds the original filename for this asset. (Read Only)

Since:

  • 4.8.1.97

String : originalPath

Holds the original path for this asset. (Read Only)

Since:

  • 4.8.1.97

String : productGUID

Holds the Globally Unique Identifier (GUID) for the product this asset belongs to. (Read Only)

Since:

  • 4.11.0.193

String : productID

Holds the product identifier for the product that this asset belongs to. (Read Only)

Since:

  • 4.9.0.55

String : productName

Holds the name of the product this asset belongs to. (Read Only)

Since:

  • 4.9.0.55

String : productPath

Holds the base of the product path in the cloud folder for cloud assets. (Read Only)

Since:

  • 4.9.3.83

Pixmap : smallIcon

Holds the icon path for this asset. (Read Only)


String : storeID

Holds the store identifier for the product that this asset belongs to. (Read Only)

Since:

  • 4.11.0.193

String : symLinkPath

Holds the path that the symbolic link is referencing (if any).


String : url

Holds the URL for this asset. (Read Only)


String : urlEncoded

Holds the encoded URL for this asset. (Read Only)


Array : userCategories

Holds a list of user owned categories that this asset is in. (Read Only)

Since:

  • 4.9.0.2

Array : userCompatibilities

Holds a list of user owned compatibility bases that this asset is compatible with. (Read Only)

Since:

  • 4.9.0.2

Array : userKeywords

Holds the user keywords for this asset.

Since:

  • 4.9.0.2

Array : vendorCategories

Holds a list of vendor owned categories that this asset is in. (Read Only)

Since:

  • 4.9.0.2

Array : vendorCompatibilities

Holds a list of vendor owned compatibility bases that this asset is compatible with. (Read Only)

Since:

  • 4.9.0.2

Array : vendorKeywords

Holds the vendor keywords for this asset.

Since:

  • 4.9.0.2

Methods


void : addCompatibilities( Array bases, Boolean create=false )

Sets the compatibility bases that this asset is compatible with.

Parameter(s):

  • bases - The list of compatibility bases this asset is compatible with.
  • create - If true, creates compatibility bases that do not exist. If false, compatibility will only be established for compatibility bases that already exist.

Since:

  • 4.9.0.2

void : addToCategories( Array categories, Boolean create=false )

Sets the categories for this asset.

Parameter(s):

  • categories - The list of categories to add this asset to.
  • create - If true, creates categories that do not exist. If false, only categories that already exist will be assigned.

Since:

  • 4.9.0.2

void : clearGroup()

Sets this asset as belonging to the default group identifier; 0.

Since:

  • 4.9.0.11

void : forceImageReload()

Forces the icon for this asset to reload.


String : getAsLocalFile()

Return Value:

  • The url of this asset as a local file path.

String : getBaseExtension()

Return Value:

  • The base file extension for this asset; without any encryption extension.

String : getDSLinkExtension()

Return Value:

  • The extension to use for DAZ Studio file link.

Since:

  • 4.9.0.30

String : getDSLinkText()

Return Value:

  • The text that is placed inside a DAZ Studio file link.

Since:

  • 4.9.0.30

DzAbstractAssetContainer : getOwner()

Return Value:

  • The asset container that owns this asset.

See Also:


DzProductAssetContainer : getProduct()

Return Value:

  • The product that this asset belongs to (if any), otherwise null.

See Also:

Since:

  • 4.9.0.2

String : getRelativeFilePath()

Return Value:

  • The relative file path for this asset.

Boolean : isGroup( Number id )

Return Value:

  • true if this asset is a member of group, otherwise false.

Attention:

  • 0 = default, < 0 = app defined, > 0 = user defined

Since:

  • 4.9.0.11

Boolean : loadDefaultIcon( Boolean delayLoad )

Loads the default icon for this asset.

Parameter(s):

  • delayLoad - If true, loading of the icon is delayed.

Return Value:

  • true if the default icon for this asset is successfully loaded, otherwise false.

Object : readLinkData( String linkPath )

Parameter(s):

  • linkPath - The path of the file to read from.

Return Value:

  • A map of the key value pairs in a DAZ Studio link file.

Since:

  • 4.9.0.30

void : removeCompatibilities( Array bases, Boolean isVender=false )

Removes the compatibility bases that this asset is compatible with.

Parameter(s):

  • bases - The list of compatibilities to remove from this asset.
  • isVender - If true, the compatibilities being looked up are owned by the vendor.

Since:

  • 4.9.2.53

void : removeFromCategories( Array categories, Boolean isVender=false )

Removes this asset from the categories.

Parameter(s):

  • categories - The list of categories to remove this asset from.
  • isVender - If true, the categories being looked up are owned by the vendor.

Since:

  • 4.9.2.53

Boolean : rename( String name )

Changes the name of this asset.

Parameter(s):

  • name - The new name for this asset.

Return Value:

  • true if the operation is successful, otherwise false.

Boolean : saveDSLink( String linkSavePath )

Parameter(s):

  • linkSavePath - The path of the file to save to.

Return Value:

  • true if a DAZ Studio file link to this asset is saved, otherwise false.

Attention:

  • Will overwrite and add correct extension if possible.

Since:

  • 4.9.0.30

void : setIgnoreExists( Boolean onOff )

Sets whether existence of this asset should be ignored.


DzUri : toUri()

Return Value:

  • This asset expressed as a DzUri.

Since:

  • 4.9.0.40

Boolean : updateFromMetadata( String guid=“” )

Parameter(s):

  • guid - The Globally Unique Identifier (GUID) for the product to update from. Leave empty to update using the current product if an association is already made.

Return Value:

  • true if this asset is updated, otherwise false.

Since:

  • 4.9.2.69

Signals


void : assetImageChanged( DzAsset asset )

Signature:“assetImageChanged(DzAsset*)”

Emitted when the image for this asset has changed.

Parameter(s):

  • asset - The asset that the image changed on.