Skip to content

Commit 0cc012e

Browse files
committed
C# Reformating to consistent style.
1 parent a14822a commit 0cc012e

File tree

74 files changed

+29576
-28831
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+29576
-28831
lines changed
Lines changed: 111 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
/*
2-
* Copyright (c) <2020> Side Effects Software Inc.
3-
* All rights reserved.
4-
*
5-
* Redistribution and use in source and binary forms, with or without
6-
* modification, are permitted provided that the following conditions are met:
7-
*
8-
* 1. Redistributions of source code must retain the above copyright notice,
9-
* this list of conditions and the following disclaimer.
10-
*
11-
* 2. The name of Side Effects Software may not be used to endorse or
12-
* promote products derived from this software without specific prior
13-
* written permission.
14-
*
15-
* THIS SOFTWARE IS PROVIDED BY SIDE EFFECTS SOFTWARE "AS IS" AND ANY EXPRESS
16-
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17-
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
18-
* NO EVENT SHALL SIDE EFFECTS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
19-
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20-
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
21-
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22-
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23-
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
24-
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25-
*/
2+
* Copyright (c) <2020> Side Effects Software Inc.
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are met:
7+
*
8+
* 1. Redistributions of source code must retain the above copyright notice,
9+
* this list of conditions and the following disclaimer.
10+
*
11+
* 2. The name of Side Effects Software may not be used to endorse or
12+
* promote products derived from this software without specific prior
13+
* written permission.
14+
*
15+
* THIS SOFTWARE IS PROVIDED BY SIDE EFFECTS SOFTWARE "AS IS" AND ANY EXPRESS
16+
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
18+
* NO EVENT SHALL SIDE EFFECTS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
19+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
21+
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
24+
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25+
*/
2626

2727

