Pārlūkot izejas kodu

Added initial implement of Image Types for GFX resource management
Added logic to intercept TSStatic setting shape to try and utilize a shapeAsset if it can find a matching loose file
Added lookup logic for getting any textures inside collada files to streamline asset importing logic
Fixed modal behavior for Import config and import window
Initial implementation of loose file/legacy file importing
Adjusted Asset Browser and Asset Import refreshing behavior to queue to improve performance by avoiding multiple refreshes as well as potential infinite loops
Fixed volume visibility behavior
Fixed physics world viz toggle

Areloch 5 gadi atpakaļ
vecāks
revīzija
9c381caea2
21 mainītis faili ar 753 papildinājumiem un 145 dzēšanām
  1. 20 0
      Engine/source/T3D/assets/ImageAsset.cpp
  2. 22 0
      Engine/source/T3D/assets/ImageAsset.h
  3. 26 3
      Engine/source/T3D/tsStatic.cpp
  4. 1 0
      Engine/source/T3D/tsStatic.h
  5. 18 0
      Engine/source/ts/collada/colladaImport.cpp
  6. 1 1
      Templates/BaseGame/game/tools/assetBrowser/guis/AssetImportConfigEditor.gui
  7. 1 1
      Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui
  8. 120 0
      Templates/BaseGame/game/tools/assetBrowser/guis/looseFileAudit.gui
  9. 2 0
      Templates/BaseGame/game/tools/assetBrowser/main.cs
  10. 8 0
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs
  11. 89 65
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs
  12. 0 0
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/decal.cs
  13. 0 0
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/explosion.cs
  14. 0 0
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/forest.cs
  15. 14 0
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gui.cs
  16. 8 10
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs
  17. 41 48
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.cs
  18. 310 0
      Templates/BaseGame/game/tools/assetBrowser/scripts/looseFileAudit.cs
  19. 7 1
      Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs
  20. 46 0
      Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs
  21. 19 16
      Templates/BaseGame/game/tools/worldEditor/scripts/visibility/visibilityLayer.ed.cs

+ 20 - 0
Engine/source/T3D/assets/ImageAsset.cpp

@@ -82,6 +82,24 @@ ConsoleSetType(TypeImageAssetPtr)
 
 //-----------------------------------------------------------------------------
 
+ImplementEnumType(ImageAssetType,
+   "Type of mesh data available in a shape.\n"
+   "@ingroup gameObjects")
+   { ImageAsset::Albedo,      "Albedo",      "" },
+   { ImageAsset::Normal,      "Normal",      "" },
+   { ImageAsset::Composite,   "Composite",   "" },
+   { ImageAsset::GUI,         "GUI",         "" },
+   { ImageAsset::Roughness,   "Roughness",   "" },
+   { ImageAsset::AO,          "AO",          "" },
+   { ImageAsset::Metalness,   "Metalness",   "" },
+   { ImageAsset::Glow,        "Glow",        "" },
+   { ImageAsset::Particle,    "Particle",    "" },
+   { ImageAsset::Decal,       "Decal",       "" },
+
+EndImplementEnumType;
+
+
+//-----------------------------------------------------------------------------
 ImageAsset::ImageAsset() : AssetBase(), mImage(nullptr), mUseMips(true), mIsHDRImage(false), mIsValidImage(false)
 {
    mImageFileName = StringTable->EmptyString();
@@ -105,6 +123,8 @@ void ImageAsset::initPersistFields()
 
    addField("useMips", TypeBool, Offset(mUseMips, ImageAsset), "Should the image use mips? (Currently unused).");
    addField("isHDRImage", TypeBool, Offset(mIsHDRImage, ImageAsset), "Is the image in an HDR format? (Currently unused)");
+
+   addField("imageType", TypeImageAssetType, Offset(mImageType, ImageAsset), "What the main use-case for the image is for.");
 }
 
 //------------------------------------------------------------------------------

+ 22 - 0
Engine/source/T3D/assets/ImageAsset.h

@@ -47,6 +47,23 @@ class ImageAsset : public AssetBase
 {
    typedef AssetBase Parent;
 
+public:
+   /// The different types of image use cases
+   enum ImageTypes
+   {
+      Albedo = 0,
+      Normal = 1,
+      Composite = 2,
+      GUI = 3,
+      Roughness = 4,
+      AO = 5,
+      Metalness = 6,
+      Glow = 7,
+      Particle = 8,
+      Decal = 9,
+   };
+
+protected:
    StringTableEntry mImageFileName;
 
    GFXTexHandle mImage;
@@ -55,6 +72,8 @@ class ImageAsset : public AssetBase
    bool mUseMips;
    bool mIsHDRImage;
 
+   ImageTypes mImageType;
+
 public:
    ImageAsset();
    virtual ~ImageAsset();
@@ -85,5 +104,8 @@ protected:
 
 DefineConsoleType(TypeImageAssetPtr, ImageAsset)
 
+typedef ImageAsset::ImageTypes ImageAssetType;
+DefineEnumType(ImageAssetType);
+
 #endif
 

+ 26 - 3
Engine/source/T3D/tsStatic.cpp

@@ -171,8 +171,8 @@ void TSStatic::initPersistFields()
          &TSStatic::_setShapeAsset, &defaultProtectedGetFn,
          "The source shape asset.");
 
-      addField("shapeName",   TypeShapeFilename,  Offset( mShapeName, TSStatic ),
-         "%Path and filename of the model file (.DTS, .DAE) to use for this TSStatic.", AbstractClassRep::FieldFlags::FIELD_HideInInspectors );
+      addProtectedField("shapeName",   TypeShapeFilename,  Offset( mShapeName, TSStatic ), &TSStatic::_setShape, &defaultProtectedGetFn,
+         "%Path and filename of the model file (.DTS, .DAE) to use for this TSStatic."/*, AbstractClassRep::FieldFlags::FIELD_HideInInspectors*/ );
 
    endGroup("Shape");
 
@@ -261,6 +261,27 @@ void TSStatic::initPersistFields()
    Parent::initPersistFields();
 }
 
