diff --git a/Source/Editor/Modules/ContentDatabaseModule.cs b/Source/Editor/Modules/ContentDatabaseModule.cs index aa3b0d8b8..34e35bcc0 100644 --- a/Source/Editor/Modules/ContentDatabaseModule.cs +++ b/Source/Editor/Modules/ContentDatabaseModule.cs @@ -884,6 +884,8 @@ namespace FlaxEditor.Modules return; var folder = node.Folder; var path = folder.Path; + if (!Directory.Exists(path)) + return; var canHaveAssets = node.CanHaveAssets; if (_isDuringFastSetup) diff --git a/Source/Editor/SceneGraph/LocalSceneGraph.cs b/Source/Editor/SceneGraph/LocalSceneGraph.cs index cb1c9fea2..e0ed5ba37 100644 --- a/Source/Editor/SceneGraph/LocalSceneGraph.cs +++ b/Source/Editor/SceneGraph/LocalSceneGraph.cs @@ -95,6 +95,8 @@ namespace FlaxEditor.SceneGraph return; // Check if it has parent + if (actor.Parent == null) + return; var parentNode = SceneGraphFactory.FindNode(actor.Parent.ID) as ActorNode; if (parentNode == null) return; diff --git a/Source/Engine/Core/Types/Span.h b/Source/Engine/Core/Types/Span.h index 434b981cc..35334f2c6 100644 --- a/Source/Engine/Core/Types/Span.h +++ b/Source/Engine/Core/Types/Span.h @@ -165,8 +165,8 @@ inline Span ToSpan(const Array& data) return Span((U*)data.Get(), data.Count()); } -template -inline bool SpanContains(const Span span, const T& value) +template +inline bool SpanContains(const Span span, const ComparableType& value) { for (int32 i = 0; i < span.Length(); i++) { diff --git a/Source/Engine/Level/Actor.h b/Source/Engine/Level/Actor.h index a1ca01cc6..62a032312 100644 --- a/Source/Engine/Level/Actor.h +++ b/Source/Engine/Level/Actor.h @@ -798,7 +798,7 @@ public: /// Tries to find the actor of the given type in this actor hierarchy (checks this actor and all children hierarchy). /// /// Type of the actor to search for. Includes any actors derived from the type. Supports interface types. - /// Finds only a active actor. + /// Finds only an active actor. /// Actor instance if found, null otherwise. API_FUNCTION() Actor* FindActor(API_PARAM(Attributes="TypeReference(typeof(Actor))") const MClass* type, bool activeOnly = false) const; @@ -822,33 +822,36 @@ public: /// /// Tries to find the actor of the given type in this actor hierarchy (checks this actor and all children hierarchy). /// + /// Finds only an active actor. /// Actor instance if found, null otherwise. template - FORCE_INLINE T* FindActor() const + FORCE_INLINE T* FindActor(bool activeOnly = false) const { - return (T*)FindActor(T::GetStaticClass()); + return (T*)FindActor(T::GetStaticClass(), activeOnly); } /// /// Tries to find the actor of the given type and name in this actor hierarchy (checks this actor and all children hierarchy). /// /// The name of the actor. + /// Finds only an active actor. /// Actor instance if found, null otherwise. template - FORCE_INLINE T* FindActor(const StringView& name) const + FORCE_INLINE T* FindActor(const StringView& name, bool activeOnly = false) const { - return (T*)FindActor(T::GetStaticClass(), name); + return (T*)FindActor(T::GetStaticClass(), name, activeOnly); } /// /// Tries to find the actor of the given type and tag in this actor hierarchy (checks this actor and all children hierarchy). /// /// The tag of the actor to search for. + /// Finds only an active actor. /// Actor instance if found, null otherwise. template - FORCE_INLINE T* FindActor(const Tag& tag) const + FORCE_INLINE T* FindActor(const Tag& tag, bool activeOnly = false) const { - return (T*)FindActor(T::GetStaticClass(), tag); + return (T*)FindActor(T::GetStaticClass(), tag, activeOnly); } /// diff --git a/Source/Engine/Level/Actors/Spline.h b/Source/Engine/Level/Actors/Spline.h index 8543e827f..990497c5c 100644 --- a/Source/Engine/Level/Actors/Spline.h +++ b/Source/Engine/Level/Actors/Spline.h @@ -39,70 +39,70 @@ public: /// /// Evaluates the spline curve at the given time and calculates the point location in 3D (world-space). /// - /// The time value. Can be negative or larger than curve length (curve will loop or clamp). + /// The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length. /// The calculated curve point location (world-space). API_FUNCTION() Vector3 GetSplinePoint(float time) const; /// /// Evaluates the spline curve at the given time and calculates the point location in 3D (local-space). /// - /// The time value. Can be negative or larger than curve length (curve will loop or clamp). + /// The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length. /// The calculated curve point location (local-space). API_FUNCTION() Vector3 GetSplineLocalPoint(float time) const; /// /// Evaluates the spline curve at the given time and calculates the point rotation in 3D (world-space). /// - /// The time value. Can be negative or larger than curve length (curve will loop or clamp). + /// The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length. /// The calculated curve point rotation (world-space). API_FUNCTION() Quaternion GetSplineOrientation(float time) const; /// /// Evaluates the spline curve at the given time and calculates the point rotation in 3D (local-space). /// - /// The time value. Can be negative or larger than curve length (curve will loop or clamp). + /// The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length. /// The calculated curve point rotation (local-space). API_FUNCTION() Quaternion GetSplineLocalOrientation(float time) const; /// /// Evaluates the spline curve at the given time and calculates the point scale in 3D (world-space). /// - /// The time value. Can be negative or larger than curve length (curve will loop or clamp). + /// The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length. /// The calculated curve point scale (world-space). API_FUNCTION() Vector3 GetSplineScale(float time) const; /// /// Evaluates the spline curve at the given time and calculates the point scale in 3D (local-space). /// - /// The time value. Can be negative or larger than curve length (curve will loop or clamp). + /// The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length. /// The calculated curve point scale (local-space). API_FUNCTION() Vector3 GetSplineLocalScale(float time) const; /// /// Evaluates the spline curve at the given time and calculates the transformation in 3D (world-space). /// - /// The time value. Can be negative or larger than curve length (curve will loop or clamp). + /// The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length. /// The calculated curve point transformation (world-space). API_FUNCTION() Transform GetSplineTransform(float time) const; /// /// Evaluates the spline curve at the given time and calculates the transformation in 3D (local-space). /// - /// The time value. Can be negative or larger than curve length (curve will loop or clamp). + /// The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length. /// The calculated curve point transformation (local-space). API_FUNCTION() Transform GetSplineLocalTransform(float time) const; /// /// Evaluates the spline curve direction (forward vector, aka position 1st derivative) at the given time in 3D (world-space). /// - /// The time value. Can be negative or larger than curve length (curve will loop or clamp). + /// The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length. /// The calculated curve direction (world-space). API_FUNCTION() Vector3 GetSplineDirection(float time) const; /// /// Evaluates the spline curve direction (forward vector, aka position 1st derivative) at the given time in 3D (local-space). /// - /// The time value. Can be negative or larger than curve length (curve will loop or clamp). + /// The time value. Can be negative or larger than curve length (curve will loop or clamp). Time corresponds to curve keyframes Time, not the length. /// The calculated curve direction (local-space). API_FUNCTION() Vector3 GetSplineLocalDirection(float time) const;