ScriptContext::FromNativeContext(l)->Error(ScriptContext::ErrorType::Warning,true,"Invalid index type [], should be string! '%s:%s'!",lua_tostring(l,-1),lua_tostring(l,-4));
}
else
{
// if we have custom index handler
lua_pushvalue(l,-4);// duplicate the table (class pointer)
lua_pushvalue(l,-4);// duplicate the index value for the call
lua_call(l,2,1);// call the function
}
lua_remove(l,metaTableIndex);// remove the metatable
return1;
}
if(!lua_isnil(l,-1))
{
if(lua_tocfunction(l,-1)==&Internal::LuaPropertyTagHelper)// if it's a property
{
lua_getupvalue(l,-1,1);// push on the stack the getter function
lua_remove(l,-2);// remove property object
if(lua_isnil(l,-1))
{
lua_rawgeti(l,-2,AZ_LUA_CLASS_METATABLE_NAME_INDEX);// load the class name for a better error
if(!lua_isstring(l,-1))// if we failed it means we are the base metatable
ScriptContext::FromNativeContext(l)->Error(ScriptContext::ErrorType::Warning,true,"Property '%s:%s' is write only",lua_tostring(l,-1),lua_tostring(l,-4));
lua_pop(l,1);// pop class name
}
else
{
lua_pushvalue(l,-4);// copy the user data to be passed as a this pointer.
lua_call(l,1,1);// call a function with one argument (this pointer) and 1 result
}
}
}
lua_remove(l,metaTableIndex);// remove the metatable
conststaticAZ::Crc32Ignore=AZ_CRC("ScriptIgnore",0xeb7615e1);///< Don't use the element in the script reflection
conststaticAZ::Crc32ClassNameOverride=AZ_CRC("ScriptClassNameOverride",0x891238a3);///< Provide a custom name for script reflection, that doesn't match the behavior Context name
conststaticAZ::Crc32MethodOverride=AZ_CRC("ScriptFunctionOverride",0xf89a7882);///< Use a custom function in the attribute instead of the function
conststaticAZ::Crc32ConstructorOverride=AZ_CRC("ConstructorOverride",0xef5ce4aa);///< You can provide a custom constructor to be called when created from Lua script
conststaticAZ::Crc32EventHandlerCreationFunction=AZ_CRC_CE("EventHandlerCreationFunction");///< helps create a handler for any script target so that script functions can be used for AZ::Event signals
conststaticAZ::Crc32GenericConstructorOverride=AZ_CRC("GenericConstructorOverride",0xe6a1698e);///< You can provide a custom constructor to be called when creating a script
conststaticAZ::Crc32ReaderWriterOverride=AZ_CRC("ReaderWriterOverride",0x1ad9ce2a);///< paired with \ref ScriptContext::CustomReaderWriter allows you to customize read/write to Lua VM
conststaticAZ::Crc32ConstructibleFromNil=AZ_CRC("ConstructibleFromNil",0x23908169);///< Applied to classes. Value (bool) specifies if the class be default constructed when nil is provided.
conststaticAZ::Crc32ToolTip=AZ_CRC("ToolTip",0xa1b95fb0);///< Add a tooltip for a method/event/property
conststaticAZ::Crc32Category=AZ_CRC("Category",0x064c19c1);///< Provide a category to allow for partitioning/sorting/ordering of the element
conststaticAZ::Crc32Deprecated=AZ_CRC("Deprecated",0xfe49a138);///< Marks a reflected class, method, EBus or property as deprecated.
conststaticAZ::Crc32DisallowBroadcast=AZ_CRC("DisallowBroadcast",0x389b0ac7);///< Marks a reflected EBus as not allowing Broadcasts, only Events.
conststaticAZ::Crc32ClassConstantValue=AZ_CRC_CE("ClassConstantValue");///< Indicates the property is backed by a constant value
staticconstexprAZ::Crc32Ignore=AZ_CRC_CE("ScriptIgnore");///< Don't use the element in the script reflection
staticconstexprAZ::Crc32ClassNameOverride=AZ_CRC_CE("ScriptClassNameOverride");///< Provide a custom name for script reflection, that doesn't match the behavior Context name
staticconstexprAZ::Crc32MethodOverride=AZ_CRC_CE("ScriptFunctionOverride");///< Use a custom function in the attribute instead of the function
staticconstexprAZ::Crc32ConstructorOverride=AZ_CRC_CE("ConstructorOverride");///< You can provide a custom constructor to be called when created from Lua script
staticconstexprAZ::Crc32EventHandlerCreationFunction=AZ_CRC_CE("EventHandlerCreationFunction");///< helps create a handler for any script target so that script functions can be used for AZ::Event signals
staticconstexprAZ::Crc32GenericConstructorOverride=AZ_CRC_CE("GenericConstructorOverride");///< You can provide a custom constructor to be called when creating a script
staticconstexprAZ::Crc32ReaderWriterOverride=AZ_CRC_CE("ReaderWriterOverride");///< paired with \ref ScriptContext::CustomReaderWriter allows you to customize read/write to Lua VM
staticconstexprAZ::Crc32ConstructibleFromNil=AZ_CRC_CE("ConstructibleFromNil");///< Applied to classes. Value (bool) specifies if the class be default constructed when nil is provided.
staticconstexprAZ::Crc32ToolTip=AZ_CRC_CE("ToolTip");///< Add a tooltip for a method/event/property
staticconstexprAZ::Crc32Category=AZ_CRC_CE("Category");///< Provide a category to allow for partitioning/sorting/ordering of the element
staticconstexprAZ::Crc32Deprecated=AZ_CRC_CE("Deprecated");///< Marks a reflected class, method, EBus or property as deprecated.
staticconstexprAZ::Crc32DisallowBroadcast=AZ_CRC_CE("DisallowBroadcast");///< Marks a reflected EBus as not allowing Broadcasts, only Events.
staticconstexprAZ::Crc32ClassConstantValue=AZ_CRC_CE("ClassConstantValue");///< Indicates the property is backed by a constant value
staticconstexprAZ::Crc32UseClassIndexAllowNil=AZ_CRC_CE("UseClassIndexAllowNil");///< Use the Class__IndexAllowNil method, which will not report an error on accessing undeclared values (allows for nil)
//! Attribute which stores BehaviorAzEventDescription structure which contains
//! the script name of an AZ::Event and the name of it's parameter arguments
///< This attribute can be attached to the EditContext Attribute of a reflected class, the BehaviorContext Attribute of a reflected class, method, ebus or property.
///< ExcludeFlags can be used to prevent elements from appearing in List, Documentation, etc...
->DataElement(AZ::Edit::UIHandlers::Default,&BuildVariableOverrides::m_dependencies,"Dependencies","Variables in Dependencies of the Script Canvas Graph")
returnAZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to get engine relative path from %s-%.*s.",editorAssetId.ToString<AZStd::string>().c_str(),aznumeric_cast<int>(assetHint.size()),assetHint.data()));
returnAZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to load graph from %s-%s: %s",editorAssetId.ToString<AZStd::string>().c_str(),assetHint.data(),loadAssetOutcome.GetError().c_str()));
returnAZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to load dependent graph from %s-%s: %s",editorAssetId.ToString<AZStd::string>().c_str(),assetHint.data(),loadDependentOutcome.GetError().c_str()));
->DataElement(AZ::Edit::UIHandlers::Default,&EditorScriptCanvasComponent::m_scriptCanvasAssetHolder,"Script Canvas Asset","Script Canvas asset associated with this component")
AZ_Error("ScriptCanvasBuilder",false,"Runtime information did not build for ScriptCanvas Component using asset: %s",m_scriptCanvasAssetHolder.GetAssetId().ToString<AZStd::string>().c_str());
// eventually, this will need to be recursive, or the full asset handling system will need to be integrated into the testing framework
// #functions2_recursive_unit_tests eventually, this will need to be recursive, or the full asset handling system will need to be integrated into the testing framework
// in order to test functionality with a dependency stack greater than 2
// load all script assets, and their dependencies, initialize statics on all those dependencies if it is the first time loaded
AZ_Error("Script Canvas",success,"Cannot push Datum with type %s into BehaviorValueParameter expecting type %s",GetName(m_type).c_str(),GetName(targetType).c_str());
AZ_Assert(executionState,"Error in compiled lua file, 1st argument to UnpackDependencyArgs is not an ExecutionStateInterpreted");
AZ_Assert(lua_islightuserdata(lua,2),"Error in compiled lua file, 2nd argument to UnpackDependencyArgs is not userdata (AZStd::vector<AZ::Data::Asset<RuntimeAsset>>*), but a :%s",lua_typename(lua,2));
AZ_Assert(m_runtimeAsset.GetAutoLoadBehavior()==AZ::Data::AssetLoadBehavior::PreLoad,"RuntimeComponent::m_runtimeAsset Auto load behavior MUST be set to AZ::Data::AssetLoadBehavior::PreLoad");
AZ_Assert(RuntimeDataOverrides::IsPreloadBehaviorEnforced(m_runtimeOverrides),"RuntimeComponent::m_runtimeAsset Auto load behavior MUST be set to AZ::Data::AssetLoadBehavior::PreLoad");
}
voidRuntimeComponent::InitializeExecution()
{
#if defined(SCRIPT_CANVAS_RUNTIME_ASSET_CHECK)
if(!m_runtimeAsset.Get())
if(!m_runtimeOverrides.m_runtimeAsset.Get())
{
AZ_Error("ScriptCanvas",false,"RuntimeComponent::m_runtimeAsset AssetId: %s was valid, but the data was not pre-loaded, so this script will not run",m_runtimeAsset.GetId().ToString<AZStd::string>().data());
AZ_Error("ScriptCanvas",false,"RuntimeComponent::m_runtimeAsset AssetId: %s was valid, but the data was not pre-loaded, so this script will not run",m_runtimeOverrides.m_runtimeAsset.GetId().ToString<AZStd::string>().data());
return;
}
#else
AZ_Assert(m_runtimeAsset.Get(),"RuntimeComponent::m_runtimeAsset AssetId: %s was valid, but the data was not pre-loaded, so this script will not run",m_runtimeAsset.GetId().ToString<AZStd::string>().data());
AZ_Assert(m_runtimeAsset.Get(),"RuntimeComponent::m_runtimeAsset AssetId: %s was valid, but the data was not pre-loaded, so this script will not run",m_runtimeOverrides.m_runtimeAsset.GetId().ToString<AZStd::string>().data());
AZ_Error("ScriptCanvas",false,"RuntimeComponent::m_runtimeAsset AssetId: %s failed to create an execution state, possibly due to missing dependent asset, script will not run",m_runtimeAsset.GetId().ToString<AZStd::string>().data());
AZ_Error("ScriptCanvas",false,"RuntimeComponent::m_runtimeAsset AssetId: %s failed to create an execution state, possibly due to missing dependent asset, script will not run",m_runtimeOverrides.m_runtimeAsset.GetId().ToString<AZStd::string>().data());
AZ_CVAR(bool,g_disableParseOnGraphValidation,false,{},AZ::ConsoleFunctorFlags::Null,"In case parsing the graph is interfering with opening a graph, disable parsing on validation");
AZ_CVAR(bool,g_printAbstractCodeModel,false,{},AZ::ConsoleFunctorFlags::Null,"Print out the Abstract Code Model at the end of parsing for debug purposes.");
AZ_CVAR(bool,g_saveRawTranslationOuputToFile,false,{},AZ::ConsoleFunctorFlags::Null,"Save out the raw result of translation for debug purposes.");
AZ_CVAR(bool,g_printAbstractCodeModel,true,{},AZ::ConsoleFunctorFlags::Null,"Print out the Abstract Code Model at the end of parsing for debug purposes.");
AZ_CVAR(bool,g_printAbstractCodeModelAtPrefabTime,false,{},AZ::ConsoleFunctorFlags::Null,"Print out the Abstract Code Model at the end of parsing (at prefab time) for debug purposes.");
AZ_CVAR(bool,g_saveRawTranslationOuputToFile,true,{},AZ::ConsoleFunctorFlags::Null,"Save out the raw result of translation for debug purposes.");
AZ_CVAR(bool,g_saveRawTranslationOuputToFileAtPrefabTime,false,{},AZ::ConsoleFunctorFlags::Null,"Save out the raw result of translation (at prefab time) for debug purposes.");
returncontext.Report(JSR::Tasks::ReadField,JSR::Outcomes::Missing,AZStd::string::format("ScriptUserDataSerializer::Load failed to load the %s member",JsonSerialization::TypeIdFieldIdentifier));
returncontext.Report(result,"ScriptUserDataSerializer::Load failed to load a value matched the reported AZ TypeId. The C++ declaration may have been deleted or changed.");
"* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.\n"
->DataElement(AZ::Edit::UIHandlers::ComboBox,&GraphVariable::m_InitialValueSource,"Initial Value Source","Variables can get their values from within the graph or through component properties.")