Editor.Model.InstantiationParams
ClassParameters used when instantiating a scene object, including its parent hierarchy.
Index
Properties
Example
// InstantiationParams is consumed by AssetManager.instantiate() to control
// where the new scene objects are parented. Its constructor is protected,
// so callers typically build a plain object shaped like InstantiationParams
// and pass it through.
const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const scene = model.project.scene;
const assetManager = model.project.assetManager;
// Create a parent under which freshly-instantiated objects will be placed.
const parent = scene.createSceneObject('InstantiationParent');
const params = {
parents: [parent],
} as unknown as Editor.Model.InstantiationParams;
// Use with: await assetManager.instantiate(assets, params);
// assets is an Editor.Assets.Asset[] resolved from AssetManager earlier.
void assetManager;
console.log('InstantiationParams.parents length:', params.parents.length);
Properties
parents
parents:
SceneObject[]
List of SceneObject parents to assign during instantiation.