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) –

Return type

PropertyValue

delete_dependency(index) None

Delete Dependency

Parameters

index (int32) –

get_actor(actor_index) Actor

Get Actor

Parameters

actor_index (int32) –

Return type

Actor

get_captured_properties(actor)

Returns which properties have been captured for this actor in Variant

Parameters

actor (Actor) –

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) –

Return type

VariantDependency

get_dependents(level_variant_sets, only_enabled_dependencies)

Returns all the variants that have this variant as a dependency

Parameters
Return type

Array(Variant)

get_display_text() Text

Get Display Text

Return type

Text

get_num_actors() int32

Get Num Actors

Return type

int32

get_num_dependencies() int32

Get Num Dependencies

Return type

int32

get_parent() VariantSet

Get Parent

Return type

VariantSet

get_thumbnail() Texture2D

Gets the thumbnail currently used for this variant

Return type

Texture2D

is_active() bool

Returns true if none of our properties are dirty

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.000000, min_z=50.000000, gamma=2.200000) 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