diff --git a/Source/Engine/Graphics/Textures/GPUTexture.h b/Source/Engine/Graphics/Textures/GPUTexture.h
index 184f50c89..21a08c6f5 100644
--- a/Source/Engine/Graphics/Textures/GPUTexture.h
+++ b/Source/Engine/Graphics/Textures/GPUTexture.h
@@ -535,7 +535,7 @@ public:
///
/// The destination texture data container.
/// True if cannot download data, otherwise false.
- API_FUNCTION() bool DownloadData(TextureData& result);
+ API_FUNCTION() bool DownloadData(API_PARAM(Out) TextureData& result);
///
/// Creates GPU async task that will gather texture data from the GPU.
diff --git a/Source/Engine/Graphics/Textures/TextureBase.cs b/Source/Engine/Graphics/Textures/TextureBase.cs
index 9a9315d31..04df2e792 100644
--- a/Source/Engine/Graphics/Textures/TextureBase.cs
+++ b/Source/Engine/Graphics/Textures/TextureBase.cs
@@ -5,20 +5,6 @@ using System.Runtime.InteropServices;
namespace FlaxEngine
{
- partial class GPUTexture
- {
- ///
- /// Downloads the texture data to be accessible from CPU. For frequent access, use staging textures, otherwise current thread will be stalled to wait for the GPU frame to copy data into staging buffer.
- ///
- /// Downloaded texture data container, or nul if failed.
- [Unmanaged]
- public TextureData DownloadData()
- {
- var result = new TextureData();
- return DownloadData(result) ? null : result;
- }
- }
-
partial class TextureBase
{
///
diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs
index 6dd2aba6f..0a9dc4513 100644
--- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs
+++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cpp.cs
@@ -1362,7 +1362,12 @@ namespace Flax.Build.Bindings
var apiType = FindApiTypeInfo(buildData, parameterInfo.Type, caller);
if (apiType != null)
{
- if (parameterInfo.IsOut)
+ if (parameterInfo.IsOut && parameterInfo.Type.IsRef && !parameterInfo.Type.IsPtr && apiType.IsScriptingObject)
+ {
+ contents.Append(indent).AppendFormat("{1}* {0}Temp = New<{1}>();", parameterInfo.Name, parameterInfo.Type.GetFullNameNative(buildData, caller, false)).AppendLine();
+ callParams += "*";
+ }
+ else if (parameterInfo.IsOut)
contents.Append(indent).AppendFormat("{1} {0}Temp;", parameterInfo.Name, parameterInfo.Type.GetFullNameNative(buildData, caller, false)).AppendLine();
else
contents.Append(indent).AppendFormat("auto {0}Temp = {1};", parameterInfo.Name, param).AppendLine();