瀏覽代碼

Removed unneeded duplicate of blank sky skybox
Fixed various inspector field editor button icons
Fixed drag-n-drop apply logic for material assets
Fixed up some convex shape editor material references
Fixed tools overlay gui profile opaqueness flag
Fixed uvEditor image asset binding/lookups
Fixed decal editor preview display
Fixed shape editor would you like to save your changes prompt
Added additional sanity check for bad material reference in tsMesh
Fixed saving of terrain asset when working in editor default level

Areloch 4 年之前
父節點
當前提交
c76c5f7ee1
共有 31 個文件被更改,包括 109 次插入121 次删除
  1. 2 2
      Engine/source/T3D/assets/GUIAsset.cpp
  2. 1 1
      Engine/source/T3D/assets/ImageAsset.cpp
  3. 2 2
      Engine/source/T3D/assets/MaterialAsset.cpp
  4. 1 1
      Engine/source/T3D/assets/ShapeAsset.cpp
  5. 1 1
      Engine/source/T3D/assets/TerrainAsset.cpp
  6. 2 2
      Engine/source/T3D/assets/TerrainMaterialAsset.cpp
  7. 1 1
      Engine/source/cinterface/c_simobjectInterface.cpp
  8. 9 9
      Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp
  9. 1 1
      Engine/source/ts/tsMesh.cpp
  10. 9 3
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.tscript
  11. 0 15
      Templates/BaseGame/game/tools/base/images/materials.tscript
  12. 二進制
      Templates/BaseGame/game/tools/base/images/skybox_1.jpg
  13. 0 8
      Templates/BaseGame/game/tools/base/images/skybox_1_image.asset.taml
  14. 二進制
      Templates/BaseGame/game/tools/base/images/skybox_2.jpg
  15. 0 8
      Templates/BaseGame/game/tools/base/images/skybox_2_image.asset.taml
  16. 二進制
      Templates/BaseGame/game/tools/base/images/skybox_3.jpg
  17. 0 8
      Templates/BaseGame/game/tools/base/images/skybox_3_image.asset.taml
  18. 二進制
      Templates/BaseGame/game/tools/base/images/skybox_4.jpg
  19. 0 8
      Templates/BaseGame/game/tools/base/images/skybox_4_image.asset.taml
  20. 二進制
      Templates/BaseGame/game/tools/base/images/skybox_5.jpg
  21. 0 8
      Templates/BaseGame/game/tools/base/images/skybox_5_image.asset.taml
  22. 二進制
      Templates/BaseGame/game/tools/base/images/skybox_6.jpg
  23. 0 8
      Templates/BaseGame/game/tools/base/images/skybox_6_image.asset.taml
  24. 2 2
      Templates/BaseGame/game/tools/convexEditor/main.tscript
  25. 40 7
      Templates/BaseGame/game/tools/decalEditor/decalEditorGui.tscript
  26. 1 1
      Templates/BaseGame/game/tools/gui/profiles.ed.tscript
  27. 4 22
      Templates/BaseGame/game/tools/gui/uvEditor.ed.gui
  28. 1 1
      Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui
  29. 8 0
      Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript
  30. 3 2
      Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.tscript
  31. 21 0
      Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.tscript

+ 2 - 2
Engine/source/T3D/assets/GUIAsset.cpp

@@ -261,13 +261,13 @@ GuiControl* GuiInspectorTypeGUIAssetPtr::constructEditControl()
    dSprintf(szBuffer, sizeof(szBuffer), "echo(\"Game Object Editor not implemented yet!\");", retCtrl->getId());
    dSprintf(szBuffer, sizeof(szBuffer), "echo(\"Game Object Editor not implemented yet!\");", retCtrl->getId());
    mSMEdButton->setField("Command", szBuffer);
    mSMEdButton->setField("Command", szBuffer);
 
 
-   char bitmapName[512] = "tools/worldEditor/images/toolbar/shape-editor";
+   char bitmapName[512] = "ToolsModule:GameTSCtrl_image";
    mSMEdButton->setBitmap(StringTable->insert(bitmapName));
    mSMEdButton->setBitmap(StringTable->insert(bitmapName));
 
 
    mSMEdButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
    mSMEdButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
    mSMEdButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile");
    mSMEdButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile");
    mSMEdButton->setDataField(StringTable->insert("hovertime"), NULL, "1000");
    mSMEdButton->setDataField(StringTable->insert("hovertime"), NULL, "1000");
