Skip to content

Commit

Permalink
Merge pull request #21 from aras-p/editing-tools
Browse files Browse the repository at this point in the history
Editing tools
  • Loading branch information
aras-p authored Oct 6, 2023
2 parents f520309 + 21f00b7 commit a7f88bd
Show file tree
Hide file tree
Showing 11 changed files with 874 additions and 50 deletions.
1 change: 0 additions & 1 deletion Assets/GSTestScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ MonoBehaviour:
m_SortNthFrame: 1
m_RenderMode: 0
m_PointDisplaySize: 3
m_RenderInSceneView: 1
m_ShaderSplats: {fileID: 4800000, guid: ed800126ae8844a67aad1974ddddd59c, type: 3}
m_ShaderComposite: {fileID: 4800000, guid: 7e184af7d01193a408eb916d8acafff9, type: 3}
m_ShaderDebugPoints: {fileID: 4800000, guid: b44409fc67214394f8f47e4e2648425e, type: 3}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,16 @@ public static string PathToDisplayString(string path)
return "<none>";
path = path.Replace('\\', '/');
string[] parts = path.Split('/');

// check if filename is not some super generic one
var baseName = Path.GetFileNameWithoutExtension(parts[^1]).ToLowerInvariant();
if (baseName != "point_cloud" && baseName != "splat" && baseName != "input")
return parts[^1];

// otherwise if filename is just some generic "point cloud" type, then take some folder names above it into account
if (parts.Length >= 4)
path = string.Join('/', parts.TakeLast(4));

path = path.Replace('/', '-');
return path;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public class GaussianSplatAssetCreator : EditorWindow
{
const string kProgressTitle = "Creating Gaussian Splat Asset";
const string kCamerasJson = "cameras.json";
const string kPrefQuality = "nesnausk.GaussianSplatting.CreatorQuality";
const string kPrefOutputFolder = "nesnausk.GaussianSplatting.CreatorOutputFolder";

enum DataQuality
{
Expand Down Expand Up @@ -61,6 +63,12 @@ public static void Init()
window.Show();
}

void Awake()
{
m_Quality = (DataQuality)EditorPrefs.GetInt(kPrefQuality, (int)DataQuality.Medium);
m_OutputFolder = EditorPrefs.GetString(kPrefOutputFolder, "Assets/GaussianAssets");
}

void OnEnable()
{
ApplyQualityLevel();
Expand Down Expand Up @@ -89,11 +97,18 @@ void OnGUI()
EditorGUILayout.Space();
GUILayout.Label("Output", EditorStyles.boldLabel);
rect = EditorGUILayout.GetControlRect(true);
m_OutputFolder = m_FilePicker.PathFieldGUI(rect, new GUIContent("Output Folder"), m_OutputFolder, null, "GaussianAssetOutputFolder");
string newOutputFolder = m_FilePicker.PathFieldGUI(rect, new GUIContent("Output Folder"), m_OutputFolder, null, "GaussianAssetOutputFolder");
if (newOutputFolder != m_OutputFolder)
{
m_OutputFolder = newOutputFolder;
EditorPrefs.SetString(kPrefOutputFolder, m_OutputFolder);
}

var newQuality = (DataQuality) EditorGUILayout.EnumPopup("Quality", m_Quality);
if (newQuality != m_Quality)
{
m_Quality = newQuality;
EditorPrefs.SetInt(kPrefQuality, (int)m_Quality);
ApplyQualityLevel();
}

Expand Down
Loading

0 comments on commit a7f88bd

Please sign in to comment.