Browse Source

Feature: Auto-generate NotNull and PassByValue attributes objects that get passed by value in native code
- Also, properly convert null to default-constructed value for such property setters

BearishSun 7 years ago
parent
commit
37dc25d7dd
36 changed files with 232 additions and 82 deletions
  1. 2 0
      Source/Scripting/MBansheeEditor/Generated/GUIColorDistributionField.generated.cs
  2. 2 0
      Source/Scripting/MBansheeEditor/Generated/GUIColorGradient.generated.cs
  3. 2 0
      Source/Scripting/MBansheeEditor/Generated/GUIColorGradientField.generated.cs
  4. 6 0
      Source/Scripting/MBansheeEditor/Generated/GUICurvesField.generated.cs
  5. 2 0
      Source/Scripting/MBansheeEditor/Generated/GUIFloatDistributionField.generated.cs
  6. 2 0
      Source/Scripting/MBansheeEditor/Generated/GUIVector2DistributionField.generated.cs
  7. 2 0
      Source/Scripting/MBansheeEditor/Generated/GUIVector3DistributionField.generated.cs
  8. 2 0
      Source/Scripting/MBansheeEngine/Generated/CParticleSystem.generated.cs
  9. 16 0
      Source/Scripting/MBansheeEngine/Generated/ParticleEmitter.generated.cs
  10. 8 0
      Source/Scripting/MBansheeEngine/Generated/ParticleGpuSimulationSettings.generated.cs
  11. 2 0
      Source/Scripting/MBansheeEngine/Generated/ParticleVectorFieldSettings.generated.cs
  12. 18 0
      Source/Scripting/MBansheeEngine/Generated/RenderSettings.generated.cs
  13. 4 0
      Source/Scripting/MBansheeEngine/Generated/RootMotion.generated.cs
  14. 6 3
      Source/Scripting/SBansheeEditor/Generated/BsScriptGUIColorDistributionField.generated.cpp
  15. 2 1
      Source/Scripting/SBansheeEditor/Generated/BsScriptGUIColorGradient.generated.cpp
  16. 6 3
      Source/Scripting/SBansheeEditor/Generated/BsScriptGUIColorGradientField.generated.cpp
  17. 10 5
      Source/Scripting/SBansheeEditor/Generated/BsScriptGUICurvesField.generated.cpp
  18. 6 3
      Source/Scripting/SBansheeEditor/Generated/BsScriptGUIFloatDistributionField.generated.cpp
  19. 6 3
      Source/Scripting/SBansheeEditor/Generated/BsScriptGUIVector2DistributionField.generated.cpp
  20. 6 3
      Source/Scripting/SBansheeEditor/Generated/BsScriptGUIVector3DistributionField.generated.cpp
  21. 6 3
      Source/Scripting/SBansheeEngine/Generated/BsScriptAnimationClip.generated.cpp
  22. 8 4
      Source/Scripting/SBansheeEngine/Generated/BsScriptAnimationCurves.generated.cpp
  23. 8 4
      Source/Scripting/SBansheeEngine/Generated/BsScriptAnimationUtility.generated.cpp
  24. 2 1
      Source/Scripting/SBansheeEngine/Generated/BsScriptCCamera.generated.cpp
  25. 4 2
      Source/Scripting/SBansheeEngine/Generated/BsScriptCParticleSystem.generated.cpp
  26. 6 3
      Source/Scripting/SBansheeEngine/Generated/BsScriptColorDistribution.generated.cpp
  27. 4 2
      Source/Scripting/SBansheeEngine/Generated/BsScriptMaterial.generated.cpp
  28. 6 3
      Source/Scripting/SBansheeEngine/Generated/BsScriptMesh.generated.cpp
  29. 18 9
      Source/Scripting/SBansheeEngine/Generated/BsScriptParticleEmitter.generated.cpp
  30. 8 4
      Source/Scripting/SBansheeEngine/Generated/BsScriptParticleGpuSimulationSettings.generated.cpp
  31. 2 1
      Source/Scripting/SBansheeEngine/Generated/BsScriptParticleVectorFieldSettings.generated.cpp
  32. 2 1
      Source/Scripting/SBansheeEngine/Generated/BsScriptPhysicsMesh.generated.cpp
  33. 18 9
      Source/Scripting/SBansheeEngine/Generated/BsScriptRenderSettings.generated.cpp
  34. 24 12
      Source/Scripting/SBansheeEngine/Generated/BsScriptTDistribution.generated.cpp
  35. 2 1
      Source/Scripting/SBansheeEngine/Generated/BsScriptTexture.generated.cpp
  36. 4 2
      Source/Scripting/SBansheeEngine/Generated/BsScriptViewport.generated.cpp

+ 2 - 0
Source/Scripting/MBansheeEditor/Generated/GUIColorDistributionField.generated.cs

