unreal.SmartObjectDefinition

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

Bases: DataAsset

SmartObject definition asset. Contains sharable information that can be used by multiple SmartObject instances at runtime.

C++ Source:

  • Plugin: SmartObjects

  • Module: SmartObjectsModule

  • File: SmartObjectDefinition.h

Editor Properties: (see get_editor_property/set_editor_property)

  • activity_tags (GameplayTagContainer): [Read-Write] Tags identifying this Smart Object’s use case. Can be used while looking for objects supporting given activity

  • activity_tags_merging_policy (SmartObjectTagMergingPolicy): [Read-Write] Indicates how Tags from slots and parent object are combined to be evaluated by a TagQuery from a find request.

  • default_behavior_definitions (Array[SmartObjectBehaviorDefinition]): [Read-Write] List of behavior definitions of different types provided to SO’s user if the slot does not provide one.

  • definition_data (Array[SmartObjectDefinitionDataProxy]): [Read-Write] Custom definition data items (struct inheriting from SmartObjectDefinitionData) for the whole Smart Object.

  • object_tag_filter (GameplayTagQuery): [Read-Write] deprecated: Use FWorldCondition_SmartObjectActorTagQuery or FSmartObjectWorldConditionObjectTagQuery in Preconditions instead.

  • parameters (InstancedPropertyBag): [Read-Write] Parameters for the SmartObject definition

  • preconditions (WorldConditionQueryDefinition): [Read-Write] Preconditions that must pass for the object to be found/used.

  • slots (Array[SmartObjectSlotDefinition]): [Read-Write] Where SmartObject’s user needs to stay to be able to activate it. These will be used by AI to approach the object. Locations are relative to object’s location.

  • user_tag_filter (GameplayTagQuery): [Read-Write] This object is available if user tags match this query; always available if query is empty.

  • user_tags_filtering_policy (SmartObjectTagFilteringPolicy): [Read-Write] Indicates how TagQueries from slots and parent object will be processed against User Tags from a find request.

  • world_condition_schema_class (type(Class)): [Read-Write]

get_activity_tags() GameplayTagContainer

Returns the list of tags describing the activity associated to this definition

Return type:

GameplayTagContainer

get_bounds() Box

Return bounds encapsulating all slots

Return type:

Box

get_mutable_slot(index) SmartObjectSlotDefinition
Parameters:

index (int32) –

Returns:

mutable slot definition stored at a given index

Return type:

SmartObjectSlotDefinition

get_slot_activity_tags_by_index(slot_index) GameplayTagContainer

Fills the provided GameplayTagContainer with the activity tags associated to the slot according to the tag merging policy.

Parameters:

slot_index (int32) – Index of the slot for which the tags are requested

Returns:

out_activity_tags (GameplayTagContainer): Tag container to fill with the activity tags associated to the slot

Return type:

GameplayTagContainer

get_slot_world_transform(slot_index, owner_transform) Transform

Returns the transform (in world space) of the given slot index. note: Method will ensure on invalid slot index.

Parameters:
  • slot_index (int32) – Index within the list of slots.

  • owner_transform (Transform) – Transform (in world space) of the slot owner.

Returns:

Transform (in world space) of the slot associated to SlotIndex, or OwnerTransform if index is invalid.

Return type:

Transform

get_user_tag_filter() GameplayTagQuery

Returns the tag query to run on the user tags provided by a request to accept this definition

Return type:

GameplayTagQuery

get_user_tags_filtering_policy() SmartObjectTagFilteringPolicy

Returns the tag filtering policy that should be applied on User tags by this definition

Return type:

SmartObjectTagFilteringPolicy

is_valid_slot_index(slot_index) bool
Parameters:

slot_index (int32) –

Returns:

True if specified slot index is valid.

Return type:

bool

k2_get_slots() Array[SmartObjectSlotDefinition]

K2 Get Slots

Return type:

Array[SmartObjectSlotDefinition]

property object_tag_filter: GameplayTagQuery

[Read-Write] deprecated: Use FWorldCondition_SmartObjectActorTagQuery or FSmartObjectWorldConditionObjectTagQuery in Preconditions instead.

Type:

(GameplayTagQuery)

set_user_tag_filter(user_tag_filter) None

Sets the tag query to run on the user tags provided by a request to accept this definition

Parameters:

user_tag_filter (GameplayTagQuery) –