Пример #1
0
    public override void OnInspectorGUI()
    {
        //if (Event.current.type != EventType.Layout)
        //	return;
        AXModel model = (AXModel)target;


        Event e = Event.current;

        //GUI.skin = axskin;
        //GUI.skin = null;

        //Debug.Log(evt.type);
        switch (e.type)
        {
        case EventType.Layout:
            if (doAutobuild)
            {
                doAutobuild = false;
                //model.autobuild ();
                ArchimatixEngine.scheduleBuild();
            }
            break;


        case EventType.MouseDown:
            //Debug.Log("Down");

            break;

        case EventType.MouseUp:

            //doAutobuild = true;
            break;

        case EventType.KeyUp:

            if (e.keyCode == KeyCode.Return || e.keyCode == KeyCode.KeypadEnter)
            {
                Undo.RegisterCompleteObjectUndo(model, "Enter");
                doAutobuild = true;
            }
            //Debug.Log("KeyUp");
            //doAutobuild = true;
            break;

        case EventType.DragUpdated:
            UnityEngine.Debug.Log("Dragging");
            break;

        case EventType.DragPerform:
            //DragAndDrop.AcceptDrag();
            UnityEngine.Debug.Log("Drag and Drop not supported... yet");
            Undo.RegisterCompleteObjectUndo(model, "Default material scale");

            doAutobuild = true;
            break;
        }



        if (richLabelStyle == null)
        {
            richLabelStyle          = new GUIStyle(GUI.skin.label);
            richLabelStyle.richText = true;
            richLabelStyle.wordWrap = true;
        }
        //if (infoIconTexture = null)


        String rubricColor = (EditorGUIUtility.isProSkin) ? "#bbbbff" : "#bbbbff";



        GUIStyle gsTest = new GUIStyle();

        gsTest.normal.background = ArchimatixEngine.nodeIcons ["Blank"];        // //Color.gray;
        gsTest.normal.textColor  = Color.white;


        Color textColor    = new Color(.82f, .80f, .85f);
        Color textColorSel = new Color(.98f, .95f, 1f);

        GUIStyle rubric = new GUIStyle(GUI.skin.label);

        rubric.normal.textColor = textColor;


        GUIStyle foldoutStyle = new GUIStyle(EditorStyles.foldout);

        foldoutStyle.normal.textColor  = textColor;
        foldoutStyle.active.textColor  = textColorSel;
        foldoutStyle.hover.textColor   = textColor;
        foldoutStyle.focused.textColor = textColorSel;

        foldoutStyle.onNormal.textColor  = textColor;
        foldoutStyle.onActive.textColor  = textColorSel;
        foldoutStyle.onHover.textColor   = textColor;
        foldoutStyle.onFocused.textColor = textColorSel;



        GUILayout.Space(10);

        GUILayout.BeginVertical(gsTest);



        EditorGUI.indentLevel++;


        EditorGUIUtility.labelWidth = 150;


        model.displayModelDefaults = EditorGUILayout.Foldout(model.displayModelDefaults, "Model Defaults", true, foldoutStyle);

        if (model.displayModelDefaults)
        {
            // PRECISION LEVEL
            EditorGUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label("Precision Level", rubric);
            GUILayout.FlexibleSpace();
            model.precisionLevel = (PrecisionLevel)EditorGUILayout.EnumPopup("", model.precisionLevel);
            EditorGUILayout.EndHorizontal();


            if (!AXNodeGraphEditorWindow.IsOpen)
            {
                GUILayout.Space(10);

                if (GUILayout.Button("Open in Node Graph"))
                {
                    AXNodeGraphEditorWindow.Init();
                }
            }


            //GUILayout.Space(20);



            // -- RUBRIC - MATERIAL --

            EditorGUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label("Material (Default)", rubric);
            GUILayout.FlexibleSpace();

            //if (GUILayout.Button ( infoIconTexture, GUIStyle.none))
            if (GUILayout.Button(infoIconTexture, GUIStyle.none, new GUILayoutOption[] {
                GUILayout.Width(16),
                GUILayout.Height(16)
            }))
            {
                Application.OpenURL("http://www.archimatix.com/manual/materials");
            }

            EditorGUILayout.EndHorizontal();

            // --------
            if (model.axMat.mat.name == "AX_GridPurple")
            {
                EditorGUILayout.HelpBox("Set the default Material for this model.", MessageType.Info);
            }

            // Material
            EditorGUI.BeginChangeCheck();

            model.axMat.mat = (Material)EditorGUILayout.ObjectField(model.axMat.mat, typeof(Material), true);
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RegisterCompleteObjectUndo(model, "Default material for " + model.name);
                model.remapMaterialTools();
                model.autobuild();
            }

            GUILayout.Space(10);

            // Texture //
            model.showDefaultMaterial = EditorGUILayout.Foldout(model.showDefaultMaterial, "Texture Scaling", true, foldoutStyle);
            if (model.showDefaultMaterial)
            {
                EditorGUI.BeginChangeCheck();
                model.axTex.scaleIsUnified = EditorGUILayout.Toggle("Unified Scaling", model.axTex.scaleIsUnified);
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RegisterCompleteObjectUndo(model, "Default material scale");
                    model.axTex.scale.y = model.axTex.scale.x;
                    model.isAltered();
                }

                if (model.axTex.scaleIsUnified)
                {
                    EditorGUI.BeginChangeCheck();
                    model.axTex.scale.x = EditorGUILayout.FloatField("Scale", model.axTex.scale.x);
                    if (EditorGUI.EndChangeCheck())
                    {
                        Undo.RegisterCompleteObjectUndo(model, "Default material for " + model.name);

                        model.axTex.scale.y = model.axTex.scale.x;
                        model.isAltered();
                        ArchimatixEngine.scheduleBuild();
                    }
                }
                else
                {
                    // Scale X
                    EditorGUI.BeginChangeCheck();
                    model.axTex.scale.x = EditorGUILayout.FloatField("Scale X", model.axTex.scale.x);
                    if (EditorGUI.EndChangeCheck())
                    {
                        Undo.RegisterCompleteObjectUndo(model, "Default material for " + model.name);
                        model.isAltered();
                        ArchimatixEngine.scheduleBuild();
                    }

                    // Scale Y
                    EditorGUI.BeginChangeCheck();
                    model.axTex.scale.y = EditorGUILayout.FloatField("Scale Y", model.axTex.scale.y);
                    if (EditorGUI.EndChangeCheck())
                    {
                        Undo.RegisterCompleteObjectUndo(model, "Default material for " + model.name);
                        model.isAltered();
                        ArchimatixEngine.scheduleBuild();
                    }
                }

                EditorGUI.BeginChangeCheck();
                model.axTex.runningU = EditorGUILayout.Toggle("Running U", model.axTex.runningU);
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RegisterCompleteObjectUndo(model, "Running U");
                    model.isAltered();
                    ArchimatixEngine.scheduleBuild();
                }
            }

            GUILayout.Space(10);


            // PhysicMaterial //
            model.axMat.showPhysicMaterial = EditorGUILayout.Foldout(model.axMat.showPhysicMaterial, "Physics Material", true, foldoutStyle);
            if (model.axMat.showPhysicMaterial)
            {
                // PHYSIC MATERIAL
                EditorGUI.BeginChangeCheck();
                model.axMat.physMat = (PhysicMaterial)EditorGUILayout.ObjectField(model.axMat.physMat, typeof(PhysicMaterial), true);
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RegisterCompleteObjectUndo(model, "Default PhysicMaterial for " + model.name);
                    model.remapMaterialTools();
                    ArchimatixEngine.scheduleBuild();
                }

                // DENSITY
                EditorGUI.BeginChangeCheck();
                model.axMat.density = EditorGUILayout.FloatField("Density", model.axMat.density);
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RegisterCompleteObjectUndo(model, "Material Density for " + model.name);
                    model.isAltered();
                    ArchimatixEngine.scheduleBuild();
                }
            }


            GUILayout.Space(20);



            model.automaticModelRegeneration = EditorGUILayout.ToggleLeft("Automatic Model Regeneration", model.automaticModelRegeneration);

            GUILayout.Space(20);

            // -- RUBRIC - LIGHTING --

            EditorGUILayout.BeginHorizontal();


            GUILayout.Space(20);
            GUILayout.Label("Lighting", rubric);


            //GUILayout.Label ("<color=" + rubricColor + "> <size=13>Lighting</size></color>", richLabelStyle);
            GUILayout.FlexibleSpace();

            //if (GUILayout.Button ( infoIconTexture, GUIStyle.none))
            if (GUILayout.Button(infoIconTexture, GUIStyle.none, new GUILayoutOption[] {
                GUILayout.Width(16),
                GUILayout.Height(16)
            }))
            {
                Application.OpenURL("http://www.archimatix.com/manual/lightmapping-with-archimatix");
            }

            EditorGUILayout.EndHorizontal();

            // --------


            // LIGHTMAP FLAGS ENABLED
            EditorGUI.BeginChangeCheck();
            model.staticFlagsEnabled = EditorGUILayout.ToggleLeft("Lightmap Flags Enabled", model.staticFlagsEnabled);
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RegisterCompleteObjectUndo(model, "Static Masks Enabled change for " + model.name);

                model.staticFlagsJustEnabled = true;

                ArchimatixEngine.scheduleBuild();
            }

            // SECONDARY UVs
            if (model.staticFlagsEnabled)
            {
                //if (model.buildStatus == AXModel.BuildStatus.Generated)
                EditorGUI.BeginChangeCheck();
                model.createSecondaryUVs = EditorGUILayout.ToggleLeft("Create Secondary UVs (for Baked GI)", model.createSecondaryUVs);
                if (EditorGUI.EndChangeCheck())
                {
                    //if (model.createSecondaryUVs)
                    //	AXEditorUtilities.makeLightMapUVs (model);
                    model.createSecondaryUVsJustEnabled = true;
                }
            }



            GUILayout.Space(20);
        }         // displayModelDefaults

        /*
         * if (GUILayout.Button("Set All Objects as Lightmap Static"))
         * {
         *      Debug.Log("Set all");
         *      model.setLightmapStaticForAllPOs();
         * }
         */



        if (ArchimatixEngine.plevel == 3)
        {
            // RUNTIME //

            string countString = "";
            if (model.exposedParameterAliases != null && model.exposedParameterAliases.Count > 0)
            {
                countString = " (" + model.exposedParameterAliases.Count + ")";
            }

            model.displayModelRuntimeParameters = EditorGUILayout.Foldout(model.displayModelRuntimeParameters, "Runtime Parameters" + countString, true, foldoutStyle);

            if (model.displayModelRuntimeParameters)
            {
                //GUILayout.Label("<color="+rubricColor+"> <size=13>Pro Runtime Features</size></color>", richLabelStyle);


                // EXPOSED PARAMETERS
                //if (model.cycleSelectedAXGO != null)
                //	GUILayout.Label("Consumer Address: "+model.cycleSelectedAXGO.consumerAddress);

                //GUILayout.Label("Runtime Parameters");

                if (model.exposedParameterAliases != null && model.exposedParameterAliases.Count > 0)
                {
                    EditorGUI.BeginChangeCheck();
                    foreach (AXParameterAlias pa in model.exposedParameterAliases)
                    {
                        ParameterAliasGUILayout.OnGUI(pa);
                    }
                    if (EditorGUI.EndChangeCheck())
                    {
                        model.isAltered();
                    }
                }
                else
                {
//					GUIStyle labelSty = new GUIStyle("Label");
//					labelSty.wordWrap = true;
//					labelSty.richText = true;

                    EditorGUILayout.HelpBox("You can add runntime parameters by opening any parameter in the graph and checking \"Enable Runtime\"", MessageType.Info);

                    //GUILayout.Label ("<color=\"gray\">You can add runntime parameters by opening any parameter in the graph and checking \"Enable Runtime\"</color>", labelSty);
                }


                GUILayout.Space(15);

                if (model.exposedParameterAliases != null && model.exposedParameterAliases.Count > 0)
                {
                    if (GUILayout.Button("Create Runtime Controller", GUILayout.Width(200)))
                    {
                        ArchimatixEngine.createControllerForModel = model;
                    }
                }



                // RUNTIME HANDLES
                //if (model.cycleSelectedAXGO != null)
                //	GUILayout.Label("Consumer Address: "+model.cycleSelectedAXGO.consumerAddress);
                if (model.runtimeHandleAliases != null && model.runtimeHandleAliases.Count > 0)
                {
                    //GUILayout.Label("Runtime Handles");


                    foreach (AXHandleRuntimeAlias rth in model.runtimeHandleAliases)
                    {
                        AXRuntimeHandlesGUI.OnGUI(rth);
                    }
                }



                GUILayout.Space(20);
            }
        }         // RUNTIME



        // RELATIONS

        if (model.selectedRelationInGraph != null)
        {
            GUILayout.Space(20);

            GUILayout.Label("<color=" + rubricColor + "> <size=13>Selected Relation</size></color>", richLabelStyle);


            AXRelation r = model.selectedRelationInGraph;
            RelationEditorGUI.OnGUI(r);
        }


        //GUILayout.Space(20);


        model.displayModelSelectedNodes = EditorGUILayout.Foldout(model.displayModelSelectedNodes, "Selected Node Controls", true, foldoutStyle);

        if (model.displayModelSelectedNodes)
        {
            // -- RUBRIC - SELECTED NODES --

            EditorGUILayout.BeginHorizontal();

            //GUILayout.Label("<color="+rubricColor+"> <size=13>Selected Nodes</size></color>", richLabelStyle);
            GUILayout.FlexibleSpace();

            //if (GUILayout.Button ( infoIconTexture, GUIStyle.none))
            if (GUILayout.Button(infoIconTexture, GUIStyle.none, new GUILayoutOption[] {
                GUILayout.Width(16),
                GUILayout.Height(16)
            }))
            {
                Application.OpenURL("http://www.archimatix.com/manual/node-selection");
            }

            EditorGUILayout.EndHorizontal();

            // --------



            //GUILayout.Space(10);

            if (model.selectedPOs != null && model.selectedPOs.Count > 0)
            {
                for (int i = 0; i < model.selectedPOs.Count; i++)
                {
                    //Debug.Log(i);
                    AXParametricObject po = model.selectedPOs [i];

                    //Debug.Log(i+" ------------------------ po.Name="+po.Name+ " -- " + po.generator.AllInput_Ps.Count);


                    doPO(po);

                    // for subnodes...

                    if (po.generator.AllInput_Ps != null)
                    {
                        for (int j = po.generator.AllInput_Ps.Count - 1; j >= 0; j--)
                        {
                            AXParameter p = po.generator.AllInput_Ps [j];

                            if (p.DependsOn != null)
                            {
                                AXParametricObject spo = p.DependsOn.parametricObject;
                                doPO(spo);

                                // sub-sub nodes...
                                for (int k = spo.generator.AllInput_Ps.Count - 1; k >= 0; k--)
                                {
                                    if (spo.generator.AllInput_Ps [k].DependsOn != null)
                                    {
                                        doPO(spo.generator.AllInput_Ps [k].DependsOn.parametricObject);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                GUILayout.Label("<color=\"gray\">...no nodes selected</color>", richLabelStyle);
            }

            GUILayout.Space(50);
        }

        EditorGUI.indentLevel--;

        GUILayout.EndVertical();
//		Editor currentTransformEditor = Editor.CreateEditor(model.gameObject.);
//		if (currentTransformEditor != null) {
//            currentTransformEditor.OnInspectorGUI ();
//        }



        //model.controls[0].val = EditorGUILayout.Slider(model.controls[0].val, 0, 100);


        /*
         * switch (e.type)
         * {
         * case EventType.KeyUp:
         * case EventType.mouseUp:
         *
         *      model.autobuild();
         *      //e.Use ();
         *
         *      //return;
         *      break;
         *
         * case EventType.mouseDown:
         *
         *      //model.autobuild();
         *      //e.Use ();
         *      break;
         *
         * }
         */


        //DrawDefaultInspector ();
    }
Пример #2
0
    public override void OnInspectorGUI()
    {
        //if (Event.current.type != EventType.Layout)
        //	return;
        AXModel model = (AXModel)target;

        Event e = Event.current;


        //Debug.Log(evt.type);
        switch (e.type)
        {
        case EventType.Layout:
            if (doAutobuild)
            {
                doAutobuild = false;
                model.autobuild();
            }
            break;


        case EventType.MouseDown:
            //Debug.Log("Down");

            break;

        case EventType.MouseUp:

            doAutobuild = true;
            break;

        case EventType.KeyUp:
            Undo.RegisterCompleteObjectUndo(model, "Key Up");
            //Debug.Log("KeyUp");
            doAutobuild = true;
            break;

        case EventType.DragUpdated:
            //Debug.Log("Dragging");
            break;

        case EventType.DragPerform:
            //DragAndDrop.AcceptDrag();
            //Debug.Log("Drag and Drop not supported... yet");
            Undo.RegisterCompleteObjectUndo(model, "Default material scale");

            doAutobuild = true;
            break;
        }

        /*
         * switch (e.type)
         * {
         * case EventType.mouseUp:
         *
         *      model.autobuild();
         *      //e.Use ();
         *      break;
         *
         * case EventType.mouseDown:
         *
         *      model.autobuild();
         *      //e.Use ();
         *      break;
         *
         * }
         */



        //myTarget.MyValue = EditorGUILayout.IntSlider("Val-you", myTarget.MyValue, 1, 10);



        if (richLabelStyle == null)
        {
            richLabelStyle          = new GUIStyle(GUI.skin.label);
            richLabelStyle.richText = true;
            richLabelStyle.wordWrap = true;
        }
        //if (infoIconTexture = null)


        String rubricColor = (EditorGUIUtility.isProSkin) ? "#bbbbff" : "#660022";



        EditorGUIUtility.labelWidth = 150;



        model.precisionLevel = (PrecisionLevel)EditorGUILayout.EnumPopup("Precision Level", model.precisionLevel);


        if (!AXNodeGraphEditorWindow.IsOpen)
        {
            GUILayout.Space(10);

            if (GUILayout.Button("Open in Node Graph"))
            {
                AXNodeGraphEditorWindow.Init();
            }
        }


        GUILayout.Space(20);



        // -- RUBRIC - MATERIAL --

        EditorGUILayout.BeginHorizontal();

        GUILayout.Label("<color=" + rubricColor + "> <size=13>Material (Default)</size></color>", richLabelStyle);
        GUILayout.FlexibleSpace();

        //if (GUILayout.Button ( infoIconTexture, GUIStyle.none))
        if (GUILayout.Button(infoIconTexture, GUIStyle.none, new GUILayoutOption[] { GUILayout.Width(16), GUILayout.Height(16) }))
        {
            Application.OpenURL("http://www.archimatix.com/manual/materials");
        }

        EditorGUILayout.EndHorizontal();

        // --------


        // Material
        EditorGUI.BeginChangeCheck();

        model.axMat.mat = (Material)EditorGUILayout.ObjectField(model.axMat.mat, typeof(Material), true);
        if (EditorGUI.EndChangeCheck())
        {
            Undo.RegisterCompleteObjectUndo(model, "Default material for " + model.name);
            model.remapMaterialTools();
            model.autobuild();
        }



        // Texture //
        model.showDefaultMaterial = EditorGUILayout.Foldout(model.showDefaultMaterial, "Texture Scaling");
        if (model.showDefaultMaterial)
        {
            EditorGUI.BeginChangeCheck();
            model.axTex.scaleIsUnified = EditorGUILayout.Toggle("Unified Scaling", model.axTex.scaleIsUnified);
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RegisterCompleteObjectUndo(model, "Default material scale");
                model.axTex.scale.y = model.axTex.scale.x;
                model.isAltered();
            }

            if (model.axTex.scaleIsUnified)
            {
                EditorGUI.BeginChangeCheck();
                model.axTex.scale.x = EditorGUILayout.FloatField("Scale", model.axTex.scale.x);
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RegisterCompleteObjectUndo(model, "Default material for " + model.name);

                    model.axTex.scale.y = model.axTex.scale.x;
                    model.isAltered();
                }
            }
            else
            {
                // Scale X
                EditorGUI.BeginChangeCheck();
                model.axTex.scale.x = EditorGUILayout.FloatField("Scale X", model.axTex.scale.x);
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RegisterCompleteObjectUndo(model, "Default material for " + model.name);
                    model.isAltered();
                }

                // Scale Y
                EditorGUI.BeginChangeCheck();
                model.axTex.scale.y = EditorGUILayout.FloatField("Scale Y", model.axTex.scale.y);
                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RegisterCompleteObjectUndo(model, "Default material for " + model.name);
                    model.isAltered();
                }
            }

            EditorGUI.BeginChangeCheck();
            model.axTex.runningU = EditorGUILayout.Toggle("Running U", model.axTex.runningU);
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RegisterCompleteObjectUndo(model, "Running U");
                model.isAltered();
            }
        }

        // PhysicMaterial //
        model.axMat.showPhysicMaterial = EditorGUILayout.Foldout(model.axMat.showPhysicMaterial, "Physics Material");
        if (model.axMat.showPhysicMaterial)
        {
            // PHYSIC MATERIAL
            EditorGUI.BeginChangeCheck();
            model.axMat.physMat = (PhysicMaterial)EditorGUILayout.ObjectField(model.axMat.physMat, typeof(PhysicMaterial), true);
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RegisterCompleteObjectUndo(model, "Default PhysicMaterial for " + model.name);
                model.remapMaterialTools();
                model.autobuild();
            }

            // DENSITY
            EditorGUI.BeginChangeCheck();
            model.axMat.density = EditorGUILayout.FloatField("Density", model.axMat.density);
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RegisterCompleteObjectUndo(model, "Material Density for " + model.name);
                model.isAltered();
            }
        }


        GUILayout.Space(20);



        // -- RUBRIC - LIGHTING --

        EditorGUILayout.BeginHorizontal();

        GUILayout.Label("<color=" + rubricColor + "> <size=13>Lighting</size></color>", richLabelStyle);
        GUILayout.FlexibleSpace();

        //if (GUILayout.Button ( infoIconTexture, GUIStyle.none))
        if (GUILayout.Button(infoIconTexture, GUIStyle.none, new GUILayoutOption[] { GUILayout.Width(16), GUILayout.Height(16) }))
        {
            Application.OpenURL("http://www.archimatix.com/manual/lightmapping-with-archimatix");
        }

        EditorGUILayout.EndHorizontal();

        // --------


        // LIGHTMAP FLAGS ENABLED
        EditorGUI.BeginChangeCheck();
        model.staticFlagsEnabled = EditorGUILayout.ToggleLeft("Lightmap Flags Enabled", model.staticFlagsEnabled);
        if (EditorGUI.EndChangeCheck())
        {
            Undo.RegisterCompleteObjectUndo(model, "Static Masks Enabled change for " + model.name);

            model.staticFlagsJustEnabled = true;

            model.autobuild();
        }

        // SECONDARY UVs
        if (model.staticFlagsEnabled)
        {
            //if (model.buildStatus == AXModel.BuildStatus.Generated)
            EditorGUI.BeginChangeCheck();
            model.createSecondaryUVs = EditorGUILayout.ToggleLeft("Create Secondary UVs (for Baked GI)", model.createSecondaryUVs);
            if (EditorGUI.EndChangeCheck())
            {
                //if (model.createSecondaryUVs)
                //	AXEditorUtilities.makeLightMapUVs (model);
                model.createSecondaryUVsJustEnabled = true;
            }
        }



        GUILayout.Space(20);



        /*
         * if (GUILayout.Button("Set All Objects as Lightmap Static"))
         * {
         *      Debug.Log("Set all");
         *      model.setLightmapStaticForAllPOs();
         * }
         */



        if (ArchimatixEngine.plevel == 3)
        {
            // RUNTIME //

            GUILayout.Label("<color=" + rubricColor + "> <size=13>Pro Runtime Features</size></color>", richLabelStyle);


            // EXPOSED PARAMETERS
            //if (model.cycleSelectedAXGO != null)
            //	GUILayout.Label("Consumer Address: "+model.cycleSelectedAXGO.consumerAddress);

            GUILayout.Label("Runtime Parameters");

            EditorGUI.BeginChangeCheck();
            foreach (AXParameterAlias pa in model.exposedParameterAliases)
            {
                ParameterAliasGUILayout.OnGUI(pa);
            }
            if (EditorGUI.EndChangeCheck())
            {
                model.isAltered();
            }

            GUILayout.Space(30);

            if (model.exposedParameterAliases != null && model.exposedParameterAliases.Count > 0)
            {
                if (GUILayout.Button("Create Runtime Controller", GUILayout.Width(200)))
                {
                    ArchimatixEngine.createControllerForModel = model;
                }
            }



            // RUNTIME HANDLES
            //if (model.cycleSelectedAXGO != null)
            //	GUILayout.Label("Consumer Address: "+model.cycleSelectedAXGO.consumerAddress);
            if (model.runtimeHandleAliases != null && model.runtimeHandleAliases.Count > 0)
            {
                GUILayout.Label("Runtime Handles");


                foreach (AXHandleRuntimeAlias rth in model.runtimeHandleAliases)
                {
                    AXRuntimeHandlesGUI.OnGUI(rth);
                }
            }


            GUILayout.Space(20);
        }         // RUNTIME



        // RELATIONS

        if (model.selectedRelationInGraph != null)
        {
            GUILayout.Space(20);

            GUILayout.Label("<color=" + rubricColor + "> <size=13>Selected Relation</size></color>", richLabelStyle);


            AXRelation r = model.selectedRelationInGraph;
            RelationEditorGUI.OnGUI(r);
        }


        GUILayout.Space(20);



        // -- RUBRIC - SELECTED NODES --

        EditorGUILayout.BeginHorizontal();

        GUILayout.Label("<color=" + rubricColor + "> <size=13>Selected Nodes</size></color>", richLabelStyle);
        GUILayout.FlexibleSpace();

        //if (GUILayout.Button ( infoIconTexture, GUIStyle.none))
        if (GUILayout.Button(infoIconTexture, GUIStyle.none, new GUILayoutOption[] { GUILayout.Width(16), GUILayout.Height(16) }))
        {
            Application.OpenURL("http://www.archimatix.com/manual/node-selection");
        }

        EditorGUILayout.EndHorizontal();

        // --------



        GUILayout.Space(10);

        if (model.selectedPOs != null && model.selectedPOs.Count > 0)
        {
            for (int i = 0; i < model.selectedPOs.Count; i++)
            {
                //Debug.Log(i);
                AXParametricObject po = model.selectedPOs[i];

                //Debug.Log(i+" ------------------------ po.Name="+po.Name+ " -- " + po.generator.AllInput_Ps.Count);


                doPO(po);

                // for subnodes...

                if (po.generator.AllInput_Ps != null)
                {
                    for (int j = po.generator.AllInput_Ps.Count - 1; j >= 0; j--)
                    {
                        AXParameter p = po.generator.AllInput_Ps[j];

                        if (p.DependsOn != null)
                        {
                            AXParametricObject spo = p.DependsOn.parametricObject;
                            doPO(spo);

                            // sub-sub nodes...
                            for (int k = spo.generator.AllInput_Ps.Count - 1; k >= 0; k--)
                            {
                                if (spo.generator.AllInput_Ps[k].DependsOn != null)
                                {
                                    doPO(spo.generator.AllInput_Ps[k].DependsOn.parametricObject);
                                }
                            }
                        }
                    }
                }
            }
        }
        else
        {
            GUILayout.Label("...no nodes selected");
        }

        GUILayout.Space(50);



        //model.controls[0].val = EditorGUILayout.Slider(model.controls[0].val, 0, 100);


        /*
         * switch (e.type)
         * {
         * case EventType.KeyUp:
         * case EventType.mouseUp:
         *
         *      model.autobuild();
         *      //e.Use ();
         *
         *      //return;
         *      break;
         *
         * case EventType.mouseDown:
         *
         *      //model.autobuild();
         *      //e.Use ();
         *      break;
         *
         * }
         */


        //DrawDefaultInspector ();
    }