Example #1
0
        public void changeNormal()
        {
            GuiBitmapCtrl ctrl = this.findObjectByInternalName("normTexCtrl", true);
            string        file = ctrl.bitmap;

            if (file.StartsWith("tools/"))
            {
                file = "";
            }
            file = _selectTextureFileDialog(file);

            if (file == "")
            {
                if (ctrl.bitmap != "")
                {
                    file = ctrl.bitmap;
                }
                else
                {
                    file = "tools/materialeditor/gui/unknownImage";
                }
            }
            file = Util.makeRelativePath(file, Util.getMainDotCsDir());
            ctrl.setBitmapX(file);
        }
Example #2
0
        public void setActiveMaterial(TerrainMaterial mat)
        {
            if (mat.isObject())
            {
                GuiTextEditCtrl matNameCtrl        = this.findObjectByInternalName("matNameCtrl", true);
                GuiBitmapCtrl   baseTexCtrl        = this.findObjectByInternalName("baseTexCtrl", true);
                GuiBitmapCtrl   detailTexCtrl      = this.findObjectByInternalName("detailTexCtrl", true);
                GuiBitmapCtrl   macroTexCtrl       = this.findObjectByInternalName("macroTexCtrl", true);
                GuiBitmapCtrl   normTexCtrl        = this.findObjectByInternalName("normTexCtrl", true);
                GuiTextEditCtrl detSizeCtrl        = this.findObjectByInternalName("detSizeCtrl", true);
                GuiTextEditCtrl baseSizeCtrl       = this.findObjectByInternalName("baseSizeCtrl", true);
                GuiTextEditCtrl detStrengthCtrl    = this.findObjectByInternalName("detStrengthCtrl", true);
                GuiTextEditCtrl detDistanceCtrl    = this.findObjectByInternalName("detDistanceCtrl", true);
                GuiCheckBoxCtrl sideProjectionCtrl = this.findObjectByInternalName("sideProjectionCtrl", true);
                GuiTextEditCtrl parallaxScaleCtrl  = this.findObjectByInternalName("parallaxScaleCtrl", true);

                GuiTextEditCtrl macroSizeCtrl     = this.findObjectByInternalName("macroSizeCtrl", true);
                GuiTextEditCtrl macroStrengthCtrl = this.findObjectByInternalName("macroStrengthCtrl", true);
                GuiTextEditCtrl macroDistanceCtrl = this.findObjectByInternalName("macroDistanceCtrl", true);

                //TerrainPainterAddition
                GuiTextEditCtrl terrainFolderCtrl = FOT("terrainFolderCtrl");

                this["activeMat"] = mat;

                matNameCtrl.setText(mat.internalName);

                baseTexCtrl.setBitmapX(mat.diffuseMap == "" ? "tools/materialeditor/gui/unknownImage" : mat.diffuseMap);
                detailTexCtrl.setBitmapX(mat.detailMap == "" ? "tools/materialeditor/gui/unknownImage" : mat.detailMap);
                macroTexCtrl.setBitmapX(mat.macroMap == "" ? "tools/materialeditor/gui/unknownImage" : mat.macroMap);
                normTexCtrl.setBitmapX(mat.normalMap == "" ? "tools/materialeditor/gui/unknownImage" : mat.normalMap);

                detSizeCtrl.setText(mat.detailSize.AsString());
                baseSizeCtrl.setText(mat.diffuseSize.AsString());
                detStrengthCtrl.setText(mat.detailStrength.AsString());
                detDistanceCtrl.setText(mat.detailDistance.AsString());
                sideProjectionCtrl.setValue(mat.useSideProjection.AsString());
                parallaxScaleCtrl.setText(mat.parallaxScale.AsString());

                macroSizeCtrl.setText(mat.macroSize.AsString());
                macroStrengthCtrl.setText(mat.macroStrength.AsString());
                macroDistanceCtrl.setText(mat.macroDistance.AsString());

                //TerrainPainterAddition
                terrainFolderCtrl.setText(mat["terrainFolder"]);
                activateMaterialCtrls(true);
            }
            else
            {
                this["activeMat"] = "0";
                activateMaterialCtrls(false);
            }
        }