unreal.CustomizableObjectInstance

class unreal.CustomizableObjectInstance(outer: Object | None = None, name: Name | str = 'None')

Bases: Object

Customizable Object Instance

C++ Source:

  • Plugin: Mutable

  • Module: CustomizableObject

  • File: CustomizableObjectInstance.h

Editor Properties: (see get_editor_property/set_editor_property)

  • updated_delegate (ObjectInstanceUpdatedDelegate): [Read-Write] Broadcast when the Customizable Object Instance is updated.

add_value_to_float_range(param_name) int32

Increases the range of values of the float with ParamName, returns the index of the new float value, -1 otherwise. The added value is initialized with 0.5f and is the last one of the range.

Parameters:

param_name (str)

Return type:

int32

add_value_to_int_range(param_name) int32

Increases the range of values of the integer with ParamName and returns the index of the new integer value, -1 otherwise. The added value is initialized with the first integer option and is the last one of the range.

Parameters:

param_name (str)

Return type:

int32

add_value_to_projector_range(param_name) int32

Increases the range of values of the projector with ParamName, returns the index of the new projector value, -1 otherwise. The added value is initialized with the default projector as set up in the editor and is the last one of the range.

Parameters:

param_name (str)

Return type:

int32

bake(baking_configuration) None

Performs the baking of the instance resources in an async fashion. Bind yourself to the callback present in InBakingConfiguration to get notified in case it fails

Parameters:

baking_configuration (BakingConfiguration) – The configuration to be using for the baking operation

clone() CustomizableObjectInstance

Clones the instance creating a new identical transient instance.

Return type:

CustomizableObjectInstance

clone_static(outer) CustomizableObjectInstance

Clones the instance creating a new identical static instance with the given Outer.

Parameters:

outer (Object)

Return type:

CustomizableObjectInstance

contains_bool_parameter(parameter_name) bool

Return true if the Bool Parameter exists.

Parameters:

parameter_name (str)

Return type:

bool

contains_enum_parameter(parameter_name) bool

Return true if the Int Parameter exists.

Parameters:

parameter_name (str)

Return type:

bool

contains_float_parameter(parameter_name) bool

Return true if the Float Parameter exists.

Parameters:

parameter_name (str)

Return type:

bool

contains_int_parameter(parameter_name) bool

DEPRECATED. Use ContainsEnumParameter instead.

Parameters:

parameter_name (str)

Return type:

bool

contains_material_parameter(parameter_name) bool

Return true if the Material Parameter exists.

Parameters:

parameter_name (str)

Return type:

bool

contains_projector_parameter(parameter_name) bool

Return true if the Projector Parameter exists.

Parameters:

parameter_name (str)

Return type:

bool

contains_skeletal_mesh_parameter(parameter_name) bool

Return true if the Skeletal Mesh Parameter exists.

Parameters:

parameter_name (str)

Return type:

bool

contains_texture_parameter(parameter_name) bool

Return true if the Texture Parameter exists.

Parameters:

parameter_name (str)

Return type:

bool

contains_transform_parameter(parameter_name) bool

Return true if the Transform Parameter exists.

Parameters:

parameter_name (str)

Return type:

bool

contains_vector_parameter(parameter_name) bool

Return true if the Vector Parameter exists.

Parameters:

parameter_name (str)

Return type:

bool

for_each_anim_instance(object_component_index, delegate) None

DEPRECATED: Use ForEachComponentAnimInstance.

Parameters:
for_each_component_anim_instance(component_name, delegate) None

Execute a delegate for each animation instance involved in this customizable object instance.

Parameters:
get_anim_bp(component_name, slot)

Returns the animation BP for the parameter component and slot, gathered from all the meshes that compose this instance.

Parameters:
Return type:

type(Class)

get_animation_gameplay_tags() GameplayTagContainer

Return the list of tags for this instance.

Return type:

GameplayTagContainer

get_bool_parameter_selected_option(bool_param_name) bool

Gets the bool value “BoolValue” of a bool parameter with name “BoolParamName”.

Parameters:

bool_param_name (str)

Return type:

bool

get_build_parameter_relevancy() bool

Return true if the parameter relevancy will be updated when this instance is generated.

Return type:

bool

get_color_parameter_selected_option(color_param_name) LinearColor

Gets the value of a color parameter with name “ColorParamName”.

Parameters:

color_param_name (str)

Return type:

LinearColor

get_component_mesh_skeletal_mesh(component_name) SkeletalMesh

DEPRECATED: Use GetSkeletalMeshComponentSkeletalMesh

Parameters:

component_name (Name)

Return type:

SkeletalMesh

get_component_names() Array[Name]

Return the list of names of components generated for this instance. This only has values when the instance has been completely generated.

Return type:

Array[Name]

get_current_state() str

Return the name of the current CustomizableObject state this is instance is set to.

Return type:

str

get_customizable_object() CustomizableObject

Get the CustomizableObject that this is an instance of.

Return type:

CustomizableObject

get_enum_parameter_selected_option(param_name, range_index=-1) str

Return the name of the option currently set in the given parameter.

Parameters:
  • param_name (str)

  • range_index (int32)

Return type:

str

get_extension_instance_data(extension) InstancedStruct

Get Extension Instance Data

Parameters:

extension (CustomizableObjectExtension)

Return type:

InstancedStruct

get_float_parameter_selected_option(float_param_name, range_index=-1) float

Gets the value of a float parameter with name “FloatParamName”.

Parameters:
  • float_param_name (str)

  • range_index (int32)

Return type:

float

get_float_value_range(param_name) int32

For multidimensional parameters, return the number of dimensions that the given float parameter supports.

Parameters:

param_name (str)

Return type:

int32

get_int_parameter_selected_option(param_name, range_index=-1) str

DEPRECATED. Use GetEnumParameterSelectedOption instead.

Parameters:
  • param_name (str)

  • range_index (int32)

Return type:

str

get_int_value_range(param_name) int32

For multidimensional parameters, return the number of dimensions that the given int parameter supports.

Parameters:

param_name (str)

Return type:

int32

get_material_parameter_selected_option(material_param_name, range_index=-1) MaterialInterface

Gets the value of a Material parameter with name “MaterialParamName”.

Parameters:
  • material_param_name (str)

  • range_index (int32)

Return type:

MaterialInterface

get_merged_asset_user_data(component_index) Set[AssetUserData]

Returns the AssetUserData that was gathered from all the constituent mesh parts during the last update. It requires that the CustomizableObject had the bEnableAssetUserDataMerge set to true during compilation.

Parameters:

component_index (int32)

Return type:

Set[AssetUserData]

get_num_components() int32

Return the total number of components that can be generated with the CustomizableObject (unrelated to this instance parameters). DEPRECATED: Get the CO with GetCustomizableObect and get the components there with GetComponentCount. If the actual components of this instance are required, use GetComponents to get a list of names.

Return type:

int32

get_projector_angle(param_name, range_index=-1) float

Get the current cylindrical projector angle for the parameter with the given name.

Parameters:
  • param_name (str)

  • range_index (int32)

Return type:

float

get_projector_direction(param_name, range_index=-1) Vector

Get the current projector direction vector for the parameter with the given name.

Parameters:
  • param_name (str)

  • range_index (int32)

Return type:

Vector

get_projector_parameter_type(param_name, range_index=-1) CustomizableObjectProjectorType

Get the current projector type for the parameter with the given name.

Parameters:
  • param_name (str)

  • range_index (int32)

Return type:

CustomizableObjectProjectorType

get_projector_position(param_name, range_index=-1) Vector

Get the current projector position for the parameter with the given name.

Parameters:
  • param_name (str)

  • range_index (int32)

Return type:

Vector

get_projector_scale(param_name, range_index=-1) Vector

Get the current projector scale for the parameter with the given name.

Parameters:
  • param_name (str)

  • range_index (int32)

Return type:

Vector

get_projector_up(param_name, range_index=-1) Vector

Get the current projector up vector for the parameter with the given name.

Parameters:
  • param_name (str)

  • range_index (int32)

Return type:

Vector

get_projector_value(projector_param_name, range_index=-1) -> (out_pos=Vector, out_direction=Vector, out_up=Vector, out_scale=Vector, out_angle=float, out_type=CustomizableObjectProjectorType)

Get the projector values of a projector parameter with index “ProjectorParamIndex”.

Parameters:
  • projector_param_name (str)

  • range_index (int32)

Returns:

out_pos (Vector):

out_direction (Vector):

out_up (Vector):

out_scale (Vector):

out_angle (float):

out_type (CustomizableObjectProjectorType):

Return type:

tuple

get_projector_value_range(param_name) int32

For multidimensional parameters, return the number of dimensions that the given projector parameter supports.

Parameters:

param_name (str)

Return type:

int32

get_skeletal_mesh(component_index=0) SkeletalMesh

DEPRECATED: Use GetSkeletalMeshComponentSkeletalMesh

Parameters:

component_index (int32)

Return type:

SkeletalMesh

