Commit b4eb7e01 authored by Sylvain Renault's avatar Sylvain Renault
Browse files

Issue showing objects in Editor UI is solved (creator ID should never be Empty!).

Some improvmenents in the Graph editor (design, messages).
parent 3857ad31
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ namespace ETSI.ARF.WorldStorage.UI
        protected Vector2 scrollPos;
        protected Color ori;
        protected GUIStyle gsTest;
        protected string saveText = "Save";

        public void Update()
        {
+24 −11
Original line number Diff line number Diff line
@@ -189,6 +189,9 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
            GUILayout.Label("Augmented Reality Framework", leftStyle);
            GUILayout.Label("Copyright (C) 2024, ETSI (BSD 3-Clause License)", leftStyle);

            //separator line
            Rect rect = EditorGUILayout.GetControlRect(false, 1);
            EditorGUI.DrawRect(rect, Color.gray);

            switch (type)
            {
@@ -221,7 +224,7 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
                //anchor icon
                EditorGUILayout.BeginHorizontal();
                Texture anchorImage = (Texture)AssetDatabase.LoadAssetAtPath("Assets/ETSI.ARF/ARF World Storage API/Images/anchor.png", typeof(Texture));
                GUI.backgroundColor = Color.clear;
                GUI.backgroundColor = WorldStorageWindow.arfColors[8];
                GUILayout.Box(anchorImage, GUILayout.Width(40), GUILayout.Height(40));

                //anchor label
@@ -245,7 +248,8 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
                    GUI.backgroundColor = Color.clear;
                    GUILayout.BeginHorizontal();
                    GUILayout.Box(warningImage, GUILayout.Width(27), GUILayout.Height(27));
                    EditorGUILayout.LabelField("This element is not synchronized with the World Storage");
                    GUILayout.Label("This element is not synchronized with the World Storage!", EditorStyles.whiteBoldLabel);

                    GUILayout.EndHorizontal();
                }

@@ -260,7 +264,7 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
                EditorGUILayout.LabelField("UUID ", EditorStyles.boldLabel, GUILayout.Width(50));
                if (!SaveInfo.instance.nodePositions.ContainsKey(worldAnchor.UUID.ToString()))
                {
                    EditorGUILayout.LabelField("none yet (element not yet saved in the server)");
                    EditorGUILayout.LabelField("None yet (element not yet saved in the server)");
                }
                else
                {
@@ -268,6 +272,8 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
                }
                EditorGUILayout.EndHorizontal();

                GUI.backgroundColor = Color.white;

                //name
                EditorGUILayout.BeginHorizontal();
                EditorGUI.BeginChangeCheck();
@@ -433,7 +439,7 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
                //
                //FOOTER
                //
                GUILayout.FlexibleSpace();
                //GUILayout.FlexibleSpace();
                EditorGUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();

@@ -494,6 +500,7 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
                GUI.backgroundColor = Color.green;
                if (GUILayout.Button("Save"))
                {
                    System.Guid _creator = Guid.NewGuid(); // System.Guid.Parse(WorldStorageWindow.WorldStorageWindowSingleton.worldStorageUser.UUID);
                    if (SaveInfo.instance.nodePositions.ContainsKey(worldAnchor.UUID.ToString()))
                    {
                        if (SaveInfo.instance.elemsToUpdate.Contains(worldAnchor.UUID.ToString()))
@@ -510,6 +517,7 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
                        posX.Add(worldAnchorNode.GetPosition().x.ToString());
                        var posY = new Collection<String>();
                        posY.Add(worldAnchorNode.GetPosition().y.ToString());

                        WorldAnchor worldAnchor = worldAnchorNode.worldAnchor;
                        worldAnchor.KeyvalueTags["unityAuthoringPosX"] = posX;
                        worldAnchor.KeyvalueTags["unityAuthoringPosY"] = posY;
@@ -560,7 +568,7 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
                //trackable icon
                EditorGUILayout.BeginHorizontal();
                Texture trackImage = (Texture)AssetDatabase.LoadAssetAtPath("Assets/ETSI.ARF/ARF World Storage API/Images/trackable.png", typeof(Texture));
                GUI.backgroundColor = Color.clear;
                GUI.backgroundColor = WorldStorageWindow.arfColors[7];
                GUILayout.Box(trackImage, GUILayout.Width(40), GUILayout.Height(40));

                //trackable label
@@ -584,7 +592,7 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
                    GUI.backgroundColor = Color.clear;
                    GUILayout.BeginHorizontal();
                    GUILayout.Box(warningImage, GUILayout.Width(27), GUILayout.Height(27));
                    EditorGUILayout.LabelField("This element is not synchronized with the World Storage");
                    GUILayout.Label("This element is not synchronized with the World Storage!", EditorStyles.whiteBoldLabel);
                    GUILayout.EndHorizontal();
                }

@@ -599,7 +607,7 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
                EditorGUILayout.LabelField("UUID ", EditorStyles.boldLabel, GUILayout.Width(50));
                if (!SaveInfo.instance.nodePositions.ContainsKey(trackable.UUID.ToString()))
                {
                    EditorGUILayout.LabelField("none yet (element not yet saved in the server)");
                    EditorGUILayout.LabelField("None yet (element not yet saved in the server)");
                }
                else
                {
@@ -607,6 +615,8 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
                }
                EditorGUILayout.EndHorizontal();

                GUI.backgroundColor = Color.white;

                //name
                EditorGUILayout.BeginHorizontal();
                EditorGUI.BeginChangeCheck();
@@ -932,6 +942,7 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
                                TrackablePayload = new byte[64],
                                LocalCRS = localCRS,
                                Unit = UnitSystem.CM,
                                Confidence = 0,
                                TrackableSize = trackableSize,
                                KeyvalueTags = new KeyvalueTagList()
                            };
@@ -1010,7 +1021,7 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
                //world link icon
                EditorGUILayout.BeginHorizontal();
                Texture linkImage = (Texture)AssetDatabase.LoadAssetAtPath("Assets/ETSI.ARF/ARF World Storage API/Images/link.png", typeof(Texture));
                GUI.backgroundColor = Color.clear;
                GUI.backgroundColor = WorldStorageWindow.arfColors[9];
                GUILayout.Box(linkImage, GUILayout.Width(40), GUILayout.Height(40));

                //world link label
@@ -1034,19 +1045,21 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
                    GUI.backgroundColor = Color.clear;
                    GUILayout.BeginHorizontal();
                    GUILayout.Box(warningImage, GUILayout.Width(27), GUILayout.Height(27));
                    EditorGUILayout.LabelField("This element is not synchronized with the World Storage");
                    GUILayout.Label("This element is not synchronized with the World Storage!", EditorStyles.whiteBoldLabel);
                    GUILayout.EndHorizontal();
                }

                //ELEMENT'S ATTRIBUTES
                EditorGUI.BeginChangeCheck();

                GUI.backgroundColor = Color.white;

                //uuid
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("UUID ", EditorStyles.boldLabel, GUILayout.Width(50));
                if (!SaveInfo.instance.linkIds.Contains(worldLink.UUID.ToString()))
                {
                    EditorGUILayout.LabelField("none yet (element not yet saved in the server)");
                    EditorGUILayout.LabelField("None yet (element not yet saved in the server)");
                }
                else
                {
+3 −4
Original line number Diff line number Diff line
@@ -67,12 +67,14 @@ namespace ETSI.ARF.WorldStorage.UI
            winSingleton.worldStorageUser = user;
            if (!string.IsNullOrEmpty(UUID))
            {
                winSingleton.saveText = "Update";
                winSingleton.UUID = UUID;
                winSingleton.GetParams();
            }
            else
            {
                // Create new one
                winSingleton.saveText = "Create";
                winSingleton.AddObject();
            }
        }