2828
using UnityEngine;
@@ -37,100 +37,100 @@ namespace HoudiniEngineUnity
3737
[InitializeOnLoad]
3838
public static class HEU_EditorApp
3939
{
40-
41-
/// <summary>
42-
/// Executed after script (re)load. Sets up plugin callbacks.
43-
/// </summary>
44-
static HEU_EditorApp()
45-
{
46-
EditorApplication.hierarchyWindowItemOnGUI += HierarchyWindowItemOnGUI;
40+
/// <summary>
41+
/// Executed after script (re)load. Sets up plugin callbacks.
42+
/// </summary>
43+
static HEU_EditorApp()
44+
{
45+
EditorApplication.hierarchyWindowItemOnGUI += HierarchyWindowItemOnGUI;
4746

4847
#if UNITY_2018_1_OR_NEWER
49-
EditorApplication.quitting += EditorQuit;
48+
EditorApplication.quitting += EditorQuit;
5049
#endif
5150

5251
#if UNITY_2019_1_OR_NEWER
53-
SceneView.duringSceneGui += OnSceneGUIDelegate;
52+
SceneView.duringSceneGui += OnSceneGUIDelegate;
5453
#else
5554
SceneView.onSceneGUIDelegate += OnSceneGUIDelegate;
5655
#endif
57-
}
58-
59-
private static void HierarchyWindowItemOnGUI(int instanceID, Rect selectionRect)
60-
{
61-
ProcessDragEvent(Event.current, null);
62-
}
63-
64-
private static void OnSceneGUIDelegate(SceneView sceneView)
65-
{
66-
ProcessDragEvent(Event.current, sceneView);
67-
}
68-
69-
private static void ProcessDragEvent(Event dragEvent, SceneView sceneView)
70-
{
71-
if (dragEvent != null && (dragEvent.type == EventType.DragUpdated || dragEvent.type == EventType.DragPerform))
72-
{
73-
bool dragHDAs = false;
74-
List<string> hdaList = new List<string>();
75-
foreach (string file in DragAndDrop.paths)
76-
{
77-
if (HEU_HAPIUtility.IsHoudiniAssetFile(file))
78-
{
79-
dragHDAs = true;
80-
DragAndDrop.visualMode = DragAndDropVisualMode.Move;
81-
hdaList.Add(file);
82-
break;
83-
}
84-
}
85-
86-
if (dragHDAs)
87-
{
88-
if (dragEvent.type == EventType.DragPerform)
89-
{
90-
if (HEU_SessionManager.ValidatePluginSession())
91-
{
92-
Vector3 dropPos = Vector3.zero;
93-
if (sceneView != null)
94-
{
95-
Camera camera = sceneView.camera;
96-
Vector3 mousePos = HEU_EditorUI.GetMousePosition(ref dragEvent, camera);
97-
98-
Ray ray = camera.ScreenPointToRay(mousePos);
99-
ray.origin = camera.transform.position;
100-
Plane plane = new Plane();
101-
plane.SetNormalAndPosition(Vector3.up, Vector3.zero);
102-
float enter = 0f;
103-
plane.Raycast(ray, out enter);
104-
enter = Mathf.Clamp(enter, camera.nearClipPlane, camera.farClipPlane);
105-
dropPos = ray.origin + ray.direction * enter;
106-
}
107-
108-
List<GameObject> createdGOs = new List<GameObject>();
109-
foreach (string file in hdaList)
110-
{
111-
GameObject go = HEU_HAPIUtility.InstantiateHDA(file, dropPos, HEU_SessionManager.GetOrCreateDefaultSession(), true);
112-
if (go != null)
113-
{
114-
createdGOs.Add(go);
115-
}
116-
}
117-
118-
// Select the created assets
119-
HEU_EditorUtility.SelectObjects(createdGOs.ToArray());
120-
}
121-
}
122-
123-
dragEvent.Use();
124-
}
125-
}
126-
}
127-
128-
private static void EditorQuit()
129-
{
130-
HEU_Logger.Log("Houdini Engine: Editor is closing. Closing all sessions and clearing cache.");
131-
HEU_SessionManager.CloseAllSessions();
132-
HEU_PluginStorage.DeleteAllSavedSessionData();
133-
}
56+
}
57+
58+
private static void HierarchyWindowItemOnGUI(int instanceID, Rect selectionRect)
59+
{
60+
ProcessDragEvent(Event.current, null);
61+
}
62+
63+
private static void OnSceneGUIDelegate(SceneView sceneView)
64+
{
65+
ProcessDragEvent(Event.current, sceneView);
66+
}
67+
68+
private static void ProcessDragEvent(Event dragEvent, SceneView sceneView)
69+
{
70+
if (dragEvent != null &&
71+
(dragEvent.type == EventType.DragUpdated || dragEvent.type == EventType.DragPerform))
72+
{
73+
bool dragHDAs = false;
74+
List<string> hdaList = new List<string>();
75+
foreach (string file in DragAndDrop.paths)
76+
{
77+
if (HEU_HAPIUtility.IsHoudiniAssetFile(file))
78+
{
79+
dragHDAs = true;
80+
DragAndDrop.visualMode = DragAndDropVisualMode.Move;
81+
hdaList.Add(file);
82+
break;
83+
}
84+
}
85+
86+
if (dragHDAs)
87+
{
88+
if (dragEvent.type == EventType.DragPerform)
89+
{
90+
if (HEU_SessionManager.ValidatePluginSession())
91+
{
92+
Vector3 dropPos = Vector3.zero;
93+
if (sceneView != null)
94+
{
95+
Camera camera = sceneView.camera;
96+
Vector3 mousePos = HEU_EditorUI.GetMousePosition(ref dragEvent, camera);
97+
98+
Ray ray = camera.ScreenPointToRay(mousePos);
99+
ray.origin = camera.transform.position;
100+
Plane plane = new Plane();
101+
plane.SetNormalAndPosition(Vector3.up, Vector3.zero);
102+
float enter = 0f;
103+
plane.Raycast(ray, out enter);
104+
enter = Mathf.Clamp(enter, camera.nearClipPlane, camera.farClipPlane);
105+
dropPos = ray.origin + ray.direction * enter;
106+
}
107+
108+
List<GameObject> createdGOs = new List<GameObject>();
109+
foreach (string file in hdaList)
110+
{
111+
GameObject go = HEU_HAPIUtility.InstantiateHDA(file, dropPos,
112+
HEU_SessionManager.GetOrCreateDefaultSession(), true);
113+
if (go != null)
114+
{
115+
createdGOs.Add(go);
116+
}
117+
}
118+
119+
// Select the created assets
120+
HEU_EditorUtility.SelectObjects(createdGOs.ToArray());
121+
}
122+
}
123+
124+
dragEvent.Use();
125+
}
126+
}
127+
}
128+
129+
private static void EditorQuit()
130+
{
131+
HEU_Logger.Log("Houdini Engine: Editor is closing. Closing all sessions and clearing cache.");
132+
HEU_SessionManager.CloseAllSessions();
133+
HEU_PluginStorage.DeleteAllSavedSessionData();
134+
}
134135
}
135-
136136
}
Lines changed: 47 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
/*
2-
* Copyright (c) <2020> Side Effects Software Inc.
3-
* All rights reserved.
4-
*
5-
* Redistribution and use in source and binary forms, with or without
6-
* modification, are permitted provided that the following conditions are met:
7-
*
8-
* 1. Redistributions of source code must retain the above copyright notice,
9-
* this list of conditions and the following disclaimer.
10-
*
11-
* 2. The name of Side Effects Software may not be used to endorse or
12-
* promote products derived from this software without specific prior
13-
* written permission.
14-
*
15-
* THIS SOFTWARE IS PROVIDED BY SIDE EFFECTS SOFTWARE "AS IS" AND ANY EXPRESS
16-
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17-
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
18-
* NO EVENT SHALL SIDE EFFECTS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
19-
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20-
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
21-
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22-
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23-
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
24-
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25-
*/
2+
* Copyright (c) <2020> Side Effects Software Inc.
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are met:
7+
*
8+
* 1. Redistributions of source code must retain the above copyright notice,
9+
* this list of conditions and the following disclaimer.
10+
*
11+
* 2. The name of Side Effects Software may not be used to endorse or
12+
* promote products derived from this software without specific prior
13+
* written permission.
14+
*
15+
* THIS SOFTWARE IS PROVIDED BY SIDE EFFECTS SOFTWARE "AS IS" AND ANY EXPRESS
16+
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
18+
* NO EVENT SHALL SIDE EFFECTS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
19+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
21+
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
24+
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25+
*/
2626

