unreal.SmartObjectLibrary

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

Bases: BlueprintFunctionLibrary

Smart Object Blueprint Function Library

C++ Source:

  • Plugin: SmartObjects

  • Module: SmartObjectsModule

  • File: SmartObjectBlueprintFunctionLibrary.h

classmethod add_multiple_smart_objects(smart_object_actors) bool

Adds to the simulation all smart objects for multiple actors.

Parameters:

smart_object_actors (Array[Actor]) – The actors containing the smart objects to add to the simulation

Returns:

True if the requested operation succeeded; false otherwise

Return type:

bool

classmethod add_or_remove_multiple_smart_objects(smart_object_actors, add) bool

Adds to the simulation all smart objects for multiple actors or removes them according to ‘bAdd’. note: Removing a smart object from the simulation will interrupt all active interactions. If you simply need to make the object unavailable for queries consider using one of the SetSmartObjectEnabled functions so active interactions can be gracefully completed. see: SetSmartObjectEnabled, SetMultipleSmartObjectsEnabled

Parameters:
  • smart_object_actors (Array[Actor]) – The actors containing the smart objects to add or remove from the simulation

  • add (bool) – Whether the smart objects should be added or removed from the simulation

Returns:

True if all actors were valid and the requested operation succeeded; false otherwise

Return type:

bool

classmethod add_or_remove_smart_object(smart_object, enabled) bool

Adds to the simulation all smart objects for an actor or removes them according to ‘bAdd’. note: Removing a smart object from the simulation will interrupt all active interactions. If you simply need to make the object unavailable for queries consider using one of the SetSmartObjectEnabled functions so active interactions can be gracefully completed. see: SetSmartObjectEnabled, SetMultipleSmartObjectsEnabled

Parameters:
  • smart_object (Actor) –

  • enabled (bool) –

Returns:

True if the requested operation succeeded; false otherwise

Return type:

bool

classmethod add_smart_object(smart_object_actor) bool

Adds to the simulation all smart objects for an actor.

Parameters:

smart_object_actor (Actor) – The actor containing the smart objects to add to the simulation

Returns:

True if the requested operation succeeded; false otherwise

Return type:

bool

classmethod conv_smart_object_claim_handle_to_string(result) str

Converts a SmartObjectClaimHandle value to a string

Parameters:

result (SmartObjectClaimHandle) –

Return type:

str

classmethod conv_smart_object_definition_to_string(definition) str

Converts a SmartObjectDefinition value to a string

Parameters:

definition (SmartObjectDefinition) –

Return type:

str

classmethod conv_smart_object_handle_to_string(handle) str

Converts a SmartObjectHandle value to a string

Parameters:

handle (SmartObjectHandle) –

Return type:

str

classmethod conv_smart_object_request_result_to_string(result) str

Converts a SmartObjectRequestResult value to a string

Parameters:

result (SmartObjectRequestResult) –

Return type:

str

classmethod conv_smart_object_slot_handle_to_string(handle) str

Converts a SmartObjectSlotHandle value to a string

Parameters:

handle (SmartObjectSlotHandle) –

Return type:

str

classmethod equal_smart_object_handle_smart_object_handle(a, b) bool

Returns true if SmartObjectHandle A is equal to SmartObjectHandle B (A == B)

Parameters:
Return type:

bool

classmethod equal_smart_object_slot_handle_smart_object_slot_handle(a, b) bool

Returns true if SmartObjectSlotHandle A is equal to SmartObjectSlotHandle B (A == B)

Parameters:
Return type:

bool

classmethod find_smart_objects_in_actor(filter, search_actor, user_actor=None) Array[SmartObjectRequestResult] or None

Search a given Actor for slot candidates respecting the request criteria and selection conditions.

Parameters:
  • filter (SmartObjectRequestFilter) – Parameters defining the search area and criteria

  • search_actor (Actor) – The actor to search

  • user_actor (Actor) – Used to create additional data that could be provided to bind values in the conditions evaluation context

Returns:

True if at least one candidate was found.

out_results (Array[SmartObjectRequestResult]): List of smart object slot candidates found in range

Return type:

Array[SmartObjectRequestResult] or None

classmethod find_smart_objects_in_component(filter, smart_object_component, user_actor=None) Array[SmartObjectRequestResult] or None

Search a given Smart Object Component for slot candidates respecting the request criteria and selection conditions.