@@ -155,7 +157,7 @@ namespace ETSI.ARF.WorldStorage.UI
            // ---------------------
            EditorGUILayout.BeginHorizontal();
            GUI.backgroundColor = WorldStorageWindow.arfColors[2];
            if (GUILayout.Button("Save"))
            if (GUILayout.Button(saveText))
            {
                Debug.Log("PUT Trackable");

@@ -170,7 +172,6 @@ namespace ETSI.ARF.WorldStorage.UI
                        if (WorldStorageWindow.WorldStorageWindowSingleton != null)
                        {
                            WorldStorageWindow.WorldStorageWindowSingleton.GetTrackables();
                            WorldStorageWindow.WorldStorageWindowSingleton.repaint = true;
                        }
                        Close();
                    });
@@ -194,7 +195,6 @@ namespace ETSI.ARF.WorldStorage.UI
                        if (WorldStorageWindow.WorldStorageWindowSingleton != null)
                        {
                            WorldStorageWindow.WorldStorageWindowSingleton.GetTrackables();
                            WorldStorageWindow.WorldStorageWindowSingleton.repaint = true;
                        }
                        Close();
                    });
@@ -316,7 +316,6 @@ namespace ETSI.ARF.WorldStorage.UI
                UUID = response.result;
                UUID = UUID.Trim('"'); //Bugfix: remove " from server return value
                WorldStorageWindow.WorldStorageWindowSingleton.GetTrackables();
                WorldStorageWindow.WorldStorageWindowSingleton.repaint = true;
            });
        }

