unreal.Variant

class unreal.Variant(outer=None, name='None')

Bases: unreal.Object

C++ Source:

  • Plugin: VariantManagerContent

  • Module: VariantManagerContent

  • File: Variant.h

add_actor_binding(actor)None

Binds the Actor to the Variant, internally creating a VariantObjectBinding

Parameters

actor (Actor) –

add_dependency(dependency) -> (int32, dependency=VariantDependency)

Add Dependency

Parameters

dependency (VariantDependency) –

Returns

dependency (VariantDependency):

Return type

VariantDependency

capture_property(actor, property_path)PropertyValue

Finds the actor binding to Actor within Variant and tries capturing a property with PropertyPath Returns the captured UPropertyValue if succeeded or nullptr if it failed.

Parameters
  • actor (Actor) –

  • property_path (str) –

Returns

Return type

PropertyValue

delete_dependency(index)None

Delete Dependency

Parameters

index (int32) –

get_actor(actor_index)Actor

Get Actor

Parameters

actor_index (int32) –

Returns

Return type

Actor

get_captured_properties(actor)

Returns which properties have been captured for this actor in Variant

Parameters

actor (Actor) –

Returns

Return type

Array(PropertyValue)

get_dependency(index)VariantDependency

Get the dependency at index ‘Index’ by value. Will crash if index is invalid

Parameters

index (int32) –

Returns

Return type

VariantDependency

get_dependents(level_variant_sets, only_enabled_dependencies)

Returns all the variants that have this variant as a dependency

Parameters
Returns

Return type

Array(Variant)

get_display_text()Text

Get Display Text

Returns

Return type

Text

get_num_actors()int32

Get Num Actors

Returns

Return type

int32

get_num_dependencies()int32

Get Num Dependencies

Returns

Return type

int32

get_parent()VariantSet

Get Parent

Returns

Return type

VariantSet

get_thumbnail()Texture2D

Gets the thumbnail currently used for this variant

Returns

Return type

Texture2D

is_active()bool

Returns true if none of our properties are dirty

Returns

Return type

bool

remove_actor_binding(actor)None

Removes an actor binding to Actor from Variant, if it exists

Parameters

actor (Actor) –

remove_actor_binding_by_name(actor_name)None

Looks for an actor binding to an actor with ActorLabel within Variant and removes it, if it exists

Parameters

actor_name (str) –

remove_captured_property(actor, property_)None

Removes a property capture from an actor binding within Variant, if it exists

Parameters
remove_captured_property_by_name(actor, property_path)None

Removes property capture with PropertyPath from Actor’s binding within Variant, if it exists

Parameters
  • actor (Actor) –

  • property_path (str) –

set_dependency(index, dependency)VariantDependency

Set Dependency

Parameters
Returns

dependency (VariantDependency):

Return type

VariantDependency

set_display_text(new_display_text)None

Set Display Text

Parameters

new_display_text (Text) –

set_thumbnail_from_camera(world_context_object, camera_transform, fov_degrees=50.0, min_z=50.0, gamma=2.2)None

Set Thumbnail from Camera

Parameters
set_thumbnail_from_editor_viewport()None

Sets the thumbnail from the active editor viewport. Doesn’t do anything if the Editor is not available

set_thumbnail_from_file(file_path)None

Set Thumbnail from File

Parameters

file_path (str) –

set_thumbnail_from_texture(new_thumbnail)None

Sets the thumbnail to use for this variant. Can receive nullptr to clear it

Parameters

new_thumbnail (Texture2D) –

switch_on()None

Switch On