-   mSMEdButton->setDataField(StringTable->insert("tooltip"), NULL, "Open this file in the State Machine Editor");
+   mSMEdButton->setDataField(StringTable->insert("tooltip"), NULL, "Open this file in the GUI Editor");
 
 
    mSMEdButton->registerObject();
    mSMEdButton->registerObject();
    addObject(mSMEdButton);
    addObject(mSMEdButton);

+ 1 - 1
Engine/source/T3D/assets/ImageAsset.cpp

@@ -508,7 +508,7 @@ GuiControl* GuiInspectorTypeImageAssetPtr::constructEditControl()
    dSprintf(szBuffer, sizeof(szBuffer), "ShapeEditorPlugin.openShapeAssetId(%d.getText());", retCtrl->getId());
    dSprintf(szBuffer, sizeof(szBuffer), "ShapeEditorPlugin.openShapeAssetId(%d.getText());", retCtrl->getId());
    mImageEdButton->setField("Command", szBuffer);
    mImageEdButton->setField("Command", szBuffer);
 
 
-   char bitmapName[512] = "tools/worldEditor/images/toolbar/shape-editor";
+   char bitmapName[512] = "ToolsModule:GameTSCtrl_image";
    mImageEdButton->setBitmap(StringTable->insert(bitmapName));
    mImageEdButton->setBitmap(StringTable->insert(bitmapName));
 
 
    mImageEdButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
    mImageEdButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");

+ 2 - 2
Engine/source/T3D/assets/MaterialAsset.cpp

@@ -388,13 +388,13 @@ GuiControl* GuiInspectorTypeMaterialAssetPtr::constructEditControl()
    dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.editAsset(%d.getText());", retCtrl->getId());
    dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.editAsset(%d.getText());", retCtrl->getId());
    mEditButton->setField("Command", szBuffer);
    mEditButton->setField("Command", szBuffer);
 
 
-   char bitmapName[512] = "tools/worldEditor/images/toolbar/material-editor";
+   char bitmapName[512] = "ToolsModule:material_editor_n_image";
    mEditButton->setBitmap(StringTable->insert(bitmapName));
    mEditButton->setBitmap(StringTable->insert(bitmapName));
 
 
    mEditButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
    mEditButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
    mEditButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile");
    mEditButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile");
    mEditButton->setDataField(StringTable->insert("hovertime"), NULL, "1000");
    mEditButton->setDataField(StringTable->insert("hovertime"), NULL, "1000");
-   mEditButton->setDataField(StringTable->insert("tooltip"), NULL, "Open this file in the Material Editor");
+   mEditButton->setDataField(StringTable->insert("tooltip"), NULL, "Open this asset in the Material Editor");
 
 
    mEditButton->registerObject();
    mEditButton->registerObject();
    addObject(mEditButton);
    addObject(mEditButton);

+ 1 - 1
Engine/source/T3D/assets/ShapeAsset.cpp

@@ -612,7 +612,7 @@ GuiControl* GuiInspectorTypeShapeAssetPtr::constructEditControl()
    dSprintf(szBuffer, sizeof(szBuffer), "ShapeEditorPlugin.openShapeAssetId(%d.getText());", retCtrl->getId());
    dSprintf(szBuffer, sizeof(szBuffer), "ShapeEditorPlugin.openShapeAssetId(%d.getText());", retCtrl->getId());
    mShapeEdButton->setField("Command", szBuffer);
    mShapeEdButton->setField("Command", szBuffer);
 
 
-   char bitmapName[512] = "tools/worldEditor/images/toolbar/shape-editor";
+   char bitmapName[512] = "ToolsModule:shape_editor_n_image";
    mShapeEdButton->setBitmap(StringTable->insert(bitmapName));
    mShapeEdButton->setBitmap(StringTable->insert(bitmapName));
 
 
    mShapeEdButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
    mShapeEdButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");

+ 1 - 1
Engine/source/T3D/assets/TerrainAsset.cpp

@@ -467,7 +467,7 @@ GuiControl* GuiInspectorTypeTerrainAssetPtr::constructEditControl()
 
 
    mShapeEdButton->setField("Command", "EditorGui.setEditor(TerrainEditorPlugin);");
    mShapeEdButton->setField("Command", "EditorGui.setEditor(TerrainEditorPlugin);");
 
 