+3 −1
Original line number Diff line number Diff line
@@ -64,12 +64,14 @@ namespace ETSI.ARF.WorldStorage.UI
            winSingleton.worldStorageUser = user;
            if (!string.IsNullOrEmpty(UUID))
            {
                winSingleton.saveText = "Update";
                winSingleton.UUID = UUID;
                winSingleton.GetParams();
            }
            else
            {
                // Create new one
                winSingleton.saveText = "Create";
                winSingleton.AddObject();
            }
        }
@@ -152,7 +154,7 @@ namespace ETSI.ARF.WorldStorage.UI
            // ---------------------
            EditorGUILayout.BeginHorizontal();
            GUI.backgroundColor = WorldStorageWindow.arfColors[2];
            if (GUILayout.Button("Save"))
            if (GUILayout.Button(saveText))
            {
                Debug.Log("PUT World Anchor");

+7 −1
Original line number Diff line number Diff line
@@ -122,6 +122,7 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows

            EditorGUI.BeginChangeCheck();
            worldStorageServer = (WorldStorageServer)EditorGUILayout.ObjectField("World Storage Server", worldStorageServer, typeof(WorldStorageServer), false, GUILayout.Width(500));
            worldStorageUser = (WorldStorageUser)EditorGUILayout.ObjectField("User", worldStorageUser, typeof(WorldStorageUser), false, GUILayout.Width(500));
            if (EditorGUI.EndChangeCheck())
            {
                GraphEditorWindow.ResetWindow();
@@ -143,6 +144,7 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
                        myGraph.style.top = Length.Percent(11);
                        myGraph.style.bottom = Length.Percent(5);
                        rootVisualElement.Add(myGraph);
                        Debug.Log("World Graph window initialized.");
                    }
                    catch (Exception e)
                    {
@@ -163,7 +165,11 @@ namespace ETSI.ARF.WorldStorage.Editor.Windows
            leftStyle.alignment = TextAnchor.MiddleLeft;

            GUILayout.Label("Augmented Reality Framework", leftStyle);
            GUILayout.Label("Copyright (C) 2022, ETSI (BSD 3-Clause License)", leftStyle);
            GUILayout.Label("Copyright (C) 2024, ETSI (BSD 3-Clause License)", leftStyle);

            //separator line
            Rect rect = EditorGUILayout.GetControlRect(false, 1);
            EditorGUI.DrawRect(rect, Color.gray);

            //reframe all elements to see them all
            if (SaveInfo.instance.toReFrame && (twoFrames == 2))
Loading