+bool TSStatic::_setShape(void* obj, const char* index, const char* data)
+{
+   TSStatic* ts = static_cast<TSStatic*>(obj);// ->setFile(FileName(data));
+
+   //before we continue, lets hit up the Asset Database to see if this file is associated to an asset. If so, we grab the asset instead
+   AssetQuery query;
+   S32 foundAssetcount = AssetDatabase.findAssetLooseFile(&query, data);
+   if (foundAssetcount == 0)
+   {
+      //didn't find any assets. continue as normal
+      ts->mShapeName = StringTable->insert(data);
+   }
+   else
+   {
+      ts->setShapeAsset(query.mAssetList[0]);
+      ts->mShapeName = StringTable->EmptyString();
+   }
+
+   return false;
+}
+
 bool TSStatic::_setShapeAsset(void* obj, const char* index, const char* data)
 {
    TSStatic* ts = static_cast<TSStatic*>(obj);// ->setFile(FileName(data));
@@ -539,8 +560,10 @@ void TSStatic::prepCollision()
    setMaskBits( UpdateCollisionMask );
 
    // Allow the ShapeInstance to prep its collision if it hasn't already
-   if ( mShapeInstance )
+   if (mShapeInstance)
       mShapeInstance->prepCollision();
+   else
+      return;
 
    // Cleanup any old collision data
    mCollisionDetails.clear();

+ 1 - 0
Engine/source/T3D/tsStatic.h

@@ -235,6 +235,7 @@ public:
 
    DECLARE_CONOBJECT(TSStatic);
    static void initPersistFields();
+   static bool _setShape(void* obj, const char* index, const char* data);
    static bool _setShapeAsset(void* obj, const char* index, const char* data);
    static bool _setFieldSkin( void *object, const char* index, const char* data );
    static const char *_getFieldSkin( void *object, const char *data );

+ 18 - 0
Engine/source/ts/collada/colladaImport.cpp

@@ -203,6 +203,24 @@ DefineEngineFunction( enumColladaForImport, bool, (const char * shapePath, const
       }
    }
 
+   // Get images count
+   for (S32 i = 0; i < root->getLibrary_images_array().getCount(); i++)
+   {
+      const domLibrary_images* libraryImages = root->getLibrary_images_array()[i];
+
+      for (S32 j = 0; j < libraryImages->getImage_array().getCount(); j++)
+      {
+         domImage* img = libraryImages->getImage_array()[j];
+
+         S32 materialID = tree->findItemByName(_GetNameOrId(img));
+
+         if (materialID == 0)
+            continue;
+
+         tree->setItemValue(materialID, img->getInit_from()->getValue().str().c_str());
+      }
+   }
+
    // Get animation count
    for (S32 i = 0; i < root->getLibrary_animation_clips_array().getCount(); i++)
    {

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/guis/AssetImportConfigEditor.gui

@@ -5,7 +5,7 @@
    minExtent = "8 2";
    horizSizing = "right";
    vertSizing = "bottom";
-   profile = "GuiDefaultProfile";
+   profile = "ToolsGuiDefaultNonModalProfile";
    visible = "1";
    active = "1";
    tooltipProfile = "GuiToolTipProfile";

+ 1 - 1
Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui

@@ -5,7 +5,7 @@
    minExtent = "8 2";
    horizSizing = "right";
    vertSizing = "bottom";
-   profile = "GuiDefaultProfile";
+   profile = "ToolsGuiDefaultNonModalProfile";
    visible = "1";
    active = "1";
    tooltipProfile = "GuiToolTipProfile";

+ 120 - 0
Templates/BaseGame/game/tools/assetBrowser/guis/looseFileAudit.gui

@@ -0,0 +1,120 @@
+//--- OBJECT WRITE BEGIN ---
+%guiContent = new GuiControl(LooseFileAudit) {
+   position = "0 0";
+   extent = "1024 768";
+   minExtent = "8 2";
+   horizSizing = "right";
+   vertSizing = "bottom";
+   profile = "ToolsGuiDefaultNonModalProfile";
+   visible = "1";
+   active = "1";
+   tooltipProfile = "GuiToolTipProfile";
+   hovertime = "1000";
+   isContainer = "1";
+   canSave = "1";
+   canSaveDynamicFields = "1";
+      Enabled = "1";
+
+   new GuiWindowCtrl(LooseFileAuditWindow) {
+      text = "Loose Files";
+      resizeWidth = "1";
+      resizeHeight = "1";
+      canMove = "1";
+      canClose = "1";
+      canMinimize = "0";
+      canMaximize = "0";
+      canCollapse = "0";
+      edgeSnap = "1";
+      margin = "0 0 0 0";
+      padding = "0 0 0 0";
+      anchorTop = "1";
+      anchorBottom = "0";
+      anchorLeft = "1";
+      anchorRight = "0";
+      position = "372 76";
+      extent = "299 612";
+      minExtent = "48 92";
+      horizSizing = "center";
+      vertSizing = "center";
+      profile = "ToolsGuiWindowProfile";
+      visible = "1";
+      active = "1";
+      tooltipProfile = "ToolsGuiToolTipProfile";
+      hovertime = "1000";
+      isContainer = "1";
+      canSave = "1";
+      canSaveDynamicFields = "0";
+      closeCommand = "Canvas.popDialog(LooseFileAudit);";
+
+      new GuiScrollCtrl() {
+         willFirstRespond = "1";
+         hScrollBar = "alwaysOn";
+         vScrollBar = "alwaysOn";
+         lockHorizScroll = "0";
+         lockVertScroll = "0";
+         constantThumbHeight = "0";
+         childMargin = "0 0";
+         mouseWheelScrollSpeed = "-1";
+         margin = "0 0 0 0";
+         padding = "0 0 0 0";
+         anchorTop = "1";
+         anchorBottom = "0";
+         anchorLeft = "1";
+         anchorRight = "0";
+         position = "0 24";
+         extent = "299 554";
+         minExtent = "8 2";
+         horizSizing = "width";
+         vertSizing = "bottom";
+         profile = "ToolsGuiScrollProfile";
+         visible = "1";
+         active = "1";
+         tooltipProfile = "GuiToolTipProfile";
+         hovertime = "1000";
+         isContainer = "1";
+         canSave = "1";
+         canSaveDynamicFields = "0";
+
+         new GuiTreeViewCtrl(LooseFileList) {
+            columns = "0";
+            fitParentWidth = "1";
+            clipColumnText = "0";
+            rowHeightPadding = "2";
+            position = "1 1";
+            extent = "284 2";
+            minExtent = "8 2";
+            horizSizing = "width";
+            vertSizing = "height";
+            profile = "ToolsGuiTreeViewProfile";
+            visible = "1";
+            active = "1";
+            tooltipProfile = "GuiToolTipProfile";
+            hovertime = "1000";
+            isContainer = "1";
+            canSave = "1";
+            canSaveDynamicFields = "0";
+         };
+      };
+      new GuiButtonCtrl() {
+         text = "Cancel";
+         groupNum = "-1";
+         buttonType = "PushButton";
+         useMouseEvents = "0";
+         position = "225 583";
+         extent = "64 22";
+         minExtent = "8 2";
+         horizSizing = "right";
+         vertSizing = "bottom";
+         profile = "ToolsGuiButtonProfile";
+         visible = "1";
+         active = "1";
+         command = "Canvas.popDialog(LooseFileAudit);";
+         tooltipProfile = "ToolsGuiToolTipProfile";
+         hovertime = "1000";
+         isContainer = "0";
+         canSave = "1";
+         canSaveDynamicFields = "0";
+      };
+   };
+};
+//--- OBJECT WRITE END ---

+ 2 - 0
Templates/BaseGame/game/tools/assetBrowser/main.cs

@@ -65,6 +65,7 @@ function initializeAssetBrowser()
    exec("./guis/assetPreviewButtonsTemplate.gui");
    exec("./guis/newFolder.gui");
    exec("./guis/assetImportLog.gui");
+   exec("./guis/looseFileAudit.gui");
 
    exec("./scripts/assetBrowser.cs");
    exec("./scripts/popupMenus.cs");
@@ -79,6 +80,7 @@ function initializeAssetBrowser()
    exec("./scripts/assetImportConfigEditor.cs");  
    exec("./scripts/directoryHandling.cs");
    exec("./scripts/selectPath.cs");
+   exec("./scripts/looseFileAudit.cs");
    
    //Processing for the different asset types
    exec("./scripts/assetTypes/component.cs"); 

+ 8 - 0
Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs

@@ -1661,3 +1661,11 @@ function AssetBrowserFilterTree::onDragDropped( %this )
 {
    %asdgadfhg =true;
 }
+
+//
+//
+function AssetBrowser::importLooseFiles(%this)
+{
+   echo("Adding loose files at directory " @ %this.dirHandler.currentAddress);
+   LooseFileAuditWindow.showDialog(%this.dirHandler.currentAddress);  
+}

+ 89 - 65
Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs

@@ -77,18 +77,8 @@ function AssetBrowser::onBeginDropFiles( %this )
       return;
       
    error("% DragDrop - Beginning files dropping.");
-   ImportAssetWindow.importAssetUnprocessedListArray.empty();
-   ImportAssetWindow.importAssetFinalListArray.empty();
-   
-   ImportAssetWindow.assetHeirarchyChanged = false;
-   
-   //prep the import control
-   Canvas.pushDialog(AssetImportCtrl);
-   AssetImportCtrl.setHidden(true);
-
-   ImportAssetTree.clear();
-   ImportAssetTree.insertItem(0, "Importing Assets");
-   AssetBrowser.unprocessedAssetsCount = 0;
+   if(!ImportAssetWindow.isAwake())
+      ImportAssetWindow.showDialog();
 }
 
 function AssetBrowser::onDropFile( %this, %filePath )
@@ -217,49 +207,6 @@ function AssetBrowser::onEndDropFiles( %this )
       return;
       
    ImportAssetWindow.refresh();
-   
-   %hasIssues = ImportAssetWindow.validateAssets();
-   
-   //If we have a valid config file set and we've set to auto-import, and we have no
-   //issues for importing, then go ahead and run the import immediately, don't
-   //bother showing the window.
-   //If any of these conditions fail, we'll display the import window so it can be handled
-   //by the user
-   if(ImportAssetWindow.importConfigsList.count() != 0 && 
-      EditorSettings.value("Assets/AssetImporDefaultConfig") !$= "" && 
-      EditorSettings.value("Assets/AutoImport", false) == true
-      && %hasIssues == false)
-   {
-      AssetImportCtrl.setHidden(true);
-      ImportAssetWindow.visible = false;
-      
-      //Go ahead and check if we have any issues, and if not, run the import!
-      ImportAssetWindow.ImportAssets();
-   }
-   else
-   {
-      //we have assets to import, so go ahead and display the window for that now
-      AssetImportCtrl.setHidden(false);
-      ImportAssetWindow.visible = true;
-      ImportAssetWindow.selectWindow();
-   }
-   
-   if(%hasIssues && getAssetImportConfigValue("General/PreventImportWithErrors", "0") == 1)
-   {
-      DoAssetImportButton.enabled = false;  
-   }
-   else
-   {
-      DoAssetImportButton.enabled = true;  
-   }
-
-   // Update object library
-   GuiFormManager::SendContentMessage($LBCreateSiderBar, %this, "refreshAll 1");
-   
-   if(ImportAssetWindow.importConfigsList.count() == 0)
-   {
-      MessageBoxOK( "Warning", "No base import config. Please create an import configuration set to simplify asset importing.");
-   }
 }
 
 //