Parameters:
  • filter (SmartObjectRequestFilter) – Parameters defining the search area and criteria

  • smart_object_component (SmartObjectComponent) – The component to search

  • user_actor (Actor) – Used to create additional data that could be provided to bind values in the conditions evaluation context

Returns:

True if at least one candidate was found.

out_results (Array[SmartObjectRequestResult]): List of smart object slot candidates found in range

Return type:

Array[SmartObjectRequestResult] or None

classmethod find_smart_objects_in_list(world_context_object, filter, actor_list, user_actor=None) Array[SmartObjectRequestResult] or None

Search list of specific actors (often from a physics query) for slot candidates respecting request criteria and selection conditions.

Parameters:
  • world_context_object (Object) – Object used to fetch the SmartObjectSubsystem of its associated world.

  • filter (SmartObjectRequestFilter) – Parameters defining the search area and criteria

  • actor_list (Array[Actor]) – Ordered list of actors to search

  • user_actor (Actor) –

Returns:

True if at least one candidate was found.

out_results (Array[SmartObjectRequestResult]): List of smart object slot candidates found in range

Return type:

Array[SmartObjectRequestResult] or None

classmethod find_smart_objects_in_targeting_request(world_context_object, filter, targeting_handle, user_actor=None) Array[SmartObjectRequestResult] or None

Search the results of the given targeting handle request for smart objects that match the request criteria

Parameters:
  • world_context_object (Object) – Object used to fetch the SmartObjectSubsystem of its associated world.

  • filter (SmartObjectRequestFilter) – Parameters defining the search area and criteria

  • targeting_handle (TargetingRequestHandle) – The targeting handle of the request that will have its results searched for smart objects

  • user_actor (Actor) – Used to create additional data that could be provided to bind values in the conditions evaluation context

Returns:

True if at least one candidate was found.

out_results (Array[SmartObjectRequestResult]): List of smart object slot candidates found in range

Return type:

Array[SmartObjectRequestResult] or None

classmethod get_blackboard_value_as_so_claim_handle(node_owner, key) SmartObjectClaimHandle

Get Blackboard Value as SOClaim Handle

Parameters:
Return type:

SmartObjectClaimHandle

classmethod get_value_as_so_claim_handle(blackboard_component, key_name) SmartObjectClaimHandle

Get Value as SOClaim Handle

Parameters:
Return type:

SmartObjectClaimHandle

classmethod is_valid_smart_object_claim_handle(handle) bool

Is Valid Smart Object Claim Handle

Parameters:

handle (SmartObjectClaimHandle) –

Return type:

bool

classmethod is_valid_smart_object_handle(handle) bool

Returns true if the given handle is valid

Parameters:

handle (SmartObjectHandle) –

Return type:

bool

classmethod is_valid_smart_object_slot_handle(handle) bool

Returns true if the given Smart Object Slot Handle is valid.

Parameters:

handle (SmartObjectSlotHandle) –

Return type:

bool

classmethod k2_set_smart_object_enabled(smart_object: Actor, enabled: bool) bool

deprecated: ‘k2_set_smart_object_enabled’ was renamed to ‘add_or_remove_smart_object’.

classmethod mark_smart_object_slot_as_claimed(world_context_object, slot_handle, user_actor=None, claim_priority=SmartObjectClaimPriority.NORMAL) SmartObjectClaimHandle

Marks a smart object slot from a request result as claimed.

Parameters:
  • world_context_object (Object) – Object used to fetch the SmartObjectSubsystem of its associated world.

  • slot_handle (SmartObjectSlotHandle) – Handle to a smart object slot.

  • user_actor (Actor) – Actor claiming the smart object

  • claim_priority (SmartObjectClaimPriority) – Claim priority, a slot claimed at lower priority can be claimed by higher priority (unless already in use).

Returns:

A handle binding the claimed smart object, its slot and a user id.

Return type:

SmartObjectClaimHandle

classmethod mark_smart_object_slot_as_free(world_context_object, claim_handle) bool

Marks a claimed or occupied smart object as free.

Parameters:
  • world_context_object (Object) – Object used to fetch the SmartObjectSubsystem of its associated world.

  • claim_handle (SmartObjectClaimHandle) – Handle to a claimed slot returned by any of the Claim methods.

Returns:

Whether the claim was successfully released or not

Return type:

bool

classmethod mark_smart_object_slot_as_occupied(world_context_object, claim_handle, definition_class) SmartObjectBehaviorDefinition