@@ -77,6 +77,8 @@ namespace BansheeEditor
 
 
 		/// <summary>Changes the value of the field.</summary>
 		/// <summary>Changes the value of the field.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public ColorDistribution Value
 		public ColorDistribution Value
 		{
 		{

+ 2 - 0
Source/Scripting/MBansheeEditor/Generated/GUIColorGradient.generated.cs

@@ -28,6 +28,8 @@ namespace BansheeEditor
 
 
 		/// <summary>Color gradient to display.</summary>
 		/// <summary>Color gradient to display.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public ColorGradient Gradient
 		public ColorGradient Gradient
 		{
 		{

+ 2 - 0
Source/Scripting/MBansheeEditor/Generated/GUIColorGradientField.generated.cs

@@ -77,6 +77,8 @@ namespace BansheeEditor
 
 
 		/// <summary>Changes the value of the field.</summary>
 		/// <summary>Changes the value of the field.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public ColorGradient Value
 		public ColorGradient Value
 		{
 		{

+ 6 - 0
Source/Scripting/MBansheeEditor/Generated/GUICurvesField.generated.cs

@@ -80,6 +80,8 @@ namespace BansheeEditor
 		/// that range.
 		/// that range.
 		/// </summary>
 		/// </summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public AnimationCurve Curve
 		public AnimationCurve Curve
 		{
 		{
@@ -91,6 +93,8 @@ namespace BansheeEditor
 		/// field doesn't represent a range.
 		/// field doesn't represent a range.
 		/// </summary>
 		/// </summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public AnimationCurve MinCurve
 		public AnimationCurve MinCurve
 		{
 		{
@@ -102,6 +106,8 @@ namespace BansheeEditor
 		/// field doesn't represent a range.
 		/// field doesn't represent a range.
 		/// </summary>
 		/// </summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public AnimationCurve MaxCurve
 		public AnimationCurve MaxCurve
 		{
 		{

+ 2 - 0
Source/Scripting/MBansheeEditor/Generated/GUIFloatDistributionField.generated.cs

@@ -77,6 +77,8 @@ namespace BansheeEditor
 
 
 		/// <summary>Changes the value of the field.</summary>
 		/// <summary>Changes the value of the field.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public FloatDistribution Value
 		public FloatDistribution Value
 		{
 		{

+ 2 - 0
Source/Scripting/MBansheeEditor/Generated/GUIVector2DistributionField.generated.cs

@@ -77,6 +77,8 @@ namespace BansheeEditor
 
 
 		/// <summary>Changes the value of the field.</summary>
 		/// <summary>Changes the value of the field.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public Vector2Distribution Value
 		public Vector2Distribution Value
 		{
 		{

+ 2 - 0
Source/Scripting/MBansheeEditor/Generated/GUIVector3DistributionField.generated.cs

@@ -77,6 +77,8 @@ namespace BansheeEditor
 
 
 		/// <summary>Changes the value of the field.</summary>
 		/// <summary>Changes the value of the field.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public Vector3Distribution Value
 		public Vector3Distribution Value
 		{
 		{

+ 2 - 0
Source/Scripting/MBansheeEngine/Generated/CParticleSystem.generated.cs

@@ -24,6 +24,7 @@ namespace BansheeEngine
 
 
 		/// <summary>Determines general purpose settings that apply to the particle system.</summary>
 		/// <summary>Determines general purpose settings that apply to the particle system.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
 		[PassByCopy]
 		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public ParticleSystemSettings Settings
 		public ParticleSystemSettings Settings
@@ -34,6 +35,7 @@ namespace BansheeEngine
 
 
 		/// <summary>Determines settings that control particle GPU simulation.</summary>
 		/// <summary>Determines settings that control particle GPU simulation.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
 		[PassByCopy]
 		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public ParticleGpuSimulationSettings GpuSimulationSettings
 		public ParticleGpuSimulationSettings GpuSimulationSettings

+ 16 - 0
Source/Scripting/MBansheeEngine/Generated/ParticleEmitter.generated.cs

@@ -31,6 +31,8 @@ namespace BansheeEngine
 
 
 		/// <summary>Determines the number of particles that are emitted every second.</summary>
 		/// <summary>Determines the number of particles that are emitted every second.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public FloatDistribution EmissionRate
 		public FloatDistribution EmissionRate
 		{
 		{
@@ -49,6 +51,8 @@ namespace BansheeEngine
 
 
 		/// <summary>Determines the lifetime of particles when they are initially spawned, in seconds.</summary>
 		/// <summary>Determines the lifetime of particles when they are initially spawned, in seconds.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public FloatDistribution InitialLifetime
 		public FloatDistribution InitialLifetime
 		{
 		{
@@ -61,6 +65,8 @@ namespace BansheeEngine
 		/// direction, which is determined by the emission shape and potentially other properties.
 		/// direction, which is determined by the emission shape and potentially other properties.
 		/// </summary>
 		/// </summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public FloatDistribution InitialSpeed
 		public FloatDistribution InitialSpeed
 		{
 		{
@@ -73,6 +79,8 @@ namespace BansheeEngine
 		/// used if 3D size is disabled.
 		/// used if 3D size is disabled.
 		/// </summary>
 		/// </summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public FloatDistribution InitialSize
 		public FloatDistribution InitialSize
 		{
 		{
@@ -85,6 +93,8 @@ namespace BansheeEngine
 		/// Only used if 3D size is enabled.
 		/// Only used if 3D size is enabled.
 		/// </summary>
 		/// </summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public Vector3Distribution InitialSize3D
 		public Vector3Distribution InitialSize3D
 		{
 		{
@@ -109,6 +119,8 @@ namespace BansheeEngine
 		/// particle's local Z axis. Only used if 3D rotation is disabled.
 		/// particle's local Z axis. Only used if 3D rotation is disabled.
 		/// </summary>
 		/// </summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public FloatDistribution InitialRotation
 		public FloatDistribution InitialRotation
 		{
 		{
@@ -120,6 +132,8 @@ namespace BansheeEngine
 		/// Determines the rotation of the particles when initially spawned, in Euler angles. Only used if 3D rotation is enabled.
 		/// Determines the rotation of the particles when initially spawned, in Euler angles. Only used if 3D rotation is enabled.
 		/// </summary>
 		/// </summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public Vector3Distribution InitialRotation3D
 		public Vector3Distribution InitialRotation3D
 		{
 		{
@@ -141,6 +155,8 @@ namespace BansheeEngine
 
 
 		/// <summary>Determines the initial color (in RGB channels) and transparency (in A channel) of particles.</summary>
 		/// <summary>Determines the initial color (in RGB channels) and transparency (in A channel) of particles.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public ColorDistribution InitialColor
 		public ColorDistribution InitialColor
 		{
 		{

+ 8 - 0
Source/Scripting/MBansheeEngine/Generated/ParticleGpuSimulationSettings.generated.cs

@@ -16,6 +16,8 @@ namespace BansheeEngine
 		protected ParticleGpuSimulationSettings() { }
 		protected ParticleGpuSimulationSettings() { }
 
 
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public ParticleVectorFieldSettings VectorField
 		public ParticleVectorFieldSettings VectorField
 		{
 		{
@@ -25,6 +27,8 @@ namespace BansheeEngine
 
 
 		/// <summary>Determines particle color, evaluated over the particle lifetime.</summary>
 		/// <summary>Determines particle color, evaluated over the particle lifetime.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public ColorDistribution ColorOverLifetime
 		public ColorDistribution ColorOverLifetime
 		{
 		{
@@ -36,6 +40,8 @@ namespace BansheeEngine
 		/// Determines particle size, evaluated over the particle lifetime. Multiplied by the initial particle size.
 		/// Determines particle size, evaluated over the particle lifetime. Multiplied by the initial particle size.
 		/// </summary>
 		/// </summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public Vector2Distribution SizeScaleOverLifetime
 		public Vector2Distribution SizeScaleOverLifetime
 		{
 		{
@@ -68,6 +74,8 @@ namespace BansheeEngine
 
 
 		/// <summary>Settings controlling particle depth buffer collisions.</summary>
 		/// <summary>Settings controlling particle depth buffer collisions.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public ParticleDepthCollisionSettings DepthCollision
 		public ParticleDepthCollisionSettings DepthCollision
 		{
 		{

+ 2 - 0
Source/Scripting/MBansheeEngine/Generated/ParticleVectorFieldSettings.generated.cs

@@ -98,6 +98,8 @@ namespace BansheeEngine
 		/// over the particle system lifetime.
 		/// over the particle system lifetime.
 		/// </summary>
 		/// </summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public Vector3Distribution RotationRate
 		public Vector3Distribution RotationRate
 		{
 		{

+ 18 - 0
Source/Scripting/MBansheeEngine/Generated/RenderSettings.generated.cs

@@ -35,6 +35,8 @@ namespace BansheeEngine
 
 
 		/// <summary>Parameters used for customizing automatic scene exposure.</summary>
 		/// <summary>Parameters used for customizing automatic scene exposure.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public AutoExposureSettings AutoExposure
 		public AutoExposureSettings AutoExposure
 		{
 		{
@@ -61,6 +63,8 @@ namespace BansheeEngine
 
 
 		/// <summary>Parameters used for customizing tonemapping.</summary>
 		/// <summary>Parameters used for customizing tonemapping.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public TonemappingSettings Tonemapping
 		public TonemappingSettings Tonemapping
 		{
 		{
@@ -74,6 +78,8 @@ namespace BansheeEngine
 		/// simulate the effects of chromatic adaptation of the human visual system.
 		/// simulate the effects of chromatic adaptation of the human visual system.
 		/// </summary>
 		/// </summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public WhiteBalanceSettings WhiteBalance
 		public WhiteBalanceSettings WhiteBalance
 		{
 		{
@@ -83,6 +89,8 @@ namespace BansheeEngine
 
 
 		/// <summary>Parameters used for customizing color grading.</summary>
 		/// <summary>Parameters used for customizing color grading.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public ColorGradingSettings ColorGrading
 		public ColorGradingSettings ColorGrading
 		{
 		{
@@ -92,6 +100,8 @@ namespace BansheeEngine
 
 
 		/// <summary>Parameters used for customizing the depth of field effect.</summary>
 		/// <summary>Parameters used for customizing the depth of field effect.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public DepthOfFieldSettings DepthOfField
 		public DepthOfFieldSettings DepthOfField
 		{
 		{
@@ -101,6 +111,8 @@ namespace BansheeEngine
 
 
 		/// <summary>Parameters used for customizing screen space ambient occlusion.</summary>
 		/// <summary>Parameters used for customizing screen space ambient occlusion.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public AmbientOcclusionSettings AmbientOcclusion
 		public AmbientOcclusionSettings AmbientOcclusion
 		{
 		{
@@ -110,6 +122,8 @@ namespace BansheeEngine
 
 
 		/// <summary>Parameters used for customizing screen space reflections.</summary>
 		/// <summary>Parameters used for customizing screen space reflections.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public ScreenSpaceReflectionsSettings ScreenSpaceReflections
 		public ScreenSpaceReflectionsSettings ScreenSpaceReflections
 		{
 		{
@@ -119,6 +133,8 @@ namespace BansheeEngine
 
 
 		/// <summary>Parameters used for customizing the bloom effect.</summary>
 		/// <summary>Parameters used for customizing the bloom effect.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public BloomSettings Bloom
 		public BloomSettings Bloom
 		{
 		{
@@ -196,6 +212,8 @@ namespace BansheeEngine
 
 
 		/// <summary>Parameters used for customizing shadow rendering.</summary>
 		/// <summary>Parameters used for customizing shadow rendering.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public ShadowSettings ShadowSettings
 		public ShadowSettings ShadowSettings
 		{
 		{

+ 4 - 0
Source/Scripting/MBansheeEngine/Generated/RootMotion.generated.cs

@@ -17,6 +17,8 @@ namespace BansheeEngine
 
 
 		/// <summary>Animation curve representing the movement of the root bone.</summary>
 		/// <summary>Animation curve representing the movement of the root bone.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public Vector3Curve Position
 		public Vector3Curve Position
 		{
 		{
@@ -25,6 +27,8 @@ namespace BansheeEngine
 
 
 		/// <summary>Animation curve representing the rotation of the root bone.</summary>
 		/// <summary>Animation curve representing the rotation of the root bone.</summary>
 		[ShowInInspector]
 		[ShowInInspector]
+		[NotNull]
+		[PassByCopy]
 		[NativeWrapper]
 		[NativeWrapper]
 		public QuaternionCurve Rotation
 		public QuaternionCurve Rotation
 		{
 		{

+ 6 - 3
Source/Scripting/SBansheeEditor/Generated/BsScriptGUIColorDistributionField.generated.cpp

@@ -60,7 +60,8 @@ namespace bs
 		SPtr<ColorDistribution> tmpvalue;
 		SPtr<ColorDistribution> tmpvalue;
 		ScriptColorDistribution* scriptvalue;
 		ScriptColorDistribution* scriptvalue;
 		scriptvalue = ScriptColorDistribution::toNative(value);
 		scriptvalue = ScriptColorDistribution::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		static_cast<GUIColorDistributionField*>(thisPtr->getGUIElement())->setValue(*tmpvalue);
 		static_cast<GUIColorDistributionField*>(thisPtr->getGUIElement())->setValue(*tmpvalue);
 	}
 	}
 
 
@@ -100,7 +101,8 @@ namespace bs
 		SPtr<HString> tmplabelText;
 		SPtr<HString> tmplabelText;
 		ScriptHString* scriptlabelText;
 		ScriptHString* scriptlabelText;
 		scriptlabelText = ScriptHString::toNative(labelText);
 		scriptlabelText = ScriptHString::toNative(labelText);
-		tmplabelText = scriptlabelText->getInternal();
+		if(scriptlabelText != nullptr)
+			tmplabelText = scriptlabelText->getInternal();
 		String tmpstyle;
 		String tmpstyle;
 		tmpstyle = MonoUtil::monoToString(style);
 		tmpstyle = MonoUtil::monoToString(style);
 		GUIColorDistributionField* instance = GUIColorDistributionField::create(*tmplabelText, labelWidth, tmpstyle);
 		GUIColorDistributionField* instance = GUIColorDistributionField::create(*tmplabelText, labelWidth, tmpstyle);
@@ -112,7 +114,8 @@ namespace bs
 		SPtr<HString> tmplabelText;
 		SPtr<HString> tmplabelText;
 		ScriptHString* scriptlabelText;
 		ScriptHString* scriptlabelText;
 		scriptlabelText = ScriptHString::toNative(labelText);
 		scriptlabelText = ScriptHString::toNative(labelText);
-		tmplabelText = scriptlabelText->getInternal();
+		if(scriptlabelText != nullptr)
+			tmplabelText = scriptlabelText->getInternal();
 		String tmpstyle;
 		String tmpstyle;
 		tmpstyle = MonoUtil::monoToString(style);
 		tmpstyle = MonoUtil::monoToString(style);
 		GUIColorDistributionField* instance = GUIColorDistributionField::create(*tmplabelText, tmpstyle);
 		GUIColorDistributionField* instance = GUIColorDistributionField::create(*tmplabelText, tmpstyle);

+ 2 - 1
Source/Scripting/SBansheeEditor/Generated/BsScriptGUIColorGradient.generated.cpp

@@ -34,7 +34,8 @@ namespace bs
 		SPtr<ColorGradient> tmpcolorGradient;
 		SPtr<ColorGradient> tmpcolorGradient;
 		ScriptColorGradient* scriptcolorGradient;
 		ScriptColorGradient* scriptcolorGradient;
 		scriptcolorGradient = ScriptColorGradient::toNative(colorGradient);
 		scriptcolorGradient = ScriptColorGradient::toNative(colorGradient);
-		tmpcolorGradient = scriptcolorGradient->getInternal();
+		if(scriptcolorGradient != nullptr)
+			tmpcolorGradient = scriptcolorGradient->getInternal();
 		static_cast<GUIColorGradient*>(thisPtr->getGUIElement())->setGradient(*tmpcolorGradient);
 		static_cast<GUIColorGradient*>(thisPtr->getGUIElement())->setGradient(*tmpcolorGradient);
 	}
 	}
 
 

+ 6 - 3
Source/Scripting/SBansheeEditor/Generated/BsScriptGUIColorGradientField.generated.cpp

@@ -51,7 +51,8 @@ namespace bs
 		SPtr<ColorGradient> tmpvalue;
 		SPtr<ColorGradient> tmpvalue;
 		ScriptColorGradient* scriptvalue;
 		ScriptColorGradient* scriptvalue;
 		scriptvalue = ScriptColorGradient::toNative(value);
 		scriptvalue = ScriptColorGradient::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		static_cast<GUIColorGradientField*>(thisPtr->getGUIElement())->setValue(*tmpvalue);
 		static_cast<GUIColorGradientField*>(thisPtr->getGUIElement())->setValue(*tmpvalue);
 	}
 	}
 
 
@@ -80,7 +81,8 @@ namespace bs
 		SPtr<HString> tmplabelText;
 		SPtr<HString> tmplabelText;
 		ScriptHString* scriptlabelText;
 		ScriptHString* scriptlabelText;
 		scriptlabelText = ScriptHString::toNative(labelText);
 		scriptlabelText = ScriptHString::toNative(labelText);
-		tmplabelText = scriptlabelText->getInternal();
+		if(scriptlabelText != nullptr)
+			tmplabelText = scriptlabelText->getInternal();
 		String tmpstyle;
 		String tmpstyle;
 		tmpstyle = MonoUtil::monoToString(style);
 		tmpstyle = MonoUtil::monoToString(style);
 		GUIColorGradientField* instance = GUIColorGradientField::create(*tmplabelText, labelWidth, tmpstyle);
 		GUIColorGradientField* instance = GUIColorGradientField::create(*tmplabelText, labelWidth, tmpstyle);
@@ -92,7 +94,8 @@ namespace bs
 		SPtr<HString> tmplabelText;
 		SPtr<HString> tmplabelText;
 		ScriptHString* scriptlabelText;
 		ScriptHString* scriptlabelText;
 		scriptlabelText = ScriptHString::toNative(labelText);
 		scriptlabelText = ScriptHString::toNative(labelText);
-		tmplabelText = scriptlabelText->getInternal();
+		if(scriptlabelText != nullptr)
+			tmplabelText = scriptlabelText->getInternal();
 		String tmpstyle;
 		String tmpstyle;
 		tmpstyle = MonoUtil::monoToString(style);
 		tmpstyle = MonoUtil::monoToString(style);
 		GUIColorGradientField* instance = GUIColorGradientField::create(*tmplabelText, tmpstyle);
 		GUIColorGradientField* instance = GUIColorGradientField::create(*tmplabelText, tmpstyle);

+ 10 - 5
Source/Scripting/SBansheeEditor/Generated/BsScriptGUICurvesField.generated.cpp

@@ -43,7 +43,8 @@ namespace bs
 		SPtr<TAnimationCurve<float>> tmpcurve;
 		SPtr<TAnimationCurve<float>> tmpcurve;
 		ScriptTAnimationCurvefloat* scriptcurve;
 		ScriptTAnimationCurvefloat* scriptcurve;
 		scriptcurve = ScriptTAnimationCurvefloat::toNative(curve);
 		scriptcurve = ScriptTAnimationCurvefloat::toNative(curve);
-		tmpcurve = scriptcurve->getInternal();
+		if(scriptcurve != nullptr)
+			tmpcurve = scriptcurve->getInternal();
 		static_cast<GUICurvesField*>(thisPtr->getGUIElement())->setCurve(*tmpcurve);
 		static_cast<GUICurvesField*>(thisPtr->getGUIElement())->setCurve(*tmpcurve);
 	}
 	}
 
 
@@ -52,11 +53,13 @@ namespace bs
 		SPtr<TAnimationCurve<float>> tmpcurveA;
 		SPtr<TAnimationCurve<float>> tmpcurveA;
 		ScriptTAnimationCurvefloat* scriptcurveA;
 		ScriptTAnimationCurvefloat* scriptcurveA;
 		scriptcurveA = ScriptTAnimationCurvefloat::toNative(curveA);
 		scriptcurveA = ScriptTAnimationCurvefloat::toNative(curveA);
-		tmpcurveA = scriptcurveA->getInternal();
+		if(scriptcurveA != nullptr)
+			tmpcurveA = scriptcurveA->getInternal();
 		SPtr<TAnimationCurve<float>> tmpcurveB;
 		SPtr<TAnimationCurve<float>> tmpcurveB;
 		ScriptTAnimationCurvefloat* scriptcurveB;
 		ScriptTAnimationCurvefloat* scriptcurveB;
 		scriptcurveB = ScriptTAnimationCurvefloat::toNative(curveB);
 		scriptcurveB = ScriptTAnimationCurvefloat::toNative(curveB);
-		tmpcurveB = scriptcurveB->getInternal();
+		if(scriptcurveB != nullptr)
+			tmpcurveB = scriptcurveB->getInternal();
 		static_cast<GUICurvesField*>(thisPtr->getGUIElement())->setCurveRange(*tmpcurveA, *tmpcurveB);
 		static_cast<GUICurvesField*>(thisPtr->getGUIElement())->setCurveRange(*tmpcurveA, *tmpcurveB);
 	}
 	}
 
 
@@ -118,7 +121,8 @@ namespace bs
 		SPtr<HString> tmplabelText;
 		SPtr<HString> tmplabelText;
 		ScriptHString* scriptlabelText;
 		ScriptHString* scriptlabelText;
 		scriptlabelText = ScriptHString::toNative(labelText);
 		scriptlabelText = ScriptHString::toNative(labelText);
-		tmplabelText = scriptlabelText->getInternal();
+		if(scriptlabelText != nullptr)
+			tmplabelText = scriptlabelText->getInternal();
 		String tmpstyle;
 		String tmpstyle;
 		tmpstyle = MonoUtil::monoToString(style);
 		tmpstyle = MonoUtil::monoToString(style);
 		GUICurvesField* instance = GUICurvesField::create(*tmplabelText, labelWidth, tmpstyle);
 		GUICurvesField* instance = GUICurvesField::create(*tmplabelText, labelWidth, tmpstyle);
@@ -130,7 +134,8 @@ namespace bs
 		SPtr<HString> tmplabelText;
 		SPtr<HString> tmplabelText;
 		ScriptHString* scriptlabelText;
 		ScriptHString* scriptlabelText;
 		scriptlabelText = ScriptHString::toNative(labelText);
 		scriptlabelText = ScriptHString::toNative(labelText);
-		tmplabelText = scriptlabelText->getInternal();
+		if(scriptlabelText != nullptr)
+			tmplabelText = scriptlabelText->getInternal();
 		String tmpstyle;
 		String tmpstyle;
 		tmpstyle = MonoUtil::monoToString(style);
 		tmpstyle = MonoUtil::monoToString(style);
 		GUICurvesField* instance = GUICurvesField::create(*tmplabelText, tmpstyle);
 		GUICurvesField* instance = GUICurvesField::create(*tmplabelText, tmpstyle);

+ 6 - 3
Source/Scripting/SBansheeEditor/Generated/BsScriptGUIFloatDistributionField.generated.cpp

@@ -69,7 +69,8 @@ namespace bs
 		SPtr<TDistribution<float>> tmpvalue;
 		SPtr<TDistribution<float>> tmpvalue;
 		ScriptTDistributionfloat* scriptvalue;
 		ScriptTDistributionfloat* scriptvalue;
 		scriptvalue = ScriptTDistributionfloat::toNative(value);
 		scriptvalue = ScriptTDistributionfloat::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		static_cast<GUIFloatDistributionField*>(thisPtr->getGUIElement())->setValue(*tmpvalue);
 		static_cast<GUIFloatDistributionField*>(thisPtr->getGUIElement())->setValue(*tmpvalue);
 	}
 	}
 
 
@@ -120,7 +121,8 @@ namespace bs
 		SPtr<HString> tmplabelText;
 		SPtr<HString> tmplabelText;
 		ScriptHString* scriptlabelText;
 		ScriptHString* scriptlabelText;
 		scriptlabelText = ScriptHString::toNative(labelText);
 		scriptlabelText = ScriptHString::toNative(labelText);
-		tmplabelText = scriptlabelText->getInternal();
+		if(scriptlabelText != nullptr)
+			tmplabelText = scriptlabelText->getInternal();
 		String tmpstyle;
 		String tmpstyle;
 		tmpstyle = MonoUtil::monoToString(style);
 		tmpstyle = MonoUtil::monoToString(style);
 		GUIFloatDistributionField* instance = GUIFloatDistributionField::create(*tmplabelText, labelWidth, tmpstyle);
 		GUIFloatDistributionField* instance = GUIFloatDistributionField::create(*tmplabelText, labelWidth, tmpstyle);
@@ -132,7 +134,8 @@ namespace bs
 		SPtr<HString> tmplabelText;
 		SPtr<HString> tmplabelText;
 		ScriptHString* scriptlabelText;
 		ScriptHString* scriptlabelText;
 		scriptlabelText = ScriptHString::toNative(labelText);
 		scriptlabelText = ScriptHString::toNative(labelText);
-		tmplabelText = scriptlabelText->getInternal();
+		if(scriptlabelText != nullptr)
+			tmplabelText = scriptlabelText->getInternal();
 		String tmpstyle;
 		String tmpstyle;
 		tmpstyle = MonoUtil::monoToString(style);
 		tmpstyle = MonoUtil::monoToString(style);
 		GUIFloatDistributionField* instance = GUIFloatDistributionField::create(*tmplabelText, tmpstyle);
 		GUIFloatDistributionField* instance = GUIFloatDistributionField::create(*tmplabelText, tmpstyle);

+ 6 - 3
Source/Scripting/SBansheeEditor/Generated/BsScriptGUIVector2DistributionField.generated.cpp

@@ -69,7 +69,8 @@ namespace bs
 		SPtr<TDistribution<Vector2>> tmpvalue;
 		SPtr<TDistribution<Vector2>> tmpvalue;
 		ScriptTDistributionVector2* scriptvalue;
 		ScriptTDistributionVector2* scriptvalue;
 		scriptvalue = ScriptTDistributionVector2::toNative(value);
 		scriptvalue = ScriptTDistributionVector2::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		static_cast<GUIVector2DistributionField*>(thisPtr->getGUIElement())->setValue(*tmpvalue);
 		static_cast<GUIVector2DistributionField*>(thisPtr->getGUIElement())->setValue(*tmpvalue);
 	}
 	}
 
 
@@ -120,7 +121,8 @@ namespace bs
 		SPtr<HString> tmplabelText;
 		SPtr<HString> tmplabelText;
 		ScriptHString* scriptlabelText;
 		ScriptHString* scriptlabelText;
 		scriptlabelText = ScriptHString::toNative(labelText);
 		scriptlabelText = ScriptHString::toNative(labelText);
-		tmplabelText = scriptlabelText->getInternal();
+		if(scriptlabelText != nullptr)
+			tmplabelText = scriptlabelText->getInternal();
 		String tmpstyle;
 		String tmpstyle;
 		tmpstyle = MonoUtil::monoToString(style);
 		tmpstyle = MonoUtil::monoToString(style);
 		GUIVector2DistributionField* instance = GUIVector2DistributionField::create(*tmplabelText, labelWidth, tmpstyle);
 		GUIVector2DistributionField* instance = GUIVector2DistributionField::create(*tmplabelText, labelWidth, tmpstyle);
@@ -132,7 +134,8 @@ namespace bs
 		SPtr<HString> tmplabelText;
 		SPtr<HString> tmplabelText;
 		ScriptHString* scriptlabelText;
 		ScriptHString* scriptlabelText;
 		scriptlabelText = ScriptHString::toNative(labelText);
 		scriptlabelText = ScriptHString::toNative(labelText);
-		tmplabelText = scriptlabelText->getInternal();
+		if(scriptlabelText != nullptr)
+			tmplabelText = scriptlabelText->getInternal();
 		String tmpstyle;
 		String tmpstyle;
 		tmpstyle = MonoUtil::monoToString(style);
 		tmpstyle = MonoUtil::monoToString(style);
 		GUIVector2DistributionField* instance = GUIVector2DistributionField::create(*tmplabelText, tmpstyle);
 		GUIVector2DistributionField* instance = GUIVector2DistributionField::create(*tmplabelText, tmpstyle);

+ 6 - 3
Source/Scripting/SBansheeEditor/Generated/BsScriptGUIVector3DistributionField.generated.cpp

@@ -69,7 +69,8 @@ namespace bs
 		SPtr<TDistribution<Vector3>> tmpvalue;
 		SPtr<TDistribution<Vector3>> tmpvalue;
 		ScriptTDistributionVector3* scriptvalue;
 		ScriptTDistributionVector3* scriptvalue;
 		scriptvalue = ScriptTDistributionVector3::toNative(value);
 		scriptvalue = ScriptTDistributionVector3::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		static_cast<GUIVector3DistributionField*>(thisPtr->getGUIElement())->setValue(*tmpvalue);
 		static_cast<GUIVector3DistributionField*>(thisPtr->getGUIElement())->setValue(*tmpvalue);
 	}
 	}
 
 
@@ -120,7 +121,8 @@ namespace bs
 		SPtr<HString> tmplabelText;
 		SPtr<HString> tmplabelText;
 		ScriptHString* scriptlabelText;
 		ScriptHString* scriptlabelText;
 		scriptlabelText = ScriptHString::toNative(labelText);
 		scriptlabelText = ScriptHString::toNative(labelText);
-		tmplabelText = scriptlabelText->getInternal();
+		if(scriptlabelText != nullptr)
+			tmplabelText = scriptlabelText->getInternal();
 		String tmpstyle;
 		String tmpstyle;
 		tmpstyle = MonoUtil::monoToString(style);
 		tmpstyle = MonoUtil::monoToString(style);
 		GUIVector3DistributionField* instance = GUIVector3DistributionField::create(*tmplabelText, labelWidth, tmpstyle);
 		GUIVector3DistributionField* instance = GUIVector3DistributionField::create(*tmplabelText, labelWidth, tmpstyle);
@@ -132,7 +134,8 @@ namespace bs
 		SPtr<HString> tmplabelText;
 		SPtr<HString> tmplabelText;
 		ScriptHString* scriptlabelText;
 		ScriptHString* scriptlabelText;
 		scriptlabelText = ScriptHString::toNative(labelText);
 		scriptlabelText = ScriptHString::toNative(labelText);
-		tmplabelText = scriptlabelText->getInternal();
+		if(scriptlabelText != nullptr)
+			tmplabelText = scriptlabelText->getInternal();
 		String tmpstyle;
 		String tmpstyle;
 		tmpstyle = MonoUtil::monoToString(style);
 		tmpstyle = MonoUtil::monoToString(style);
 		GUIVector3DistributionField* instance = GUIVector3DistributionField::create(*tmplabelText, tmpstyle);
 		GUIVector3DistributionField* instance = GUIVector3DistributionField::create(*tmplabelText, tmpstyle);

+ 6 - 3
Source/Scripting/SBansheeEngine/Generated/BsScriptAnimationClip.generated.cpp

@@ -63,7 +63,8 @@ namespace bs
 		SPtr<AnimationCurves> tmpcurves;
 		SPtr<AnimationCurves> tmpcurves;
 		ScriptAnimationCurves* scriptcurves;
 		ScriptAnimationCurves* scriptcurves;
 		scriptcurves = ScriptAnimationCurves::toNative(curves);
 		scriptcurves = ScriptAnimationCurves::toNative(curves);
-		tmpcurves = scriptcurves->getInternal();
+		if(scriptcurves != nullptr)
+			tmpcurves = scriptcurves->getInternal();
 		thisPtr->getHandle()->setCurves(*tmpcurves);
 		thisPtr->getHandle()->setCurves(*tmpcurves);
 	}
 	}
 
 
@@ -170,11 +171,13 @@ namespace bs
 		SPtr<AnimationCurves> tmpcurves;
 		SPtr<AnimationCurves> tmpcurves;
 		ScriptAnimationCurves* scriptcurves;
 		ScriptAnimationCurves* scriptcurves;
 		scriptcurves = ScriptAnimationCurves::toNative(curves);
 		scriptcurves = ScriptAnimationCurves::toNative(curves);
-		tmpcurves = scriptcurves->getInternal();
+		if(scriptcurves != nullptr)
+			tmpcurves = scriptcurves->getInternal();
 		SPtr<RootMotion> tmprootMotion;
 		SPtr<RootMotion> tmprootMotion;
 		ScriptRootMotion* scriptrootMotion;
 		ScriptRootMotion* scriptrootMotion;
 		scriptrootMotion = ScriptRootMotion::toNative(rootMotion);
 		scriptrootMotion = ScriptRootMotion::toNative(rootMotion);
-		tmprootMotion = scriptrootMotion->getInternal();
+		if(scriptrootMotion != nullptr)
+			tmprootMotion = scriptrootMotion->getInternal();
 		ResourceHandle<AnimationClip> instance = AnimationClip::create(tmpcurves, isAdditive, sampleRate, tmprootMotion);
 		ResourceHandle<AnimationClip> instance = AnimationClip::create(tmpcurves, isAdditive, sampleRate, tmprootMotion);
 		ScriptResourceManager::instance().createBuiltinScriptResource(instance, managedInstance);
 		ScriptResourceManager::instance().createBuiltinScriptResource(instance, managedInstance);
 	}
 	}

+ 8 - 4
Source/Scripting/SBansheeEngine/Generated/BsScriptAnimationCurves.generated.cpp

@@ -64,7 +64,8 @@ namespace bs
 		SPtr<TAnimationCurve<Vector3>> tmpcurve;
 		SPtr<TAnimationCurve<Vector3>> tmpcurve;
 		ScriptTAnimationCurveVector3* scriptcurve;
 		ScriptTAnimationCurveVector3* scriptcurve;
 		scriptcurve = ScriptTAnimationCurveVector3::toNative(curve);
 		scriptcurve = ScriptTAnimationCurveVector3::toNative(curve);
-		tmpcurve = scriptcurve->getInternal();
+		if(scriptcurve != nullptr)
+			tmpcurve = scriptcurve->getInternal();
 		thisPtr->getInternal()->addPositionCurve(tmpname, *tmpcurve);
 		thisPtr->getInternal()->addPositionCurve(tmpname, *tmpcurve);
 	}
 	}
 
 
@@ -75,7 +76,8 @@ namespace bs
 		SPtr<TAnimationCurve<Quaternion>> tmpcurve;
 		SPtr<TAnimationCurve<Quaternion>> tmpcurve;
 		ScriptTAnimationCurveQuaternion* scriptcurve;
 		ScriptTAnimationCurveQuaternion* scriptcurve;
 		scriptcurve = ScriptTAnimationCurveQuaternion::toNative(curve);
 		scriptcurve = ScriptTAnimationCurveQuaternion::toNative(curve);
-		tmpcurve = scriptcurve->getInternal();
+		if(scriptcurve != nullptr)
+			tmpcurve = scriptcurve->getInternal();
 		thisPtr->getInternal()->addRotationCurve(tmpname, *tmpcurve);
 		thisPtr->getInternal()->addRotationCurve(tmpname, *tmpcurve);
 	}
 	}
 
 
@@ -86,7 +88,8 @@ namespace bs
 		SPtr<TAnimationCurve<Vector3>> tmpcurve;
 		SPtr<TAnimationCurve<Vector3>> tmpcurve;
 		ScriptTAnimationCurveVector3* scriptcurve;
 		ScriptTAnimationCurveVector3* scriptcurve;
 		scriptcurve = ScriptTAnimationCurveVector3::toNative(curve);
 		scriptcurve = ScriptTAnimationCurveVector3::toNative(curve);
-		tmpcurve = scriptcurve->getInternal();
+		if(scriptcurve != nullptr)
+			tmpcurve = scriptcurve->getInternal();
 		thisPtr->getInternal()->addScaleCurve(tmpname, *tmpcurve);
 		thisPtr->getInternal()->addScaleCurve(tmpname, *tmpcurve);
 	}
 	}
 
 
@@ -97,7 +100,8 @@ namespace bs
 		SPtr<TAnimationCurve<float>> tmpcurve;
 		SPtr<TAnimationCurve<float>> tmpcurve;
 		ScriptTAnimationCurvefloat* scriptcurve;
 		ScriptTAnimationCurvefloat* scriptcurve;
 		scriptcurve = ScriptTAnimationCurvefloat::toNative(curve);
 		scriptcurve = ScriptTAnimationCurvefloat::toNative(curve);
-		tmpcurve = scriptcurve->getInternal();
+		if(scriptcurve != nullptr)
+			tmpcurve = scriptcurve->getInternal();
 		thisPtr->getInternal()->addGenericCurve(tmpname, *tmpcurve);
 		thisPtr->getInternal()->addGenericCurve(tmpname, *tmpcurve);
 	}
 	}
 
 

+ 8 - 4
Source/Scripting/SBansheeEngine/Generated/BsScriptAnimationUtility.generated.cpp

@@ -44,7 +44,8 @@ namespace bs
 		SPtr<TAnimationCurve<Vector3>> tmpeulerCurve;
 		SPtr<TAnimationCurve<Vector3>> tmpeulerCurve;
 		ScriptTAnimationCurveVector3* scripteulerCurve;
 		ScriptTAnimationCurveVector3* scripteulerCurve;
 		scripteulerCurve = ScriptTAnimationCurveVector3::toNative(eulerCurve);
 		scripteulerCurve = ScriptTAnimationCurveVector3::toNative(eulerCurve);
-		tmpeulerCurve = scripteulerCurve->getInternal();
+		if(scripteulerCurve != nullptr)
+			tmpeulerCurve = scripteulerCurve->getInternal();
 		tmp__output = AnimationUtility::eulerToQuaternionCurve(tmpeulerCurve);
 		tmp__output = AnimationUtility::eulerToQuaternionCurve(tmpeulerCurve);
 
 
 		MonoObject* __output;
 		MonoObject* __output;
@@ -59,7 +60,8 @@ namespace bs
 		SPtr<TAnimationCurve<Quaternion>> tmpquatCurve;
 		SPtr<TAnimationCurve<Quaternion>> tmpquatCurve;
 		ScriptTAnimationCurveQuaternion* scriptquatCurve;
 		ScriptTAnimationCurveQuaternion* scriptquatCurve;
 		scriptquatCurve = ScriptTAnimationCurveQuaternion::toNative(quatCurve);
 		scriptquatCurve = ScriptTAnimationCurveQuaternion::toNative(quatCurve);
-		tmpquatCurve = scriptquatCurve->getInternal();
+		if(scriptquatCurve != nullptr)
+			tmpquatCurve = scriptquatCurve->getInternal();
 		tmp__output = AnimationUtility::quaternionToEulerCurve(tmpquatCurve);
 		tmp__output = AnimationUtility::quaternionToEulerCurve(tmpquatCurve);
 
 
 		MonoObject* __output;
 		MonoObject* __output;
@@ -74,7 +76,8 @@ namespace bs
 		SPtr<TAnimationCurve<Vector3>> tmpcompoundCurve;
 		SPtr<TAnimationCurve<Vector3>> tmpcompoundCurve;
 		ScriptTAnimationCurveVector3* scriptcompoundCurve;
 		ScriptTAnimationCurveVector3* scriptcompoundCurve;
 		scriptcompoundCurve = ScriptTAnimationCurveVector3::toNative(compoundCurve);
 		scriptcompoundCurve = ScriptTAnimationCurveVector3::toNative(compoundCurve);
-		tmpcompoundCurve = scriptcompoundCurve->getInternal();
+		if(scriptcompoundCurve != nullptr)
+			tmpcompoundCurve = scriptcompoundCurve->getInternal();
 		vec__output = AnimationUtility::splitCurve3D(tmpcompoundCurve);
 		vec__output = AnimationUtility::splitCurve3D(tmpcompoundCurve);
 
 
 		MonoArray* __output;
 		MonoArray* __output;
@@ -119,7 +122,8 @@ namespace bs
 		SPtr<TAnimationCurve<Vector2>> tmpcompoundCurve;
 		SPtr<TAnimationCurve<Vector2>> tmpcompoundCurve;
 		ScriptTAnimationCurveVector2* scriptcompoundCurve;
 		ScriptTAnimationCurveVector2* scriptcompoundCurve;
 		scriptcompoundCurve = ScriptTAnimationCurveVector2::toNative(compoundCurve);
 		scriptcompoundCurve = ScriptTAnimationCurveVector2::toNative(compoundCurve);
-		tmpcompoundCurve = scriptcompoundCurve->getInternal();
+		if(scriptcompoundCurve != nullptr)
+			tmpcompoundCurve = scriptcompoundCurve->getInternal();
 		vec__output = AnimationUtility::splitCurve2D(tmpcompoundCurve);
 		vec__output = AnimationUtility::splitCurve2D(tmpcompoundCurve);
 
 
 		MonoArray* __output;
 		MonoArray* __output;

+ 2 - 1
Source/Scripting/SBansheeEngine/Generated/BsScriptCCamera.generated.cpp

@@ -252,7 +252,8 @@ namespace bs
 		SPtr<RenderSettings> tmpsettings;
 		SPtr<RenderSettings> tmpsettings;
 		ScriptRenderSettings* scriptsettings;
 		ScriptRenderSettings* scriptsettings;
 		scriptsettings = ScriptRenderSettings::toNative(settings);
 		scriptsettings = ScriptRenderSettings::toNative(settings);
-		tmpsettings = scriptsettings->getInternal();
+		if(scriptsettings != nullptr)
+			tmpsettings = scriptsettings->getInternal();
 		thisPtr->getHandle()->setRenderSettings(tmpsettings);
 		thisPtr->getHandle()->setRenderSettings(tmpsettings);
 	}
 	}
 
 

+ 4 - 2
Source/Scripting/SBansheeEngine/Generated/BsScriptCParticleSystem.generated.cpp

@@ -35,7 +35,8 @@ namespace bs
 		SPtr<ParticleSystemSettings> tmpsettings;
 		SPtr<ParticleSystemSettings> tmpsettings;
 		ScriptParticleSystemSettings* scriptsettings;
 		ScriptParticleSystemSettings* scriptsettings;
 		scriptsettings = ScriptParticleSystemSettings::toNative(settings);
 		scriptsettings = ScriptParticleSystemSettings::toNative(settings);
-		tmpsettings = scriptsettings->getInternal();
+		if(scriptsettings != nullptr)
+			tmpsettings = scriptsettings->getInternal();
 		thisPtr->getHandle()->setSettings(*tmpsettings);
 		thisPtr->getHandle()->setSettings(*tmpsettings);
 	}
 	}
 
 
@@ -55,7 +56,8 @@ namespace bs
 		SPtr<ParticleGpuSimulationSettings> tmpsettings;
 		SPtr<ParticleGpuSimulationSettings> tmpsettings;
 		ScriptParticleGpuSimulationSettings* scriptsettings;
 		ScriptParticleGpuSimulationSettings* scriptsettings;
 		scriptsettings = ScriptParticleGpuSimulationSettings::toNative(settings);
 		scriptsettings = ScriptParticleGpuSimulationSettings::toNative(settings);
-		tmpsettings = scriptsettings->getInternal();
+		if(scriptsettings != nullptr)
+			tmpsettings = scriptsettings->getInternal();
 		thisPtr->getHandle()->setGpuSimulationSettings(*tmpsettings);
 		thisPtr->getHandle()->setGpuSimulationSettings(*tmpsettings);
 	}
 	}
 
 

+ 6 - 3
Source/Scripting/SBansheeEngine/Generated/BsScriptColorDistribution.generated.cpp

@@ -66,7 +66,8 @@ namespace bs
 		SPtr<ColorGradient> tmpgradient;
 		SPtr<ColorGradient> tmpgradient;
 		ScriptColorGradient* scriptgradient;
 		ScriptColorGradient* scriptgradient;
 		scriptgradient = ScriptColorGradient::toNative(gradient);
 		scriptgradient = ScriptColorGradient::toNative(gradient);
-		tmpgradient = scriptgradient->getInternal();
+		if(scriptgradient != nullptr)
+			tmpgradient = scriptgradient->getInternal();
 		SPtr<ColorDistribution> instance = bs_shared_ptr_new<ColorDistribution>(*tmpgradient);
 		SPtr<ColorDistribution> instance = bs_shared_ptr_new<ColorDistribution>(*tmpgradient);
 		new (bs_alloc<ScriptColorDistribution>())ScriptColorDistribution(managedInstance, instance);
 		new (bs_alloc<ScriptColorDistribution>())ScriptColorDistribution(managedInstance, instance);
 	}
 	}
@@ -76,11 +77,13 @@ namespace bs
 		SPtr<ColorGradient> tmpminGradient;
 		SPtr<ColorGradient> tmpminGradient;
 		ScriptColorGradient* scriptminGradient;
 		ScriptColorGradient* scriptminGradient;
 		scriptminGradient = ScriptColorGradient::toNative(minGradient);
 		scriptminGradient = ScriptColorGradient::toNative(minGradient);
-		tmpminGradient = scriptminGradient->getInternal();
+		if(scriptminGradient != nullptr)
+			tmpminGradient = scriptminGradient->getInternal();
 		SPtr<ColorGradient> tmpmaxGradient;
 		SPtr<ColorGradient> tmpmaxGradient;
 		ScriptColorGradient* scriptmaxGradient;
 		ScriptColorGradient* scriptmaxGradient;
 		scriptmaxGradient = ScriptColorGradient::toNative(maxGradient);
 		scriptmaxGradient = ScriptColorGradient::toNative(maxGradient);
-		tmpmaxGradient = scriptmaxGradient->getInternal();
+		if(scriptmaxGradient != nullptr)
+			tmpmaxGradient = scriptmaxGradient->getInternal();
 		SPtr<ColorDistribution> instance = bs_shared_ptr_new<ColorDistribution>(*tmpminGradient, *tmpmaxGradient);
 		SPtr<ColorDistribution> instance = bs_shared_ptr_new<ColorDistribution>(*tmpminGradient, *tmpmaxGradient);
 		new (bs_alloc<ScriptColorDistribution>())ScriptColorDistribution(managedInstance, instance);
 		new (bs_alloc<ScriptColorDistribution>())ScriptColorDistribution(managedInstance, instance);
 	}
 	}

+ 4 - 2
Source/Scripting/SBansheeEngine/Generated/BsScriptMaterial.generated.cpp

@@ -125,7 +125,8 @@ namespace bs
 		SPtr<TAnimationCurve<float>> tmpvalue;
 		SPtr<TAnimationCurve<float>> tmpvalue;
 		ScriptTAnimationCurvefloat* scriptvalue;
 		ScriptTAnimationCurvefloat* scriptvalue;
 		scriptvalue = ScriptTAnimationCurvefloat::toNative(value);
 		scriptvalue = ScriptTAnimationCurvefloat::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getHandle()->setFloatCurve(tmpname, *tmpvalue, arrayIdx);
 		thisPtr->getHandle()->setFloatCurve(tmpname, *tmpvalue, arrayIdx);
 	}
 	}
 
 
@@ -143,7 +144,8 @@ namespace bs
 		SPtr<ColorGradient> tmpvalue;
 		SPtr<ColorGradient> tmpvalue;
 		ScriptColorGradient* scriptvalue;
 		ScriptColorGradient* scriptvalue;
 		scriptvalue = ScriptColorGradient::toNative(value);
 		scriptvalue = ScriptColorGradient::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getHandle()->setColorGradient(tmpname, *tmpvalue, arrayIdx);
 		thisPtr->getHandle()->setColorGradient(tmpname, *tmpvalue, arrayIdx);
 	}
 	}
 
 

+ 6 - 3
Source/Scripting/SBansheeEngine/Generated/BsScriptMesh.generated.cpp

@@ -98,7 +98,8 @@ namespace bs
 		SPtr<RendererMeshData> tmpdata;
 		SPtr<RendererMeshData> tmpdata;
 		ScriptRendererMeshData* scriptdata;
 		ScriptRendererMeshData* scriptdata;
 		scriptdata = ScriptRendererMeshData::toNative(data);
 		scriptdata = ScriptRendererMeshData::toNative(data);
-		tmpdata = scriptdata->getInternal();
+		if(scriptdata != nullptr)
+			tmpdata = scriptdata->getInternal();
 		ResourceHandle<Mesh> instance = MeshEx::create(tmpdata, topology, usage);
 		ResourceHandle<Mesh> instance = MeshEx::create(tmpdata, topology, usage);
 		ScriptResourceManager::instance().createBuiltinScriptResource(instance, managedInstance);
 		ScriptResourceManager::instance().createBuiltinScriptResource(instance, managedInstance);
 	}
 	}
@@ -108,7 +109,8 @@ namespace bs
 		SPtr<RendererMeshData> tmpdata;
 		SPtr<RendererMeshData> tmpdata;
 		ScriptRendererMeshData* scriptdata;
 		ScriptRendererMeshData* scriptdata;
 		scriptdata = ScriptRendererMeshData::toNative(data);
 		scriptdata = ScriptRendererMeshData::toNative(data);
-		tmpdata = scriptdata->getInternal();
+		if(scriptdata != nullptr)
+			tmpdata = scriptdata->getInternal();
 		Vector<SubMesh> vecsubMeshes;
 		Vector<SubMesh> vecsubMeshes;
 		if(subMeshes != nullptr)
 		if(subMeshes != nullptr)
 		{
 		{
@@ -173,7 +175,8 @@ namespace bs
 		SPtr<RendererMeshData> tmpvalue;
 		SPtr<RendererMeshData> tmpvalue;
 		ScriptRendererMeshData* scriptvalue;
 		ScriptRendererMeshData* scriptvalue;
 		scriptvalue = ScriptRendererMeshData::toNative(value);
 		scriptvalue = ScriptRendererMeshData::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		MeshEx::setMeshData(thisPtr->getHandle(), tmpvalue);
 		MeshEx::setMeshData(thisPtr->getHandle(), tmpvalue);
 	}
 	}
 }
 }

+ 18 - 9
Source/Scripting/SBansheeEngine/Generated/BsScriptParticleEmitter.generated.cpp

@@ -69,7 +69,8 @@ namespace bs
 		SPtr<ParticleEmitterShape> tmpshape;
 		SPtr<ParticleEmitterShape> tmpshape;
 		ScriptParticleEmitterShapeBase* scriptshape;
 		ScriptParticleEmitterShapeBase* scriptshape;
 		scriptshape = (ScriptParticleEmitterShapeBase*)ScriptParticleEmitterShape::toNative(shape);
 		scriptshape = (ScriptParticleEmitterShapeBase*)ScriptParticleEmitterShape::toNative(shape);
-		tmpshape = scriptshape->getInternal();
+		if(scriptshape != nullptr)
+			tmpshape = scriptshape->getInternal();
 		thisPtr->getInternal()->setShape(tmpshape);
 		thisPtr->getInternal()->setShape(tmpshape);
 	}
 	}
 
 
@@ -89,7 +90,8 @@ namespace bs
 		SPtr<TDistribution<float>> tmpvalue;
 		SPtr<TDistribution<float>> tmpvalue;
 		ScriptTDistributionfloat* scriptvalue;
 		ScriptTDistributionfloat* scriptvalue;
 		scriptvalue = ScriptTDistributionfloat::toNative(value);
 		scriptvalue = ScriptTDistributionfloat::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->setEmissionRate(*tmpvalue);
 		thisPtr->getInternal()->setEmissionRate(*tmpvalue);
 	}
 	}
 
 
@@ -141,7 +143,8 @@ namespace bs
 		SPtr<TDistribution<float>> tmpvalue;
 		SPtr<TDistribution<float>> tmpvalue;
 		ScriptTDistributionfloat* scriptvalue;
 		ScriptTDistributionfloat* scriptvalue;
 		scriptvalue = ScriptTDistributionfloat::toNative(value);
 		scriptvalue = ScriptTDistributionfloat::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->setInitialLifetime(*tmpvalue);
 		thisPtr->getInternal()->setInitialLifetime(*tmpvalue);
 	}
 	}
 
 
@@ -161,7 +164,8 @@ namespace bs
 		SPtr<TDistribution<float>> tmpvalue;
 		SPtr<TDistribution<float>> tmpvalue;
 		ScriptTDistributionfloat* scriptvalue;
 		ScriptTDistributionfloat* scriptvalue;
 		scriptvalue = ScriptTDistributionfloat::toNative(value);
 		scriptvalue = ScriptTDistributionfloat::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->setInitialSpeed(*tmpvalue);
 		thisPtr->getInternal()->setInitialSpeed(*tmpvalue);
 	}
 	}
 
 
@@ -181,7 +185,8 @@ namespace bs
 		SPtr<TDistribution<float>> tmpvalue;
 		SPtr<TDistribution<float>> tmpvalue;
 		ScriptTDistributionfloat* scriptvalue;
 		ScriptTDistributionfloat* scriptvalue;
 		scriptvalue = ScriptTDistributionfloat::toNative(value);
 		scriptvalue = ScriptTDistributionfloat::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->setInitialSize(*tmpvalue);
 		thisPtr->getInternal()->setInitialSize(*tmpvalue);
 	}
 	}
 
 
@@ -201,7 +206,8 @@ namespace bs
 		SPtr<TDistribution<Vector3>> tmpvalue;
 		SPtr<TDistribution<Vector3>> tmpvalue;
 		ScriptTDistributionVector3* scriptvalue;
 		ScriptTDistributionVector3* scriptvalue;
 		scriptvalue = ScriptTDistributionVector3::toNative(value);
 		scriptvalue = ScriptTDistributionVector3::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->setInitialSize3D(*tmpvalue);
 		thisPtr->getInternal()->setInitialSize3D(*tmpvalue);
 	}
 	}
 
 
@@ -237,7 +243,8 @@ namespace bs
 		SPtr<TDistribution<float>> tmpvalue;
 		SPtr<TDistribution<float>> tmpvalue;
 		ScriptTDistributionfloat* scriptvalue;
 		ScriptTDistributionfloat* scriptvalue;
 		scriptvalue = ScriptTDistributionfloat::toNative(value);
 		scriptvalue = ScriptTDistributionfloat::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->setInitialRotation(*tmpvalue);
 		thisPtr->getInternal()->setInitialRotation(*tmpvalue);
 	}
 	}
 
 
@@ -257,7 +264,8 @@ namespace bs
 		SPtr<TDistribution<Vector3>> tmpvalue;
 		SPtr<TDistribution<Vector3>> tmpvalue;
 		ScriptTDistributionVector3* scriptvalue;
 		ScriptTDistributionVector3* scriptvalue;
 		scriptvalue = ScriptTDistributionVector3::toNative(value);
 		scriptvalue = ScriptTDistributionVector3::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->setInitialRotation3D(*tmpvalue);
 		thisPtr->getInternal()->setInitialRotation3D(*tmpvalue);
 	}
 	}
 
 
@@ -293,7 +301,8 @@ namespace bs
 		SPtr<ColorDistribution> tmpvalue;
 		SPtr<ColorDistribution> tmpvalue;
 		ScriptColorDistribution* scriptvalue;
 		ScriptColorDistribution* scriptvalue;
 		scriptvalue = ScriptColorDistribution::toNative(value);
 		scriptvalue = ScriptColorDistribution::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->setInitialColor(*tmpvalue);
 		thisPtr->getInternal()->setInitialColor(*tmpvalue);
 	}
 	}
 
 

+ 8 - 4
Source/Scripting/SBansheeEngine/Generated/BsScriptParticleGpuSimulationSettings.generated.cpp

@@ -60,7 +60,8 @@ namespace bs
 		SPtr<ParticleVectorFieldSettings> tmpvalue;
 		SPtr<ParticleVectorFieldSettings> tmpvalue;
 		ScriptParticleVectorFieldSettings* scriptvalue;
 		ScriptParticleVectorFieldSettings* scriptvalue;
 		scriptvalue = ScriptParticleVectorFieldSettings::toNative(value);
 		scriptvalue = ScriptParticleVectorFieldSettings::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->vectorField = *tmpvalue;
 		thisPtr->getInternal()->vectorField = *tmpvalue;
 	}
 	}
 
 
@@ -80,7 +81,8 @@ namespace bs
 		SPtr<ColorDistribution> tmpvalue;
 		SPtr<ColorDistribution> tmpvalue;
 		ScriptColorDistribution* scriptvalue;
 		ScriptColorDistribution* scriptvalue;
 		scriptvalue = ScriptColorDistribution::toNative(value);
 		scriptvalue = ScriptColorDistribution::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->colorOverLifetime = *tmpvalue;
 		thisPtr->getInternal()->colorOverLifetime = *tmpvalue;
 	}
 	}
 
 
@@ -100,7 +102,8 @@ namespace bs
 		SPtr<TDistribution<Vector2>> tmpvalue;
 		SPtr<TDistribution<Vector2>> tmpvalue;
 		ScriptTDistributionVector2* scriptvalue;
 		ScriptTDistributionVector2* scriptvalue;
 		scriptvalue = ScriptTDistributionVector2::toNative(value);
 		scriptvalue = ScriptTDistributionVector2::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->sizeScaleOverLifetime = *tmpvalue;
 		thisPtr->getInternal()->sizeScaleOverLifetime = *tmpvalue;
 	}
 	}
 
 
@@ -151,7 +154,8 @@ namespace bs
 		SPtr<ParticleDepthCollisionSettings> tmpvalue;
 		SPtr<ParticleDepthCollisionSettings> tmpvalue;
 		ScriptParticleDepthCollisionSettings* scriptvalue;
 		ScriptParticleDepthCollisionSettings* scriptvalue;
 		scriptvalue = ScriptParticleDepthCollisionSettings::toNative(value);
 		scriptvalue = ScriptParticleDepthCollisionSettings::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->depthCollision = *tmpvalue;
 		thisPtr->getInternal()->depthCollision = *tmpvalue;
 	}
 	}
 }
 }

