Exemple #1
0
    // Draw toggles
    private void DrawRenderSettings()
    {
        GUILayout.Label("Render Settings", style.titleStyle);

        style.DrawToggle("Nodes", ref settings.renderNodes);
        style.DrawToggle("Lines", ref settings.renderLines);
        style.DrawToggle("Curves", ref settings.renderCurves);
        style.DrawToggle("Adjustment Nodes", ref settings.renderCurveAdjustmentNodes);

        if (!settings.renderNodes && !settings.renderLines && !settings.renderCurves && !settings.renderCurveAdjustmentNodes)
        {
            SendMessageRequest("Nothing is being displayed, please select an option!", WarningStatus.Warning);
        }
    }
Exemple #2
0
    // Draw for each mesh setting container the settings
    private void DrawMeshSettings(MeshSettingsContainer mesh, int meshIndex)
    {
        GUILayout.Space(10);
        GUILayout.Label("Settings", style.titleStyle);

        // Mesh reference
        EditorGUI.BeginChangeCheck();
        style.DrawObjectField("Mesh Object", ref mesh.usedMesh);

        // Clean the mesh when it changed
        if (EditorGUI.EndChangeCheck())
        {
            TrackManager.meshTools.CleanMesh(mesh);
        }

        if (mesh.usedMesh)
        {
            // Draw this mesh y/n
            style.DrawToggle("Create Mesh", ref mesh.createMesh);

            if (mesh.createMesh)
            {
                // Draw settings for object without a triangle in the input mesh
                if (!mesh.isSeperateObj)
                {
                    // Draw symmetry mode
                    GUILayout.Label("Mesh Settings", style.textStyle);
                    style.DrawToggle("Symmetry Mode", ref mesh.symmetry);

                    // Draw loop mesh setting
                    style.DrawToggle("Loop Mesh Around", ref mesh.loopMesh);
                }
                // Settings unavailable for mesh with triangles
                else if (settings.showInfo)
                {
                    mesh.symmetry = false;
                    mesh.loopMesh = false;
                    style.DrawInfo("Loop Mesh and symmetry modes are not available when the mesh has faces.");
                }
                // Draw flip normal setting
                style.DrawToggle("Flip Normals", ref mesh.flipNormals);

                // Draw offset settings
                GUILayout.Label("Offset of the mesh", style.textStyle);
                style.DrawFloatField("Offset Mesh X", ref mesh.offsetFromCurveX, -100, 100);
                style.DrawFloatField("Offset Mesh Y", ref mesh.offsetFromCurveY, -100, 100);

                // Draw size settings
                GUILayout.Label("Size of the mesh", style.textStyle);
                style.DrawFloatField("Mesh Size X", ref mesh.localSizeOfMeshX, 0.01f);
                style.DrawFloatField("Mesh Size Y", ref mesh.localSizeOfMeshY, 0.01f);

                if (mesh.isSeperateObj)
                {
                    style.DrawFloatField("Mesh Size Z", ref mesh.localSizeOfMeshZ, 0.01f);
                }
                else if (settings.showInfo)
                {
                    mesh.localSizeOfMeshZ = 0;
                    style.DrawInfo("The size of the mesh in the Z axis is unavailable when the mesh does not have faces.");
                }

                // Check if mesh size is not too small
                if (mesh.localSizeOfMeshX < 0.1f || mesh.localSizeOfMeshY < 0.1f || (mesh.isSeperateObj && mesh.localSizeOfMeshZ < 0.1f))
                {
                    SendMessageRequest("Size of the mesh is really small! Mesh might not be visible.", meshIndex, WarningStatus.Warning);
                }

                GUILayout.Label("Materials", style.textStyle);
                style.DrawObjectField("Main Material", ref mesh.materialInput);
                if (!mesh.materialInput)
                {
                    SendMessageRequest("Material is not assigned, mesh will display as error material.", meshIndex, WarningStatus.Warning);
                }
            }
            else if (settings.showInfo)
            {
                style.DrawInfo("This mesh will not be generated.");
            }
        }
        else
        {
            SendMessageRequest("The settings need a mesh to operate!", meshIndex, WarningStatus.Error);
        }
    }