Skip to content

Commit a4a454f

Browse files
committed
Resolved compilation issues related to using UNITY_2022_1_OR_NEWER when UNITY_SPLINES_INSTALLED is required.
1 parent 3d47cd1 commit a4a454f

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

Plugins/HoudiniEngineUnity/Scripts/PublicWrappers/IHEU_InputNode.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ public interface IHEU_InputNode
114114
/// <summary>Tilemap settings</summary>
115115
HEU_InputInterfaceTilemapSettings TilemapSettings { get; }
116116

117+
#if UNITY_2022_1_OR_NEWER
118+
/// <summary>Spline settings</summary>
119+
HEU_InputInterfaceSplineSettings SplineSettings { get; }
120+
#endif
121+
117122
/// <summary>
118123
/// Whether or not this is an asset input
119124
/// </summary>

Plugins/HoudiniEngineUnity/Scripts/Utility/HEU_InputInterfaceSpline.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@
2424
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2525
*/
2626

27-
#if UNITY_SPLINES_INSTALLED
2827

2928
using System.Collections.Generic;
3029
using System.Linq;
3130
using UnityEngine;
31+
32+
#if UNITY_SPLINES_INSTALLED
33+
3234
using UnityEngine.Splines;
3335
using Unity.Mathematics;
3436

37+
#endif
38+
3539

3640
namespace HoudiniEngineUnity
3741
{
@@ -48,6 +52,7 @@ public class HEU_InputInterfaceSplineSettings
4852
private float _samplingResolution = 0.5f;
4953
};
5054

55+
#if UNITY_SPLINES_INSTALLED
5156
/// <summary>
5257
/// This class provides functionality for uploading Unity spline data from gameobjects
5358
/// into Houdini through an input node.
@@ -78,6 +83,11 @@ private HEU_InputInterfaceSpline() : base(priority: DEFAULT_PRIORITY)
7883

7984
public void Initialize(HEU_InputInterfaceSplineSettings settings)
8085
{
86+
if (settings == null)
87+
{
88+
settings = new HEU_InputInterfaceSplineSettings();
89+
}
90+
8191
this.settings = settings;
8292
}
8393

@@ -280,6 +290,6 @@ public bool UploadData(HEU_SessionBase session, HAPI_NodeId inputNodeID, HEU_Inp
280290
return session.CommitGeo(inputNodeID);
281291
}
282292
}
283-
} // HoudiniEngineUnity
293+
#endif
284294

285-
#endif
295+
} // HoudiniEngineUnity

Plugins/HoudiniEngineUnity/Scripts/Utility/HEU_InputUtility.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ internal static bool CreateInputNodeWithMultiObjects(HEU_SessionBase session, HA
226226
HEU_InputInterfaceTilemap tilemapInterface = inputInterface as HEU_InputInterfaceTilemap;
227227
tilemapInterface.Initialize(inputNode.TilemapSettings);
228228
}
229-
#if UNITY_2022_1_OR_NEWER
229+
#if UNITY_SPLINES_INSTALLED
230230
if (inputInterfaceType == typeof(HEU_InputInterfaceSpline))
231231
{
232232
HEU_InputInterfaceSpline splineInterface = inputInterface as HEU_InputInterfaceSpline;

0 commit comments

Comments
 (0)