Open 3D Engine AzToolsFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzToolsFramework::EditorComponentAPIRequests Class Referenceabstract

Exposes the Editor Component CRUD API; it is exposed to Behavior Context for Editor Scripting. More...

#include <EditorComponentAPIBus.h>

Inherits AZ::EBusTraits.

Public Types

enum class  EntityType { Game , System , Layer , Level }
 
using AddComponentsOutcome = AZ::Outcome< AZStd::vector< AZ::EntityComponentIdPair >, AZStd::string >
 
using GetComponentOutcome = AZ::Outcome< AZ::EntityComponentIdPair, AZStd::string >
 
using GetComponentsOutcome = AZ::Outcome< AZStd::vector< AZ::EntityComponentIdPair >, AZStd::string >
 
using PropertyTreeOutcome = AZ::Outcome< PropertyTreeEditor, AZStd::string >
 
using PropertyOutcome = AZ::Outcome< AZStd::any, AZStd::string >
 

Public Member Functions

virtual AZStd::vector< AZ::Uuid > FindComponentTypeIdsByEntityType (const AZStd::vector< AZStd::string > &componentTypeNames, EntityType entityType)=0
 
virtual AZStd::vector< AZ::Uuid > FindComponentTypeIdsByService (const AZStd::vector< AZ::ComponentServiceType > &serviceFilter, const AZStd::vector< AZ::ComponentServiceType > &incompatibleServiceFilter)=0
 
virtual AZStd::vector< AZStd::string > FindComponentTypeNames (const AZ::ComponentTypeList &componentTypeIds)=0
 Finds the component names from their type ids.
 
virtual AZStd::vector< AZStd::string > BuildComponentTypeNameListByEntityType (EntityType entityType)=0
 Returns the full list of names for all components that can be created for the given Entity type (aka type of Menu).
 
virtual AddComponentsOutcome AddComponentsOfType (AZ::EntityId entityId, const AZ::ComponentTypeList &componentTypeIds)=0
 Add Components of the given types to an Entity.
 
virtual AddComponentsOutcome AddComponentOfType (AZ::EntityId entityId, const AZ::Uuid &componentTypeId)=0
 Add a single component of a given type to an Entity.
 
virtual bool HasComponentOfType (AZ::EntityId entityId, AZ::Uuid componentTypeId)=0
 Returns true if a Component of type provided can be found on Entity, false otherwise.
 
virtual size_t CountComponentsOfType (AZ::EntityId entityId, AZ::Uuid componentTypeId)=0
 Count Components of type provided on the Entity.
 
virtual GetComponentOutcome GetComponentOfType (AZ::EntityId entityId, AZ::Uuid componentTypeId)=0
 Get Component of type from Entity.
 
virtual GetComponentsOutcome GetComponentsOfType (AZ::EntityId entityId, AZ::Uuid componentTypeId)=0
 Get all Components of type from Entity.
 
virtual bool IsValid (AZ::EntityComponentIdPair componentInstance)=0
 Verify if component instance referenced by AZ::EntityComponentIdPair is valid.
 
virtual bool EnableComponents (const AZStd::vector< AZ::EntityComponentIdPair > &componentInstances)=0
 Enable Components on Entity by AZ::EntityComponentIdPair. Returns true if the operation was successful, false otherwise.
 
virtual bool IsComponentEnabled (const AZ::EntityComponentIdPair &componentInstance)=0
 Returns true if the Component is active.
 
virtual bool DisableComponents (const AZStd::vector< AZ::EntityComponentIdPair > &componentInstances)=0
 Disable Components on Entity by AZ::EntityComponentIdPair. Returns true if the operation was successful, false otherwise.
 
virtual bool RemoveComponents (const AZStd::vector< AZ::EntityComponentIdPair > &componentInstances)=0
 Remove Components from Entity by AZ::EntityComponentIdPair. Returns true if the operation was successful, false otherwise.
 
virtual PropertyTreeOutcome BuildComponentPropertyTreeEditor (const AZ::EntityComponentIdPair &componentInstance)=0
 Get the PropertyTreeEditor for the Component Instance provided.
 
virtual PropertyOutcome GetComponentProperty (const AZ::EntityComponentIdPair &componentInstance, const AZStd::string_view propertyPath)=0
 Get Value of Property on Component.
 
virtual PropertyOutcome SetComponentProperty (const AZ::EntityComponentIdPair &componentInstance, const AZStd::string_view propertyPath, const AZStd::any &value)=0
 
virtual bool CompareComponentProperty (const AZ::EntityComponentIdPair &componentInstance, const AZStd::string_view propertyPath, const AZStd::any &value)=0
 Compare Value of Property on Component.
 
virtual const AZStd::vector< AZStd::string > BuildComponentPropertyList (const AZ::EntityComponentIdPair &componentInstance)=0
 Get a full list of Component Properties for the Component Entity provided.
 
virtual void SetVisibleEnforcement (bool enforceVisiblity)=0
 Toggles the usage of visible enforcement logic (defaults to False)
 

Static Public Attributes

static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single
 
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single
 

Detailed Description

Exposes the Editor Component CRUD API; it is exposed to Behavior Context for Editor Scripting.

Member Function Documentation

◆ FindComponentTypeIdsByEntityType()

virtual AZStd::vector< AZ::Uuid > AzToolsFramework::EditorComponentAPIRequests::FindComponentTypeIdsByEntityType ( const AZStd::vector< AZStd::string > &  componentTypeNames,
EntityType  entityType 
)
pure virtual

This method requires the filter @entityType because it is possible that two components With different uuids to have the same name. But, the chances of collision is reduced by specifying the entity type.

◆ FindComponentTypeIdsByService()

virtual AZStd::vector< AZ::Uuid > AzToolsFramework::EditorComponentAPIRequests::FindComponentTypeIdsByService ( const AZStd::vector< AZ::ComponentServiceType > &  serviceFilter,
const AZStd::vector< AZ::ComponentServiceType > &  incompatibleServiceFilter 
)
pure virtual

Return a list of type ids for components that match the required services filter, and don't conflict with any of the incompatible services filter

◆ SetComponentProperty()

virtual PropertyOutcome AzToolsFramework::EditorComponentAPIRequests::SetComponentProperty ( const AZ::EntityComponentIdPair &  componentInstance,
const AZStd::string_view  propertyPath,
const AZStd::any &  value 
)
pure virtual

Set Value of Property on Component If

Parameters
valueis an AZStd::any then the logic will set the property to a default value

The documentation for this class was generated from the following file: