unreal.SmartObjectLibrary¶
- class unreal.SmartObjectLibrary(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
BlueprintFunctionLibrarySmart 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.
- 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:
- Returns:
True if all actors were valid and the requested operation succeeded; false otherwise
- Return type:
- 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
- classmethod add_smart_object(smart_object_actor) bool¶
Adds to the simulation all smart objects for an actor.
- classmethod conv_smart_object_claim_handle_to_string(result) str¶
Converts a SmartObjectClaimHandle value to a string
- Parameters:
result (SmartObjectClaimHandle)
- Return type:
- classmethod conv_smart_object_definition_to_string(definition) str¶
Converts a SmartObjectDefinition value to a string
- Parameters:
definition (SmartObjectDefinition)
- Return type:
- classmethod conv_smart_object_handle_to_string(handle) str¶
Converts a SmartObjectHandle value to a string
- Parameters:
handle (SmartObjectHandle)
- Return type:
- classmethod conv_smart_object_request_result_to_string(result) str¶
Converts a SmartObjectRequestResult value to a string
- Parameters:
result (SmartObjectRequestResult)
- Return type:
- classmethod conv_smart_object_slot_handle_to_string(handle) str¶
Converts a SmartObjectSlotHandle value to a string
- Parameters:
handle (SmartObjectSlotHandle)
- Return type:
- 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:
- 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:
- 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 Smart Object Claim Handle
- Parameters:
node_owner (BTNode)
key (BlackboardKeySelector)
- Return type:
- classmethod get_num_slot_entrances(definition, slot_index) int32¶
Returns the number of entrance annotations on a slot. Use this to iterate entrances with GetSlotEntranceOffsetAndRotation.
- Parameters:
definition (SmartObjectDefinition) – The smart object definition to query
slot_index (int32) – Index of the slot to query
- Returns:
The number of entrance annotations on the slot, or 0 if the definition or slot is invalid
- Return type:
int32
- classmethod get_slot_entrance_offset_and_rotation(definition, slot_index, entrance_index) (out_offset=Vector, out_rotation=Rotator) or None¶
Returns the entrance offset and rotation for a specific entrance annotation on a slot.
- Parameters:
definition (SmartObjectDefinition) – The smart object definition to query
slot_index (int32) – Index of the slot to query
entrance_index (int32) – Index of the entrance annotation within the slot (0 for first entrance)
- Returns:
True if the entrance annotation was found at the given indices
out_offset (Vector): The local space offset of the entrance
out_rotation (Rotator): The local space rotation of the entrance
- Return type:
tuple or None
- classmethod get_slot_entrance_transform(definition, slot_index, entrance_index) Transform or None¶
Returns the entrance transform (offset and rotation combined) for a specific entrance annotation on a slot. This is equivalent to GetSlotEntranceOffsetAndRotation but returns the result as a single FTransform.
- Parameters:
definition (SmartObjectDefinition) – The smart object definition to query
slot_index (int32) – Index of the slot to query
entrance_index (int32) – Index of the entrance annotation within the slot (0 for first entrance)
- Returns:
True if the entrance annotation was found at the given indices
out_transform (Transform): The local space transform of the entrance (translation from Offset, rotation from Rotation, unit scale)
- Return type:
Transform or None
- classmethod get_value_as_so_claim_handle(blackboard_component, key_name) SmartObjectClaimHandle¶
Get Value as SOClaim Handle
- Parameters:
blackboard_component (BlackboardComponent)
key_name (Name)
- Return type:
- classmethod is_valid_smart_object_claim_handle(handle) bool¶
Is Valid (Smart Object Claim Handle)
- Parameters:
handle (SmartObjectClaimHandle)
- Return type:
- classmethod is_valid_smart_object_handle(handle) bool¶
Returns true if the given handle is valid
- Parameters:
handle (SmartObjectHandle)
- Return type:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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
- 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
- classmethod set_blackboard_value_as_so_claim_handle(node_owner, key, value) None¶
Set Blackboard Value As Smart Object Claim Handle
- Parameters:
node_owner (BTNode)
key (BlackboardKeySelector)
value (SmartObjectClaimHandle)
- 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:
- Returns:
True if all actors were valid and the requested operation succeeded; false otherwise
- Return type:
- 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
- classmethod set_value_as_so_claim_handle(blackboard_component, key_name, value) None¶
Set Value as SOClaim Handle
- Parameters:
blackboard_component (BlackboardComponent)
key_name (Name)
value (SmartObjectClaimHandle)
- classmethod smart_object_claim_handle_invalid() SmartObjectClaimHandle¶
Returns the invalid smart object claim handle.
- Return type: