- fixed an issue with vertex colors in Unity 5

- added support for UV channels 3 & 4 in Unity 5
- fixed a problem with the scene hierarchy search box
This commit is contained in:
RaduMCosma 2015-11-03 00:56:03 +02:00
parent a928ffbf92
commit a9c8a4ab79
3 changed files with 248 additions and 142 deletions

View File

@ -116,6 +116,8 @@ namespace Unity_Studio
public float[] m_Colors;
public float[] m_UV1;
public float[] m_UV2;
public float[] m_UV3;
public float[] m_UV4;
public float[] m_Tangents;
public class SubMesh
@ -553,7 +555,7 @@ namespace Unity_Studio
m_Channels[c].dimension = a_Stream.ReadByte();
//calculate stride for Unity 5
singleStreamStride += m_Channels[c].dimension * (m_Channels[c].format % 2 == 0 ? 4 : 2);//fingers crossed!
singleStreamStride += m_Channels[c].dimension * (4 / (int)Math.Pow(2, m_Channels[c].format));
}
if (version[0] < 5)
@ -586,7 +588,7 @@ namespace Unity_Studio
#endregion
#region compute FvF
byte valueBufferSize = 0;
int valueBufferSize = 0;
byte[] valueBuffer;
float[] dstArray;
@ -601,11 +603,16 @@ namespace Unity_Studio
{
var m_Stream = m_Streams[m_Channel.stream];
for (int b = 0; b < 6; b++)
for (int b = 0; b < 8; b++)
{
if (m_Stream.channelMask.Get(b))
{
switch (m_Channel.format)
// in Unity 4.x the colors channel has 1 dimension, as in 1 color with 4 components
if (b == 2 && m_Channel.format == 2) { m_Channel.dimension = 4; }
valueBufferSize = 4 / (int)Math.Pow(2, m_Channel.format);
/*switch (m_Channel.format)
{
case 0: //32bit
valueBufferSize = 4;
@ -615,9 +622,9 @@ namespace Unity_Studio
break;
case 2: //8bit
valueBufferSize = 1;
m_Channel.dimension = 4;//these are actually groups of 4 components
m_Channel.dimension = 4;//in older versions this is 1, as in 1 color with 4 components
break;
}
}*/
valueBuffer = new byte[valueBufferSize];
dstArray = new float[m_VertexCount * m_Channel.dimension];
@ -634,22 +641,29 @@ namespace Unity_Studio
switch (b)
{
case 0://1
case 0:
m_Vertices = dstArray;
break;
case 1://2
case 1:
m_Normals = dstArray;
break;
case 2://4
case 2:
m_Colors = dstArray;
break;
case 3://8
case 3:
m_UV1 = dstArray;
break;
case 4://16
case 4:
m_UV2 = dstArray;
break;
case 5://32
case 5:
if (version[0] == 5) { m_UV3 = dstArray; }
else { m_Tangents = dstArray; }
break;
case 6:
m_UV4 = dstArray;
break;
case 7:
m_Tangents = dstArray;
break;
}
@ -799,13 +813,31 @@ namespace Unity_Studio
m_UV1[v] = (float)m_UV_Unpacked[v] / bitmax * m_UV_Packed.m_Range + m_UV_Packed.m_Start;
}
if (m_UV_Packed.m_NumItems == m_VertexCount * 4)
if (m_UV_Packed.m_NumItems >= m_VertexCount * 4)
{
m_UV2 = new float[m_VertexCount * 2];
for (uint v = 0; v < m_VertexCount * 2; v++)
{
m_UV2[v] = (float)m_UV_Unpacked[v + m_VertexCount * 2] / bitmax * m_UV_Packed.m_Range + m_UV_Packed.m_Start;
}
if (m_UV_Packed.m_NumItems >= m_VertexCount * 6)
{
m_UV3 = new float[m_VertexCount * 2];
for (uint v = 0; v < m_VertexCount * 2; v++)
{
m_UV3[v] = (float)m_UV_Unpacked[v + m_VertexCount * 4] / bitmax * m_UV_Packed.m_Range + m_UV_Packed.m_Start;
}
if (m_UV_Packed.m_NumItems == m_VertexCount * 8)
{
m_UV4 = new float[m_VertexCount * 2];
for (uint v = 0; v < m_VertexCount * 2; v++)
{
m_UV4[v] = (float)m_UV_Unpacked[v + m_VertexCount * 6] / bitmax * m_UV_Packed.m_Range + m_UV_Packed.m_Start;
}
}
}
}
}

View File

@ -62,16 +62,14 @@
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.sceneTreeView = new Unity_Studio.GOHierarchy();
this.treeSearch = new System.Windows.Forms.TextBox();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.assetListView = new System.Windows.Forms.ListView();
this.columnHeaderName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeaderType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeaderSize = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.listSearch = new System.Windows.Forms.TextBox();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.classesListView = new System.Windows.Forms.ListView();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.progressbarPanel = new System.Windows.Forms.Panel();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.previewPanel = new System.Windows.Forms.Panel();
@ -92,22 +90,24 @@
this.classTextBox = new System.Windows.Forms.TextBox();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.treeSearch = new System.Windows.Forms.TextBox();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.classesListView = new System.Windows.Forms.ListView();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.timer = new System.Windows.Forms.Timer(this.components);
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.openFolderDialog1 = new System.Windows.Forms.OpenFileDialog();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.saveFolderDialog1 = new System.Windows.Forms.SaveFileDialog();
this.treeTip = new System.Windows.Forms.ToolTip(this.components);
this.sceneTreeView = new Unity_Studio.GOHierarchy();
this.menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.progressbarPanel.SuspendLayout();
this.previewPanel.SuspendLayout();
this.FMODpanel.SuspendLayout();
@ -115,6 +115,7 @@
((System.ComponentModel.ISupportInitialize)(this.FMODvolumeBar)).BeginInit();
this.classPreviewPanel.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.tabPage3.SuspendLayout();
this.SuspendLayout();
//
// menuStrip1
@ -396,7 +397,6 @@
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
//this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1";
@ -418,6 +418,32 @@
this.tabPage1.Text = "Scene Hierarchy";
this.tabPage1.UseVisualStyleBackColor = true;
//
// sceneTreeView
//
this.sceneTreeView.CheckBoxes = true;
this.sceneTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.sceneTreeView.HideSelection = false;
this.sceneTreeView.Location = new System.Drawing.Point(0, 20);
this.sceneTreeView.Name = "sceneTreeView";
this.sceneTreeView.Size = new System.Drawing.Size(410, 588);
this.sceneTreeView.TabIndex = 1;
this.sceneTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.sceneTreeView_AfterCheck);
//
// treeSearch
//
this.treeSearch.Dock = System.Windows.Forms.DockStyle.Top;
this.treeSearch.ForeColor = System.Drawing.SystemColors.GrayText;
this.treeSearch.Location = new System.Drawing.Point(0, 0);
this.treeSearch.Name = "treeSearch";
this.treeSearch.Size = new System.Drawing.Size(410, 20);
this.treeSearch.TabIndex = 0;
this.treeSearch.Text = " Search ";
this.treeSearch.TextChanged += new System.EventHandler(this.treeSearch_TextChanged);
this.treeSearch.Enter += new System.EventHandler(this.treeSearch_Enter);
this.treeSearch.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeSearch_KeyDown);
this.treeSearch.Leave += new System.EventHandler(this.treeSearch_Leave);
this.treeSearch.MouseEnter += new System.EventHandler(this.treeSearch_MouseEnter);
//
// tabPage2
//
this.tabPage2.Controls.Add(this.assetListView);
@ -478,43 +504,6 @@
this.listSearch.Enter += new System.EventHandler(this.listSearch_Enter);
this.listSearch.Leave += new System.EventHandler(this.listSearch_Leave);
//
// tabPage3
//
this.tabPage3.Controls.Add(this.classesListView);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(410, 608);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "Asset Classes";
this.tabPage3.UseVisualStyleBackColor = true;
//
// classesListView
//
this.classesListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2});
this.classesListView.Dock = System.Windows.Forms.DockStyle.Fill;
this.classesListView.FullRowSelect = true;
this.classesListView.Location = new System.Drawing.Point(0, 0);
this.classesListView.MultiSelect = false;
this.classesListView.Name = "classesListView";
this.classesListView.Size = new System.Drawing.Size(410, 608);
this.classesListView.TabIndex = 0;
this.classesListView.UseCompatibleStateImageBehavior = false;
this.classesListView.View = System.Windows.Forms.View.Details;
this.classesListView.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.classesListView_ItemSelectionChanged);
//
// columnHeader1
//
this.columnHeader1.DisplayIndex = 1;
this.columnHeader1.Text = "Name";
this.columnHeader1.Width = 328;
//
// columnHeader2
//
this.columnHeader2.DisplayIndex = 0;
this.columnHeader2.Text = "ID";
//
// progressbarPanel
//
this.progressbarPanel.Controls.Add(this.progressBar1);
@ -740,19 +729,42 @@
this.toolStripStatusLabel1.Text = "Ready to go";
this.toolStripStatusLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// treeSearch
// tabPage3
//
this.treeSearch.Dock = System.Windows.Forms.DockStyle.Top;
this.treeSearch.ForeColor = System.Drawing.SystemColors.GrayText;
this.treeSearch.Location = new System.Drawing.Point(0, 0);
this.treeSearch.Name = "treeSearch";
this.treeSearch.Size = new System.Drawing.Size(410, 20);
this.treeSearch.TabIndex = 0;
this.treeSearch.Text = " Search ";
this.treeSearch.Enter += new System.EventHandler(this.treeSearch_Enter);
this.treeSearch.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeSearch_KeyDown);
this.treeSearch.Leave += new System.EventHandler(this.treeSearch_Leave);
this.treeSearch.MouseEnter += new System.EventHandler(this.treeSearch_MouseEnter);
this.tabPage3.Controls.Add(this.classesListView);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(410, 608);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "Asset Classes";
this.tabPage3.UseVisualStyleBackColor = true;
//
// classesListView
//
this.classesListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2});
this.classesListView.Dock = System.Windows.Forms.DockStyle.Fill;
this.classesListView.FullRowSelect = true;
this.classesListView.Location = new System.Drawing.Point(0, 0);
this.classesListView.MultiSelect = false;
this.classesListView.Name = "classesListView";
this.classesListView.Size = new System.Drawing.Size(410, 608);
this.classesListView.TabIndex = 0;
this.classesListView.UseCompatibleStateImageBehavior = false;
this.classesListView.View = System.Windows.Forms.View.Details;
this.classesListView.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.classesListView_ItemSelectionChanged);
//
// columnHeader1
//
this.columnHeader1.DisplayIndex = 1;
this.columnHeader1.Text = "Name";
this.columnHeader1.Width = 328;
//
// columnHeader2
//
this.columnHeader2.DisplayIndex = 0;
this.columnHeader2.Text = "ID";
//
// timer
//
@ -789,18 +801,6 @@
this.saveFolderDialog1.RestoreDirectory = true;
this.saveFolderDialog1.Title = "Browse for folder";
//
// sceneTreeView
//
this.sceneTreeView.CheckBoxes = true;
this.sceneTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.sceneTreeView.HideSelection = false;
this.sceneTreeView.LineColor = System.Drawing.Color.Empty;
this.sceneTreeView.Location = new System.Drawing.Point(0, 20);
this.sceneTreeView.Name = "sceneTreeView";
this.sceneTreeView.Size = new System.Drawing.Size(410, 588);
this.sceneTreeView.TabIndex = 1;
this.sceneTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.sceneTreeView_AfterCheck);
//
// UnityStudioForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -824,9 +824,10 @@
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
this.tabPage3.ResumeLayout(false);
this.progressbarPanel.ResumeLayout(false);
this.previewPanel.ResumeLayout(false);
this.previewPanel.PerformLayout();
@ -838,6 +839,7 @@
this.classPreviewPanel.PerformLayout();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.tabPage3.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();

