Open 3D Engine EditorPythonBindings Gem 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.
EditorPythonBindings::PythonMarshalTypeRequests Class Referenceabstract

An abstract to marshal between Behavior and Python type values. More...

#include <PythonMarshalComponent.h>

Inherits AZ::EBusTraits.

Public Types

using BusIdType = AZ::TypeId
 
using DeallocateFunction = Convert::VariableDeleter
 
using BehaviorTraits = AZ::BehaviorParameter::Traits
 
using BehaviorValueResult = AZStd::pair< bool, DeallocateFunction >
 
using PythonValueResult = AZStd::pair< pybind11::object, DeallocateFunction >
 

Public Member Functions

virtual AZStd::optional< BehaviorValueResultPythonToBehaviorValueParameter (BehaviorTraits traits, pybind11::object pyObj, AZ::BehaviorArgument &outValue)=0
 
virtual AZStd::optional< PythonValueResultBehaviorValueParameterToPython (AZ::BehaviorArgument &behaviorValue)=0
 
virtual bool CanConvertPythonToBehaviorValue (BehaviorTraits traits, pybind11::object pyObj) const =0
 Validates that a particular Python object can convert into a Behavior value parameter type.
 

Static Public Attributes

static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple
 
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById
 

Detailed Description

An abstract to marshal between Behavior and Python type values.

Member Typedef Documentation

◆ BehaviorValueResult

using EditorPythonBindings::PythonMarshalTypeRequests::BehaviorValueResult = AZStd::pair<bool, DeallocateFunction>

Marshals a Python value to a BehaviorArgument plus an optional function to deallocate it after usage

Returns
returns a pair of a flag to indicate success and an function to deallocate

◆ PythonValueResult

using EditorPythonBindings::PythonMarshalTypeRequests::PythonValueResult = AZStd::pair<pybind11::object, DeallocateFunction>

Marshals a BehaviorArgument to a Python value object

Returns
returns a pair of a valid Python object and an optional function to deallocate after sent to Python

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