get_skeletal_mesh_component_override_materials(component_name) Array[MaterialInterface]

Get Skeletal Mesh Component Override Materials

Parameters:

component_name (Name)

Return type:

Array[MaterialInterface]

get_skeletal_mesh_component_skeletal_mesh(component_name) SkeletalMesh

Given a Mesh Component name, return its generated Skeletal Mesh.

Parameters:

component_name (Name)

Return type:

SkeletalMesh

get_skeletal_mesh_parameter_selected_option(skeletal_mesh_param_name, range_index=-1) SkeletalMesh

Gets the value of a Skeletal Mesh parameter with name “SkeletalMeshParamName”.

Parameters:
  • skeletal_mesh_param_name (str)

  • range_index (int32)

Return type:

SkeletalMesh

get_texture_parameter_selected_option(texture_param_name, range_index=-1) Texture

Gets the value of a texture parameter with name “TextureParamName”.

Parameters:
  • texture_param_name (str)

  • range_index (int32)

Return type:

Texture

get_texture_value_range(param_name) int32

For multidimensional parameters, return the number of dimensions that the given texture parameter supports.

Parameters:

param_name (str)

Return type:

int32

get_transform_parameter_selected_option(transform_param_name) Transform

Gets the value of a transform parameter with name “TransformParamName”.

Parameters:

transform_param_name (str)

Return type:

Transform

has_any_parameters() bool

Return true if the instance has any parameters.

Return type:

bool

has_any_skeletal_mesh() bool

Return true if a skeletal mesh has been generated for any component of this instance.

Return type:

bool

is_parameter_dirty(param_name, range_index=-1) bool

Return true if the parameter has changed but the Instance has not yet been updated.

Parameters:
  • param_name (str)

  • range_index (int32)

Return type:

bool

is_parameter_relevant(param_name) bool

Return true if the given parameter has any effect in the current object state, and considering the current values of the other parameters.

Parameters:

param_name (str)

Return type:

bool

multilayer_projector_create_layer(projector_param_name, index) None

See FMultilayerProjector::CreateLayer.

Parameters:
  • projector_param_name (Name)

  • index (int32)

multilayer_projector_get_layer(projector_param_name, index) MultilayerProjectorLayer

See FMultilayerProjector::GetLayer.

Parameters:
  • projector_param_name (Name)

  • index (int32)

Return type:

MultilayerProjectorLayer

multilayer_projector_num_layers(projector_param_name) int32

See FMultilayerProjector::NumLayers.

Parameters:

projector_param_name (Name)

Return type:

int32

multilayer_projector_remove_layer_at(projector_param_name, index) None

See FMultilayerProjector::RemoveLayerAt.

Parameters:
  • projector_param_name (Name)

  • index (int32)

multilayer_projector_update_layer(projector_param_name, index, layer) None

See FMultilayerProjector::UpdateLayer.

Parameters:
remove_value_from_float_range(param_name, range_index=-1) int32
Remove the FRangeIndex element of the float range of values from the parameter ParamName. If RangeValue is -1 removes the last of the float range of values.

Returns the index of the last valid float, -1 if no values left.

Parameters:
  • param_name (str)

  • range_index (int32)

Return type:

int32

remove_value_from_int_range(param_name, range_index=-1) int32
Remove the FRangeIndex element of the integer range of values from the parameter ParamName. If RangeValue is -1 removes the last of the integer range of values.

Returns the index of the last valid integer, -1 if no values left.

Parameters:
  • param_name (str)

  • range_index (int32)

Return type:

int32

remove_value_from_projector_range(param_name, range_index=-1) int32
Remove the FRangeIndex element of the projector range of values from the parameter ParamName. If RangeValue is -1 removes the last of the projector range of values.

Returns the index of the last valid projector, -1 if no values left.

Parameters:
  • param_name (str)

  • range_index (int32)

Return type:

int32

set_bool_parameter_selected_option(bool_param_name, bool_value) None

Sets the bool value “BoolValue” of a bool parameter with name “BoolParamName”.

Parameters:
  • bool_param_name (str)

  • bool_value (bool)

set_build_parameter_relevancy(value) None

Set the flag that controls if parameter relevancy will be updated when this instance is generated.

Parameters:

value (bool)

set_color_parameter_selected_option(color_param_name, color_value) None

Sets the color value “ColorValue” of a color parameter with index “ColorParamIndex”.

Parameters:
set_current_state(state_name) None

Set the CustomizableObject state that this instance will be generated into.

Parameters:

state_name (str)

set_default_value(param_name) None

Sets a parameter to its default value

Parameters:

