Make math classes & EntityId visible in Lua Documentation. (#6261)

Small change in behavior context attribute for a few
classes so they become visible when extracting Lua symbols
from the ScriptContextDebug() API.

From:
Attribute(AZ::Script::Attributes::ExcludeFrom,
    AZ::Script::Attributes::ExcludeFlags::All)

To:
Attribute(AZ::Script::Attributes::ExcludeFrom,
    AZ::Script::Attributes::ExcludeFlags::ListOnly)

It seems the previous code was simply trying to hide those symbols from
the Script Canvas node palette. But it was also, seemingly unintentional,
hiding those symbol from Lua Documentation.

Signed-off-by: galibzon <66021303+galibzon@users.noreply.github.com>
This commit is contained in:
galibzon
2021-12-08 16:51:44 -06:00
committed by GitHub
parent 9b480f252e
commit 76e09a36d9
13 changed files with 35 additions and 35 deletions
@@ -811,12 +811,12 @@ namespace AZ
if (behaviorContext)
{
behaviorContext->Class<EntityId>()
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Module, "entity")
->Method("IsValid", &EntityId::IsValid)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Method("ToString", &EntityId::ToString)
->Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
+12 -12
View File
@@ -94,7 +94,7 @@ namespace AZ
behaviorContext->Class<Aabb>()
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Module, "math")
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)
->Attribute(AZ::Script::Attributes::GenericConstructorOverride, &AabbDefaultConstructor)
->Property("min", &Aabb::GetMin, &Aabb::SetMin)
@@ -112,46 +112,46 @@ namespace AZ
->Method("GetCenter", &Aabb::GetCenter)
->Method("Set", &Aabb::Set)
->Attribute(AZ::Script::Attributes::MethodOverride, &AabbSetGeneric)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Method("CreateFromObb", &Aabb::CreateFromObb)
->Method("GetXExtent", &Aabb::GetXExtent)
->Method("GetYExtent", &Aabb::GetYExtent)
->Method("GetZExtent", &Aabb::GetZExtent)
->Method("GetAsSphere", &Aabb::GetAsSphere, nullptr, "() -> Vector3(center) and float(radius)")
->Attribute(AZ::Script::Attributes::MethodOverride, &AabbGetAsSphereMultipleReturn)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Method<bool (Aabb::*)(const Aabb&) const>("Contains", &Aabb::Contains, nullptr, "const Vector3& or const Aabb&")
->Attribute(AZ::Script::Attributes::MethodOverride, &AabbContainsGeneric)
->Method<bool (Aabb::*)(const Vector3&) const>("ContainsVector3", &Aabb::Contains, nullptr, "const Vector3&")
->Attribute(AZ::Script::Attributes::Ignore, 0) // ignore for script since we already got the generic contains above
->Method("Overlaps", &Aabb::Overlaps)
->Method("Expand", &Aabb::Expand)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Method("GetExpanded", &Aabb::GetExpanded)
->Method("AddPoint", &Aabb::AddPoint)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Method("AddAabb", &Aabb::AddAabb)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Method("GetDistance", &Aabb::GetDistance)
->Method("GetClamped", &Aabb::GetClamped)
->Method("Clamp", &Aabb::Clamp)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Method("SetNull", &Aabb::SetNull)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Method("Translate", &Aabb::Translate)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Method("GetTranslated", &Aabb::GetTranslated)
->Method("GetSurfaceArea", &Aabb::GetSurfaceArea)
->Method("GetTransformedObb", static_cast<Obb(Aabb::*)(const Transform&) const>(&Aabb::GetTransformedObb))
->Method("GetTransformedAabb", static_cast<Aabb(Aabb::*)(const Transform&) const>(&Aabb::GetTransformedAabb))
->Method("ApplyTransform", &Aabb::ApplyTransform)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Method("Clone", [](const Aabb& rhs) -> Aabb { return rhs; })
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Method("IsFinite", &Aabb::IsFinite)
->Method("Equal", &Aabb::operator==)
->Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::Equal)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All);
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly);
}
}
+1 -1
View File
@@ -237,7 +237,7 @@ namespace AZ
behaviorContext->Class<Color>()->
Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)->
Attribute(AZ::Script::Attributes::Module, "math")->
Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)->
Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)->
Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)->
Constructor<float>()->
Constructor<float, float, float, float>()->
@@ -260,7 +260,7 @@ namespace AZ
behaviorContext->Class<Matrix3x3>()->
Attribute(Script::Attributes::Scope, Script::Attributes::ScopeFlags::Common)->
Attribute(Script::Attributes::Module, "math")->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::ListOnly)->
Attribute(Script::Attributes::Storage, Script::Attributes::StorageType::Value)->
Attribute(AZ::Script::Attributes::ConstructorOverride, &Internal::Matrix3x3ScriptConstructor)->
Attribute(Script::Attributes::GenericConstructorOverride, &Internal::Matrix3x3DefaultConstructor)->
@@ -280,7 +280,7 @@ namespace AZ
behaviorContext->Class<Matrix4x4>()->
Attribute(Script::Attributes::Scope, Script::Attributes::ScopeFlags::Common)->
Attribute(Script::Attributes::Module, "math")->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::ListOnly)->
Attribute(Script::Attributes::Storage, Script::Attributes::StorageType::Value)->
Attribute(Script::Attributes::GenericConstructorOverride, &Internal::Matrix4x4DefaultConstructor)->
Property<Vector4(Matrix4x4::*)() const, void (Matrix4x4::*)(const Vector4&)>("basisX", &Matrix4x4::GetBasisX, &Matrix4x4::SetBasisX)->
+1 -1
View File
@@ -69,7 +69,7 @@ namespace AZ
if (behaviorContext)
{
behaviorContext->Class<Obb>()->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::ListOnly)->
Attribute(Script::Attributes::Storage, Script::Attributes::StorageType::Value)->
Attribute(Script::Attributes::GenericConstructorOverride, &Internal::ObbDefaultConstructor)->
Property("position", &Obb::GetPosition, &Obb::SetPosition)->
+1 -1
View File
@@ -142,7 +142,7 @@ namespace AZ
if (behaviorContext)
{
behaviorContext->Class<Plane>()->
Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)->
Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)->
Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)->
Attribute(AZ::Script::Attributes::GenericConstructorOverride, &Internal::PlaneDefaultConstructor)->
Method("ToString", &Internal::PlaneToString)->
@@ -170,7 +170,7 @@ namespace AZ
behaviorContext->Class<Quaternion>()->
Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)->
Attribute(AZ::Script::Attributes::Module, "math")->
Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)->
Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)->
Constructor<float>()->
Constructor<float, float, float, float>()->
Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)->
+2 -2
View File
@@ -98,7 +98,7 @@ namespace AZ
if (BehaviorContext* behaviorContext = azrtti_cast<BehaviorContext*>(context))
{
behaviorContext->Class<SplineAddress>()->
Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::List)->
Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)->
Constructor<u64, float>()->
Attribute(Script::Attributes::Storage, Script::Attributes::StorageType::Value)->
Attribute(Script::Attributes::ConstructorOverride, &Internal::SplineAddressScriptConstructor)->
@@ -118,7 +118,7 @@ namespace AZ
Property("rayDistance", [](RaySplineQueryResult* thisPtr) { return thisPtr->m_rayDistance; }, nullptr);
behaviorContext->Class<Spline>()->
Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::List)->
Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)->
Attribute(Script::Attributes::Storage, Script::Attributes::StorageType::RuntimeOwn)->
Method("GetNearestAddressRay", &Spline::GetNearestAddressRay)->
Method("GetNearestAddressPosition", &Spline::GetNearestAddressPosition)->
+10 -10
View File
@@ -293,7 +293,7 @@ namespace AZ
behaviorContext->Class<Transform>()->
Attribute(Script::Attributes::Scope, Script::Attributes::ScopeFlags::Common)->
Attribute(Script::Attributes::Module, "math")->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::ListOnly)->
Attribute(Script::Attributes::Storage, Script::Attributes::StorageType::Value)->
Attribute(Script::Attributes::GenericConstructorOverride, &Internal::TransformDefaultConstructor)->
Constructor<const Vector3&, const Quaternion&, float>()->
@@ -312,35 +312,35 @@ namespace AZ
Attribute(Script::Attributes::Ignore, 0)-> // ignore for script since we already got the generic multiply above
Method<Transform(Transform::*)(const Transform&) const>("MultiplyTransform", &Transform::operator*)->
Attribute(Script::Attributes::Ignore, 0)-> // ignore for script since we already got the generic multiply above
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::ListOnly)->
Method("Equal", &Transform::operator==)->
Attribute(Script::Attributes::Operator, Script::Attributes::OperatorType::Equal)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::ListOnly)->
Method("Clone", [](const Transform& rhs) -> Transform { return rhs; })->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::ListOnly)->
Method("GetTranslation", &Transform::GetTranslation)->
Method("GetBasisAndTranslation", &Transform::GetBasisAndTranslation)->
Attribute(Script::Attributes::MethodOverride, &Internal::TransformGetBasisAndTranslationMultipleReturn)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::ListOnly)->
Method("TransformVector", &Transform::TransformVector)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::ListOnly)->
Method<void (Transform::*)(const Vector3&)>("SetTranslation", &Transform::SetTranslation)->
Attribute(Script::Attributes::MethodOverride, &Internal::TransformSetTranslationGeneric)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::ListOnly)->
Method("GetRotation", &Transform::GetRotation)->
Method<void (Transform::*)(const Quaternion&)>("SetRotation", &Transform::SetRotation)->
Method("GetUniformScale", &Transform::GetUniformScale)->
Method("SetUniformScale", &Transform::SetUniformScale)->
Method("ExtractUniformScale", &Transform::ExtractUniformScale)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::ListOnly)->
Method("MultiplyByUniformScale", &Transform::MultiplyByUniformScale)->
Method("GetInverse", &Transform::GetInverse)->
Method("Invert", &Transform::Invert)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::ListOnly)->
Method("IsOrthogonal", &Transform::IsOrthogonal, behaviorContext->MakeDefaultValues(Constants::Tolerance))->
Method("GetOrthogonalized", &Transform::GetOrthogonalized)->
Method("Orthogonalize", &Transform::Orthogonalize)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::ListOnly)->
Method("IsClose", &Transform::IsClose, behaviorContext->MakeDefaultValues(Constants::Tolerance))->
Method("IsFinite", &Transform::IsFinite)->
Method("CreateIdentity", &Transform::CreateIdentity)->
@@ -191,7 +191,7 @@ namespace AZ
behaviorContext->Class<Vector2>()->
Attribute(Script::Attributes::Scope, Script::Attributes::ScopeFlags::Common)->
Attribute(Script::Attributes::Module, "math")->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::ListOnly)->
Constructor<float>()->
Constructor<float, float>()->
Attribute(Script::Attributes::Storage, Script::Attributes::StorageType::Value)->
@@ -206,7 +206,7 @@ namespace AZ
behaviorContext->Class<Vector3>()->
Attribute(Script::Attributes::Scope, Script::Attributes::ScopeFlags::Common)->
Attribute(Script::Attributes::Module, "math")->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::ListOnly)->
Constructor<float>()->
Constructor<float, float, float>()->
Attribute(Script::Attributes::Storage, Script::Attributes::StorageType::Value)->
@@ -215,7 +215,7 @@ namespace AZ
behaviorContext->Class<Vector4>()->
Attribute(Script::Attributes::Scope, Script::Attributes::ScopeFlags::Common)->
Attribute(Script::Attributes::Module, "math")->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)->
Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::ListOnly)->
Constructor<float>()->
Constructor<float, float, float, float>()->
Attribute(Script::Attributes::Storage, Script::Attributes::StorageType::Value)->