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.
- 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 get_blackboard_value_as_so_claim_handle(node_owner, key) SmartObjectClaimHandle ¶
Get Blackboard Value as SOClaim Handle
- Parameters:
node_owner (BTNode) –
key (BlackboardKeySelector) –
- Return type:
- 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 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) 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
- 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 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 SOClaim 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) –