Delete obsolete code

This commit is contained in:
Perfare 2018-10-27 09:39:45 +08:00
parent d380c38710
commit 1f897cf431
13 changed files with 110 additions and 1572 deletions

View File

@ -209,7 +209,6 @@
<Compile Include="Classes\BuildSettings.cs" />
<Compile Include="StudioClasses\BundleFile.cs" />
<Compile Include="StudioClasses\TypeTreeItem.cs" />
<Compile Include="StudioClasses\FBXExporter.cs" />
<Compile Include="StudioClasses\SpriteHelper.cs" />
<Compile Include="StudioClasses\Exporter.cs" />
<Compile Include="StudioClasses\Importer.cs" />

View File

@ -46,11 +46,6 @@
this.assetGroupOptions = new System.Windows.Forms.ToolStripComboBox();
this.showExpOpt = new System.Windows.Forms.ToolStripMenuItem();
this.modelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
this.exportallobjectsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportallobjectssplitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportselectedobjectsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
this.exportAllObjectssplitToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.exportSelectedObjectsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportSelectedObjectsWithAnimationClipToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -282,11 +277,6 @@
// modelToolStripMenuItem
//
this.modelToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItem3,
this.exportallobjectsMenuItem,
this.exportallobjectssplitToolStripMenuItem,
this.exportselectedobjectsMenuItem,
this.toolStripMenuItem2,
this.exportAllObjectssplitToolStripMenuItem1,
this.exportSelectedObjectsToolStripMenuItem,
this.exportSelectedObjectsWithAnimationClipToolStripMenuItem});
@ -294,59 +284,24 @@
this.modelToolStripMenuItem.Size = new System.Drawing.Size(58, 21);
this.modelToolStripMenuItem.Text = "Model";
//
// toolStripMenuItem3
//
this.toolStripMenuItem3.Enabled = false;
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(332, 22);
this.toolStripMenuItem3.Text = "-----------------------Ascii-----------------------";
//
// exportallobjectsMenuItem
//
this.exportallobjectsMenuItem.Name = "exportallobjectsMenuItem";
this.exportallobjectsMenuItem.Size = new System.Drawing.Size(332, 22);
this.exportallobjectsMenuItem.Text = "Export all objects";
this.exportallobjectsMenuItem.Click += new System.EventHandler(this.ExportObjects_Click);
//
// exportallobjectssplitToolStripMenuItem
//
this.exportallobjectssplitToolStripMenuItem.Name = "exportallobjectssplitToolStripMenuItem";
this.exportallobjectssplitToolStripMenuItem.Size = new System.Drawing.Size(332, 22);
this.exportallobjectssplitToolStripMenuItem.Text = "Export all objects (split)";
this.exportallobjectssplitToolStripMenuItem.Click += new System.EventHandler(this.exportallobjectssplitToolStripMenuItem_Click);
//
// exportselectedobjectsMenuItem
//
this.exportselectedobjectsMenuItem.Name = "exportselectedobjectsMenuItem";
this.exportselectedobjectsMenuItem.Size = new System.Drawing.Size(332, 22);
this.exportselectedobjectsMenuItem.Text = "Export selected objects";
this.exportselectedobjectsMenuItem.Click += new System.EventHandler(this.ExportObjects_Click);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Enabled = false;
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(332, 22);
this.toolStripMenuItem2.Text = "----------------------Binary----------------------";
//
// exportAllObjectssplitToolStripMenuItem1
//
this.exportAllObjectssplitToolStripMenuItem1.Name = "exportAllObjectssplitToolStripMenuItem1";
this.exportAllObjectssplitToolStripMenuItem1.Size = new System.Drawing.Size(332, 22);
this.exportAllObjectssplitToolStripMenuItem1.Size = new System.Drawing.Size(323, 22);
this.exportAllObjectssplitToolStripMenuItem1.Text = "Export all objects (split)";
this.exportAllObjectssplitToolStripMenuItem1.Click += new System.EventHandler(this.exportAllObjectssplitToolStripMenuItem1_Click);
//
// exportSelectedObjectsToolStripMenuItem
//
this.exportSelectedObjectsToolStripMenuItem.Name = "exportSelectedObjectsToolStripMenuItem";
this.exportSelectedObjectsToolStripMenuItem.Size = new System.Drawing.Size(332, 22);
this.exportSelectedObjectsToolStripMenuItem.Size = new System.Drawing.Size(323, 22);
this.exportSelectedObjectsToolStripMenuItem.Text = "Export selected objects";
this.exportSelectedObjectsToolStripMenuItem.Click += new System.EventHandler(this.exportSelectedObjectsToolStripMenuItem_Click);
//
// exportSelectedObjectsWithAnimationClipToolStripMenuItem
//
this.exportSelectedObjectsWithAnimationClipToolStripMenuItem.Name = "exportSelectedObjectsWithAnimationClipToolStripMenuItem";
this.exportSelectedObjectsWithAnimationClipToolStripMenuItem.Size = new System.Drawing.Size(332, 22);
this.exportSelectedObjectsWithAnimationClipToolStripMenuItem.Size = new System.Drawing.Size(323, 22);
this.exportSelectedObjectsWithAnimationClipToolStripMenuItem.Text = "Export selected objects with AnimationClip";
this.exportSelectedObjectsWithAnimationClipToolStripMenuItem.Click += new System.EventHandler(this.exportObjectswithAnimationClipMenuItem_Click);
//
@ -1051,8 +1006,6 @@
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem extractFileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem extractFolderToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportallobjectsMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportselectedobjectsMenuItem;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
private System.Windows.Forms.ToolStripComboBox assetGroupOptions;
@ -1072,7 +1025,6 @@
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem exportClassStructuresMenuItem;
private System.Windows.Forms.Label FMODcopyright;
private System.Windows.Forms.ToolStripMenuItem exportallobjectssplitToolStripMenuItem;
private OpenTK.GLControl glControl1;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem showOriginalFileToolStripMenuItem;
@ -1087,8 +1039,6 @@
private System.Windows.Forms.ToolStripMenuItem exportAnimatorWithSelectedAnimationClipToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportAllObjectssplitToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem jumpToSceneHierarchyToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem3;
}
}

View File

@ -1364,68 +1364,6 @@ namespace AssetStudio
return false;
}
private void exportallobjectssplitToolStripMenuItem_Click(object sender, EventArgs e)
{
if (sceneTreeView.Nodes.Count > 0)
{
var saveFolderDialog1 = new OpenFolderDialog();
if (saveFolderDialog1.ShowDialog(this) == DialogResult.OK)
{
var savePath = saveFolderDialog1.Folder + "\\";
progressBar1.Value = 0;
progressBar1.Maximum = sceneTreeView.Nodes.Cast<TreeNode>().Sum(x => x.Nodes.Count);
ExportSplitObjects(savePath, sceneTreeView.Nodes);
}
}
else
{
StatusStripUpdate("No Objects available for export");
}
}
private void ExportObjects_Click(object sender, EventArgs e)
{
if (sceneTreeView.Nodes.Count > 0)
{
var exportAll = ((ToolStripItem)sender).Name == "exportallobjectsMenuItem";
saveFileDialog1.FileName = productName + DateTime.Now.ToString("_yy_MM_dd__HH_mm_ss");
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
var gameObjects = new List<GameObject>();
foreach (var node in treeNodeDictionary.Values)
{
if (node.Checked || exportAll)
{
gameObjects.Add(node.gameObject);
}
}
progressBar1.Value = 0;
progressBar1.Maximum = 1;
if (gameObjects.Count == 0)
{
progressBar1.PerformStep();
toolStripStatusLabel1.Text = "Nothing exported.";
return;
}
toolStripStatusLabel1.Text = $"Exporting {Path.GetFileName(saveFileDialog1.FileName)}";
FBXExporter.WriteFBX(saveFileDialog1.FileName, gameObjects);
toolStripStatusLabel1.Text = $"Finished exporting {Path.GetFileName(saveFileDialog1.FileName)}";
progressBar1.PerformStep();
if (openAfterExport.Checked && File.Exists(saveFileDialog1.FileName))
{
Process.Start(Path.GetDirectoryName(saveFileDialog1.FileName));
}
}
}
else
{
toolStripStatusLabel1.Text = "No Objects available for export";
}
}
private void ExportAssets_Click(object sender, EventArgs e)
{
if (exportableAssets.Count > 0)
@ -1957,7 +1895,7 @@ namespace AssetStudio
var savePath = saveFolderDialog1.Folder + "\\";
progressBar1.Value = 0;
progressBar1.Maximum = sceneTreeView.Nodes.Cast<TreeNode>().Sum(x => x.Nodes.Count); ;
ExportSplitObjects(savePath, sceneTreeView.Nodes, true);
ExportSplitObjects(savePath, sceneTreeView.Nodes);
}
}
else

View File

@ -28,18 +28,8 @@
/// </summary>
private void InitializeComponent()
{
this.FbxBox = new System.Windows.Forms.GroupBox();
this.scaleFactor = new System.Windows.Forms.NumericUpDown();
this.convertDummies = new System.Windows.Forms.CheckBox();
this.scaleLabel = new System.Windows.Forms.Label();
this.exportDeformers = new System.Windows.Forms.CheckBox();
this.geometryBox = new System.Windows.Forms.GroupBox();
this.exportColors = new System.Windows.Forms.CheckBox();
this.exportUVs = new System.Windows.Forms.CheckBox();
this.exportTangents = new System.Windows.Forms.CheckBox();
this.exportNormals = new System.Windows.Forms.CheckBox();
this.fbxOKbutton = new System.Windows.Forms.Button();
this.fbxCancel = new System.Windows.Forms.Button();
this.OKbutton = new System.Windows.Forms.Button();
this.Cancel = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.convertAudio = new System.Windows.Forms.CheckBox();
this.panel1 = new System.Windows.Forms.Panel();
@ -48,6 +38,8 @@
this.tobmp = new System.Windows.Forms.RadioButton();
this.converttexture = new System.Windows.Forms.CheckBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.fbxFormat = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.fbxVersion = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.flatInbetween = new System.Windows.Forms.CheckBox();
@ -59,9 +51,6 @@
this.allBones = new System.Windows.Forms.CheckBox();
this.allFrames = new System.Windows.Forms.CheckBox();
this.EulerFilter = new System.Windows.Forms.CheckBox();
this.FbxBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.scaleFactor)).BeginInit();
this.geometryBox.SuspendLayout();
this.groupBox1.SuspendLayout();
this.panel1.SuspendLayout();
this.groupBox2.SuspendLayout();
@ -69,154 +58,26 @@
((System.ComponentModel.ISupportInitialize)(this.filterPrecision)).BeginInit();
this.SuspendLayout();
//
// FbxBox
// OKbutton
//
this.FbxBox.AutoSize = true;
this.FbxBox.Controls.Add(this.scaleFactor);
this.FbxBox.Controls.Add(this.convertDummies);
this.FbxBox.Controls.Add(this.scaleLabel);
this.FbxBox.Controls.Add(this.exportDeformers);
this.FbxBox.Controls.Add(this.geometryBox);
this.FbxBox.Location = new System.Drawing.Point(12, 12);
this.FbxBox.Name = "FbxBox";
this.FbxBox.Size = new System.Drawing.Size(247, 235);
this.FbxBox.TabIndex = 0;
this.FbxBox.TabStop = false;
this.FbxBox.Text = "Fbx Ascii";
this.OKbutton.Location = new System.Drawing.Point(321, 240);
this.OKbutton.Name = "OKbutton";
this.OKbutton.Size = new System.Drawing.Size(75, 21);
this.OKbutton.TabIndex = 6;
this.OKbutton.Text = "OK";
this.OKbutton.UseVisualStyleBackColor = true;
this.OKbutton.Click += new System.EventHandler(this.fbxOKbutton_Click);
//
// scaleFactor
// Cancel
//
this.scaleFactor.DecimalPlaces = 2;
this.scaleFactor.Increment = new decimal(new int[] {
1,
0,
0,
131072});
this.scaleFactor.Location = new System.Drawing.Point(95, 194);
this.scaleFactor.Name = "scaleFactor";
this.scaleFactor.Size = new System.Drawing.Size(46, 21);
this.scaleFactor.TabIndex = 1;
this.scaleFactor.Value = new decimal(new int[] {
254,
0,
0,
131072});
//
// convertDummies
//
this.convertDummies.AutoSize = true;
this.convertDummies.Location = new System.Drawing.Point(6, 170);
this.convertDummies.Name = "convertDummies";
this.convertDummies.Size = new System.Drawing.Size(228, 16);
this.convertDummies.TabIndex = 5;
this.convertDummies.Text = "Convert Deforming Dummies to Bones";
this.convertDummies.UseVisualStyleBackColor = true;
this.convertDummies.CheckedChanged += new System.EventHandler(this.exportOpnions_CheckedChanged);
//
// scaleLabel
//
this.scaleLabel.AutoSize = true;
this.scaleLabel.Location = new System.Drawing.Point(6, 196);
this.scaleLabel.Name = "scaleLabel";
this.scaleLabel.Size = new System.Drawing.Size(83, 12);
this.scaleLabel.TabIndex = 0;
this.scaleLabel.Text = "Scale Factor:";
//
// exportDeformers
//
this.exportDeformers.AutoSize = true;
this.exportDeformers.Location = new System.Drawing.Point(6, 148);
this.exportDeformers.Name = "exportDeformers";
this.exportDeformers.Size = new System.Drawing.Size(108, 16);
this.exportDeformers.TabIndex = 1;
this.exportDeformers.Text = "Skin Deformers";
this.exportDeformers.UseVisualStyleBackColor = true;
this.exportDeformers.CheckedChanged += new System.EventHandler(this.exportDeformers_CheckedChanged);
//
// geometryBox
//
this.geometryBox.AutoSize = true;
this.geometryBox.Controls.Add(this.exportColors);
this.geometryBox.Controls.Add(this.exportUVs);
this.geometryBox.Controls.Add(this.exportTangents);
this.geometryBox.Controls.Add(this.exportNormals);
this.geometryBox.Location = new System.Drawing.Point(6, 20);
this.geometryBox.Name = "geometryBox";
this.geometryBox.Size = new System.Drawing.Size(235, 122);
this.geometryBox.TabIndex = 0;
this.geometryBox.TabStop = false;
this.geometryBox.Text = "Geometry";
//
// exportColors
//
this.exportColors.AutoSize = true;
this.exportColors.Checked = true;
this.exportColors.CheckState = System.Windows.Forms.CheckState.Checked;
this.exportColors.Location = new System.Drawing.Point(6, 86);
this.exportColors.Name = "exportColors";
this.exportColors.Size = new System.Drawing.Size(102, 16);
this.exportColors.TabIndex = 3;
this.exportColors.Text = "Vertex Colors";
this.exportColors.UseVisualStyleBackColor = true;
this.exportColors.CheckedChanged += new System.EventHandler(this.exportOpnions_CheckedChanged);
//
// exportUVs
//
this.exportUVs.AutoSize = true;
this.exportUVs.Checked = true;
this.exportUVs.CheckState = System.Windows.Forms.CheckState.Checked;
this.exportUVs.Location = new System.Drawing.Point(6, 64);
this.exportUVs.Name = "exportUVs";
this.exportUVs.Size = new System.Drawing.Size(108, 16);
this.exportUVs.TabIndex = 2;
this.exportUVs.Text = "UV Coordinates";
this.exportUVs.UseVisualStyleBackColor = true;
this.exportUVs.CheckedChanged += new System.EventHandler(this.exportOpnions_CheckedChanged);
//
// exportTangents
//
this.exportTangents.AutoSize = true;
this.exportTangents.Location = new System.Drawing.Point(6, 42);
this.exportTangents.Name = "exportTangents";
this.exportTangents.Size = new System.Drawing.Size(72, 16);
this.exportTangents.TabIndex = 1;
this.exportTangents.Text = "Tangents";
this.exportTangents.UseVisualStyleBackColor = true;
this.exportTangents.CheckedChanged += new System.EventHandler(this.exportOpnions_CheckedChanged);
//
// exportNormals
//
this.exportNormals.AutoSize = true;
this.exportNormals.Checked = true;
this.exportNormals.CheckState = System.Windows.Forms.CheckState.Checked;
this.exportNormals.Location = new System.Drawing.Point(6, 20);
this.exportNormals.Name = "exportNormals";
this.exportNormals.Size = new System.Drawing.Size(66, 16);
this.exportNormals.TabIndex = 0;
this.exportNormals.Text = "Normals";
this.exportNormals.UseVisualStyleBackColor = true;
this.exportNormals.CheckedChanged += new System.EventHandler(this.exportOpnions_CheckedChanged);
//
// fbxOKbutton
//
this.fbxOKbutton.Location = new System.Drawing.Point(323, 346);
this.fbxOKbutton.Name = "fbxOKbutton";
this.fbxOKbutton.Size = new System.Drawing.Size(75, 21);
this.fbxOKbutton.TabIndex = 6;
this.fbxOKbutton.Text = "OK";
this.fbxOKbutton.UseVisualStyleBackColor = true;
this.fbxOKbutton.Click += new System.EventHandler(this.fbxOKbutton_Click);
//
// fbxCancel
//
this.fbxCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.fbxCancel.Location = new System.Drawing.Point(404, 346);
this.fbxCancel.Name = "fbxCancel";
this.fbxCancel.Size = new System.Drawing.Size(75, 21);
this.fbxCancel.TabIndex = 7;
this.fbxCancel.Text = "Cancel";
this.fbxCancel.UseVisualStyleBackColor = true;
this.fbxCancel.Click += new System.EventHandler(this.fbxCancel_Click);
this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.Cancel.Location = new System.Drawing.Point(402, 240);
this.Cancel.Name = "Cancel";
this.Cancel.Size = new System.Drawing.Size(75, 21);
this.Cancel.TabIndex = 7;
this.Cancel.Text = "Cancel";
this.Cancel.UseVisualStyleBackColor = true;
this.Cancel.Click += new System.EventHandler(this.Cancel_Click);
//
// groupBox1
//
@ -224,9 +85,9 @@
this.groupBox1.Controls.Add(this.convertAudio);
this.groupBox1.Controls.Add(this.panel1);
this.groupBox1.Controls.Add(this.converttexture);
this.groupBox1.Location = new System.Drawing.Point(12, 253);
this.groupBox1.Location = new System.Drawing.Point(232, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(247, 114);
this.groupBox1.Size = new System.Drawing.Size(245, 114);
this.groupBox1.TabIndex = 9;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Convert";
@ -300,6 +161,8 @@
// groupBox2
//
this.groupBox2.AutoSize = true;
this.groupBox2.Controls.Add(this.fbxFormat);
this.groupBox2.Controls.Add(this.label4);
this.groupBox2.Controls.Add(this.fbxVersion);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Controls.Add(this.flatInbetween);
@ -311,12 +174,33 @@
this.groupBox2.Controls.Add(this.allBones);
this.groupBox2.Controls.Add(this.allFrames);
this.groupBox2.Controls.Add(this.EulerFilter);
this.groupBox2.Location = new System.Drawing.Point(265, 12);
this.groupBox2.Location = new System.Drawing.Point(12, 12);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(214, 235);
this.groupBox2.Size = new System.Drawing.Size(214, 249);
this.groupBox2.TabIndex = 11;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Fbx Binary";
this.groupBox2.Text = "Fbx";
//
// fbxFormat
//
this.fbxFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.fbxFormat.FormattingEnabled = true;
this.fbxFormat.Items.AddRange(new object[] {
"Binary",
"Ascii"});
this.fbxFormat.Location = new System.Drawing.Point(75, 180);
this.fbxFormat.Name = "fbxFormat";
this.fbxFormat.Size = new System.Drawing.Size(61, 20);
this.fbxFormat.TabIndex = 18;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(4, 183);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(59, 12);
this.label4.TabIndex = 17;
this.label4.Text = "FBXFormat";
//
// fbxVersion
//
@ -329,7 +213,7 @@
"7.3",
"7.4",
"7.5"});
this.fbxVersion.Location = new System.Drawing.Point(77, 178);
this.fbxVersion.Location = new System.Drawing.Point(75, 209);
this.fbxVersion.Name = "fbxVersion";
this.fbxVersion.Size = new System.Drawing.Size(47, 20);
this.fbxVersion.TabIndex = 16;
@ -337,7 +221,7 @@
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(6, 181);
this.label3.Location = new System.Drawing.Point(4, 212);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(65, 12);
this.label3.TabIndex = 15;
@ -449,16 +333,15 @@
//
// ExportOptions
//
this.AcceptButton = this.fbxOKbutton;
this.AcceptButton = this.OKbutton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.fbxCancel;
this.ClientSize = new System.Drawing.Size(493, 382);
this.CancelButton = this.Cancel;
this.ClientSize = new System.Drawing.Size(490, 275);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.fbxCancel);
this.Controls.Add(this.fbxOKbutton);
this.Controls.Add(this.FbxBox);
this.Controls.Add(this.Cancel);
this.Controls.Add(this.OKbutton);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ExportOptions";
@ -467,11 +350,6 @@
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Export options";
this.TopMost = true;
this.FbxBox.ResumeLayout(false);
this.FbxBox.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.scaleFactor)).EndInit();
this.geometryBox.ResumeLayout(false);
this.geometryBox.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.panel1.ResumeLayout(false);
@ -486,19 +364,8 @@
}
#endregion
private System.Windows.Forms.GroupBox FbxBox;
private System.Windows.Forms.NumericUpDown scaleFactor;
private System.Windows.Forms.Label scaleLabel;
private System.Windows.Forms.CheckBox exportDeformers;
private System.Windows.Forms.GroupBox geometryBox;
private System.Windows.Forms.CheckBox exportColors;
private System.Windows.Forms.CheckBox exportUVs;
private System.Windows.Forms.CheckBox exportTangents;
private System.Windows.Forms.CheckBox exportNormals;
private System.Windows.Forms.Button fbxOKbutton;
private System.Windows.Forms.Button fbxCancel;
private System.Windows.Forms.CheckBox convertDummies;
private System.Windows.Forms.Button OKbutton;
private System.Windows.Forms.Button Cancel;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.CheckBox converttexture;
private System.Windows.Forms.RadioButton tojpg;
@ -518,5 +385,7 @@
private System.Windows.Forms.CheckBox EulerFilter;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox fbxVersion;
private System.Windows.Forms.ComboBox fbxFormat;
private System.Windows.Forms.Label label4;
}
}

View File

@ -15,14 +15,6 @@ namespace AssetStudio
public ExportOptions()
{
InitializeComponent();
exportNormals.Checked = (bool)Properties.Settings.Default["exportNormals"];
exportTangents.Checked = (bool)Properties.Settings.Default["exportTangents"];
exportUVs.Checked = (bool)Properties.Settings.Default["exportUVs"];
exportColors.Checked = (bool)Properties.Settings.Default["exportColors"];
exportDeformers.Checked = (bool)Properties.Settings.Default["exportDeformers"];
convertDummies.Checked = (bool)Properties.Settings.Default["convertDummies"];
convertDummies.Enabled = (bool)Properties.Settings.Default["exportDeformers"];
scaleFactor.Value = (decimal)Properties.Settings.Default["scaleFactor"];
converttexture.Checked = (bool)Properties.Settings.Default["convertTexture"];
convertAudio.Checked = (bool)Properties.Settings.Default["convertAudio"];
var str = (string)Properties.Settings.Default["convertType"];
@ -42,6 +34,7 @@ namespace AssetStudio
boneSize.Value = (decimal)Properties.Settings.Default["boneSize"];
flatInbetween.Checked = (bool)Properties.Settings.Default["flatInbetween"];
fbxVersion.SelectedIndex = (int)Properties.Settings.Default["fbxVersion"];
fbxFormat.SelectedIndex = (int)Properties.Settings.Default["fbxFormat"];
}
private void exportOpnions_CheckedChanged(object sender, EventArgs e)
@ -52,12 +45,6 @@ namespace AssetStudio
private void fbxOKbutton_Click(object sender, EventArgs e)
{
Properties.Settings.Default["exportNormals"] = exportNormals.Checked;
Properties.Settings.Default["exportTangents"] = exportTangents.Checked;
Properties.Settings.Default["exportUVs"] = exportUVs.Checked;
Properties.Settings.Default["exportColors"] = exportColors.Checked;
Properties.Settings.Default["exportDeformers"] = exportDeformers.Checked;
Properties.Settings.Default["scaleFactor"] = scaleFactor.Value;
Properties.Settings.Default["convertTexture"] = converttexture.Checked;
Properties.Settings.Default["convertAudio"] = convertAudio.Checked;
foreach (Control c in panel1.Controls)
@ -76,21 +63,16 @@ namespace AssetStudio
Properties.Settings.Default["boneSize"] = boneSize.Value;
Properties.Settings.Default["flatInbetween"] = flatInbetween.Checked;
Properties.Settings.Default["fbxVersion"] = fbxVersion.SelectedIndex;
Properties.Settings.Default["fbxFormat"] = fbxFormat.SelectedIndex;
Properties.Settings.Default.Save();
DialogResult = DialogResult.OK;
Close();
}
private void fbxCancel_Click(object sender, EventArgs e)
private void Cancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
private void exportDeformers_CheckedChanged(object sender, EventArgs e)
{
exportOpnions_CheckedChanged(sender, e);
convertDummies.Enabled = exportDeformers.Checked;
}
}
}

View File

@ -83,90 +83,6 @@ namespace AssetStudio.Properties {
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool exportNormals {
get {
return ((bool)(this["exportNormals"]));
}
set {
this["exportNormals"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool exportTangents {
get {
return ((bool)(this["exportTangents"]));
}
set {
this["exportTangents"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool exportUVs {
get {
return ((bool)(this["exportUVs"]));
}
set {
this["exportUVs"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool exportColors {
get {
return ((bool)(this["exportColors"]));
}
set {
this["exportColors"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("2.54")]
public decimal scaleFactor {
get {
return ((decimal)(this["scaleFactor"]));
}
set {
this["scaleFactor"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool exportDeformers {
get {
return ((bool)(this["exportDeformers"]));
}
set {
this["exportDeformers"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool convertDummies {
get {
return ((bool)(this["convertDummies"]));
}
set {
this["convertDummies"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
@ -310,5 +226,17 @@ namespace AssetStudio.Properties {
this["fbxVersion"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int fbxFormat {
get {
return ((int)(this["fbxFormat"]));
}
set {
this["fbxFormat"] = value;
}
}
}
}

View File

@ -17,27 +17,6 @@
<Setting Name="assetGroupOption" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="exportNormals" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="exportTangents" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="exportUVs" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="exportColors" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="scaleFactor" Type="System.Decimal" Scope="User">
<Value Profile="(Default)">2.54</Value>
</Setting>
<Setting Name="exportDeformers" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="convertDummies" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="convertTexture" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
@ -74,5 +53,8 @@
<Setting Name="fbxVersion" Type="System.Int32" Scope="User">
<Value Profile="(Default)">3</Value>
</Setting>
<Setting Name="fbxFormat" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@ -316,7 +316,8 @@ namespace AssetStudio
var boneSize = (int)(decimal)Properties.Settings.Default["boneSize"];
var flatInbetween = (bool)Properties.Settings.Default["flatInbetween"];
var fbxVersion = (int)Properties.Settings.Default["fbxVersion"];
Fbx.Exporter.Export(exportPath, convert, EulerFilter, filterPrecision, allFrames, allBones, skins, boneSize, flatInbetween, fbxVersion);
var fbxFormat = (int)Properties.Settings.Default["fbxFormat"];
Fbx.Exporter.Export(exportPath, convert, EulerFilter, filterPrecision, allFrames, allBones, skins, boneSize, flatInbetween, fbxVersion, fbxFormat == 1);
return true;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -608,7 +608,7 @@ namespace AssetStudio
});
}
public static void ExportSplitObjects(string savePath, TreeNodeCollection nodes, bool isNew = false)
public static void ExportSplitObjects(string savePath, TreeNodeCollection nodes)
{
ThreadPool.QueueUserWorkItem(state =>
{
@ -643,19 +643,14 @@ namespace AssetStudio
Directory.CreateDirectory(targetPath);
//导出FBX
StatusStripUpdate($"Exporting {filename}.fbx");
if (isNew)
try
{
try
{
ExportGameObject(j.gameObject, targetPath);
}
catch (Exception ex)
{
MessageBox.Show($"{ex.Message}\r\n{ex.StackTrace}");
}
ExportGameObject(j.gameObject, targetPath);
}
catch (Exception ex)
{
MessageBox.Show($"{ex.Message}\r\n{ex.StackTrace}");
}
else
FBXExporter.WriteFBX($"{targetPath}{filename}.fbx", gameObjects);
StatusStripUpdate($"Finished exporting {filename}.fbx");
}
}

View File

@ -22,27 +22,6 @@
<setting name="assetGroupOption" serializeAs="String">
<value>0</value>
</setting>
<setting name="exportNormals" serializeAs="String">
<value>True</value>
</setting>
<setting name="exportTangents" serializeAs="String">
<value>False</value>
</setting>
<setting name="exportUVs" serializeAs="String">
<value>True</value>
</setting>
<setting name="exportColors" serializeAs="String">
<value>True</value>
</setting>
<setting name="scaleFactor" serializeAs="String">
<value>2.54</value>
</setting>
<setting name="exportDeformers" serializeAs="String">
<value>True</value>
</setting>
<setting name="convertDummies" serializeAs="String">
<value>True</value>
</setting>
<setting name="convertTexture" serializeAs="String">
<value>True</value>
</setting>
@ -79,6 +58,9 @@
<setting name="fbxVersion" serializeAs="String">
<value>3</value>
</setting>
<setting name="fbxFormat" serializeAs="String">
<value>0</value>
</setting>
</AssetStudio.Properties.Settings>
</userSettings>
</configuration>

View File

@ -48,8 +48,8 @@ namespace AssetStudio {
ref class Exporter
{
public:
static void Export(String^ path, IImported^ imported, bool EulerFilter, float filterPrecision, bool allFrames, bool allBones, bool skins, float boneSize, bool flatInbetween, int versionIndex);
static void ExportMorph(String^ path, IImported^ imported, bool morphMask, bool flatInbetween, bool skins, float boneSize, int versionIndex);
static void Export(String^ path, IImported^ imported, bool EulerFilter, float filterPrecision, bool allFrames, bool allBones, bool skins, float boneSize, bool flatInbetween, int versionIndex, bool isAscii);
static void ExportMorph(String^ path, IImported^ imported, bool morphMask, bool flatInbetween, bool skins, float boneSize, int versionIndex, bool isAscii);
private:
HashSet<String^>^ frameNames;
@ -66,7 +66,7 @@ namespace AssetStudio {
FbxArray<FbxFileTexture*>* pTextures;
FbxArray<FbxNode*>* pMeshNodes;
Exporter(String^ path, IImported^ imported, bool allFrames, bool allBones, bool skins, float boneSize, int versionIndex, bool normals);
Exporter(String^ path, IImported^ imported, bool allFrames, bool allBones, bool skins, float boneSize, int versionIndex, bool isAscii, bool normals);
~Exporter();
void Exporter::LinkTexture(ImportedMaterial^ mat, int attIndex, FbxFileTexture* pTexture, FbxProperty& prop);

View File

@ -4,7 +4,7 @@
namespace AssetStudio
{
void Fbx::Exporter::Export(String^ path, IImported^ imported, bool EulerFilter, float filterPrecision, bool allFrames, bool allBones, bool skins, float boneSize, bool flatInbetween, int versionIndex)
void Fbx::Exporter::Export(String^ path, IImported^ imported, bool EulerFilter, float filterPrecision, bool allFrames, bool allBones, bool skins, float boneSize, bool flatInbetween, int versionIndex, bool isAscii)
{
FileInfo^ file = gcnew FileInfo(path);
DirectoryInfo^ dir = file->Directory;
@ -16,7 +16,7 @@ namespace AssetStudio
Directory::SetCurrentDirectory(dir->FullName);
path = Path::GetFileName(path);
Exporter^ exporter = gcnew Exporter(path, imported, allFrames, allBones, skins, boneSize, versionIndex, true);
Exporter^ exporter = gcnew Exporter(path, imported, allFrames, allBones, skins, boneSize, versionIndex, isAscii, true);
exporter->ExportMorphs(imported, false, flatInbetween);
exporter->ExportAnimations(EulerFilter, filterPrecision, flatInbetween);
exporter->pExporter->Export(exporter->pScene);
@ -25,7 +25,7 @@ namespace AssetStudio
Directory::SetCurrentDirectory(currentDir);
}
void Fbx::Exporter::ExportMorph(String^ path, IImported^ imported, bool morphMask, bool flatInbetween, bool skins, float boneSize, int versionIndex)
void Fbx::Exporter::ExportMorph(String^ path, IImported^ imported, bool morphMask, bool flatInbetween, bool skins, float boneSize, int versionIndex, bool isAscii)
{
FileInfo^ file = gcnew FileInfo(path);
DirectoryInfo^ dir = file->Directory;
@ -37,7 +37,7 @@ namespace AssetStudio
Directory::SetCurrentDirectory(dir->FullName);
path = Path::GetFileName(path);
Exporter^ exporter = gcnew Exporter(path, imported, false, true, skins, boneSize, versionIndex, false);
Exporter^ exporter = gcnew Exporter(path, imported, false, true, skins, boneSize, versionIndex, isAscii, false);
exporter->ExportMorphs(imported, morphMask, flatInbetween);
exporter->pExporter->Export(exporter->pScene);
delete exporter;
@ -45,7 +45,7 @@ namespace AssetStudio
Directory::SetCurrentDirectory(currentDir);
}
Fbx::Exporter::Exporter(String^ path, IImported^ imported, bool allFrames, bool allBones, bool skins, float boneSize, int versionIndex, bool normals)
Fbx::Exporter::Exporter(String^ path, IImported^ imported, bool allFrames, bool allBones, bool skins, float boneSize, int versionIndex, bool isAscii, bool normals)
{
this->imported = imported;
exportSkins = skins;
@ -80,10 +80,18 @@ namespace AssetStudio
if (versionIndex == 0)
{
pFileFormat = 3;
if (isAscii)
{
pFileFormat = 4;
}
}
else
{
pExporter->SetFileExportVersion(FBXVersion[versionIndex]);
if (isAscii)
{
pFileFormat = 1;
}
}
if (!pExporter->Initialize(cDest, pFileFormat, pSdkManager->GetIOSettings()))