View File

@ -53,9 +53,9 @@ namespace Unity_Studio
private bool isTypeSorted = false;
private bool isSizeSorted = false;
//return-to indices for tree search
private int lastAFile = 0;
private int lastGObject = 0;
//tree search
private int nextGObject = 0;
List<GameObject> treeSrcResults = new List<GameObject>();
//counters for progress bar
private int totalAssetCount = 0;
@ -878,19 +878,6 @@ namespace Unity_Studio
}
}
private void recurseTreeCheck(TreeNodeCollection start)
{
foreach (GameObject GObject in start)
{
if (GObject.Text.Like(treeSearch.Text))
{
GObject.Checked = !GObject.Checked;
if (GObject.Checked) { GObject.EnsureVisible(); }
}
else { recurseTreeCheck(GObject.Nodes); }
}
}
private void treeSearch_MouseEnter(object sender, EventArgs e)
{
treeTip.Show("Search with * ? widcards. Enter to scroll through results, Ctrl+Enter to select all results.", treeSearch, 5000);
@ -914,59 +901,57 @@ namespace Unity_Studio
}
}
private void recurseTreeCheck(TreeNodeCollection start)
{
foreach (GameObject GObject in start)
{
if (GObject.Text.Like(treeSearch.Text))
{
GObject.Checked = !GObject.Checked;
if (GObject.Checked) { GObject.EnsureVisible(); }
}
else { recurseTreeCheck(GObject.Nodes); }
}
}
private void treeSearch_TextChanged(object sender, EventArgs e)
{
treeSrcResults.Clear();
nextGObject = 0;
}
private void treeSearch_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
if (e.Control) //toggle all matching nodes //skip children?
if (treeSrcResults.Count == 0)
{
foreach (var aFile in assetsfileList)
{
foreach (var GObject in aFile.GameObjectList.Values)
{
if (GObject.Text.Like(treeSearch.Text)) { treeSrcResults.Add(GObject); }
}
}
}
if (e.Control) //toggle all matching nodes
{
sceneTreeView.BeginUpdate();
//loop assetsFileList?
/*foreach (var AFile in assetsfileList)
{
foreach (var GObject in AFile.GameObjectList)
{
if (GObject.Text.Like(treeSearch.Text))
{
GObject.Checked = true;
GObject.EnsureVisible();
}
}
}*/
//loop TreeView to avoid checking children already checked by parent
//loop TreeView recursively to avoid children already checked by parent
recurseTreeCheck(sceneTreeView.Nodes);
sceneTreeView.EndUpdate();
}
else //make visible one by one
{
bool foundNode = false;
while (!foundNode && lastAFile < assetsfileList.Count)
if (treeSrcResults.Count > 0)
{
var AFile = assetsfileList[lastAFile];
while (!foundNode && lastGObject < AFile.GameObjectList.Count)
{
var GObject = AFile.GameObjectList[lastGObject];
if (GObject.Text.Like(treeSearch.Text))
{
foundNode = true;
GObject.EnsureVisible();
sceneTreeView.SelectedNode = GObject;
lastGObject++;
return;
}
lastGObject++;
}
lastAFile++;
lastGObject = 0;
if (nextGObject > treeSrcResults.Count) { nextGObject = 0; }
treeSrcResults[nextGObject].EnsureVisible();
sceneTreeView.SelectedNode = treeSrcResults[nextGObject];
nextGObject++;
}
lastAFile = 0;
}
}
}
@ -2171,7 +2156,7 @@ namespace Unity_Studio
}
#endregion
#region UV
#region UV1
//does FBX support UVW coordinates?
if ((bool)Properties.Settings.Default["exportUVs"] && m_Mesh.m_UV1 != null && m_Mesh.m_UV1.Length > 0)
{
@ -2203,7 +2188,8 @@ namespace Unity_Studio
ob.Append("\n\t\t\t}\n\t\t}");
}
#endregion
#region UV2
if ((bool)Properties.Settings.Default["exportUVs"] && m_Mesh.m_UV2 != null && m_Mesh.m_UV2.Length > 0)
{
ob.Append("\n\t\tLayerElementUV: 1 {");
@ -2235,6 +2221,70 @@ namespace Unity_Studio
ob.Append("\n\t\t\t}\n\t\t}");
}
#endregion
#region UV3
if ((bool)Properties.Settings.Default["exportUVs"] && m_Mesh.m_UV3 != null && m_Mesh.m_UV3.Length > 0)
{
ob.Append("\n\t\tLayerElementUV: 2 {");
ob.Append("\n\t\t\tVersion: 101");
ob.Append("\n\t\t\tName: \"UVChannel_3\"");
ob.Append("\n\t\t\tMappingInformationType: \"ByVertice\"");
ob.Append("\n\t\t\tReferenceInformationType: \"Direct\"");
ob.AppendFormat("\n\t\t\tUV: *{0} {{\n\t\t\ta: ", m_Mesh.m_UV3.Length);
for (int l = 0; l < f2Lines; l++)
{
for (int v = 0; v < 60; v++)
{
ob.AppendFormat("{0},{1},", m_Mesh.m_UV3[l * 120 + v * 2], 1 - m_Mesh.m_UV3[l * 120 + v * 2 + 1]);
}
ob.Append("\n");
}
if (remf2Verts != 0)
{
for (int v = 0; v < remf2Verts; v++)
{
ob.AppendFormat("{0},{1},", m_Mesh.m_UV3[f2Lines * 120 + v * 2], 1 - m_Mesh.m_UV3[f2Lines * 120 + v * 2 + 1]);
}
}
else { ob.Length--; }//remove last newline
ob.Length--;//remove last comma
ob.Append("\n\t\t\t}\n\t\t}");
}
#endregion
#region UV4
if ((bool)Properties.Settings.Default["exportUVs"] && m_Mesh.m_UV4 != null && m_Mesh.m_UV4.Length > 0)
{
ob.Append("\n\t\tLayerElementUV: 3 {");
ob.Append("\n\t\t\tVersion: 101");
ob.Append("\n\t\t\tName: \"UVChannel_4\"");
ob.Append("\n\t\t\tMappingInformationType: \"ByVertice\"");
ob.Append("\n\t\t\tReferenceInformationType: \"Direct\"");
ob.AppendFormat("\n\t\t\tUV: *{0} {{\n\t\t\ta: ", m_Mesh.m_UV4.Length);
for (int l = 0; l < f2Lines; l++)
{
for (int v = 0; v < 60; v++)
{
ob.AppendFormat("{0},{1},", m_Mesh.m_UV4[l * 120 + v * 2], 1 - m_Mesh.m_UV4[l * 120 + v * 2 + 1]);
}
ob.Append("\n");
}
if (remf2Verts != 0)
{
for (int v = 0; v < remf2Verts; v++)
{
ob.AppendFormat("{0},{1},", m_Mesh.m_UV4[f2Lines * 120 + v * 2], 1 - m_Mesh.m_UV4[f2Lines * 120 + v * 2 + 1]);
}
}
else { ob.Length--; }//remove last newline
ob.Length--;//remove last comma
ob.Append("\n\t\t\t}\n\t\t}");
}
#endregion
#region Material
ob.Append("\n\t\tLayerElementMaterial: 0 {");
@ -2323,6 +2373,28 @@ namespace Unity_Studio
ob.Append("\n\t\t\t}");
ob.Append("\n\t\t}"); //Layer 1 end
}
if ((bool)Properties.Settings.Default["exportUVs"] && m_Mesh.m_UV3 != null && m_Mesh.m_UV3.Length > 0)
{
ob.Append("\n\t\tLayer: 2 {");
ob.Append("\n\t\t\tVersion: 100");
ob.Append("\n\t\t\tLayerElement: {");
ob.Append("\n\t\t\t\tType: \"LayerElementUV\"");
ob.Append("\n\t\t\t\tTypedIndex: 2");
ob.Append("\n\t\t\t}");
ob.Append("\n\t\t}"); //Layer 2 end
}
if ((bool)Properties.Settings.Default["exportUVs"] && m_Mesh.m_UV4 != null && m_Mesh.m_UV4.Length > 0)
{
ob.Append("\n\t\tLayer: 3 {");
ob.Append("\n\t\t\tVersion: 100");
ob.Append("\n\t\t\tLayerElement: {");
ob.Append("\n\t\t\t\tType: \"LayerElementUV\"");
ob.Append("\n\t\t\t\tTypedIndex: 3");
ob.Append("\n\t\t\t}");
ob.Append("\n\t\t}"); //Layer 3 end
}
#endregion
ob.Append("\n\t}"); //Geometry end
@ -2986,7 +3058,7 @@ namespace Unity_Studio
lastSelectedItem = null;
lastLoadedAsset = null;
//FMODinit();
FMODinit();
}