param_name (str)

set_default_values() None

Set all parameters to their default value.

set_enum_parameter_selected_option(param_name, selected_option_name, range_index=-1) None

Set the currently selected option value for the given parameter, by parameter name and option name.

Parameters:
  • param_name (str)

  • selected_option_name (str)

  • range_index (int32)

set_float_parameter_selected_option(float_param_name, float_value, range_index=-1) None

Sets the float value “FloatValue” of a float parameter with index “FloatParamIndex”.

Parameters:
  • float_param_name (str)

  • float_value (float)

  • range_index (int32)

set_int_parameter_selected_option(param_name, selected_option_name, range_index=-1) None

DEPRECATED. Use SetEnumParameterSelectedOption instead.

Parameters:
  • param_name (str)

  • selected_option_name (str)

  • range_index (int32)

set_material_parameter_selected_option(material_param_name, material_value, range_index=-1) None

Sets the Material value “MaterialParamName” of a Material parameter with index “MaterialParamName”.

Parameters:
set_object(object) None

Set the CustomizableObject this instance will be generated from. It is usually not necessary to call this since instances are already generated from a CustomizableObject.

Parameters:

object (CustomizableObject)

set_projector_angle(projector_param_name, angle, range_index=-1) None

Set only the cylindrical projector angle keeping the rest of values.

Parameters:
  • projector_param_name (str)

  • angle (float)

  • range_index (int32)

set_projector_direction(projector_param_name, direction, range_index=-1) None

Set only the projector direction vector keeping the rest of values.

Parameters:
  • projector_param_name (str)

  • direction (Vector)

  • range_index (int32)

set_projector_position(projector_param_name, pos, range_index=-1) None

Set only the projector position keeping the rest of values.

Parameters:
  • projector_param_name (str)

  • pos (Vector)

  • range_index (int32)

set_projector_scale(projector_param_name, scale, range_index=-1) None

Set only the projector scale keeping the rest of values.

Parameters:
  • projector_param_name (str)

  • scale (Vector)

  • range_index (int32)

set_projector_up(projector_param_name, up, range_index=-1) None

Set only the projector up vector keeping the rest of values.

Parameters:
  • projector_param_name (str)

  • up (Vector)

  • range_index (int32)

set_projector_value(projector_param_name, out_pos, out_direction, out_up, out_scale, out_angle, range_index=-1) None

Sets the projector values of a projector parameter with index “ProjectorParamIndex”.

Parameters:
set_random_values() None

Set random values to the parameters.

set_random_values_from_stream(stream) None

Set random values to the parameters using a stream.

Parameters:

stream (RandomStream)

set_replace_physics_assets(replace_enabled) None

Enable physics asset replacement so that generated skeletal meshes have the merged physics assets of their skeletal mesh parts and reference mesh.

Parameters:

replace_enabled (bool)

set_skeletal_mesh_parameter_selected_option(skeletal_mesh_param_name, skeletal_mesh_value, range_index=-1) None

Sets the Skeletal Mesh value “SkeletalMeshValue” of a Skeletal Mesh parameter with index “SkeletalMeshParamName”.

Parameters:
  • skeletal_mesh_param_name (str)

  • skeletal_mesh_value (SkeletalMesh)

  • range_index (int32)

set_texture_parameter_selected_option(texture_param_name, texture_value, range_index=-1) None

Sets the texture value “TextureValue” of a texture parameter with index “TextureParamIndex”.

Parameters:
  • texture_param_name (str)

  • texture_value (Texture)

  • range_index (int32)

set_transform_parameter_selected_option(transform_param_name, transform_value) None

Sets the transform value “TransformValue” of a transform parameter with name “TransformParamName”.

Parameters:
set_vector_parameter_selected_option(vector_param_name, vector_value) None

Sets the vector value “VectorValue” of a vector parameter with index “VectorParamIndex”.

Parameters:
update_skeletal_mesh_async(ignore_close_dist=False, force_high_priority=False) None

Generate the instance with the current parameters and update all the components Skeletal Meshes asynchronously.

Parameters:
  • ignore_close_dist (bool)

  • force_high_priority (bool)

update_skeletal_mesh_async_result(callback, ignore_close_dist=False, force_high_priority=False) None

Generate the instance with the current parameters and update all the components Skeletal Meshes asynchronously. Callback will be called once the update finishes, even if it fails.

Parameters:
property updated_delegate: ObjectInstanceUpdatedDelegate

[Read-Write] Broadcast when the Customizable Object Instance is updated.

Type:

(ObjectInstanceUpdatedDelegate)