Marks a previously claimed smart object slot as occupied.

Parameters:
  • world_context_object (Object) – Object used to fetch the SmartObjectSubsystem of its associated world.

  • claim_handle (SmartObjectClaimHandle) – Handle to a claimed slot returned by any of the Claim methods.

  • definition_class (type(Class)) – The type of behavior definition the user wants to use.

Returns:

The base class pointer of the requested behavior definition class associated to the slot

Return type:

SmartObjectBehaviorDefinition

classmethod not_equal_smart_object_handle_smart_object_handle(a, b) bool

Returns true if SmartObjectHandle A is NOT equal to SmartObjectHandle B (A != B)

Parameters:
Return type:

bool

classmethod not_equal_smart_object_slot_handle_smart_object_slot_handle(a, b) bool

Returns true if SmartObjectSlotHandle A is NOT equal to SmartObjectSlotHandle B (A != B)

Parameters:
Return type:

bool

classmethod remove_multiple_smart_objects(smart_object_actors) bool

Removes from the simulation all smart objects for multiple actors. note: Removing a smart object from the simulation will interrupt all active interactions. If you simply need to make the object unavailable for queries consider using one of the SetSmartObjectEnabled functions so active interactions can be gracefully completed. see: SetSmartObjectEnabled, SetMultipleSmartObjectsEnabled

Parameters:

smart_object_actors (Array[Actor]) – The actors containing the smart objects to remove from the simulation

Returns:

True if the requested operation succeeded; false otherwise

Return type:

bool

classmethod remove_smart_object(smart_object_actor) bool

Removes from the simulation all smart objects for an actor. note: Removing a smart object from the simulation will interrupt all active interactions. If you simply need to make the object unavailable for queries consider using one of the SetSmartObjectEnabled functions so active interactions can be gracefully completed. see: SetSmartObjectEnabled, SetMultipleSmartObjectsEnabled

Parameters:

smart_object_actor (Actor) – The actor containing the smart objects to add or remove from the simulation

Returns:

True if the requested operation succeeded; false otherwise

Return type:

bool

classmethod set_blackboard_value_as_so_claim_handle(node_owner, key, value) None

Set Blackboard Value as SOClaim Handle

Parameters:
classmethod set_multiple_smart_objects_enabled(smart_object_actors, enabled) bool

Marks all smart objects for a list of actors as enabled or not according to ‘bEnabled’. A smart object marked as Enabled is available for queries. note: Disabling a smart object will not interrupt active interactions, it will simply mark the object unavailable for new queries and broadcast an event that can be handled by the interacting agent to complete earlier. If the object should not be consider usable anymore and the interactions aborted then consider using one of the Add/RemoveSmartObject functions. see: AddOrRemoveSmartObject, AddOrRemoveMultipleSmartObjects, AddSmartObject, AddMultipleSmartObjects, RemoveSmartObject, RemoveMultipleSmartObjects

Parameters:
  • smart_object_actors (Array[Actor]) – The actors containing the smart objects to enable/disable

  • enabled (bool) – Whether the smart objects should be in the simulation (added) or not (removed)

Returns:

True if all actors were valid and the requested operation succeeded; false otherwise

Return type:

bool

classmethod set_smart_object_enabled(smart_object_actor, enabled) bool

Marks all smart objects for an actor as enabled or not according to ‘bEnabled’. A smart object marked as Enabled is available for queries. note: Disabling a smart object will not interrupt active interactions, it will simply mark the object unavailable for new queries and broadcast an event that can be handled by the interacting agent to complete earlier. If the object should not be consider usable anymore and the interactions aborted then consider using one of the Add/RemoveSmartObject functions. see: AddOrRemoveSmartObject, AddOrRemoveMultipleSmartObjects, AddSmartObject, AddMultipleSmartObjects, RemoveSmartObject, RemoveMultipleSmartObjects

Parameters:
  • smart_object_actor (Actor) – The actor containing the smart objects to enable/disable

  • enabled (bool) – Whether the smart objects should be enabled or not

Returns:

True if the requested operation succeeded; false otherwise

Return type:

bool

classmethod set_value_as_so_claim_handle(blackboard_component, key_name, value) None

Set Value as SOClaim Handle

Parameters:
classmethod smart_object_claim_handle_invalid() SmartObjectClaimHandle

Returns the invalid smart object claim handle.

Return type:

SmartObjectClaimHandle