@@ -384,6 +331,8 @@ function AssetBrowser::addImportingAsset( %this, %assetType, %filePath, %parentA
    
    ImportAssetWindow.assetValidationList.add(%assetItem);
    
+   ImportAssetWindow.refresh();
+   
    return %assetItem;
 }
 
@@ -433,6 +382,36 @@ function ImportAssetButton::onClick(%this)
 }
 //
 
+function ImportAssetWindow::showDialog(%this)
+{
+   ImportAssetWindow.importAssetUnprocessedListArray.empty();
+   ImportAssetWindow.importAssetFinalListArray.empty();
+   
+   ImportAssetWindow.assetHeirarchyChanged = false;
+   
+   //prep the import control
+   Canvas.pushDialog(AssetImportCtrl);
+   AssetImportCtrl.setHidden(true);
+
+   ImportAssetTree.clear();
+   ImportAssetTree.insertItem(0, "Importing Assets");
+   AssetBrowser.unprocessedAssetsCount = 0;
+   
+   %this.dirty = false;
+}
+
+function ImportAssetWindow::Close(%this)
+{
+   //Some cleanup
+   ImportAssetWindow.importingFilesArray.empty();
+   
+   %this.importTempDirHandler.deleteFolder("tools/assetBrowser/importTemp/*/");
+   
+   if(ImportAssetWindow.isAwake())
+      ImportAssetWindow.refresh();
+      
+   Canvas.popDialog();  
+}
 //
 function ImportAssetWindow::onWake(%this)
 {
@@ -800,6 +779,16 @@ function refreshImportAssetWindow()
 }
 
 function ImportAssetWindow::refresh(%this)