2727
using System.Collections;
2828
using System.Collections.Generic;
@@ -35,29 +35,27 @@ namespace HoudiniEngineUnity
3535
/// </summary>
3636
public static class HEU_EditorStrings
3737
{
38-
39-
// Menus
40-
public const string INPROCESS_SESSION = "In-Process Session";
41-
public const string RPC_PIPE_SESSION = "Pipe Session";
42-
public const string RPC_SOCKET_SESSION = "Socket Session";
43-
public const string GET_SESSION_INFO = "Session Info";
44-
public const string CLOSE_DEFAULT_SESSION = "Close Default Session";
45-
public const string CLOSE_ALL_SESSIONS = "Close All Sessions";
46-
public const string RESTART_SESSION = "Restart Session";
47-
public const string RECONNECT_TO_SESSION = "Reconnect To Session";
48-
49-
public const string LOAD_SESSION_FROM_HIP = "Load Session From HIP";
50-
public const string SAVE_SESSION_TO_HIP = "Save Houdini Scene (.hip)";
51-
52-
public const string OPEN_SCENE_IN_HOUDINI = "Open Scene In Houdini";
53-
54-
public const string REVERT_SETTINGS = "Revert To Default";
55-
public const string RELOAD_SETTINGS = "Reload From Saved File";
56-
57-
public const string HELP_DOCUMENTATION = "Online Documentation";
58-
public const string HELP_DOCUMENTATION_URL = "http://www.sidefx.com/docs/unity/";
59-
public const string HELP_FORUM = "Online Forum";
60-
public const string HELP_FORUM_URL = "http://www.sidefx.com/forum/50/";
38+
// Menus
39+
public const string INPROCESS_SESSION = "In-Process Session";
40+
public const string RPC_PIPE_SESSION = "Pipe Session";
41+
public const string RPC_SOCKET_SESSION = "Socket Session";
42+
public const string GET_SESSION_INFO = "Session Info";
43+
public const string CLOSE_DEFAULT_SESSION = "Close Default Session";
44+
public const string CLOSE_ALL_SESSIONS = "Close All Sessions";
45+
public const string RESTART_SESSION = "Restart Session";
46+
public const string RECONNECT_TO_SESSION = "Reconnect To Session";
47+
48+
public const string LOAD_SESSION_FROM_HIP = "Load Session From HIP";
49+
public const string SAVE_SESSION_TO_HIP = "Save Houdini Scene (.hip)";
50+
51+
public const string OPEN_SCENE_IN_HOUDINI = "Open Scene In Houdini";
52+
53+
public const string REVERT_SETTINGS = "Revert To Default";
54+
public const string RELOAD_SETTINGS = "Reload From Saved File";
55+
56+
public const string HELP_DOCUMENTATION = "Online Documentation";
57+
public const string HELP_DOCUMENTATION_URL = "http://www.sidefx.com/docs/unity/";
58+
public const string HELP_FORUM = "Online Forum";
59+
public const string HELP_FORUM_URL = "http://www.sidefx.com/forum/50/";
6160
}
62-
63-
} // HoudiniEngineUnity
61+
} // HoudiniEngineUnity

0 commit comments

Comments
 (0)