+ 2 - 1
Source/Scripting/SBansheeEngine/Generated/BsScriptParticleVectorFieldSettings.generated.cpp

@@ -172,7 +172,8 @@ namespace bs
 		SPtr<TDistribution<Vector3>> tmpvalue;
 		SPtr<TDistribution<Vector3>> tmpvalue;
 		ScriptTDistributionVector3* scriptvalue;
 		ScriptTDistributionVector3* scriptvalue;
 		scriptvalue = ScriptTDistributionVector3::toNative(value);
 		scriptvalue = ScriptTDistributionVector3::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->rotationRate = *tmpvalue;
 		thisPtr->getInternal()->rotationRate = *tmpvalue;
 	}
 	}
 
 

+ 2 - 1
Source/Scripting/SBansheeEngine/Generated/BsScriptPhysicsMesh.generated.cpp

@@ -53,7 +53,8 @@ namespace bs
 		SPtr<RendererMeshData> tmpmeshData;
 		SPtr<RendererMeshData> tmpmeshData;
 		ScriptRendererMeshData* scriptmeshData;
 		ScriptRendererMeshData* scriptmeshData;
 		scriptmeshData = ScriptRendererMeshData::toNative(meshData);
 		scriptmeshData = ScriptRendererMeshData::toNative(meshData);
