Merge remote-tracking branch 'origin/master' into navigation-features

# Conflicts:
#	Source/Editor/Content/Settings/NavigationSettings.cs
#	Source/Engine/Engine/PhysicalMaterial.cs
#	Source/Tools/Flax.Build/Bindings/BindingsGenerator.Api.cs
This commit is contained in:
Wojtek Figat
2021-01-04 14:31:56 +01:00
2425 changed files with 4606 additions and 30937 deletions

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Runtime.CompilerServices;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AnimationManager.h"
#include "Engine/Profiler/ProfilerCPU.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using Flax.Build;
using Flax.Build.NativeCpp;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AnimGraph.h"
#include "Engine/Core/Collections/Array.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AnimGraph.h"
#include "Engine/Debug/DebugLog.h"
@@ -178,12 +178,12 @@ bool AnimGraph::InitCustomNode(Node* node)
MMethod* evaluate = type->GetMethod("Evaluate", 1);
if (load == nullptr)
{
LOG(Warning, "Invalid custom node type {0}. Missng Load method.", typeName);
LOG(Warning, "Invalid custom node type {0}. Missing Load method.", typeName);
return false;
}
if (evaluate == nullptr)
{
LOG(Warning, "Invalid custom node type {0}. Missng Evaluate method.", typeName);
LOG(Warning, "Invalid custom node type {0}. Missing Evaluate method.", typeName);
return false;
}

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AnimGraph.h"
#include "Engine/Engine/Time.h"
@@ -119,8 +119,9 @@ bool AnimGraph::Load(ReadStream* stream, bool loadMeta)
// Register for scripts reloading events (only if using any custom nodes)
// Handle load event always because anim graph asset may be loaded before game scripts
if (_customNodes.HasItems())
if (_customNodes.HasItems() && !_isRegisteredForScriptingEvents)
{
_isRegisteredForScriptingEvents = true;
#if USE_EDITOR
Scripting::ScriptsReloading.Bind<AnimGraph, &AnimGraph::OnScriptsReloading>(this);
Scripting::ScriptsReloaded.Bind<AnimGraph, &AnimGraph::OnScriptsReloaded>(this);
@@ -131,6 +132,19 @@ bool AnimGraph::Load(ReadStream* stream, bool loadMeta)
return false;
}
AnimGraph::~AnimGraph()
{
// Unregister for scripts reloading events (only if using any custom nodes)
if (_isRegisteredForScriptingEvents)
{
#if USE_EDITOR
Scripting::ScriptsReloading.Unbind<AnimGraph, &AnimGraph::OnScriptsReloading>(this);
Scripting::ScriptsReloaded.Unbind<AnimGraph, &AnimGraph::OnScriptsReloaded>(this);
#endif
Scripting::ScriptsLoaded.Unbind<AnimGraph, &AnimGraph::OnScriptsLoaded>(this);
}
}
bool AnimGraph::onParamCreated(Parameter* p)
{
if (p->Identifier == ANIM_GRAPH_PARAM_BASE_MODEL_ID)

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -311,7 +311,7 @@ public:
public:
/// <summary>
/// The instance data version number. Used to sync the Anim Graph data with the instance state. Handles Anim Graph reloads to enure data is valid.
/// The instance data version number. Used to sync the Anim Graph data with the instance state. Handles Anim Graph reloads to ensure data is valid.
/// </summary>
uint32 Version = 0;
@@ -443,7 +443,7 @@ public:
struct MultiBlend1DData
{
/// <summary>
/// The computed length of the mixes animations. Shared for all blend points to provide mor stabilization during looped playback.
/// The computed length of the mixes animations. Shared for all blend points to provide more stabilization during looped playback.
/// </summary>
float Length;
@@ -456,7 +456,7 @@ public:
struct MultiBlend2DData
{
/// <summary>
/// The computed length of the mixes animations. Shared for all blend points to provide mor stabilization during looped playback.
/// The computed length of the mixes animations. Shared for all blend points to provide more stabilization during looped playback.
/// </summary>
float Length;
@@ -733,7 +733,7 @@ private:
typedef void (*InitBucketHandler)(AnimGraphInstanceData::Bucket&);
bool _isFunction;
bool _isFunction, _isRegisteredForScriptingEvents;
int32 _bucketsCounter;
Array<InitBucketHandler> _bucketInitializerList;
Array<Node*> _customNodes;
@@ -751,13 +751,16 @@ public:
, _isFunction(isFunction)
, _bucketInitializerList(64)
, _owner(owner)
, _isRegisteredForScriptingEvents(false)
{
}
~AnimGraph();
public:
/// <summary>
/// The Anim Graph data version number. Used to sync the Anim Graph data with the instances state. Handles Anim Graph reloads to enure data is valid.
/// The Anim Graph data version number. Used to sync the Anim Graph data with the instances state. Handles Anim Graph reloads to ensure data is valid.
/// </summary>
uint32 Version = 0;
@@ -834,7 +837,7 @@ private:
public:
#if USE_EDITOR
// Custom event that is called every time the Anim Graph signal flows over the graph (including the data connections). Can be used to read nad visualize the animation blending logic.
// Custom event that is called every time the Anim Graph signal flows over the graph (including the data connections). Can be used to read and visualize the animation blending logic.
static Delegate<Asset*, ScriptingObject*, uint32, uint32> DebugFlow;
#endif

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AnimGraph.h"
#include "Engine/Content/Assets/Animation.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "InverseKinematics.h"
@@ -17,7 +17,7 @@ void InverseKinematics::SolveTwoBoneIK(Transform& rootNode, Transform& jointNode
Vector3 jointPos = jointNode.Translation;
Vector3 desiredDelta = target - rootNode.Translation;
float desiredLength = desiredDelta.Length();
float maxLimbLength = lowerLimbLength + upperLimbLength;
float limbLengthLimit = lowerLimbLength + upperLimbLength;
Vector3 desiredDir;
if (desiredLength < ZeroTolerance)
@@ -56,17 +56,17 @@ void InverseKinematics::SolveTwoBoneIK(Transform& rootNode, Transform& jointNode
if (allowStretching)
{
const float startStretchRatio = 1.0f;
const float scaleRange = maxStretchScale - startStretchRatio;
if (scaleRange > ZeroTolerance && maxLimbLength > ZeroTolerance)
const float initialStretchRatio = 1.0f;
const float range = maxStretchScale - initialStretchRatio;
if (range > ZeroTolerance && limbLengthLimit > ZeroTolerance)
{
const float reachRatio = desiredLength / maxLimbLength;
const float scalingFactor = (maxStretchScale - 1.0f) * Math::Saturate((reachRatio - startStretchRatio) / scaleRange);
const float reachRatio = desiredLength / limbLengthLimit;
const float scalingFactor = (maxStretchScale - 1.0f) * Math::Saturate((reachRatio - initialStretchRatio) / range);
if (scalingFactor > ZeroTolerance)
{
lowerLimbLength *= 1.0f + scalingFactor;
upperLimbLength *= 1.0f + scalingFactor;
maxLimbLength *= 1.0f + scalingFactor;
limbLengthLimit *= 1.0f + scalingFactor;
}
}
}
@@ -74,9 +74,9 @@ void InverseKinematics::SolveTwoBoneIK(Transform& rootNode, Transform& jointNode
Vector3 resultEndPos = target;
Vector3 resultJointPos = jointPos;
if (desiredLength >= maxLimbLength)
if (desiredLength >= limbLengthLimit)
{
resultEndPos = rootNode.Translation + maxLimbLength * desiredDir;
resultEndPos = rootNode.Translation + limbLengthLimit * desiredDir;
resultJointPos = rootNode.Translation + upperLimbLength * desiredDir;
}
else

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -29,7 +29,7 @@ public:
/// <param name="targetNode">The end node transformation (in model space).</param>
/// <param name="target">The target position of the end node to reach (in model space).</param>
/// <param name="jointTarget">The target position of the middle node to face into (in model space).</param>
/// <param name="allowStretching">True if allow bones stretching, otherwise bone lengths will be preserved when trying to reach teh target.</param>
/// <param name="allowStretching">True if allow bones stretching, otherwise bone lengths will be preserved when trying to reach the target.</param>
/// <param name="maxStretchScale">The maximum scale when stretching bones. Used only if allowStretching is true.</param>
static void SolveTwoBoneIK(Transform& rootNode, Transform& jointNode, Transform& targetNode, const Vector3& target, const Vector3& jointTarget, bool allowStretching = false, float maxStretchScale = 1.5f);
};

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "SceneAnimation.h"
#include "Engine/Content/Factories/BinaryAssetFactory.h"
@@ -289,7 +289,7 @@ Asset::LoadResult SceneAnimation::load()
trackRuntime->DataType = CurvePropertyTrack::DataTypes::Color32;
if (trackRuntime->DataType == CurvePropertyTrack::DataTypes::Unknown)
{
LOG(Warning, "Unknwon curve animation property type {2} for the track {1}, type {0}.", (int32)track.Type, track.Name, String(trackRuntime->PropertyTypeName));
LOG(Warning, "Unknown curve animation property type {2} for the track {1}, type {0}.", (int32)track.Type, track.Name, String(trackRuntime->PropertyTypeName));
track.Disabled = true;
}
needsParent = true;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -102,7 +102,7 @@ public:
void* Data;
/// <summary>
/// The track dependant data (from the shared runtime allocation).
/// The track dependent data (from the shared runtime allocation).
/// </summary>
void* RuntimeData;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "SceneAnimationPlayer.h"
#include "Engine/Core/Random.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -129,7 +129,7 @@ public:
public:
/// <summary>
/// Gets the value that determinates whether the scene animation is playing.
/// Gets the value that determines whether the scene animation is playing.
/// </summary>
API_PROPERTY() FORCE_INLINE bool IsPlaying() const
{
@@ -137,7 +137,7 @@ public:
}
/// <summary>
/// Gets the value that determinates whether the scene animation is paused.
/// Gets the value that determines whether the scene animation is paused.
/// </summary>
API_PROPERTY() FORCE_INLINE bool IsPaused() const
{
@@ -145,7 +145,7 @@ public:
}
/// <summary>
/// Gets the value that determinates whether the scene animation is stopped.
/// Gets the value that determines whether the scene animation is stopped.
/// </summary>
API_PROPERTY() FORCE_INLINE bool IsStopped() const
{

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.IO;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Audio.h"
#include "AudioBackend.h"
@@ -127,7 +127,7 @@ void Audio::OnAddListener(AudioListener* listener)
if (Listeners.Count() >= AUDIO_MAX_LISTENERS)
{
LOG(Error, "Unsupported amount of the audio listneres!");
LOG(Error, "Unsupported amount of the audio listeners!");
return;
}

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AudioClip.h"
#include "Audio.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AudioListener.h"
#include "Engine/Engine/Time.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -19,7 +19,7 @@ public:
bool DisableAudio = false;
/// <summary>
/// The doppler doppler effect factor. Scale for source and listener velocities. Default is 1.
/// The doppler effect factor. Scale for source and listener velocities. Default is 1.
/// </summary>
float DopplerFactor = 1.0f;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AudioSource.h"
#include "Engine/Level/SceneObjectsFactory.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -196,7 +196,7 @@ public:
API_FUNCTION() void Stop();
/// <summary>
/// Gets the the current state of the audio playback (playing/paused/stopped).
/// Gets the current state of the audio playback (playing/paused/stopped).
/// </summary>
/// <returns>The value.</returns>
API_PROPERTY() FORCE_INLINE States GetState() const

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if AUDIO_API_NONE

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if AUDIO_API_OPENAL

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if AUDIO_API_XAUDIO2

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.IO;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CSGBuilder.h"
#include "CSGMesh.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CSGData.h"
#include "Brush.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CSGMesh.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CSGMesh.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CSGMesh.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CSGMesh.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Asset.h"
#include "Content.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEngine
{

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Animation.h"
#include "SkinnedModel.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AnimationGraph.h"
#if USE_EDITOR

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AnimationGraphFunction.h"
#include "Engine/Core/Log.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CubeTexture.h"
#include "Engine/Content/Factories/BinaryAssetFactory.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "IESProfile.h"
#include "Engine/Content/Factories/BinaryAssetFactory.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Material.h"
#include "Engine/Core/Log.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "MaterialBase.h"
#include "MaterialInstance.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "MaterialFunction.h"
#if COMPILE_WITH_MATERIAL_GRAPH

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "MaterialInstance.h"
#include "Engine/Core/Types/Variant.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Model.h"
#include "Engine/Core/Log.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "RawDataAsset.h"
#include "Engine/Content/Factories/BinaryAssetFactory.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Shader.h"
#include "Engine/Core/Log.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "SkeletonMask.h"
#include "Engine/Core/Log.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "SkinnedModel.h"
#include "Engine/Core/Log.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Texture.h"
#include "Engine/Content/Content.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "VisualScript.h"
#include "Engine/Core/Log.h"

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -370,7 +370,7 @@ public:
/// <summary>
/// Gets the current stack trace of the current thread Visual Script execution.
/// </summary>
/// <returns>The the stack trace string.</returns>
/// <returns>The stack trace string.</returns>
static String GetStackTrace();
/// <summary>

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "BinaryAsset.h"
#include "Storage/ContentStorageManager.h"
@@ -118,16 +118,16 @@ void BinaryAsset::GetImportMetadata(String& path, String& username) const
}
// Parse metadata and try to get import info
rapidjson_flax::Document doc;
doc.Parse((const char*)Metadata.Get(), Metadata.Length());
if (doc.HasParseError() == false)
rapidjson_flax::Document document;
document.Parse((const char*)Metadata.Get(), Metadata.Length());
if (document.HasParseError() == false)
{
path = JsonTools::GetString(doc, "ImportPath");
username = JsonTools::GetString(doc, "ImportUsername");
path = JsonTools::GetString(document, "ImportPath");
username = JsonTools::GetString(document, "ImportUsername");
}
else
{
Log::JsonParseException(doc.GetParseError(), GetPath());
Log::JsonParseException(document.GetParseError(), document.GetErrorOffset(), GetPath());
}
}

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AssetsCache.h"
#include "Engine/Core/Log.h"
@@ -346,7 +346,7 @@ void AssetsCache::RegisterAssets(FlaxStorage* storage)
// Check if storage contains ID which has been already registered
if (FindAsset(e.ID, info))
{
LOG(Warning, "Founded dupplicated asset \'{0}\'. Locations: \'{1}\' and \'{2}\'", e.ID, storagePath, info.Path);
LOG(Warning, "Founded duplicated asset \'{0}\'. Locations: \'{1}\' and \'{2}\'", e.ID, storagePath, info.Path);
duplicatedEntries.Add(i);
}
}

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.IO;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Content.h"
#include "JsonAsset.h"
@@ -574,17 +574,21 @@ bool Content::RenameAsset(const StringView& oldPath, const StringView& newPath)
Asset* newAsset = GetAsset(newPath);
// Validate name
if (newAsset != nullptr || FileSystem::FileExists(newPath))
if (newAsset != nullptr && newAsset != oldAsset)
{
LOG(Error, "Invalid name '{0}' when trying to rename '{1}'.", newPath, oldPath);
return true;
}
// Check if is create
// Ensure asset is ready for renaming
if (oldAsset)
{
// Wait for data loaded
oldAsset->WaitForLoaded();
if (oldAsset->WaitForLoaded())
{
LOG(Error, "Failed to load asset '{0}'.", oldAsset->ToString());
return true;
}
// Unload
// Don't unload asset fully, only release ref to file, don't call OnUnload so managed asset and all refs will remain alive

Some files were not shown because too many files have changed in this diff Show More