+{
+   if(!%this.dirty)
+   {
+      %this.dirty = true;
+      
+      %this.schedule(16, "doRefresh");
+   }
+}
+
+function ImportAssetWindow::doRefresh(%this)
 {
    //Go through and process any newly, unprocessed assets
    %id = ImportAssetTree.getChild(1);
@@ -858,6 +847,51 @@ function ImportAssetWindow::refresh(%this)
    warn(%ImportActionSummary);
    
    AssetImportSummarization.Text = %ImportActionSummary;
+   
+   %hasIssues = ImportAssetWindow.validateAssets();
+   
+   //If we have a valid config file set and we've set to auto-import, and we have no
+   //issues for importing, then go ahead and run the import immediately, don't
+   //bother showing the window.
+   //If any of these conditions fail, we'll display the import window so it can be handled
+   //by the user
+   if(ImportAssetWindow.importConfigsList.count() != 0 && 
+      EditorSettings.value("Assets/AssetImporDefaultConfig") !$= "" && 
+      EditorSettings.value("Assets/AutoImport", false) == true
+      && %hasIssues == false)
+   {
+      AssetImportCtrl.setHidden(true);
+      ImportAssetWindow.visible = false;
+      
+      //Go ahead and check if we have any issues, and if not, run the import!
+      ImportAssetWindow.ImportAssets();
+   }
+   else
+   {
+      //we have assets to import, so go ahead and display the window for that now
+      AssetImportCtrl.setHidden(false);
+      ImportAssetWindow.visible = true;
+      ImportAssetWindow.selectWindow();
+   }
+   
+   if(%hasIssues && getAssetImportConfigValue("General/PreventImportWithErrors", "0") == 1)
+   {
+      DoAssetImportButton.enabled = false;  
+   }
+   else
+   {
+      DoAssetImportButton.enabled = true;  
+   }
+
+   // Update object library
+   GuiFormManager::SendContentMessage($LBCreateSiderBar, %this, "refreshAll 1");
+   
+   if(ImportAssetWindow.importConfigsList.count() == 0)
+   {
+      MessageBoxOK( "Warning", "No base import config. Please create an import configuration set to simplify asset importing.");
+   }
+   
+   %this.dirty = false;
 }
 
 function ImportAssetWindow::refreshChildItem(%this, %id)
@@ -1558,16 +1592,6 @@ function ImportAssetWindow::doImportAssets(%this, %id)
    }
 }
 
-function ImportAssetWindow::Close(%this)
-{
-   //Some cleanup
-   ImportAssetWindow.importingFilesArray.empty();
-   
-   %this.importTempDirHandler.deleteFolder("tools/assetBrowser/importTemp/*/");
-   
-   Canvas.popDialog();  
-}
-
 function ImportAssetWindow::resolveIssue(%this, %assetItem)
 {
    //Ok, we actually have a warning, so lets resolve

+ 0 - 0
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/decal.cs


+ 0 - 0
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/explosion.cs


+ 0 - 0
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/forest.cs


+ 14 - 0
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gui.cs

@@ -89,6 +89,20 @@ function AssetBrowser::createGUIAsset(%this)
 	return %tamlpath;  
 }
 
+function AssetBrowser::inspectImportingGUIAsset(%this, %assetItem)
+{
+   AssetImportCtrl-->NewAssetsInspector.startGroup("GUI");
+   
+   AssetImportCtrl-->NewAssetsInspector.addField("GUIFile", "GUI File Path", "filename", "Intended usage case of this image. Used to map to material slots and set up texture profiles.", "", 
+                                                      "", %assetItem);
+                                                      
+   //Make this a callback so that if it's set we can callback to a validator function
+   //This function(and others for other asset types) would check if the loosefile audit window is open, and if it is, remove the file from the list
+   AssetImportCtrl-->NewAssetsInspector.addField("ScriptFile", "Script File Path", "filename", "Intended usage case of this image. Used to map to material slots and set up texture profiles.", "", 
+                                                      "", %assetItem);                                                  
+   AssetImportCtrl-->NewAssetsInspector.endGroup();                                                
+}
+
 function AssetBrowser::editGUIAsset(%this, %assetDef)
 {
    if(!isObject(%assetDef.assetName))

+ 8 - 10
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/image.cs

@@ -81,21 +81,19 @@ function AssetBrowser::prepareImportImageAsset(%this, %assetItem)
          if(getAssetImportConfigValue("Materials/PopulateMaterialMaps", "1") == 1)
          {
             if(%foundSuffixType $= "diffuse")
-               %assetItem.ImageType = "Diffuse";
-               //%materialAsset.diffuseImageAsset = %assetItem;
+               %assetItem.ImageType = "Abledo";
             else if(%foundSuffixType $= "normal")
                %assetItem.ImageType = "Normal";
-               //%materialAsset.normalImageAsset = %assetItem;
             else if(%foundSuffixType $= "metalness")
-               %materialAsset.metalnessImageAsset = %assetItem;
+               %assetItem.ImageType = "metalness";
             else if(%foundSuffixType $= "roughness")
-               %materialAsset.roughnessImageAsset = %assetItem;
-               else if(%foundSuffixType $= "specular")
-               %materialAsset.specularImageAsset = %assetItem;
+               %assetItem.ImageType = "roughness";
+            else if(%foundSuffixType $= "specular")
+               %assetItem.ImageType = "specular";
             else if(%foundSuffixType $= "AO")
-               %materialAsset.AOImageAsset = %assetItem;
+               %assetItem.ImageType = "AO";
             else if(%foundSuffixType $= "composite")
-               %materialAsset.compositeImageAsset = %assetItem;
+               %assetItem.ImageType = "composite";
          }
       }
       
@@ -113,7 +111,7 @@ function AssetBrowser::inspectImportingImageAsset(%this, %assetItem)
 {
    AssetImportCtrl-->NewAssetsInspector.startGroup("Image");
    AssetImportCtrl-->NewAssetsInspector.addField("ImageType", "Image Type", "list", "Intended usage case of this image. Used to map to material slots and set up texture profiles.", "GUI", 
-                                                      "Color,Normal,Composite,Roughness,AO,Metalness,Glow,GUI,Particle,Decal", %assetItem);
+                                                      "Albedo,Normal,Composite,Roughness,AO,Metalness,Glow,GUI,Particle,Decal", %assetItem);
                                                       
    AssetImportCtrl-->NewAssetsInspector.endGroup();                                                
 }

+ 41 - 48
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/shape.cs