-		tmpmeshData = scriptmeshData->getInternal();
+		if(scriptmeshData != nullptr)
+			tmpmeshData = scriptmeshData->getInternal();
 		ResourceHandle<PhysicsMesh> instance = PhysicsMeshEx::create(tmpmeshData, type);
 		ResourceHandle<PhysicsMesh> instance = PhysicsMeshEx::create(tmpmeshData, type);
 		ScriptResourceManager::instance().createBuiltinScriptResource(instance, managedInstance);
 		ScriptResourceManager::instance().createBuiltinScriptResource(instance, managedInstance);
 	}
 	}

+ 18 - 9
Source/Scripting/SBansheeEngine/Generated/BsScriptRenderSettings.generated.cpp

@@ -115,7 +115,8 @@ namespace bs
 		SPtr<AutoExposureSettings> tmpvalue;
 		SPtr<AutoExposureSettings> tmpvalue;
 		ScriptAutoExposureSettings* scriptvalue;
 		ScriptAutoExposureSettings* scriptvalue;
 		scriptvalue = ScriptAutoExposureSettings::toNative(value);
 		scriptvalue = ScriptAutoExposureSettings::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->autoExposure = *tmpvalue;
 		thisPtr->getInternal()->autoExposure = *tmpvalue;
 	}
 	}
 
 
