Full Template for ticket #1

This commit is contained in:
DavidWyand-GG 2012-09-19 11:54:25 -04:00
parent 74f265b3b3
commit f439dc8dcd
2150 changed files with 286240 additions and 0 deletions

View file

@ -0,0 +1,68 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(MaterialEditorToolbar) {
canSaveDynamicFields = "0";
internalName = "ShapeEditorToolbar";
Enabled = "1";
isContainer = "1";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "672 0";
Extent = "802" SPC getWord(EditorGuiToolbar.extent, 1);
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
canMove = "0";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
resizeWidth = "0";
resizeHeight = "0";
EdgeSnap = "0";
text ="";
new GuiTextCtrl() {
profile = "GuiTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "5 7";
extent = "76 16";
minExtent = "8 8";
visible = "1";
text = "Material Library";
maxLength = "255";
helpTag = "0";
};
new GuiBitmapCtrl() {
Enabled = "1";
Profile = "GuiDefaultProfile";
position = "86 3";
Extent = "2 26";
MinExtent = "1 1";
bitmap = "core/art/gui/images/separator-h.png";
};
new GuiBitmapButtonCtrl() {
canSaveDynamicFields = "0";
internalName = "";
Enabled = "1";
isContainer = "0";
Profile = "GuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "91 3";
Extent = "29 27";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
Command = "materialSelector.showDialog();";
tooltipprofile = "GuiToolTipProfile";
ToolTip = "Select and Edit an Existing Material";
hovertime = "1000";
bitmap = "tools/materialEditor/gui/materialSelectorIcon";
text = "";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
};

View file

@ -0,0 +1,70 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
// Material Editor Written by Dave Calabrese of Gaslight Studios
singleton GuiControlProfile (GuiMatEdSliderProfile)
{
bitmap = "./matEdSlider";
category = "Editor";
};
singleton GuiControlProfile (GuiMatEdRightJustifyProfile)
{
// font
fontType = "Arial";
fontSize = 14;
fontCharset = ANSI;
fontColor = "0 0 0";
justify = "right";
category = "Editor";
};
singleton GuiControlProfile(GuiMatEdPopUpMenuProfile)
{
opaque = false;
mouseOverSelected = true;
textOffset = "3 3";
border = 1;
/*borderThickness = 1;*/
fixedExtent = true;
//bitmap = "./images/scrollbar";
bitmap = "tools/editorClasses/gui/images/scroll";
hasBitmapArray = true;
//profileForChildren = GuiPopupMenuItemBorder;
profileForChildren = GuiControlListPopupProfile;
fillColor = "255 0 0 255";
fontColor = "255 255 255 255";
fillColorHL = "50 50 50";
fontColorHL = "220 220 220";
borderColor = "100 100 108";
category = "Editor";
};
singleton GuiControlProfile (MatEdCenteredTextProfile)
{
fontColor = "0 0 0";
justify = "center";
category = "Editor";
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

@ -0,0 +1,796 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl() {
canSaveDynamicFields = "0";
internalName = "MatEdPreviewWindowContainer";
Enabled = "1";
isContainer = "1";
Profile = "GuiDefaultProfile";
HorizSizing = "width";
VertSizing = "height";
Position = "0 0";
Extent = "800 600";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
new GuiWindowCollapseCtrl(MaterialEditorPreviewWindow) {
canSaveDynamicFields = "0";
internalName = "MatEdPreviewWindow";
Enabled = "1";
isContainer = "1";
Profile = "GuiWindowProfile";
HorizSizing = "windowRelative";
VertSizing = "windowRelative";
Extent = "210 251 ";
MinExtent = "210 150";
Position = getWord($pref::Video::mode, 0) - 209
SPC getWord(EditorGuiToolbar.extent, 1)-1;
canSave = "1";
Visible = "1";
hovertime = "1000";
Margin = "4 4 4 4";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
closeCommand = "MaterialEditorPreviewWindow.setVisible(false);";
minSize = "50 50";
EdgeSnap = "1";
text = "Material Preview";
/*new GuiContainer(MaterialEditorPreviewPane) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1"; //1
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "4 23";
Extent = "200 221";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "GuiToolTipProfile";
hovertime = "1000";
Docking = "Client";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";*/
new GuiContainer(matEd_previewPanel) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "GuiDefaultProfile";
HorizSizing = "width";
VertSizing = "height";
position = "4 45";
Extent = "202 202";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
Docking = "Client";
Margin = "24 1 3 3 ";
new GuiSwatchButtonCtrl(matEd_previewBackground) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiInspectorSwatchButtonProfile";
HorizSizing = "width";
VertSizing = "height";
position = "-1 -1";
Extent = "204 204";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
color = "0 0 0 .8";
//bitmap = "tools/materialEditor/gui/gridTiny2.PNG";
//wrap = "1";
};
new GuiContainer(){ // this is blocking the mouse imput to the swatch imput behind it
HorizSizing = "width";
VertSizing = "height";
Position = "-1 -1";
Extent = "204 204";
};
new GuiMaterialPreview(matEd_previewObjectView) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "width";
VertSizing = "height";
position = "1 1";
Extent = "199 199";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
cameraZRot = "0";
forceFOV = "0";
};
//};
};
new GuiPopUpMenuCtrl(matEd_quickPreview_Popup) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiPopUpMenuProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "4 24";
Extent = "67 18";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.updatePreviewObject();";
ToolTip = "Changes the Preview Mesh";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
text = "Sphere";
maxLength = "1024";
maxPopupHeight = "200";
sbUsesNAColor = "0";
reverseTextList = "0";
bitmapBounds = "16 16";
};
new GuiSwatchButtonCtrl(MaterialPreviewBackgroundPicker) { // Background Color
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiInspectorSwatchButtonProfile";
HorizSizing = "left";
VertSizing = "top";
position = "189 229";
Extent = "14 14";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "getColorF($thisControl.color, \"MaterialEditorGui.updatePreviewBackground\");";
color = "0 0 0 .8";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
// Ambient light color picker
new GuiSwatchButtonCtrl(matEd_ambientLightColorPicker) {
canSaveDynamicFields = "0";
Enabled = "1";
color = "1 1 1 1";
isContainer = "0";
Profile = "GuiInspectorSwatchButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "81 28";
Extent = "14 14";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "getColorF($ThisControl.color, \"MaterialEditorGui.updateAmbientColor\");";
hovertime = "1000";
groupNum = "-1";
ToolTip ="Change Ambient Light Color";
buttonType = "PushButton";
useMouseEvents = "0";
};
// Light color picker
new GuiSwatchButtonCtrl(matEd_lightColorPicker) {
canSaveDynamicFields = "0";
Enabled = "1";
color = "1 1 1 1";
isContainer = "0";
Profile = "GuiInspectorSwatchButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "75 23";
Extent = "14 14";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "getColorF($ThisControl.color, \"MaterialEditorGui.updateLightColor\");";
hovertime = "1000";
groupNum = "-1";
ToolTip ="Change Normal Light Color";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiCheckboxCtrl(){
position = "108 25";
Extent = "98 18";
HorizSizing = "left";
profile = "GuiCheckBoxProfile";
Variable = "MaterialEditorGui.livePreview";
Command = "MaterialEditorGui.updateLivePreview($ThisControl.getValue());";
text ="Preview in World";
};
};
new GuiWindowCtrl(matEd_cubemapEditor) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "GuiWindowProfile";
HorizSizing = "center";
VertSizing = "center";
position = "200 257";
Extent = "478 248";
MinExtent = "478 248";
canSave = "1";
Visible = "0";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
resizeWidth = "0";
resizeHeight = "0";
canMove = "1";
canClose = "1";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
EdgeSnap = "1";
closeCommand = "MaterialEditorGui.hideCubemapEditor(true);";
text = "Cubemap Editor";
new GuiTextCtrl(){
Profile = "GuiTextProfile";
position = "307 40";
Extent = "30 16";
text = "Name";
};
new GuiTextEditCtrl(matEd_cubemapEd_activeCubemapNameTxt) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiTextEditProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "338 40";
Extent = "131 18";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
text = "myCubemap 1";
maxLength = "1024";
AltCommand = "MaterialEditorGui.editCubemapName($ThisControl.getText());";
};
new GuiButtonCtrl(){
Profile = "GuiButtonProfile";
position = "339 216";
Extent = "74 24";
text = "Select";
command = "MaterialEditorGui.selectCubemap();"; // needs hookup use selected cubemap
};
new GuiButtonCtrl(){
Profile = "GuiButtonProfile";
position = "417 216";
Extent = "52 24";
text = "Cancel";
command = "MaterialEditorGui.hideCubemapEditor(true);"; // needs hookup Cancel
};
new GuiScrollCtrl(matEd_cubemapEd_availableCubemapScroller) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "GuiScrollProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "5 40";
Extent = "154 203";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
willFirstRespond = "1";
hScrollBar = "alwaysOff";
vScrollBar = "dynamic";
lockHorizScroll = "true";
lockVertScroll = "false";
constantThumbHeight = "0";
childMargin = "0 0";
new GuiListBoxCtrl(matEd_cubemapEd_availableCubemapList) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiListBoxProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "2 2";
Extent = "128 2";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
AllowMultipleSelections = "0";
fitParentWidth = "1";
};
};
new GuiTextCtrl(){
Profile = "GuiTextProfile";
position = "6 22";
Extent = "67 16";
text = "Cubemaps";
};
// ------------------------------ Right X Positive ------------------------------------
new GuiBitmapCtrl(matEd_cubemapEd_XPos) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "299 106";
Extent = "64 64";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
bitmap = "tools/materialeditor/gui/unknownImage";
wrap = "0";
};
new GuiTextCtrl(matEd_cubeMapEd_xPosTxt) {
position = "304 110";
Extent = "57 10";
text = "+ X Right";
};
new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateXPOSImg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "299 106";
Extent = "64 64";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.editCubemapImage(\"0\", $ThisControl.bitmap );";
tooltipprofile = "GuiDefaultProfile";
ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
};
// ------------------------------ X Negitive ------------------------------------
new GuiBitmapCtrl(matEd_cubemapEd_XNeg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "167 106";
Extent = "64 64";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
bitmap = "tools/materialeditor/gui/unknownImage";
wrap = "0";
};
new GuiTextCtrl(matEd_cubeMapEd_xNegTxt) {
position = "171 110";
Extent = "57 10";
text = "- X Left";
};
new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateXNEGImg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "167 106";
Extent = "64 64";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.editCubemapImage(\"1\", $ThisControl.bitmap );";
tooltipprofile = "GuiDefaultProfile";
ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
};
// ------------------------------ Y Positive ------------------------------------
new GuiBitmapCtrl(matEd_cubemapEd_YPos) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "233 172";
Extent = "64 64";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
bitmap = "tools/materialeditor/gui/unknownImage";
wrap = "0";
};
new GuiTextCtrl(matEd_cubeMapEd_yPosTxt) {
position = "237 175";
Extent = "57 10";
text = "+ Y Front";
};
new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateYPOSImg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "233 172";
Extent = "64 64";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.editCubemapImage(\"3\", $ThisControl.bitmap );";
tooltipprofile = "GuiDefaultProfile";
ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
};
// ------------------------------ Y Negitive ------------------------------------
new GuiBitmapCtrl(matEd_cubemapEd_YNeG) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "233 40";
Extent = "64 64";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
bitmap = "tools/materialeditor/gui/unknownImage";
wrap = "0";
};
new GuiTextCtrl(matEd_cubeMapEd_yNegTxt) {
position = "237 44";
Extent = "57 10";
text = "- Y Back";
};
new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateYNegImg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "233 40";
Extent = "64 64";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.editCubemapImage(\"2\", $ThisControl.bitmap );";
tooltipprofile = "GuiDefaultProfile";
ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
};
// ------------------------------ Z Positive ------------------------------------
new GuiBitmapCtrl(matEd_cubemapEd_ZPos) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "233 106";
Extent = "64 64";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
bitmap = "tools/materialeditor/gui/unknownImage";
wrap = "0";
};
new GuiTextCtrl(matEd_cubeMapEd_zPosTxt) {
position = "237 110";
Extent = "57 10";
text = "+ Z Top";
};
new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateZPosImg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "233 106";
Extent = "64 64";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.editCubemapImage(\"4\", $ThisControl.bitmap );";
tooltipprofile = "GuiDefaultProfile";
ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
};
// ------------------------------ Z Negitive ------------------------------------
new GuiBitmapCtrl(matEd_cubemapEd_ZNeg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "365 106";
Extent = "64 64";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
bitmap = "tools/materialeditor/gui/unknownImage";
wrap = "0";
};
new GuiTextCtrl(matEd_cubeMapEd_zNegTxt) {
position = "369 110";
Extent = "57 10";
text = "- Z Bottom";
};
new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateZNegImg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "365 106";
Extent = "64 64";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.editCubemapImage(\"5\", $ThisControl.bitmap );";
tooltipprofile = "GuiDefaultProfile";
ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
bitmap = "tools/materialEditor/gui/cubemapBtnBorder";
};
// Create New Cubemap
new GuiBitmapButtonCtrl() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "top";
position = "128 23";
Extent = "17 17";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "matEd_addCubemapWindow.setVisible(1);"; // -------------- Needs Hookup Create New Cubemap
hovertime = "1000";
tooltip = "Create New Cubemap";
bitmap = "core/art/gui/images/new";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapButtonCtrl() {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "top";
position = "143 23";
Extent = "17 17";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.showDeleteCubemapDialog();"; // -------------- Needs Hookup Delete Cubemap
hovertime = "1000";
tooltip = "Delete Cubemap";
bitmap = "tools/gui/images/delete";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapButtonCtrl() {
internalName = "saveCubemap";
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "top";
position = "106 23";
Extent = "17 17";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.showSaveCubemapDialog();"; // -------------- Needs Hookup Save Cubemap
hovertime = "1000";
tooltip = "Save Cubemap";
bitmap = "tools/gui/images/save-icon";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
};
new GuiWindowCtrl(matEd_addCubemapWindow) {
canSaveDynamicFields = "0";
isContainer = "1";
Profile = "GuiWindowProfile";
HorizSizing = "center";
VertSizing = "center";
position = "362 333";
Extent = "300 99";
MinExtent = "48 92";
canSave = "1";
Visible = "0";
tooltipprofile = "GuiToolTipProfile";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
EdgeSnap = "1";
text = "Create Cubemap";
new GuiTextEditCtrl() {
canSaveDynamicFields = "0";
internalName = "cubemapName";
isContainer = "0";
Profile = "GuiTextEditProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "96 35";
Extent = "196 18";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "GuiToolTipProfile";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
maxLength = "1024";
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
AltCommand = "";
passwordMask = "*";
};
new GuiTextCtrl() {
canSaveDynamicFields = "0";
isContainer = "0";
Profile = "GuiTextProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "12 36";
Extent = "77 16";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "GuiToolTipProfile";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
maxLength = "1024";
text = "Cubemap Name";
};
new GuiButtonCtrl() {
canSaveDynamicFields = "0";
isContainer = "0";
Profile = "GuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "96 68";
Extent = "126 22";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "GuiToolTipProfile";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
text = "Create";
Command = "MaterialEditorGui.addCubemap( matEd_addCubemapWindow-->cubemapName.getText() );matEd_addCubemapWindow.setVisible(0);";
};
new GuiButtonCtrl() {
canSaveDynamicFields = "0";
isContainer = "0";
Profile = "GuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "228 68";
Extent = "64 22";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "GuiToolTipProfile";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
text = "Cancel";
Command = "matEd_addCubemapWindow.setVisible(0);";
};
};
};
//--- OBJECT WRITE END ---

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 869 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 891 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 929 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 815 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 915 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 793 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 689 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

View file

@ -0,0 +1,160 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
// Material Editor Written by Dave Calabrese and Travis Vroman of Gaslight Studios
function initializeMaterialEditor()
{
echo(" % - Initializing Material Editor");
// Load Preview Window
exec("~/materialEditor/gui/guiMaterialPreviewWindow.ed.gui");
// Load Properties Window
exec("~/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui");
// Load Client Scripts.
exec("./scripts/materialEditor.ed.cs");
exec("./scripts/materialEditorUndo.ed.cs");
//exec("./gui/profiles.ed.cs");
MaterialEditorPreviewWindow.setVisible( false );
matEd_cubemapEditor.setVisible( false );
matEd_addCubemapWindow.setVisible( false );
MaterialEditorPropertiesWindow.setVisible( false );
EditorGui.add( MaterialEditorPreviewWindow );
EditorGui.add( matEd_cubemapEditor );
EditorGui.add( matEd_addCubemapWindow );
EditorGui.add( MaterialEditorPropertiesWindow );
}
function destroyMaterialEditor()
{
}
// Material Editor
function MaterialEditorPlugin::onWorldEditorStartup( %this )
{
// Add ourselves to the window menu.
%accel = EditorGui.addToEditorsMenu( "Material Editor", "", MaterialEditorPlugin );
// Add ourselves to the ToolsToolbar
%tooltip = "Material Editor (" @ %accel @ ")";
EditorGui.addToToolsToolbar( "MaterialEditorPlugin", "MaterialEditorPalette", expandFilename("tools/worldEditor/images/toolbar/matterial-editor"), %tooltip );
//connect editor windows
GuiWindowCtrl::attach( MaterialEditorPropertiesWindow, MaterialEditorPreviewWindow);
%map = new ActionMap();
%map.bindCmd( keyboard, "1", "EWorldEditorNoneModeBtn.performClick();", "" ); // Select
%map.bindCmd( keyboard, "2", "EWorldEditorMoveModeBtn.performClick();", "" ); // Move
%map.bindCmd( keyboard, "3", "EWorldEditorRotateModeBtn.performClick();", "" ); // Rotate
%map.bindCmd( keyboard, "4", "EWorldEditorScaleModeBtn.performClick();", "" ); // Scale
%map.bindCmd( keyboard, "f", "FitToSelectionBtn.performClick();", "" );// Fit Camera to Selection
%map.bindCmd( keyboard, "z", "EditorGuiStatusBar.setCamera(\"Standard Camera\");", "" );// Free Camera
%map.bindCmd( keyboard, "n", "ToggleNodeBar->renderHandleBtn.performClick();", "" );// Render Node
%map.bindCmd( keyboard, "shift n", "ToggleNodeBar->renderTextBtn.performClick();", "" );// Render Node Text
%map.bindCmd( keyboard, "alt s", "MaterialEditorGui.save();", "" );// Save Material
//%map.bindCmd( keyboard, "delete", "ToggleNodeBar->renderTextBtn.performClick();", "" );// delete Material
%map.bindCmd( keyboard, "g", "ESnapOptions-->GridSnapButton.performClick();" ); // Grid Snappping
%map.bindCmd( keyboard, "t", "SnapToBar->objectSnapDownBtn.performClick();", "" );// Terrain Snapping
%map.bindCmd( keyboard, "b", "SnapToBar-->objectSnapBtn.performClick();" ); // Soft Snappping
%map.bindCmd( keyboard, "v", "EWorldEditorToolbar->boundingBoxColBtn.performClick();", "" );// Bounds Selection
%map.bindCmd( keyboard, "o", "objectCenterDropdown->objectBoxBtn.performClick(); objectCenterDropdown.toggle();", "" );// Object Center
%map.bindCmd( keyboard, "p", "objectCenterDropdown->objectBoundsBtn.performClick(); objectCenterDropdown.toggle();", "" );// Bounds Center
%map.bindCmd( keyboard, "k", "objectTransformDropdown->objectTransformBtn.performClick(); objectTransformDropdown.toggle();", "" );// Object Transform
%map.bindCmd( keyboard, "l", "objectTransformDropdown->worldTransformBtn.performClick(); objectTransformDropdown.toggle();", "" );// World Transform
MaterialEditorPlugin.map = %map;
MaterialEditorGui.fileSpec = "Torque Material Files (materials.cs)|materials.cs|All Files (*.*)|*.*|";
MaterialEditorGui.textureFormats = "Image Files (*.png, *.jpg, *.dds, *.bmp, *.gif, *.jng. *.tga)|*.png;*.jpg;*.dds;*.bmp;*.gif;*.jng;*.tga|All Files (*.*)|*.*|";
MaterialEditorGui.modelFormats = "DTS Files (*.dts)|*.dts";
MaterialEditorGui.lastTexturePath = "";
MaterialEditorGui.lastTextureFile = "";
MaterialEditorGui.lastModelPath = "";
MaterialEditorGui.lastModelFile = "";
MaterialEditorGui.currentMaterial = "";
MaterialEditorGui.lastMaterial = "";
MaterialEditorGui.currentCubemap = "";
MaterialEditorGui.currentObject = "";
MaterialEditorGui.livePreview = "1";
MaterialEditorGui.currentLayer = "0";
MaterialEditorGui.currentMode = "Material";
MaterialEditorGui.currentMeshMode = "EditorShape";
new ArrayObject(UnlistedCubemaps);
UnlistedCubemaps.add( "unlistedCubemaps", matEdCubeMapPreviewMat );
UnlistedCubemaps.add( "unlistedCubemaps", WarnMatCubeMap );
//MaterialEditor persistence manager
new PersistenceManager(matEd_PersistMan);
}
function MaterialEditorPlugin::onActivated( %this )
{
if($gfx::wireframe){
$wasInWireFrameMode = true;
$gfx::wireframe = false;
}else{
$wasInWireFrameMode = false;
}
advancedTextureMapsRollout.Expanded = false;
materialAnimationPropertiesRollout.Expanded = false;
materialAdvancedPropertiesRollout.Expanded = false;
WorldEditorPlugin.onActivated();
EditorGui-->MatEdPropertiesWindow.setVisible( true );
EditorGui-->MatEdPreviewWindow.setVisible( true );
EditorGui-->WorldEditorToolbar.setVisible( true );
MaterialEditorGui.currentObject = $Tools::materialEditorList;
// Execute the back end scripts that actually do the work.
MaterialEditorGui.open();
%this.map.push();
Parent::onActivated(%this);
}
function MaterialEditorPlugin::onEditMenuSelect( %this, %editMenu )
{
WorldEditorPlugin.onEditMenuSelect( %editMenu );
}
function MaterialEditorPlugin::onDeactivated( %this )
{
if($wasInWireFrameMode)
$gfx::wireframe = true;
WorldEditorPlugin.onDeactivated();
MaterialEditorGui.quit();
EditorGui-->MatEdPropertiesWindow.setVisible( false );
EditorGui-->MatEdPreviewWindow.setVisible( false );
EditorGui-->WorldEditorToolbar.setVisible( false );
%this.map.pop();
Parent::onDeactivated(%this);
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,477 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
function MaterialEditorGui::createUndo(%this, %class, %desc)
{
pushInstantGroup();
%action = new UndoScriptAction()
{
class = %class;
superClass = BaseMaterialEdAction;
actionName = %desc;
};
popInstantGroup();
return %action;
}
function MaterialEditorGui::submitUndo(%this, %action)
{
if(!%this.preventUndo)
%action.addToManager(Editor.getUndoManager());
}
function BaseMaterialEdAction::redo(%this)
{
%this.redo();
}
function BaseMaterialEdAction::undo(%this)
{
}
// Generic updateActiveMaterial redo/undo
function ActionUpdateActiveMaterial::redo(%this)
{
if( MaterialEditorPreviewWindow.isVisible() && MaterialEditorGui.currentMaterial == %this.material )
{
/*
if( MaterialEditorGui.currentMaterial != %this.material )
{
MaterialEditorGui.currentObject = %this.object;
MaterialEditorGui.setMode();
MaterialEditorGui.setActiveMaterial(%this.material);
}
*/
eval("materialEd_previewMaterial." @ %this.field @ " = " @ %this.newValue @ ";");
materialEd_previewMaterial.flush();
materialEd_previewMaterial.reload();
if (MaterialEditorGui.livePreview == true)
{
eval("%this.material." @ %this.field @ " = " @ %this.newValue @ ";");
MaterialEditorGui.currentMaterial.flush();
MaterialEditorGui.currentMaterial.reload();
}
MaterialEditorGui.preventUndo = true;
MaterialEditorGui.guiSync( materialEd_previewMaterial );
MaterialEditorGui.setMaterialDirty();
MaterialEditorGui.preventUndo = false;
}
else
{
eval("%this.material." @ %this.field @ " = " @ %this.newValue @ ";");
%this.material.flush();
%this.material.reload();
}
}
function ActionUpdateActiveMaterial::undo(%this)
{
MaterialEditorGui.preventUndo = true;
if( MaterialEditorPreviewWindow.isVisible() && MaterialEditorGui.currentMaterial == %this.material )
{
/*
if( MaterialEditorGui.currentMaterial != %this.material )
{
MaterialEditorGui.currentObject = %this.object;
MaterialEditorGui.setMode();
MaterialEditorGui.setActiveMaterial(%this.material);
}
*/
eval("materialEd_previewMaterial." @ %this.field @ " = " @ %this.oldValue @ ";");
materialEd_previewMaterial.flush();
materialEd_previewMaterial.reload();
if (MaterialEditorGui.livePreview == true)
{
eval("%this.material." @ %this.field @ " = " @ %this.oldValue @ ";");
MaterialEditorGui.currentMaterial.flush();
MaterialEditorGui.currentMaterial.reload();
}
MaterialEditorGui.guiSync( materialEd_previewMaterial );
MaterialEditorGui.setMaterialDirty();
}
else
{
eval("%this.material." @ %this.field @ " = " @ %this.oldValue @ ";");
%this.material.flush();
%this.material.reload();
}
MaterialEditorGui.preventUndo = false;
}
// Special case updateActiveMaterial redo/undo
function ActionUpdateActiveMaterialAnimationFlags::redo(%this)
{
if( MaterialEditorPreviewWindow.isVisible() && MaterialEditorGui.currentMaterial == %this.material )
{
/*
if( MaterialEditorGui.currentMaterial != %this.material )
{
MaterialEditorGui.currentObject = %this.object;
MaterialEditorGui.setMode();
MaterialEditorGui.setActiveMaterial(%this.material);
}
*/
eval("materialEd_previewMaterial.animFlags[" @ %this.layer @ "] = " @ %this.newValue @ ";");
materialEd_previewMaterial.flush();
materialEd_previewMaterial.reload();
if (MaterialEditorGui.livePreview == true)
{
eval("%this.material.animFlags[" @ %this.layer @ "] = " @ %this.newValue @ ";");
MaterialEditorGui.currentMaterial.flush();
MaterialEditorGui.currentMaterial.reload();
}
MaterialEditorGui.guiSync( materialEd_previewMaterial );
MaterialEditorGui.setMaterialDirty();
}
else
{
eval("%this.material.animFlags[" @ %this.layer @ "] = " @ %this.newValue @ ";");
%this.material.flush();
%this.material.reload();
}
}
function ActionUpdateActiveMaterialAnimationFlags::undo(%this)
{
if( MaterialEditorPreviewWindow.isVisible() && MaterialEditorGui.currentMaterial == %this.material )
{
eval("materialEd_previewMaterial.animFlags[" @ %this.layer @ "] = " @ %this.oldValue @ ";");
materialEd_previewMaterial.flush();
materialEd_previewMaterial.reload();
if (MaterialEditorGui.livePreview == true)
{
eval("%this.material.animFlags[" @ %this.layer @ "] = " @ %this.oldValue @ ";");
MaterialEditorGui.currentMaterial.flush();
MaterialEditorGui.currentMaterial.reload();
}
MaterialEditorGui.guiSync( materialEd_previewMaterial );
MaterialEditorGui.setMaterialDirty();
}
else
{
eval("%this.material.animFlags[" @ %this.layer @ "] = " @ %this.oldValue @ ";");
%this.material.flush();
%this.material.reload();
}
}
function ActionUpdateActiveMaterialName::redo(%this)
{
%this.material.setName(%this.newName);
MaterialEditorGui.updateMaterialReferences( MissionGroup, %this.oldName, %this.newName );
if( MaterialEditorPreviewWindow.isVisible() && MaterialEditorGui.currentMaterial == %this.material )
{
MaterialEditorGui.guiSync( materialEd_previewMaterial );
MaterialEditorGui.setMaterialDirty();
}
}
function ActionUpdateActiveMaterialName::undo(%this)
{
%this.material.setName(%this.oldName);
MaterialEditorGui.updateMaterialReferences( MissionGroup, %this.newName, %this.oldName );
if( MaterialEditorPreviewWindow.isVisible() && MaterialEditorGui.currentMaterial == %this.material )
{
MaterialEditorGui.guiSync( materialEd_previewMaterial );
MaterialEditorGui.setMaterialDirty();
}
}
function ActionRefreshMaterial::redo(%this)
{
if( MaterialEditorPreviewWindow.isVisible() && MaterialEditorGui.currentMaterial == %this.material )
{
%this.material.setName( %this.newName );
MaterialEditorGui.copyMaterials( %this.newMaterial, materialEd_previewMaterial );
materialEd_previewMaterial.flush();
materialEd_previewMaterial.reload();
if (MaterialEditorGui.livePreview == true)
{
MaterialEditorGui.copyMaterials( %this.newMaterial , %this.material );
%this.material.flush();
%this.material.reload();
}
MaterialEditorGui.guiSync( materialEd_previewMaterial );
MaterialEditorGui.setMaterialNotDirty();
}
else
{
MaterialEditorGui.copyMaterials( %this.newMaterial, %this.material );
%this.material.flush();
%this.material.reload();
}
}
function ActionRefreshMaterial::undo(%this)
{
if( MaterialEditorPreviewWindow.isVisible() && MaterialEditorGui.currentMaterial == %this.material )
{
%this.material.setName( %this.oldName );
MaterialEditorGui.copyMaterials( %this.oldMaterial, materialEd_previewMaterial );
materialEd_previewMaterial.flush();
materialEd_previewMaterial.reload();
if (MaterialEditorGui.livePreview == true)
{
MaterialEditorGui.copyMaterials( %this.oldMaterial, %this.material );
%this.material.flush();
%this.material.reload();
}
MaterialEditorGui.guiSync( materialEd_previewMaterial );
MaterialEditorGui.setMaterialDirty();
}
else
{
MaterialEditorGui.copyMaterials( %this.oldMaterial, %this.material );
%this.material.flush();
%this.material.reload();
}
}
function ActionClearMaterial::redo(%this)
{
if( MaterialEditorPreviewWindow.isVisible() && MaterialEditorGui.currentMaterial == %this.material )
{
MaterialEditorGui.copyMaterials( %this.newMaterial, materialEd_previewMaterial );
materialEd_previewMaterial.flush();
materialEd_previewMaterial.reload();
if (MaterialEditorGui.livePreview == true)
{
MaterialEditorGui.copyMaterials( %this.newMaterial, %this.material );
%this.material.flush();
%this.material.reload();
}
MaterialEditorGui.guiSync( materialEd_previewMaterial );
MaterialEditorGui.setMaterialDirty();
}
else
{
MaterialEditorGui.copyMaterials( %this.newMaterial, %this.material );
%this.material.flush();
%this.material.reload();
}
}
function ActionClearMaterial::undo(%this)
{
if( MaterialEditorPreviewWindow.isVisible() && MaterialEditorGui.currentMaterial == %this.material )
{
MaterialEditorGui.copyMaterials( %this.oldMaterial, materialEd_previewMaterial );
materialEd_previewMaterial.flush();
materialEd_previewMaterial.reload();
if (MaterialEditorGui.livePreview == true)
{
MaterialEditorGui.copyMaterials( %this.oldMaterial, %this.material );
%this.material.flush();
%this.material.reload();
}
MaterialEditorGui.guiSync( materialEd_previewMaterial );
MaterialEditorGui.setMaterialDirty();
}
else
{
MaterialEditorGui.copyMaterials( %this.oldMaterial, %this.material );
%this.material.flush();
%this.material.reload();
}
}
function ActionChangeMaterial::redo(%this)
{
if( %this.mode $= "model" )
{
%this.object.changeMaterial( %this.materialTarget, %this.fromMaterial.getName(), %this.toMaterial.getName() );
MaterialEditorGui.currentObject = %this.object;
if( %this.toMaterial.getFilename() !$= "tools/gui/materialSelector.ed.gui" ||
%this.toMaterial.getFilename() !$= "tools/materialEditor/scripts/materialEditor.ed.cs")
{
matEd_PersistMan.removeObjectFromFile(%this.toMaterial);
}
matEd_PersistMan.setDirty(%this.fromMaterial);
matEd_PersistMan.setDirty(%this.toMaterial, %this.toMaterialNewFname);
matEd_PersistMan.saveDirty();
matEd_PersistMan.removeDirty(%this.fromMaterial);
matEd_PersistMan.removeDirty(%this.toMaterial);
}
else
{
eval("%this.object." @ %this.materialTarget @ " = " @ %this.toMaterial.getName() @ ";");
MaterialEditorGui.currentObject.postApply();
}
if( MaterialEditorPreviewWindow.isVisible() )
MaterialEditorGui.setActiveMaterial( %this.toMaterial );
}
function ActionChangeMaterial::undo(%this)
{
if( %this.mode $= "model" )
{
%this.object.changeMaterial( %this.materialTarget, %this.toMaterial.getName(), %this.fromMaterial.getName() );
MaterialEditorGui.currentObject = %this.object;
if( %this.toMaterial.getFilename() !$= "tools/gui/materialSelector.ed.gui" ||
%this.toMaterial.getFilename() !$= "tools/materialEditor/scripts/materialEditor.ed.cs")
{
matEd_PersistMan.removeObjectFromFile(%this.toMaterial);
}
matEd_PersistMan.setDirty(%this.fromMaterial);
matEd_PersistMan.setDirty(%this.toMaterial, %this.toMaterialOldFname);
matEd_PersistMan.saveDirty();
matEd_PersistMan.removeDirty(%this.fromMaterial);
matEd_PersistMan.removeDirty(%this.toMaterial);
}
else
{
eval("%this.object." @ %this.materialTarget @ " = " @ %this.fromMaterial.getName() @ ";");
MaterialEditorGui.currentObject.postApply();
}
if( MaterialEditorPreviewWindow.isVisible() )
MaterialEditorGui.setActiveMaterial( %this.fromMaterial );
}
function ActionCreateNewMaterial::redo(%this)
{
if( MaterialEditorPreviewWindow.isVisible() )
{
if( MaterialEditorGui.currentMaterial != %this.newMaterial )
{
MaterialEditorGui.currentObject = "";
MaterialEditorGui.setMode();
MaterialEditorGui.setActiveMaterial(%this.newMaterial);
}
MaterialEditorGui.copyMaterials( %this.newMaterial, materialEd_previewMaterial );
materialEd_previewMaterial.flush();
materialEd_previewMaterial.reload();
MaterialEditorGui.guiSync( materialEd_previewMaterial );
}
%idx = UnlistedMaterials.getIndexFromValue( %this.newMaterial.getName() );
UnlistedMaterials.erase( %idx );
}
function ActionCreateNewMaterial::undo(%this)
{
if( MaterialEditorPreviewWindow.isVisible() )
{
if( MaterialEditorGui.currentMaterial != %this.oldMaterial )
{
MaterialEditorGui.currentObject = "";
MaterialEditorGui.setMode();
MaterialEditorGui.setActiveMaterial(%this.oldMaterial);
}
MaterialEditorGui.copyMaterials( %this.oldMaterial, materialEd_previewMaterial );
materialEd_previewMaterial.flush();
materialEd_previewMaterial.reload();
MaterialEditorGui.guiSync( materialEd_previewMaterial );
}
UnlistedMaterials.add( "unlistedMaterials", %this.newMaterial.getName() );
}
function ActionDeleteMaterial::redo(%this)
{
if( MaterialEditorPreviewWindow.isVisible() )
{
if( MaterialEditorGui.currentMaterial != %this.newMaterial )
{
MaterialEditorGui.currentObject = "";
MaterialEditorGui.setMode();
MaterialEditorGui.setActiveMaterial(%this.newMaterial);
}
MaterialEditorGui.copyMaterials( %this.newMaterial, materialEd_previewMaterial );
materialEd_previewMaterial.flush();
materialEd_previewMaterial.reload();
MaterialEditorGui.guiSync( materialEd_previewMaterial );
}
if( %this.oldMaterial.getFilename() !$= "tools/gui/materialSelector.ed.gui" ||
%this.oldMaterial.getFilename() !$= "tools/materialEditor/scripts/materialEditor.ed.cs")
{
matEd_PersistMan.removeObjectFromFile(%this.oldMaterial);
}
UnlistedMaterials.add( "unlistedMaterials", %this.oldMaterial.getName() );
}
function ActionDeleteMaterial::undo(%this)
{
if( MaterialEditorPreviewWindow.isVisible() )
{
if( MaterialEditorGui.currentMaterial != %this.oldMaterial )
{
MaterialEditorGui.currentObject = "";
MaterialEditorGui.setMode();
MaterialEditorGui.setActiveMaterial(%this.oldMaterial);
}
MaterialEditorGui.copyMaterials( %this.oldMaterial, materialEd_previewMaterial );
materialEd_previewMaterial.flush();
materialEd_previewMaterial.reload();
MaterialEditorGui.guiSync( materialEd_previewMaterial );
}
matEd_PersistMan.setDirty(%this.oldMaterial, %this.oldMaterialFname);
matEd_PersistMan.saveDirty();
matEd_PersistMan.removeDirty(%this.oldMaterial);
%idx = UnlistedMaterials.getIndexFromValue( %this.oldMaterial.getName() );
UnlistedMaterials.erase( %idx );
}