@@ -97,58 +97,12 @@ function AssetBrowser::prepareImportShapeAsset(%this, %assetItem)
    if(getAssetImportConfigValue("Materials/ImportMaterials", "1") == 1 && %matCount > 0)
    {
       %materialItem = %assetItem.shapeInfo.getChild(%matItem);
-      
-      %matName = %assetItem.shapeInfo.getItemText(%materialItem);
-      
-      %filePath = %assetItem.shapeInfo.getItemValue(%materialItem);
-      if(%filePath !$= "" && isFile(%filePath))
-      {
-         AssetBrowser.addImportingAsset("MaterialAsset", %filePath, %assetItem);
-      }
-      else
-      {
-         //check to see if it's actually just a flat color
-         if(getWordCount(%filePath) == 4 && getWord(%filePath, 0) $= "Color:")
-         {
-            AssetBrowser.addImportingAsset("MaterialAsset", %matName, %assetItem);
-         }
-         else
-         {
-            //we need to try and find our material, since the shapeInfo wasn't able to find it automatically
-            %filePath = findImageFile(filePath(%assetItem.filePath), %matName);
-            if(%filePath !$= "" && isFile(%filePath))
-               AssetBrowser.addImportingAsset("MaterialAsset", %filePath, %assetItem);
-            else
-               AssetBrowser.addImportingAsset("MaterialAsset", filePath(%assetItem.filePath) @ "/" @ %matName, %assetItem);
-         }
-      }
+      processShapeMaterialInfo(%assetItem, %materialItem);
       
       %materialItem = %assetItem.shapeInfo.getNextSibling(%materialItem);
       while(%materialItem != 0)
       {
-         %matName = %assetItem.shapeInfo.getItemText(%materialItem);
-         %filePath = %assetItem.shapeInfo.getItemValue(%materialItem);
-         if(%filePath !$= "" && isFile(%filePath))
-         {
-            AssetBrowser.addImportingAsset("MaterialAsset", %filePath, %assetItem);
-         }
-         else
-         {
-            //check to see if it's actually just a flat color
-            if(getWordCount(%filePath) == 4 && getWord(%filePath, 0) $= "Color:")
-            {
-               AssetBrowser.addImportingAsset("MaterialAsset", %matName, %assetItem);
-            }
-            else
-            {
-               //we need to try and find our material, since the shapeInfo wasn't able to find it automatically
-               %filePath = findImageFile(filePath(%assetItem.filePath), %matName);
-               if(%filePath !$= "" && isFile(%filePath))
-                  AssetBrowser.addImportingAsset("MaterialAsset", %filePath, %assetItem);
-               else
-                  AssetBrowser.addImportingAsset("MaterialAsset", filePath(%assetItem.filePath) @ "/" @ %matName, %assetItem);
-            }
-         }
+         processShapeMaterialInfo(%assetItem, %materialItem);
             
          %materialItem = %assetItem.shapeInfo.getNextSibling(%materialItem);
       }
@@ -356,4 +310,43 @@ function GuiInspectorTypeShapeAssetPtr::onControlDropped( %this, %payload, %posi
    }
    
    EWorldEditor.isDirty = true;
+}
+
+function processShapeMaterialInfo(%assetItem, %materialItem)
+{
+   %matName = %assetItem.shapeInfo.getItemText(%materialItem);
+   
+   %filePath = %assetItem.shapeInfo.getItemValue(%materialItem);
+   if(%filePath !$= "")
+   {
+      if(!isFile(%filePath))
+      {
+         //could be a stale path reference, such as if it was downloaded elsewhere. Trim to just the filename and see
+         //if we can find it there
+         %shapePathBase = filePath(%assetItem.filePath);
+         %imageFileName = %shapePathBase @ "/" @ fileName(%filePath);
+         if(isFile(%imageFileName))
+            %filePath = %imageFileName;
+      }
+   
+      %matAssetItem = AssetBrowser.addImportingAsset("MaterialAsset", "", %assetItem, %matName);
+      AssetBrowser.addImportingAsset("ImageAsset", %filePath, %matAssetItem);
+   }
+   else
+   {
+      //check to see if it's actually just a flat color
+      if(getWordCount(%filePath) == 4 && getWord(%filePath, 0) $= "Color:")
+      {
+         AssetBrowser.addImportingAsset("MaterialAsset", %matName, %assetItem);
+      }
+      else
+      {
+         //we need to try and find our material, since the shapeInfo wasn't able to find it automatically
+         %filePath = findImageFile(filePath(%assetItem.filePath), %matName);
+         if(%filePath !$= "" && isFile(%filePath))
+            AssetBrowser.addImportingAsset("MaterialAsset", %filePath, %assetItem);
+         else
+            AssetBrowser.addImportingAsset("MaterialAsset", filePath(%assetItem.filePath) @ "/" @ %matName, %assetItem);
+      }
+   }  
 }

+ 310 - 0
Templates/BaseGame/game/tools/assetBrowser/scripts/looseFileAudit.cs

@@ -0,0 +1,310 @@
+function LooseFileAuditWindow::buildPopupMenus(%this)
+{
+   //
+   // Import Asset Actions
+   //
+   //done with any valid image format file
+   if( !isObject( ImageLooseFilePopup ) )
+   {
+      %this.ImportAssetActions = new PopupMenu( ImageLooseFilePopup )
+      {
+         superClass = "MenuBuilder";
+         class = "EditorWorldMenu";
+         
+         item[0] = "Make an Image Asset" TAB "" TAB "LooseFileAuditWindow.importImage();";
+      };
+   }
+   
+   //Done with .cs files
+   if( !isObject( ScriptLooseFilePopup ) )
+   {
+      %this.ImportAssetActions = new PopupMenu( ScriptLooseFilePopup )
+      {
+         superClass = "MenuBuilder";
+         class = "EditorWorldMenu";
+         
+         item[0] = "Make a Script Asset" TAB "" TAB "LooseFileAuditWindow.importScript();";
+         item[1] = "Make a PostFX Asset" TAB "" TAB "LooseFileAuditWindow.importPostFX();";
+         item[2] = "Make a Material Asset" TAB "" TAB "LooseFileAuditWindow.importMaterial();";
+         item[3] = "Make a Terrain Material Asset" TAB "" TAB "LooseFileAuditWindow.importTerrMat();";
+         item[4] = "Make a Particle Asset" TAB "" TAB "LooseFileAuditWindow.importParticle();";
+         item[5] = "Make a Explosion Asset" TAB "" TAB "LooseFileAuditWindow.importExplosion();";
+         item[6] = "Make a Forest Brush Asset" TAB "" TAB "LooseFileAuditWindow.importForest();";
+      };
+   }  
+   
+   ScriptLooseFilePopup.enableItem(4, false);
+   ScriptLooseFilePopup.enableItem(5, false);   
+   ScriptLooseFilePopup.enableItem(6, false);
+   
+   if( !isObject( ShapeLooseFilePopup ) )
+   {
+      %this.ImportAssetActions = new PopupMenu( ShapeLooseFilePopup )
+      {
+         superClass = "MenuBuilder";
+         class = "EditorWorldMenu";
+         
+         item[0] = "Make a Shape Asset" TAB "" TAB "LooseFileAuditWindow.importShape();";
+         item[1] = "Make a Shape Animation Asset" TAB "" TAB "LooseFileAuditWindow.importShapeAnimation();";
+      };
+   }
+   
+   if( !isObject( DecalLooseFilePopup ) )
+   {
+      %this.ImportAssetActions = new PopupMenu( DecalLooseFilePopup )
+      {
+         superClass = "MenuBuilder";
+         class = "EditorWorldMenu";
+         
+         item[0] = "Make a Decal Asset" TAB "" TAB "LooseFileAuditWindow.importDecal();";
+      };
+   }
+   
+   if( !isObject( TerrainLooseFilePopup ) )
+   {
+      %this.ImportAssetActions = new PopupMenu( TerrainLooseFilePopup )
+      {
+         superClass = "MenuBuilder";
+         class = "EditorWorldMenu";
+         
+         item[0] = "Make a Terrain Data Asset" TAB "" TAB "LooseFileAuditWindow.importTerrain();";
+      };
+   }
+   
+   if( !isObject(SoundLooseFilePopup ) )
+   {
+      %this.ImportAssetActions = new PopupMenu( SoundLooseFilePopup )
+      {
+         superClass = "MenuBuilder";
+         class = "EditorWorldMenu";
+         
+         item[0] = "Make a Sound Asset" TAB "" TAB "LooseFileAuditWindow.importSound();";
+      };
+   }
+   
+   if( !isObject(LevelLooseFilePopup ) )
+   {
+      %this.ImportAssetActions = new PopupMenu( LevelLooseFilePopup )
+      {
+         superClass = "MenuBuilder";
+         class = "EditorWorldMenu";
+         
+         item[0] = "Make a Level Asset" TAB "" TAB "LooseFileAuditWindow.importLevel();";
+      };
+   }
+   
+   if( !isObject(GUILooseFilePopup ) )
+   {
+      %this.ImportAssetActions = new PopupMenu( GUILooseFilePopup )
+      {
+         superClass = "MenuBuilder";
+         class = "EditorWorldMenu";
+         
+         item[0] = "Make a GUI Asset" TAB "" TAB "LooseFileAuditWindow.importGUI();";
+      };
+   }
+}
+
+function LooseFileAuditWindow::showDialog(%this, %address)
+{
+   LooseFileAuditWindow.buildPopupMenus();
+   
+   Canvas.pushDialog(LooseFileAudit);
+   
+   %this.currentAddress = %address;
+   
+   %this.refresh();
+}
+
+function LooseFileAuditWindow::refresh(%this)
+{
+   LooseFileList.clear();
+   LooseFileList.insertItem(0, "Loose Files");
+   
+   //First, wipe out any files inside the folder first
+   %file = findFirstFileMultiExpr( %this.currentAddress @ "/*.*", false);
+   
+   %aq = new AssetQuery();
+
+   while( %file !$= "" )
+   {      
+      //%filename = fileName(%file);
+      //%filePath = filePath(%file);
+      if(!strIsMatchExpr("*.asset.taml", %file) && !strIsMatchExpr("*.taml", %file))
+      {
+         %assetsFound = AssetDatabase.findAssetLooseFile(%aq, %file);
+         
+         if(%assetsFound == 0)
+         {
+            LooseFileList.insertItem(1, %file); 
+         }
+      }
+      
+      %file = findNextFileMultiExpr( %this.currentAddress @ "/*.*" );
+   }
+   
+   LooseFileList.buildVisibleTree(true);
+   LooseFileList.expandItem(0);
+   
+   %aq.delete();
+}
+
+function LooseFileList::onRightMouseDown(%this, %itemId)
+{
+   LooseFileList.itemPath = %this.getItemText(%itemId);
+   LooseFileList.selectedItem = %itemId;
+   
+   %ext = fileExt(LooseFileList.itemPath);
+   if(isImageFormat(%ext))
+   {
+        ImageLooseFilePopup.showPopup(Canvas);
+   }
+   else if(%ext $= ".cs")
+   {
+        ScriptLooseFilePopup.showPopup(Canvas);
+   }
+   else if(isShapeFormat(%ext))
+   {
+        ShapeLooseFilePopup.showPopup(Canvas);
+   }
+   else if(%ext $= ".mis")
+   {
+        LevelLooseFilePopup.showPopup(Canvas);
+   }
+   else if(isSoundFormat(%ext))
+   {
+        SoundLooseFilePopup.showPopup(Canvas);
+   }
+   else if(%ext $= ".ter")
+   {
+        TerrainLooseFilePopup.showPopup(Canvas);
+   }
+   else if(%ext $= ".gui")
+   {
+        GUILooseFilePopup.showPopup(Canvas);
+   }
+}
+
+//
+//
+function LooseFileAuditWindow::importImage(%this)
+{
+   if(!ImportAssetWindow.isAwake())
+      ImportAssetWindow.showDialog();
+      
+   AssetBrowser.addImportingAsset("ImageAsset", LooseFileList.itemPath, "", "");
+   LooseFileList.removeItem(LooseFileList.selectedItem, false);
+   LooseFileList.buildVisibleTree(true);
+   LooseFileList.expandItem(0);
+}
+
+function LooseFileAuditWindow::importScript(%this)
+{
+   if(!ImportAssetWindow.isAwake())
+      ImportAssetWindow.showDialog();
+      
+   AssetBrowser.addImportingAsset("ScriptAsset", LooseFileList.itemPath, "", "");
+   LooseFileList.removeItem(LooseFileList.selectedItem, false);
+   LooseFileList.buildVisibleTree(true);
+   LooseFileList.expandItem(0);
+}
+
+function LooseFileAuditWindow::importGUI(%this)
+{
+   if(!ImportAssetWindow.isAwake())
+      ImportAssetWindow.showDialog();
+      
+   AssetBrowser.addImportingAsset("GUIAsset", LooseFileList.itemPath, "", "");
+   LooseFileList.removeItem(LooseFileList.selectedItem, false);
+   LooseFileList.buildVisibleTree(true);
+   LooseFileList.expandItem(0);
+}
+
+function LooseFileAuditWindow::importLevel(%this)
+{
+   if(!ImportAssetWindow.isAwake())
+      ImportAssetWindow.showDialog();
+      
+   AssetBrowser.addImportingAsset("LevelAsset", LooseFileList.itemPath, "", "");
+   LooseFileList.removeItem(LooseFileList.selectedItem, false);
+   LooseFileList.buildVisibleTree(true);
+   LooseFileList.expandItem(0);
+}
+
+function LooseFileAuditWindow::importSound(%this)
+{
+   if(!ImportAssetWindow.isAwake())
+      ImportAssetWindow.showDialog();
+      
+   AssetBrowser.addImportingAsset("SoundAsset", LooseFileList.itemPath, "", "");
+   LooseFileList.removeItem(LooseFileList.selectedItem, false);
+   LooseFileList.buildVisibleTree(true);
+   LooseFileList.expandItem(0);
+}
+
+function LooseFileAuditWindow::importTerrain(%this)
+{
+   if(!ImportAssetWindow.isAwake())
+      ImportAssetWindow.showDialog();
+      
+   AssetBrowser.addImportingAsset("TerrainAsset", LooseFileList.itemPath, "", "");
+   LooseFileList.removeItem(LooseFileList.selectedItem, false);
+   LooseFileList.buildVisibleTree(true);
+   LooseFileList.expandItem(0);
+   
+}
+
+function LooseFileAuditWindow::importTerrMat(%this)
+{
+   if(!ImportAssetWindow.isAwake())
+      ImportAssetWindow.showDialog();
+      
+   AssetBrowser.addImportingAsset("TerrainMaterialAsset", LooseFileList.itemPath, "", "");
+   LooseFileList.removeItem(LooseFileList.selectedItem, false);
+   LooseFileList.buildVisibleTree(true);
+   LooseFileList.expandItem(0);
+}
+
+function LooseFileAuditWindow::importShape(%this)
+{
+   if(!ImportAssetWindow.isAwake())
+      ImportAssetWindow.showDialog();
+      
+   AssetBrowser.addImportingAsset("ShapeAsset", LooseFileList.itemPath, "", "");
+   LooseFileList.removeItem(LooseFileList.selectedItem, false);
+   LooseFileList.buildVisibleTree(true);
+   LooseFileList.expandItem(0);
+}
+
+function LooseFileAuditWindow::importShapeAnimation(%this)
+{
+   if(!ImportAssetWindow.isAwake())
+      ImportAssetWindow.showDialog();
+      
+   AssetBrowser.addImportingAsset("ShapeAnimationAsset", LooseFileList.itemPath, "", "");
+   LooseFileList.removeItem(LooseFileList.selectedItem, false);
+   LooseFileList.buildVisibleTree(true);
+   LooseFileList.expandItem(0);
+}
+
+function LooseFileAuditWindow::importPostFX(%this)
+{
+   if(!ImportAssetWindow.isAwake())
+      ImportAssetWindow.showDialog();
+      
+   AssetBrowser.addImportingAsset("PostEffectAsset", LooseFileList.itemPath, "", "");
+   LooseFileList.removeItem(LooseFileList.selectedItem, false);
+   LooseFileList.buildVisibleTree(true);
+   LooseFileList.expandItem(0);
+}
+
+function LooseFileAuditWindow::importMaterial(%this)
+{
+   if(!ImportAssetWindow.isAwake())
+      ImportAssetWindow.showDialog();
+      
+   AssetBrowser.addImportingAsset("MaterialAsset", LooseFileList.itemPath, "", "");
+   LooseFileList.removeItem(LooseFileList.selectedItem, false);
+   LooseFileList.buildVisibleTree(true);
+   LooseFileList.expandItem(0);
+}

+ 7 - 1
Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs

@@ -162,6 +162,8 @@ function AssetBrowser::buildPopupMenus(%this)
          item[8] = "Create C++ Asset" TAB AddNewCppAssetPopup;
          item[9] = "-";
          item[10] = "Create New Module" TAB "" TAB "AssetBrowser.CreateNewModule();";
+         item[11] = "-";
+         item[12] = "Import Loose Files" TAB "" TAB "AssetBrowser.importLooseFiles();";
       
       };
    }
@@ -182,6 +184,8 @@ function AssetBrowser::buildPopupMenus(%this)
          Item[ 5 ] = "Duplicate Module" TAB "" TAB "AssetBrowser.copyModule();";
          Item[ 6 ] = "-";
          Item[ 7 ] = "Delete Module" TAB "" TAB "AssetBrowser.deleteModule();";
+         item[ 8 ] = "-";
+         item[ 9 ] = "Import Loose Files" TAB "" TAB "AssetBrowser.importLooseFiles();";
       };
    }
    
@@ -217,6 +221,8 @@ function AssetBrowser::buildPopupMenus(%this)
          Item[ 3 ] = "Duplicate Folder" TAB "" TAB "AssetBrowser.duplicateAsset();";
          item[ 4 ] = "-";
          item[ 5 ] = "Delete Folder" TAB "" TAB "AssetBrowser.deleteAsset();";
+         item[ 6 ] = "-";
+         item[ 7 ] = "Import Loose Files" TAB "" TAB "AssetBrowser.importLooseFiles();";
       };
    }
    
@@ -306,7 +312,7 @@ function AssetBrowser::buildPopupMenus(%this)
          superClass = "MenuBuilder";
          class = "EditorWorldMenu";
          
-         item[ 0 ] = "Import Project Loose Files" TAB "" TAB "AssetBrowser.importLegacyGame();";
+         item[ 0 ] = "Import Project Loose Files" TAB "" TAB "AssetBrowser.importLooseFiles();";
          Item[ 1 ] = "-";
          item[ 2 ] = "Import new assets" TAB "" TAB "Canvas.pushDialog(AssetImportCtrl);";
       };

+ 46 - 0
Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs

@@ -389,4 +389,50 @@ function toggleMatComplexityViz()
       
    MatComplexityVizBin.material = Viz_MaterialComplexityMat;
    MatComplexityVizBin.maxComplexity = 10;
+}
+
+//
+//
+function toggleVolumeViz(%vizName)
+{
+   if(%vizName $= "Zones")
+   {
+      $Zone::isRenderable = !$Zone::isRenderable;
+      EVisibilityVolumeOptions.checkItem(0, $Zone::isRenderable);
+   }
+   else if(%vizName $= "Portals")
+   {
+      $Portal::isRenderable = !$Portal::isRenderable;
+      EVisibilityVolumeOptions.checkItem(1, $Portal::isRenderable);
+   }
+   else if(%vizName $= "Occlusion")
+   {
+      $OcclusionVolume::isRenderable = !$OcclusionVolume::isRenderable;
+      EVisibilityVolumeOptions.checkItem(2, $OcclusionVolume::isRenderable);
+   }
+   else if(%vizName $= "Triggers")
+   {
+      $Trigger::renderTriggers = !$Trigger::renderTriggers;
+      EVisibilityVolumeOptions.checkItem(3, $Trigger::renderTriggers);
+   }
+   else if(%vizName $= "PhysicalZone")
+   {
+      $PhysicalZone::renderZones = !$PhysicalZone::renderZones;
+      EVisibilityVolumeOptions.checkItem(4, $PhysicalZone::renderZones);
+   }
+   else if(%vizName $= "SoundEmitters")
+   {
+      $SFXEmitter::renderEmitters = !$SFXEmitter::renderEmitters;
+      EVisibilityVolumeOptions.checkItem(5, $SFXEmitter::renderEmitters);
+   }
+   else if(%vizName $= "MissionArea")
+   {
+      EWorldEditor.renderMissionArea = !EWorldEditor.renderMissionArea;
+      EVisibilityVolumeOptions.checkItem(6, EWorldEditor.renderMissionArea);
+   }
+   else if(%vizName $= "SoundSpaces")
+   {
+      $SFXSpace::isRenderable = !$SFXSpace::isRenderable;
+      EVisibilityVolumeOptions.checkItem(7, $SFXSpace::isRenderable);
+   }
 }

+ 19 - 16
Templates/BaseGame/game/tools/worldEditor/scripts/visibility/visibilityLayer.ed.cs

@@ -81,14 +81,16 @@ function setupEditorVisibilityMenu()
       superClass = "MenuBuilder";
       class = "EditorWorldMenu";
       
-      item[ 0 ] = "Show Zones" TAB "" TAB "$Zone::isRenderable = !$Zone::isRenderable;";
-      item[ 1 ] = "Show Portals" TAB "" TAB "$Portal::isRenderable = !$Portal::isRenderable;";
-      item[ 2 ] = "Show Occlusion Volumes" TAB "" TAB "$OcclusionVolume::isRenderable = !$OcclusionVolume::isRenderable;";
-      item[ 3 ] = "Show Triggers" TAB "" TAB "$Trigger::renderTriggers = !$Trigger::renderTriggers;";
-      item[ 4 ] = "Show Physical Zones" TAB "" TAB "$PhysicalZone::renderZones = !$PhysicalZone::renderZones;";
-      item[ 5 ] = "Show Sound Emitters" TAB "" TAB "$SFXEmitter::renderEmitters = !$SFXEmitter::renderEmitters;";
-      item[ 6 ] = "Show Mission Area" TAB "" TAB "EWorldEditor.renderMissionArea = !EWorldEditor.renderMissionArea;";
-      item[ 7 ] = "Show Sound Spaces" TAB "" TAB "$SFXSpace::isRenderable = !$SFXSpace::isRenderable;";
+      radioSelection = false;
+      
+      item[ 0 ] = "Show Zones" TAB "" TAB "toggleVolumeViz(\"Zones\");";
+      item[ 1 ] = "Show Portals" TAB "" TAB "toggleVolumeViz(\"Portals\");";
+      item[ 2 ] = "Show Occlusion Volumes" TAB "" TAB "toggleVolumeViz(\"Occlusion\");";
+      item[ 3 ] = "Show Triggers" TAB "" TAB "toggleVolumeViz(\"Triggers\");";
+      item[ 4 ] = "Show Physical Zones" TAB "" TAB "toggleVolumeViz(\"PhysicalZone\");";
+      item[ 5 ] = "Show Sound Emitters" TAB "" TAB "toggleVolumeViz(\"SoundEmitters\");";
+      item[ 6 ] = "Show Mission Area" TAB "" TAB "toggleVolumeViz(\"MissionArea\");";
+      item[ 7 ] = "Show Sound Spaces" TAB "" TAB "toggleVolumeViz(\"SoundSpaces\");";
    };
    
    %debugRenderpopup = new PopupMenu(EVisibilityDebugRenderOptions)
@@ -96,17 +98,16 @@ function setupEditorVisibilityMenu()
       superClass = "MenuBuilder";
       class = "EditorWorldMenu";
       
-      item[ 0 ] = "Show Player Collision" TAB "" TAB "$Player::renderCollision != $Player::renderCollision;";
-      item[ 1 ] = "Show Terrain Debug" TAB "" TAB "$TerrainBlock::debugRender != $TerrainBlock::debugRender;";
-      item[ 2 ] = "Show Decals Debug" TAB "" TAB "$Decals::debugRender != $Decals::debugRender;";
-      item[ 3 ] = "Show Bounding Boxes" TAB "" TAB "$Scene::renderBoundingBoxes != $Scene::renderBoundingBoxes;";
-      item[ 4 ] = "Show Physics World" TAB "" TAB "$PhysicsWorld::render != $PhysicsWorld::render;";
-      item[ 5 ] = "Show Player Collision" TAB "" TAB "";
-      item[ 6 ] = "Show Texel Density" TAB "" TAB "toggleTexelDensityViz();";
+      item[ 0 ] = "Show Player Collision" TAB "" TAB "$Player::renderCollision = !$Player::renderCollision;";
+      item[ 1 ] = "Show Terrain Debug" TAB "" TAB "$TerrainBlock::debugRender = !$TerrainBlock::debugRender;";
+      item[ 2 ] = "Show Decals Debug" TAB "" TAB "$Decals::debugRender = !$Decals::debugRender;";
+      item[ 3 ] = "Show Bounding Boxes" TAB "" TAB "$Scene::renderBoundingBoxes = !$Scene::renderBoundingBoxes;";
+      item[ 4 ] = "Show Physics World" TAB "" TAB "togglePhysicsDebugViz();";
+      item[ 5 ] = "Show Texel Density" TAB "" TAB "toggleTexelDensityViz();";
    };
    
+   %debugRenderpopup.enableItem(4, false);
    %debugRenderpopup.enableItem(5, false);
-   %debugRenderpopup.enableItem(6, false);
    
    //
    //Lighting stuff
@@ -435,6 +436,8 @@ function EVisibility::addClassOptions( %this )
 
 function togglePhysicsDebugViz( %enable )
 {
+   $PhysicsWorld::render = %enable;
+   
    if(physicsPluginPresent())
    {
       physicsDebugDraw(%enable);