@@ -151,7 +152,8 @@ namespace bs
 		SPtr<TonemappingSettings> tmpvalue;
 		SPtr<TonemappingSettings> tmpvalue;
 		ScriptTonemappingSettings* scriptvalue;
 		ScriptTonemappingSettings* scriptvalue;
 		scriptvalue = ScriptTonemappingSettings::toNative(value);
 		scriptvalue = ScriptTonemappingSettings::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->tonemapping = *tmpvalue;
 		thisPtr->getInternal()->tonemapping = *tmpvalue;
 	}
 	}
 
 
@@ -171,7 +173,8 @@ namespace bs
 		SPtr<WhiteBalanceSettings> tmpvalue;
 		SPtr<WhiteBalanceSettings> tmpvalue;
 		ScriptWhiteBalanceSettings* scriptvalue;
 		ScriptWhiteBalanceSettings* scriptvalue;
 		scriptvalue = ScriptWhiteBalanceSettings::toNative(value);
 		scriptvalue = ScriptWhiteBalanceSettings::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->whiteBalance = *tmpvalue;
 		thisPtr->getInternal()->whiteBalance = *tmpvalue;
 	}
 	}
 
 
@@ -191,7 +194,8 @@ namespace bs
 		SPtr<ColorGradingSettings> tmpvalue;
 		SPtr<ColorGradingSettings> tmpvalue;
 		ScriptColorGradingSettings* scriptvalue;
 		ScriptColorGradingSettings* scriptvalue;
 		scriptvalue = ScriptColorGradingSettings::toNative(value);
 		scriptvalue = ScriptColorGradingSettings::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->colorGrading = *tmpvalue;
 		thisPtr->getInternal()->colorGrading = *tmpvalue;
 	}
 	}
 
 
@@ -211,7 +215,8 @@ namespace bs
 		SPtr<DepthOfFieldSettings> tmpvalue;
 		SPtr<DepthOfFieldSettings> tmpvalue;
 		ScriptDepthOfFieldSettings* scriptvalue;
 		ScriptDepthOfFieldSettings* scriptvalue;
 		scriptvalue = ScriptDepthOfFieldSettings::toNative(value);
 		scriptvalue = ScriptDepthOfFieldSettings::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->depthOfField = *tmpvalue;
 		thisPtr->getInternal()->depthOfField = *tmpvalue;
 	}
 	}
 
 
@@ -231,7 +236,8 @@ namespace bs
 		SPtr<AmbientOcclusionSettings> tmpvalue;
 		SPtr<AmbientOcclusionSettings> tmpvalue;
 		ScriptAmbientOcclusionSettings* scriptvalue;
 		ScriptAmbientOcclusionSettings* scriptvalue;
 		scriptvalue = ScriptAmbientOcclusionSettings::toNative(value);
 		scriptvalue = ScriptAmbientOcclusionSettings::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->ambientOcclusion = *tmpvalue;
 		thisPtr->getInternal()->ambientOcclusion = *tmpvalue;
 	}
 	}
 
 
@@ -251,7 +257,8 @@ namespace bs
 		SPtr<ScreenSpaceReflectionsSettings> tmpvalue;
 		SPtr<ScreenSpaceReflectionsSettings> tmpvalue;
 		ScriptScreenSpaceReflectionsSettings* scriptvalue;
 		ScriptScreenSpaceReflectionsSettings* scriptvalue;
 		scriptvalue = ScriptScreenSpaceReflectionsSettings::toNative(value);
 		scriptvalue = ScriptScreenSpaceReflectionsSettings::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->screenSpaceReflections = *tmpvalue;
 		thisPtr->getInternal()->screenSpaceReflections = *tmpvalue;
 	}
 	}
 
 
@@ -271,7 +278,8 @@ namespace bs
 		SPtr<BloomSettings> tmpvalue;
 		SPtr<BloomSettings> tmpvalue;
 		ScriptBloomSettings* scriptvalue;
 		ScriptBloomSettings* scriptvalue;
 		scriptvalue = ScriptBloomSettings::toNative(value);
 		scriptvalue = ScriptBloomSettings::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->bloom = *tmpvalue;
 		thisPtr->getInternal()->bloom = *tmpvalue;
 	}
 	}
 
 
@@ -387,7 +395,8 @@ namespace bs
 		SPtr<ShadowSettings> tmpvalue;
 		SPtr<ShadowSettings> tmpvalue;
 		ScriptShadowSettings* scriptvalue;
 		ScriptShadowSettings* scriptvalue;
 		scriptvalue = ScriptShadowSettings::toNative(value);
 		scriptvalue = ScriptShadowSettings::toNative(value);
-		tmpvalue = scriptvalue->getInternal();
+		if(scriptvalue != nullptr)
+			tmpvalue = scriptvalue->getInternal();
 		thisPtr->getInternal()->shadowSettings = *tmpvalue;
 		thisPtr->getInternal()->shadowSettings = *tmpvalue;
 	}
 	}
 
 

+ 24 - 12
Source/Scripting/SBansheeEngine/Generated/BsScriptTDistribution.generated.cpp

@@ -67,7 +67,8 @@ namespace bs
 		SPtr<TAnimationCurve<float>> tmpcurve;
 		SPtr<TAnimationCurve<float>> tmpcurve;
 		ScriptTAnimationCurvefloat* scriptcurve;
 		ScriptTAnimationCurvefloat* scriptcurve;
 		scriptcurve = ScriptTAnimationCurvefloat::toNative(curve);
 		scriptcurve = ScriptTAnimationCurvefloat::toNative(curve);
-		tmpcurve = scriptcurve->getInternal();
+		if(scriptcurve != nullptr)
+			tmpcurve = scriptcurve->getInternal();
 		SPtr<TDistribution<float>> instance = bs_shared_ptr_new<TDistribution<float>>(*tmpcurve);
 		SPtr<TDistribution<float>> instance = bs_shared_ptr_new<TDistribution<float>>(*tmpcurve);
 		new (bs_alloc<ScriptTDistributionfloat>())ScriptTDistributionfloat(managedInstance, instance);
 		new (bs_alloc<ScriptTDistributionfloat>())ScriptTDistributionfloat(managedInstance, instance);
 	}
 	}
@@ -77,11 +78,13 @@ namespace bs
 		SPtr<TAnimationCurve<float>> tmpminCurve;
 		SPtr<TAnimationCurve<float>> tmpminCurve;
 		ScriptTAnimationCurvefloat* scriptminCurve;
 		ScriptTAnimationCurvefloat* scriptminCurve;
 		scriptminCurve = ScriptTAnimationCurvefloat::toNative(minCurve);
 		scriptminCurve = ScriptTAnimationCurvefloat::toNative(minCurve);
-		tmpminCurve = scriptminCurve->getInternal();
+		if(scriptminCurve != nullptr)
+			tmpminCurve = scriptminCurve->getInternal();
 		SPtr<TAnimationCurve<float>> tmpmaxCurve;
 		SPtr<TAnimationCurve<float>> tmpmaxCurve;
 		ScriptTAnimationCurvefloat* scriptmaxCurve;
 		ScriptTAnimationCurvefloat* scriptmaxCurve;
 		scriptmaxCurve = ScriptTAnimationCurvefloat::toNative(maxCurve);
 		scriptmaxCurve = ScriptTAnimationCurvefloat::toNative(maxCurve);
-		tmpmaxCurve = scriptmaxCurve->getInternal();
+		if(scriptmaxCurve != nullptr)
+			tmpmaxCurve = scriptmaxCurve->getInternal();
 		SPtr<TDistribution<float>> instance = bs_shared_ptr_new<TDistribution<float>>(*tmpminCurve, *tmpmaxCurve);
 		SPtr<TDistribution<float>> instance = bs_shared_ptr_new<TDistribution<float>>(*tmpminCurve, *tmpmaxCurve);
 		new (bs_alloc<ScriptTDistributionfloat>())ScriptTDistributionfloat(managedInstance, instance);
 		new (bs_alloc<ScriptTDistributionfloat>())ScriptTDistributionfloat(managedInstance, instance);
 	}
 	}
@@ -158,7 +161,8 @@ namespace bs
 		SPtr<Random> tmpfactor;
 		SPtr<Random> tmpfactor;
 		ScriptRandom* scriptfactor;
 		ScriptRandom* scriptfactor;
 		scriptfactor = ScriptRandom::toNative(factor);
 		scriptfactor = ScriptRandom::toNative(factor);
-		tmpfactor = scriptfactor->getInternal();
+		if(scriptfactor != nullptr)
+			tmpfactor = scriptfactor->getInternal();
 		tmp__output = thisPtr->getInternal()->evaluate(t, *tmpfactor);
 		tmp__output = thisPtr->getInternal()->evaluate(t, *tmpfactor);
 
 
 		float __output;
 		float __output;
@@ -223,7 +227,8 @@ namespace bs
 		SPtr<TAnimationCurve<Vector3>> tmpcurve;
 		SPtr<TAnimationCurve<Vector3>> tmpcurve;
 		ScriptTAnimationCurveVector3* scriptcurve;
 		ScriptTAnimationCurveVector3* scriptcurve;
 		scriptcurve = ScriptTAnimationCurveVector3::toNative(curve);
 		scriptcurve = ScriptTAnimationCurveVector3::toNative(curve);
-		tmpcurve = scriptcurve->getInternal();
+		if(scriptcurve != nullptr)
+			tmpcurve = scriptcurve->getInternal();
 		SPtr<TDistribution<Vector3>> instance = bs_shared_ptr_new<TDistribution<Vector3>>(*tmpcurve);
 		SPtr<TDistribution<Vector3>> instance = bs_shared_ptr_new<TDistribution<Vector3>>(*tmpcurve);
 		new (bs_alloc<ScriptTDistributionVector3>())ScriptTDistributionVector3(managedInstance, instance);
 		new (bs_alloc<ScriptTDistributionVector3>())ScriptTDistributionVector3(managedInstance, instance);
 	}
 	}
@@ -233,11 +238,13 @@ namespace bs
 		SPtr<TAnimationCurve<Vector3>> tmpminCurve;
 		SPtr<TAnimationCurve<Vector3>> tmpminCurve;
 		ScriptTAnimationCurveVector3* scriptminCurve;
 		ScriptTAnimationCurveVector3* scriptminCurve;
 		scriptminCurve = ScriptTAnimationCurveVector3::toNative(minCurve);
 		scriptminCurve = ScriptTAnimationCurveVector3::toNative(minCurve);
-		tmpminCurve = scriptminCurve->getInternal();
+		if(scriptminCurve != nullptr)
+			tmpminCurve = scriptminCurve->getInternal();
 		SPtr<TAnimationCurve<Vector3>> tmpmaxCurve;
 		SPtr<TAnimationCurve<Vector3>> tmpmaxCurve;
 		ScriptTAnimationCurveVector3* scriptmaxCurve;
 		ScriptTAnimationCurveVector3* scriptmaxCurve;
 		scriptmaxCurve = ScriptTAnimationCurveVector3::toNative(maxCurve);
 		scriptmaxCurve = ScriptTAnimationCurveVector3::toNative(maxCurve);
-		tmpmaxCurve = scriptmaxCurve->getInternal();
+		if(scriptmaxCurve != nullptr)
+			tmpmaxCurve = scriptmaxCurve->getInternal();
 		SPtr<TDistribution<Vector3>> instance = bs_shared_ptr_new<TDistribution<Vector3>>(*tmpminCurve, *tmpmaxCurve);
 		SPtr<TDistribution<Vector3>> instance = bs_shared_ptr_new<TDistribution<Vector3>>(*tmpminCurve, *tmpmaxCurve);
 		new (bs_alloc<ScriptTDistributionVector3>())ScriptTDistributionVector3(managedInstance, instance);
 		new (bs_alloc<ScriptTDistributionVector3>())ScriptTDistributionVector3(managedInstance, instance);
 	}
 	}
@@ -304,7 +311,8 @@ namespace bs
 		SPtr<Random> tmpfactor;
 		SPtr<Random> tmpfactor;
 		ScriptRandom* scriptfactor;
 		ScriptRandom* scriptfactor;
 		scriptfactor = ScriptRandom::toNative(factor);
 		scriptfactor = ScriptRandom::toNative(factor);
-		tmpfactor = scriptfactor->getInternal();
+		if(scriptfactor != nullptr)
+			tmpfactor = scriptfactor->getInternal();
 		Vector3 tmp__output;
 		Vector3 tmp__output;
 		tmp__output = thisPtr->getInternal()->evaluate(t, *tmpfactor);
 		tmp__output = thisPtr->getInternal()->evaluate(t, *tmpfactor);
 
 
@@ -367,7 +375,8 @@ namespace bs
 		SPtr<TAnimationCurve<Vector2>> tmpcurve;
 		SPtr<TAnimationCurve<Vector2>> tmpcurve;
 		ScriptTAnimationCurveVector2* scriptcurve;
 		ScriptTAnimationCurveVector2* scriptcurve;
 		scriptcurve = ScriptTAnimationCurveVector2::toNative(curve);
 		scriptcurve = ScriptTAnimationCurveVector2::toNative(curve);
-		tmpcurve = scriptcurve->getInternal();
+		if(scriptcurve != nullptr)
+			tmpcurve = scriptcurve->getInternal();
 		SPtr<TDistribution<Vector2>> instance = bs_shared_ptr_new<TDistribution<Vector2>>(*tmpcurve);
 		SPtr<TDistribution<Vector2>> instance = bs_shared_ptr_new<TDistribution<Vector2>>(*tmpcurve);
 		new (bs_alloc<ScriptTDistributionVector2>())ScriptTDistributionVector2(managedInstance, instance);
 		new (bs_alloc<ScriptTDistributionVector2>())ScriptTDistributionVector2(managedInstance, instance);
 	}
 	}
@@ -377,11 +386,13 @@ namespace bs
 		SPtr<TAnimationCurve<Vector2>> tmpminCurve;
 		SPtr<TAnimationCurve<Vector2>> tmpminCurve;
 		ScriptTAnimationCurveVector2* scriptminCurve;
 		ScriptTAnimationCurveVector2* scriptminCurve;
 		scriptminCurve = ScriptTAnimationCurveVector2::toNative(minCurve);
 		scriptminCurve = ScriptTAnimationCurveVector2::toNative(minCurve);
-		tmpminCurve = scriptminCurve->getInternal();
+		if(scriptminCurve != nullptr)
+			tmpminCurve = scriptminCurve->getInternal();
 		SPtr<TAnimationCurve<Vector2>> tmpmaxCurve;
 		SPtr<TAnimationCurve<Vector2>> tmpmaxCurve;
 		ScriptTAnimationCurveVector2* scriptmaxCurve;
 		ScriptTAnimationCurveVector2* scriptmaxCurve;
 		scriptmaxCurve = ScriptTAnimationCurveVector2::toNative(maxCurve);
 		scriptmaxCurve = ScriptTAnimationCurveVector2::toNative(maxCurve);
-		tmpmaxCurve = scriptmaxCurve->getInternal();
+		if(scriptmaxCurve != nullptr)
+			tmpmaxCurve = scriptmaxCurve->getInternal();
 		SPtr<TDistribution<Vector2>> instance = bs_shared_ptr_new<TDistribution<Vector2>>(*tmpminCurve, *tmpmaxCurve);
 		SPtr<TDistribution<Vector2>> instance = bs_shared_ptr_new<TDistribution<Vector2>>(*tmpminCurve, *tmpmaxCurve);
 		new (bs_alloc<ScriptTDistributionVector2>())ScriptTDistributionVector2(managedInstance, instance);
 		new (bs_alloc<ScriptTDistributionVector2>())ScriptTDistributionVector2(managedInstance, instance);
 	}
 	}
@@ -448,7 +459,8 @@ namespace bs
 		SPtr<Random> tmpfactor;
 		SPtr<Random> tmpfactor;
 		ScriptRandom* scriptfactor;
 		ScriptRandom* scriptfactor;
 		scriptfactor = ScriptRandom::toNative(factor);
 		scriptfactor = ScriptRandom::toNative(factor);
-		tmpfactor = scriptfactor->getInternal();
+		if(scriptfactor != nullptr)
+			tmpfactor = scriptfactor->getInternal();
 		Vector2 tmp__output;
 		Vector2 tmp__output;
 		tmp__output = thisPtr->getInternal()->evaluate(t, *tmpfactor);
 		tmp__output = thisPtr->getInternal()->evaluate(t, *tmpfactor);
 
 

+ 2 - 1
Source/Scripting/SBansheeEngine/Generated/BsScriptTexture.generated.cpp

@@ -182,7 +182,8 @@ namespace bs
 		SPtr<PixelData> tmpdata;
 		SPtr<PixelData> tmpdata;
 		ScriptPixelData* scriptdata;
 		ScriptPixelData* scriptdata;
 		scriptdata = ScriptPixelData::toNative(data);
 		scriptdata = ScriptPixelData::toNative(data);
-		tmpdata = scriptdata->getInternal();
+		if(scriptdata != nullptr)
+			tmpdata = scriptdata->getInternal();
 		TextureEx::setPixels(thisPtr->getHandle(), tmpdata, face, mipLevel);
 		TextureEx::setPixels(thisPtr->getHandle(), tmpdata, face, mipLevel);
 	}
 	}
 
 

+ 4 - 2
Source/Scripting/SBansheeEngine/Generated/BsScriptViewport.generated.cpp

@@ -49,7 +49,8 @@ namespace bs
 		SPtr<RenderTarget> tmptarget;
 		SPtr<RenderTarget> tmptarget;
 		ScriptRenderTargetBase* scripttarget;
 		ScriptRenderTargetBase* scripttarget;
 		scripttarget = (ScriptRenderTargetBase*)ScriptRenderTarget::toNative(target);
 		scripttarget = (ScriptRenderTargetBase*)ScriptRenderTarget::toNative(target);
-		tmptarget = scripttarget->getInternal();
+		if(scripttarget != nullptr)
+			tmptarget = scripttarget->getInternal();
 		thisPtr->getInternal()->setTarget(tmptarget);
 		thisPtr->getInternal()->setTarget(tmptarget);
 	}
 	}
 
 
@@ -151,7 +152,8 @@ namespace bs
 		SPtr<RenderTarget> tmptarget;
 		SPtr<RenderTarget> tmptarget;
 		ScriptRenderTargetBase* scripttarget;
 		ScriptRenderTargetBase* scripttarget;
 		scripttarget = (ScriptRenderTargetBase*)ScriptRenderTarget::toNative(target);
 		scripttarget = (ScriptRenderTargetBase*)ScriptRenderTarget::toNative(target);
-		tmptarget = scripttarget->getInternal();
+		if(scripttarget != nullptr)
+			tmptarget = scripttarget->getInternal();
 		SPtr<Viewport> instance = Viewport::create(tmptarget, x, y, width, height);
 		SPtr<Viewport> instance = Viewport::create(tmptarget, x, y, width, height);
 		new (bs_alloc<ScriptViewport>())ScriptViewport(managedInstance, instance);
 		new (bs_alloc<ScriptViewport>())ScriptViewport(managedInstance, instance);
 	}
 	}