#include <CustomTypeBindingBus.h>
Inherits AZ::EBusTraits.
Public Types | |
using | BusIdType = AZ::TypeId |
using | ValueHandle = std::intptr_t |
using | AllocationHandle = AZStd::optional< AZStd::pair< ValueHandle, AZ::BehaviorObject > > |
Allocate a default value for the supplied type. | |
Public Member Functions | |
virtual AllocationHandle | AllocateDefault ()=0 |
virtual AZStd::optional< ValueHandle > | PythonToBehavior (PyObject *pyObj, AZ::BehaviorParameter::Traits traits, AZ::BehaviorArgument &outValue)=0 |
This method converts an incoming Python value into a behavior value; it should fill out the outValue fields. | |
virtual AZStd::optional< ValueHandle > | BehaviorToPython (const AZ::BehaviorArgument &behaviorValue, PyObject *&outPyObj)=0 |
This method convert an incoming behavior value into a Python value; it should fill out the outPyObj pointer. | |
virtual bool | CanConvertPythonToBehavior (AZ::BehaviorParameter::Traits traits, PyObject *pyObj) const =0 |
virtual void | CleanUpValue (ValueHandle handle)=0 |
Static Public Attributes | |
static const AZ::EBusHandlerPolicy | HandlerPolicy = AZ::EBusHandlerPolicy::Multiple |
static const AZ::EBusAddressPolicy | AddressPolicy = AZ::EBusAddressPolicy::ById |
A team can define custom generic types to be created for a TypeId The handler will need to allocate, deallocate, and convert behavior data to Python values NOTE: if the TypeId is registered with the Behavior Context then that will be used instead of this custom binding
using EditorPythonBindings::CustomTypeBindingNotifications::ValueHandle = std::intptr_t |
This handle is used to identify the allocations an external module used to prepare the value After the EPB gem is done with the conversion, this handle will be sent back via the CleanUpValue() notification to indicate that the module should clean up the allocations for that value conversion
|
pure virtual |
This method is used to determine that the behavior value can be processed using the Python object type as input NOTE: it should not actually do the conversion only detect IF it can be done with the supplied Python type
|
pure virtual |
This is used to deallocate the value used by the PythonToBehavior() or BehaviorToPython() methods The notification module is responsible for mapping the handle to the value's allocation(s)