-   char bitmapName[512] = "tools/worldEditor/images/toolbar/shape-editor";
+   char bitmapName[512] = "ToolsModule:TerrainBlock_image";
    mShapeEdButton->setBitmap(StringTable->insert(bitmapName));
    mShapeEdButton->setBitmap(StringTable->insert(bitmapName));
 
 
    mShapeEdButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
    mShapeEdButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");

+ 2 - 2
Engine/source/T3D/assets/TerrainMaterialAsset.cpp

@@ -244,7 +244,7 @@ GuiControl* GuiInspectorTypeTerrainMaterialAssetPtr::constructEditControl()
 
 
    TerrainMaterial* materialDef = nullptr;
    TerrainMaterial* materialDef = nullptr;
 
 
-   char bitmapName[512] = "tools/worldEditor/images/toolbar/shape-editor";
+   char bitmapName[512] = "ToolsModule:material_editor_n_image";
 
 
    /*if (!Sim::findObject(matAsset->getMaterialDefinitionName(), materialDef))
    /*if (!Sim::findObject(matAsset->getMaterialDefinitionName(), materialDef))
    {
    {
@@ -271,7 +271,7 @@ GuiControl* GuiInspectorTypeTerrainMaterialAssetPtr::constructEditControl()
    StringBuilder strbld;
    StringBuilder strbld;
    strbld.append(matAsset->getMaterialDefinitionName());
    strbld.append(matAsset->getMaterialDefinitionName());
    strbld.append("\n");
    strbld.append("\n");
-   strbld.append("Open this file in the Material Editor");
+   strbld.append("Open this asset in the Material Editor");
 
 
    mMatPreviewButton->setDataField(StringTable->insert("tooltip"), NULL, strbld.data());
    mMatPreviewButton->setDataField(StringTable->insert("tooltip"), NULL, strbld.data());
 
 

+ 1 - 1
Engine/source/cinterface/c_simobjectInterface.cpp

@@ -53,7 +53,7 @@ DefineNewEngineMethod(SimObject, InspectPreApply, void, (), , "")
    object->inspectPreApply();
    object->inspectPreApply();
 }
 }
 
 
-DefineNewEngineMethod(SimObject, InspectPostApply, void, (), , "")
+DefineEngineMethod(SimObject, InspectPostApply, void, (), , "")
 {
 {
    object->inspectPostApply();
    object->inspectPostApply();
 }
 }

+ 9 - 9
Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp

@@ -84,7 +84,7 @@ GuiConvexEditorCtrl::GuiConvexEditorCtrl()
    mCtrlDown( false ),
    mCtrlDown( false ),
    mGridSnap(false)
    mGridSnap(false)
 {   
 {   
-	mMaterialName = StringTable->insert("Grid512_OrangeLines_Mat");
+	mMaterialName = StringTable->insert("Prototyping:WallOrange");
 }
 }
 
 
 GuiConvexEditorCtrl::~GuiConvexEditorCtrl()
 GuiConvexEditorCtrl::~GuiConvexEditorCtrl()
@@ -115,7 +115,7 @@ void GuiConvexEditorCtrl::onRemove()
 void GuiConvexEditorCtrl::initPersistFields()
 void GuiConvexEditorCtrl::initPersistFields()
 {   
 {   
    addField( "isDirty", TypeBool, Offset( mIsDirty, GuiConvexEditorCtrl ) );
    addField( "isDirty", TypeBool, Offset( mIsDirty, GuiConvexEditorCtrl ) );
-	addField( "materialName", TypeString, Offset(mMaterialName, GuiConvexEditorCtrl) );
+	addField( "materialName", TypeMaterialAssetId, Offset(mMaterialName, GuiConvexEditorCtrl) );
 
 
    Parent::initPersistFields();
    Parent::initPersistFields();
 }
 }
@@ -249,13 +249,13 @@ void GuiConvexEditorCtrl::setVisible( bool val )
 
 
                   //Set the texture to a representatory one so we know what's what
                   //Set the texture to a representatory one so we know what's what
                   if (isTrigger)
                   if (isTrigger)
-                     proxyShape->mMaterialName = "TriggerProxyMaterial";
+                     proxyShape->mMaterialName = "ToolsModule:TriggerProxyMaterial";
                   else if (isPortal)
                   else if (isPortal)
-                     proxyShape->mMaterialName = "PortalProxyMaterial";
+                     proxyShape->mMaterialName = "ToolsModule:PortalProxyMaterial";
                   else if (isZone)
                   else if (isZone)
-                     proxyShape->mMaterialName = "ZoneProxyMaterial";
+                     proxyShape->mMaterialName = "ToolsModule:ZoneProxyMaterial";
                   else if (isOccluder)
                   else if (isOccluder)
-                     proxyShape->mMaterialName = "OccluderProxyMaterial";
+                     proxyShape->mMaterialName = "ToolsModule:OccluderProxyMaterial";
 
 
                   proxyShape->_updateMaterial();
                   proxyShape->_updateMaterial();
 
 
@@ -1459,7 +1459,7 @@ bool GuiConvexEditorCtrl::isShapeValid( ConvexShape *shape )
 
 
 void GuiConvexEditorCtrl::setupShape( ConvexShape *shape )
 void GuiConvexEditorCtrl::setupShape( ConvexShape *shape )
 {
 {
-   shape->setField( "material", mMaterialName );
+   shape->setField( "materialAsset", mMaterialName );
    shape->registerObject();
    shape->registerObject();
    updateShape( shape );
    updateShape( shape );
 
 
@@ -2284,7 +2284,7 @@ ConvexEditorTool::EventResult ConvexEditorCreateTool::on3DMouseDown( const Gui3D
 
 
       mNewConvex->setTransform( objMat );   
       mNewConvex->setTransform( objMat );   
 		
 		
-		mNewConvex->setField( "material", Parent::mEditor->mMaterialName );
+		mNewConvex->setField( "materialAsset", Parent::mEditor->mMaterialName );
 		
 		
       mNewConvex->registerObject();
       mNewConvex->registerObject();
       mPlaneSizes.set( 0.1f, 0.1f, 0.1f );
       mPlaneSizes.set( 0.1f, 0.1f, 0.1f );
@@ -2509,7 +2509,7 @@ ConvexShape* ConvexEditorCreateTool::extrudeShapeFromFace( ConvexShape *inShape,
    }
    }
 
 
 	//newShape->setField( "material", Parent::mEditor->mMaterialName );
 	//newShape->setField( "material", Parent::mEditor->mMaterialName );
-   newShape->setField("material", inShape->getMaterialName());
+   newShape->setField("materialAsset", inShape->getMaterialName());
 
 
    newShape->registerObject();
    newShape->registerObject();
    mEditor->updateShape( newShape );
    mEditor->updateShape( newShape );

+ 1 - 1
Engine/source/ts/tsMesh.cpp

@@ -264,7 +264,7 @@ void TSMesh::innerRender( TSMaterialList *materials, const TSRenderState &rdata,
       // If we don't have a material instance after the overload then
       // If we don't have a material instance after the overload then
       // there is nothing to render... skip this primitive.
       // there is nothing to render... skip this primitive.
       matInst = state->getOverrideMaterial( matInst );
       matInst = state->getOverrideMaterial( matInst );
-      if ( !matInst || !matInst->isValid())
+      if ( !matInst || !matInst->isValid() || !matInst->getMaterial())
          continue;
          continue;
 
 
       // If the material needs lights then gather them
       // If the material needs lights then gather them

+ 9 - 3
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.tscript

@@ -492,6 +492,12 @@ function AssetBrowser::onMaterialAssetEditorDropped(%this, %assetDef, %position)
          %obj.materialSlot0 = %assetDef.getAssetId();
          %obj.materialSlot0 = %assetDef.getAssetId();
          echo("MaterialSlot0 set to " @ %assetDef.getAssetId());
          echo("MaterialSlot0 set to " @ %assetDef.getAssetId());
       }
       }
+      else if(%obj.isField("materialAsset"))
+      {
+         %obj.materialAsset = %assetDef.getAssetId();
+         echo("materialAsset set to " @ %assetDef.getAssetId());
+      }
+      %obj.inspectPostApply();
    }
    }
 
 
    EWorldEditor.isDirty = true;
    EWorldEditor.isDirty = true;
@@ -512,9 +518,9 @@ function GuiInspectorTypeMaterialAssetPtr::onControlDropped( %this, %payload, %p
    
    
    if(%assetType $= "MaterialAsset")
    if(%assetType $= "MaterialAsset")
    {
    {
-      //%assetDef = AssetDatabase.acquireAsset(%module @ ":" @ %assetName);
-      
-      %this.setMaterialAsset(%module @ ":" @ %assetName);
+      %cmd = %this @ ".apply(\""@ %module @ ":" @ %assetName @ "\");";
+      echo("Changing asset via the " @ %cmd @ " command");
+      eval(%cmd);
    }
    }
    
    
    EWorldEditor.isDirty = true;
    EWorldEditor.isDirty = true;

+ 0 - 15
Templates/BaseGame/game/tools/base/images/materials.tscript

@@ -3,21 +3,6 @@
 // Copyright GarageGames, LLC 2011
 // Copyright GarageGames, LLC 2011
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-singleton CubemapData( BlankSkyCubemap )
-{
-   cubeFace[0] = "./skybox_1";
-   cubeFace[1] = "./skybox_2";
-   cubeFace[2] = "./skybox_3";
-   cubeFace[3] = "./skybox_4";
-   cubeFace[4] = "./skybox_5";
-   cubeFace[5] = "./skybox_6";
-};
-
-singleton Material( BlankSkyMat )
-{
-   cubemap = BlankSkyCubemap;
-};
-
 singleton Material(White)
 singleton Material(White)
 {
 {
    diffuseMapAsset[0] = "ToolsModule:white_image";
    diffuseMapAsset[0] = "ToolsModule:white_image";

二進制
Templates/BaseGame/game/tools/base/images/skybox_1.jpg


+ 0 - 8
Templates/BaseGame/game/tools/base/images/skybox_1_image.asset.taml

@@ -1,8 +0,0 @@
-<ImageAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="skybox_1_image"
-    imageFile="@assetFile=skybox_1.jpg"
-    UseMips="true"
-    isHDRImage="false"
-    imageType="Albedo" />

二進制
Templates/BaseGame/game/tools/base/images/skybox_2.jpg


+ 0 - 8
Templates/BaseGame/game/tools/base/images/skybox_2_image.asset.taml

@@ -1,8 +0,0 @@
-<ImageAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="skybox_2_image"
-    imageFile="@assetFile=skybox_2.jpg"
-    UseMips="true"
-    isHDRImage="false"
-    imageType="Albedo" />

二進制
Templates/BaseGame/game/tools/base/images/skybox_3.jpg


+ 0 - 8
Templates/BaseGame/game/tools/base/images/skybox_3_image.asset.taml

@@ -1,8 +0,0 @@
-<ImageAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="skybox_3_image"
-    imageFile="@assetFile=skybox_3.jpg"
-    UseMips="true"
-    isHDRImage="false"
-    imageType="Albedo" />

二進制
Templates/BaseGame/game/tools/base/images/skybox_4.jpg


+ 0 - 8
Templates/BaseGame/game/tools/base/images/skybox_4_image.asset.taml

@@ -1,8 +0,0 @@
-<ImageAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="skybox_4_image"
-    imageFile="@assetFile=skybox_4.jpg"
-    UseMips="true"
-    isHDRImage="false"
-    imageType="Albedo" />

二進制
Templates/BaseGame/game/tools/base/images/skybox_5.jpg


+ 0 - 8
Templates/BaseGame/game/tools/base/images/skybox_5_image.asset.taml

@@ -1,8 +0,0 @@
-<ImageAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="skybox_5_image"
-    imageFile="@assetFile=skybox_5.jpg"
-    UseMips="true"
-    isHDRImage="false"
-    imageType="Albedo" />

二進制
Templates/BaseGame/game/tools/base/images/skybox_6.jpg


+ 0 - 8
Templates/BaseGame/game/tools/base/images/skybox_6_image.asset.taml

@@ -1,8 +0,0 @@
-<ImageAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="skybox_6_image"
-    imageFile="@assetFile=skybox_6.jpg"
-    UseMips="true"
-    isHDRImage="false"
-    imageType="Albedo" />

+ 2 - 2
Templates/BaseGame/game/tools/convexEditor/main.tscript

@@ -209,14 +209,14 @@ function ConvexEditorPlugin::onSaveMission( %this, %missionFile )
 function ConvexEditorPlugin::initSettings( %this )
 function ConvexEditorPlugin::initSettings( %this )
 {
 {
    EditorSettings.beginGroup( "ConvexEditor", true );
    EditorSettings.beginGroup( "ConvexEditor", true );
-   EditorSettings.setDefaultValue(  "MaterialName",         "Grid_512_Orange" );
+   EditorSettings.setDefaultValue(  "MaterialName",         "Prototyping:WallOrange" );
    EditorSettings.endGroup();
    EditorSettings.endGroup();
 }
 }
 
 
 function ESettingsWindow::getConvexEditorSettings(%this)
 function ESettingsWindow::getConvexEditorSettings(%this)
 {
 {
    SettingsInspector.startGroup("General");
    SettingsInspector.startGroup("General");
-   SettingsInspector.addSettingsField("ConvexEditor/MaterialName", "Default Material Name", "string", "");
+   SettingsInspector.addSettingsField("ConvexEditor/MaterialName", "Default Material Asset Name", "TypeMaterialAssetId", "");
    SettingsInspector.endGroup();
    SettingsInspector.endGroup();
 }
 }
 
 

+ 40 - 7
Templates/BaseGame/game/tools/decalEditor/decalEditorGui.tscript

@@ -100,7 +100,7 @@ function DecalEditorGui::syncNodeDetails( %this )
       return;
       return;
    
    
    %lookupName = DecalEditorGui.getDecalLookupName( %decalId );
    %lookupName = DecalEditorGui.getDecalLookupName( %decalId );
-   DecalEditorGui.updateInstancePreview( %lookupName.material );   
+   DecalEditorGui.updateInstancePreview( %lookupName.materialAsset );   
    
    
    DecalEditorDetailContainer-->instanceId.setText(%decalId @ " " @ %lookupName);
    DecalEditorDetailContainer-->instanceId.setText(%decalId @ " " @ %lookupName);
    %transformData = DecalEditorGui.getDecalTransform(%decalId);
    %transformData = DecalEditorGui.getDecalTransform(%decalId);
@@ -131,7 +131,7 @@ function DecalDataList::onSelect( %this, %id, %text )
    
    
    //Canvas.pushDialog( DecalEditDlg );
    //Canvas.pushDialog( DecalEditDlg );
    DecalInspector.inspect( %data );
    DecalInspector.inspect( %data );
-   DecalEditorGui.updateDecalPreview( %data.material );
+   DecalEditorGui.updateDecalPreview( %data.materialAsset );
 }
 }
 
 
 function RetargetDecalButton::onClick( %this )
 function RetargetDecalButton::onClick( %this )
@@ -295,7 +295,7 @@ function DecalEditorTreeView::addNodeTree(%this, %nodeName, %parentName)
 
 
 function DecalInspector::onInspectorFieldModified( %this, %object, %fieldName, %arrayIndex, %oldValue, %newValue )
 function DecalInspector::onInspectorFieldModified( %this, %object, %fieldName, %arrayIndex, %oldValue, %newValue )
 {
 {
-   if( %fieldName $= "Material" )
+   if( %fieldName $= "Material" || %fieldName $= "MaterialAsset")
       DecalEditorGui.updateDecalPreview( %newValue );
       DecalEditorGui.updateDecalPreview( %newValue );
       
       
    // Same work to do as for the regular WorldEditor Inspector.
    // Same work to do as for the regular WorldEditor Inspector.
@@ -322,17 +322,50 @@ function DecalInspector::removeDirty()
 function DecalEditorGui::updateDecalPreview( %this, %material )
 function DecalEditorGui::updateDecalPreview( %this, %material )
 {
 {
    if( isObject( %material ) )
    if( isObject( %material ) )
-      DecalPreviewWindow-->decalPreview.setBitmap( MaterialEditorGui.searchForTexture( %material.getId(), %material.diffuseMap[0]) );
+   {
+      DecalPreviewWindow-->decalPreview.setBitmap( %material.getDiffuseMap(0) );
+   }
    else
    else
-      DecalPreviewWindow-->decalPreview.setBitmap("tools/materialEditor/gui/unknownImage");
+   {
+      if(AssetDatabase.isDeclaredAsset(%material))
+      {
+         %assetDef = AssetDatabase.acquireAsset(%material);
+         %difMap = %assetDef.materialDefinitionName.getDiffuseMap(0);
+         AssetDatabase.acquireAsset(%material);
+         
+         if(%difMap !$= "" && %difMap !$= "Core_Rendering:missingTexture")
+         {
+            DecalPreviewWindow-->decalPreview.setBitmap( %difMap );
+            return;
+         }
+      }
+      DecalPreviewWindow-->decalPreview.setBitmap("ToolsModule:unknownImage_image");
+   }
 }
 }
 
 
 function DecalEditorGui::updateInstancePreview( %this, %material )
 function DecalEditorGui::updateInstancePreview( %this, %material )
 {
 {
    if( isObject( %material ) )
    if( isObject( %material ) )
-      DecalPreviewWindow-->instancePreview.setBitmap( MaterialEditorGui.searchForTexture( %material.getId(), %material.diffuseMap[0]) );      
+   {
+      DecalPreviewWindow-->instancePreview.setBitmap( %material.getDiffuseMap(0) );      
+   }
    else
    else
-      DecalPreviewWindow-->instancePreview.setBitmap("tools/materialEditor/gui/unknownImage");   
+   {
+      if(AssetDatabase.isDeclaredAsset(%material))
+      {
+         %assetDef = AssetDatabase.acquireAsset(%material);
+         %difMap = %assetDef.materialDefinitionName.getDiffuseMap(0);
+         AssetDatabase.acquireAsset(%material);
+         
+         if(%difMap !$= "" && %difMap !$= "Core_Rendering:missingTexture")
+         {
+            DecalPreviewWindow-->instancePreview.setBitmap( %difMap );
+            return;
+         }
+      }
+      
+      DecalPreviewWindow-->instancePreview.setBitmap("ToolsModule:unknownImage_image");   
+}
 }
 }
 
 
 function DecalEditorGui::rebuildInstanceTree( %this )
 function DecalEditorGui::rebuildInstanceTree( %this )

+ 1 - 1
Templates/BaseGame/game/tools/gui/profiles.ed.tscript

@@ -479,7 +479,7 @@ new GuiControlProfile( ToolsGuiScrollProfile )
 if( !isObject( ToolsGuiOverlayProfile ) )
 if( !isObject( ToolsGuiOverlayProfile ) )
 new GuiControlProfile( ToolsGuiOverlayProfile )
 new GuiControlProfile( ToolsGuiOverlayProfile )
 {
 {
-   opaque = true;
+   opaque = false;
    fillColor = EditorSettings.value("Theme/windowBackgroundColor");
    fillColor = EditorSettings.value("Theme/windowBackgroundColor");
    fontColor = EditorSettings.value("Theme/fieldTextColor");
    fontColor = EditorSettings.value("Theme/fieldTextColor");
    fontColorHL = EditorSettings.value("Theme/fieldTextGLColor");
    fontColorHL = EditorSettings.value("Theme/fieldTextGLColor");

+ 4 - 22
Templates/BaseGame/game/tools/gui/uvEditor.ed.gui

@@ -499,37 +499,19 @@ function UVEditor::showDialog( %this, %applyCallback, %obj, %uv)
    
    
    // Get the preview bitmap.  Code copied from Material Selector.
    // Get the preview bitmap.  Code copied from Material Selector.
    %material = %obj.material;
    %material = %obj.material;
-   if( %material.toneMap[0] $= "" && %material.diffuseMap[0] $= "" && !isObject(%material.cubemap) )
+   if( %material.getToneMap(0) $= "" && %material.getDiffuseMap(0) $= "" && !isObject(%material.cubemap) )
    {
    {
       %previewImage = "core/images/warnmat";
       %previewImage = "core/images/warnmat";
    }
    }
    else
    else
    {
    {
       if( %material.toneMap[0] !$= "" )
       if( %material.toneMap[0] !$= "" )
-         %previewImage = %material.toneMap[0];
-      else if( %material.diffuseMap[0] !$= "" )
-         %previewImage = %material.diffuseMap[0];
+         %previewImage = %material.getToneMap(0);
+      else if( %material.getDiffuseMap(0) !$= "" )
+         %previewImage = %material.getDiffuseMap(0);
       else if( %material.cubemap.cubeFace[0] !$= "" )
       else if( %material.cubemap.cubeFace[0] !$= "" )
          %previewImage = %material.cubemap.cubeFace[0];
          %previewImage = %material.cubemap.cubeFace[0];
-      
-      %materialDiffuse =  %previewImage;
-      %materialPath = %material.getFilename();
-      if( strchr( %materialDiffuse, "/") $= "" )
-      {
-         %k = 0;
-         while( strpos( %materialPath, "/", %k ) != -1 )
-         {
-            %foo = strpos( %materialPath, "/", %k );
-            %k = %foo + 1;
          }
          }
-      
-         %foobar = getSubStr( %materialPath , %k , 99 );
-         %previewImage =  strreplace( %materialPath, %foobar, %previewImage );
-      }
-      else
-         %previewImage =  strreplace( %materialPath, %materialPath, %previewImage );
-   }
-      
    UVEditor-->bitmapPreview.setBitmap(%previewImage);
    UVEditor-->bitmapPreview.setBitmap(%previewImage);
    
    
    // Set up the color popup
    // Set up the color popup

+ 1 - 1
Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui

@@ -4748,7 +4748,7 @@
             tooltip = "Create New Material";
             tooltip = "Create New Material";
             buttonType = "PushButton";
             buttonType = "PushButton";
             useMouseEvents = "0";
             useMouseEvents = "0";
-            bitmap = "tools/gui/images/new";
+            bitmap = "ToolsModule:new_n_image";
          };
          };
          // Save Button
          // Save Button
          new GuiBitmapButtonCtrl() {
          new GuiBitmapButtonCtrl() {

+ 8 - 0
Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.tscript

@@ -589,6 +589,14 @@ function MaterialEditorGui::searchForTexture(%this,%material, %texture)
 {   
 {   
    if( %texture !$= "" )
    if( %texture !$= "" )
    {
    {
+      if(AssetDatabase.isDeclaredAsset(%texture))
+      {
+         %assetDef = AssetDatabase.acquireAsset(%texture);
+         %imagePath = %assetDef.getImagePath();
+         AssetDatabase.releaseAsset(%texture);
+         
+         return %imagePath;
+      }
       // set the find signal as false to start out with 
       // set the find signal as false to start out with 
       %isFile = false;
       %isFile = false;
       // sete the formats we're going to be looping through if need be
       // sete the formats we're going to be looping through if need be

+ 3 - 2
Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.tscript

@@ -270,8 +270,9 @@ function ShapeEdSelectWindow::onSelect( %this, %path )
    // Prompt user to save the old shape if it is dirty
    // Prompt user to save the old shape if it is dirty
    if ( ShapeEditor.isDirty() )
    if ( ShapeEditor.isDirty() )
    {
    {
-      %cmd = "showImportDialog( \"" @ %path @ "\", \"ShapeEditor.selectShape( \\\"" @ %path @ "\\\", ";
-      toolsMessageBoxYesNoCancel( "Shape Modified", "Would you like to save your changes?", %cmd @ "true );\" );", %cmd @ "false );\" );" );
+      %cmdY = "showImportDialog( \"" @ %path @ "\", \"ShapeEditor.selectShape( \"" @ %path @ "\", true)\" );";
+      %cmdN = "showImportDialog( \"" @ %path @ "\", \"ShapeEditor.selectShape( \"" @ %path @ "\", false)\" );";
+      toolsMessageBoxYesNoCancel( "Shape Modified", "Would you like to save your changes?", %cmdY, %cmdN,"" );
    }
    }
    else
    else
    {
    {

+ 21 - 0
Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.tscript

@@ -246,6 +246,27 @@ function EditorSaveAsDefaultLevel()
 function doEditorSaveAsDefaultLevel()
 function doEditorSaveAsDefaultLevel()
 {
 {
    %success = getScene(0).save("tools/levels/DefaultEditorLevel.mis");
    %success = getScene(0).save("tools/levels/DefaultEditorLevel.mis");
+   
+   if(ETerrainEditor.isDirty)
+   {
+      // Find all of the terrain files
+      initContainerTypeSearch($TypeMasks::TerrainObjectType);
+
+      while ((%terrainObject = containerSearchNext()) != 0)
+      {
+         if(%terrainObject.terrainAsset !$= "")
+         {
+            //we utilize a terrain asset, so we'll update our dependencies while we're at it
+            %terrainObject.saveAsset();
+         }
+         else
+         {
+            %terrainObject.save(%terrainObject.terrainFile);
+         }
+      }
+   }
+
+   ETerrainPersistMan.saveDirty();
 }
 }
 
 
 function EditorResetDefaultLevel()
 function EditorResetDefaultLevel()