Link Search Menu Expand Document

Asset Collection

Glorified Data Tables

Asset Collection represent collections of things (meshes, actors) that can be used with the Asset Staging node.


Table of content


Asset Collections are basically lists of assets that you can then use inside PCG; that all share some basic properties. They exist in different flavors, for different purposes (i.e actors vs meshes), but their main appeal over Data Table or PCG Data Asset is caching and nesting.


Cached bounds data

Each entry has some basic information cached, amongst which the bounds of the referenced asset.
This is especially useful as it allows nodes to access an asset bounds’ without having to load the asset in memory.
It enables nodes like Asset Staging to do some interesting work on points before spawning anything in the world.


Nested collections

Each entry can be another collection. This is where the Asset Collection shines, because a collection can be weighted like any other entry. PCGEx will recognize sub-collection and will keep on digging in these until an asset is found.
This is particulary handy when doing random weighted selection, where you want only a subset of items to be associated to a particular weight range, and then have a new random weighted pick from inside that range. Collections can be nested without limits, offering highly granular control over weighted & random distribution.


Re-usability & templating

Since they’re regular DataAssets, Asset Collections can easily be extended, re-used, shared amongst different settings & PCG setups.


Convertible

In order to support any workflow, Asset Collection to Set makes it easy to convert any PCGEx’ Asset Collection to a good ol’ attribute set, on the fly.

Note: Collections currently don’t properly check for circular dependencies, so be careful or you’re in for a ride.


Creating new collections

You can create Asset Collection just like any other DataAsset:

guides/data-asset-collection.jpg


Rebuilding staging data

“Staging data” is basically per-item cached information. It’s pretty lightweight and consist mostly of internal stuffs; and more importantly, asset bounds.

Note: Staging data is refreshed & stored whenever an update is made to the collection, but won’t refresh when the referenced assets are updated.

As such you will need to trigger a manual refresh from to time. You can do so using the three buttons at the top of any open Asset Collection:

Button Effect
Rebuild Staging Rebuilds the currently open Asset Collection
Rebuild Staging (Recursive) Rebuild the currently open Asset Collection, as well as any sub-collections; recursively.
Rebuild Staging (Project) Rebuild ALL the project’ Asset Collection.
Use carefully as assets needs to be loaded temporarily in memory in order to compute their bounds.

Utilitary methods

There a few utils at the bottom of the detail window that my come in handy:

Button Effect
Sort (Asc) Sort collection by weights in ascending order.
Sort (Desc) Sort collection by weights in descending order.
Index to Weight (Asc) Assign entry index to entry weight
Pad Weights Add 1 to all weights so it’s easier to weight down some assets
Weight = 100 Reset all weights to 100
Randomize Weights Assign random weights to items

Available Collections


🝱 Mesh Collection

Mesh Collection DataAsset

The Mesh Collection DataAsset is a list of Meshes with ISM/HISM Descriptors, that comes with all the Asset Collection goodies.

🝱 Actor Collection

Actor Collection DataAsset

The Actor Collection DataAsset is a list of Actors, that comes with all the Asset Collection goodies.


Entries & Collections Tags


Both entries and collections can hold tags. Some of these tags are entry-bound (i.e they exist in the context of a given collection only), and some are asset-bound (i.e they are always the same no matter where that entry is referenced).
Some nodes, such as Path Spline Mesh can use & add those tags to the components they generate.

Since collections can be nested, and both entries and collections can have tags, you can pick’n choose which tags should be grabbed during the entry selection process:

Flags
None Tags will be ignored
Asset Grab tags from the final picked entry.
Hierarchy Grab tags from the entries that have been traversed to the final pick.
Collection Grab tags from the sub-collections that have been traversed to the final pick.
This does not include the root collection.
Root Collection Grab tags from the “root”, or main collection.
This does not include nested & sub-collections.
Root Asset Grab tags from the “root”, or first traversed entry.
This invalidates the Hierarchy flag.

guides/data-asset-collection-grab-tag.png