mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-19 06:22:01 +08:00
Added ability to manually select animations in ModelForm
This commit is contained in:
Generated
+79
-6
@@ -82,6 +82,11 @@
|
|||||||
this.ToolsDragPanel = new System.Windows.Forms.Panel();
|
this.ToolsDragPanel = new System.Windows.Forms.Panel();
|
||||||
this.ToolsPanelShowButton = new System.Windows.Forms.Button();
|
this.ToolsPanelShowButton = new System.Windows.Forms.Button();
|
||||||
this.SaveFileDialog = new System.Windows.Forms.SaveFileDialog();
|
this.SaveFileDialog = new System.Windows.Forms.SaveFileDialog();
|
||||||
|
this.EnableRootMotionCheckBox = new System.Windows.Forms.CheckBox();
|
||||||
|
this.label22 = new System.Windows.Forms.Label();
|
||||||
|
this.ClipComboBox = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label21 = new System.Windows.Forms.Label();
|
||||||
|
this.ClipDictComboBox = new System.Windows.Forms.ComboBox();
|
||||||
this.StatusStrip.SuspendLayout();
|
this.StatusStrip.SuspendLayout();
|
||||||
this.ConsolePanel.SuspendLayout();
|
this.ConsolePanel.SuspendLayout();
|
||||||
this.ToolsPanel.SuspendLayout();
|
this.ToolsPanel.SuspendLayout();
|
||||||
@@ -172,7 +177,7 @@
|
|||||||
this.ToolsPanel.Controls.Add(this.ToolsDragPanel);
|
this.ToolsPanel.Controls.Add(this.ToolsDragPanel);
|
||||||
this.ToolsPanel.Location = new System.Drawing.Point(12, 12);
|
this.ToolsPanel.Location = new System.Drawing.Point(12, 12);
|
||||||
this.ToolsPanel.Name = "ToolsPanel";
|
this.ToolsPanel.Name = "ToolsPanel";
|
||||||
this.ToolsPanel.Size = new System.Drawing.Size(218, 559);
|
this.ToolsPanel.Size = new System.Drawing.Size(230, 559);
|
||||||
this.ToolsPanel.TabIndex = 2;
|
this.ToolsPanel.TabIndex = 2;
|
||||||
this.ToolsPanel.Visible = false;
|
this.ToolsPanel.Visible = false;
|
||||||
//
|
//
|
||||||
@@ -181,7 +186,7 @@
|
|||||||
this.MainToolbarPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
this.MainToolbarPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.MainToolbarPanel.BackColor = System.Drawing.SystemColors.ControlDark;
|
this.MainToolbarPanel.BackColor = System.Drawing.SystemColors.ControlDark;
|
||||||
this.MainToolbarPanel.Controls.Add(this.MainToolbar);
|
this.MainToolbarPanel.Controls.Add(this.MainToolbar);
|
||||||
this.MainToolbarPanel.Location = new System.Drawing.Point(181, 2);
|
this.MainToolbarPanel.Location = new System.Drawing.Point(193, 2);
|
||||||
this.MainToolbarPanel.Name = "MainToolbarPanel";
|
this.MainToolbarPanel.Name = "MainToolbarPanel";
|
||||||
this.MainToolbarPanel.Size = new System.Drawing.Size(34, 24);
|
this.MainToolbarPanel.Size = new System.Drawing.Size(34, 24);
|
||||||
this.MainToolbarPanel.TabIndex = 4;
|
this.MainToolbarPanel.TabIndex = 4;
|
||||||
@@ -238,16 +243,21 @@
|
|||||||
this.ToolsTabControl.Location = new System.Drawing.Point(2, 30);
|
this.ToolsTabControl.Location = new System.Drawing.Point(2, 30);
|
||||||
this.ToolsTabControl.Name = "ToolsTabControl";
|
this.ToolsTabControl.Name = "ToolsTabControl";
|
||||||
this.ToolsTabControl.SelectedIndex = 0;
|
this.ToolsTabControl.SelectedIndex = 0;
|
||||||
this.ToolsTabControl.Size = new System.Drawing.Size(213, 526);
|
this.ToolsTabControl.Size = new System.Drawing.Size(225, 526);
|
||||||
this.ToolsTabControl.TabIndex = 1;
|
this.ToolsTabControl.TabIndex = 1;
|
||||||
//
|
//
|
||||||
// ToolsModelsTabPage
|
// ToolsModelsTabPage
|
||||||
//
|
//
|
||||||
|
this.ToolsModelsTabPage.Controls.Add(this.EnableRootMotionCheckBox);
|
||||||
|
this.ToolsModelsTabPage.Controls.Add(this.label22);
|
||||||
|
this.ToolsModelsTabPage.Controls.Add(this.ClipComboBox);
|
||||||
|
this.ToolsModelsTabPage.Controls.Add(this.label21);
|
||||||
|
this.ToolsModelsTabPage.Controls.Add(this.ClipDictComboBox);
|
||||||
this.ToolsModelsTabPage.Controls.Add(this.ModelsTreeView);
|
this.ToolsModelsTabPage.Controls.Add(this.ModelsTreeView);
|
||||||
this.ToolsModelsTabPage.Location = new System.Drawing.Point(4, 22);
|
this.ToolsModelsTabPage.Location = new System.Drawing.Point(4, 22);
|
||||||
this.ToolsModelsTabPage.Name = "ToolsModelsTabPage";
|
this.ToolsModelsTabPage.Name = "ToolsModelsTabPage";
|
||||||
this.ToolsModelsTabPage.Padding = new System.Windows.Forms.Padding(3);
|
this.ToolsModelsTabPage.Padding = new System.Windows.Forms.Padding(3);
|
||||||
this.ToolsModelsTabPage.Size = new System.Drawing.Size(205, 500);
|
this.ToolsModelsTabPage.Size = new System.Drawing.Size(217, 500);
|
||||||
this.ToolsModelsTabPage.TabIndex = 0;
|
this.ToolsModelsTabPage.TabIndex = 0;
|
||||||
this.ToolsModelsTabPage.Text = "Models";
|
this.ToolsModelsTabPage.Text = "Models";
|
||||||
this.ToolsModelsTabPage.UseVisualStyleBackColor = true;
|
this.ToolsModelsTabPage.UseVisualStyleBackColor = true;
|
||||||
@@ -261,7 +271,7 @@
|
|||||||
this.ModelsTreeView.Location = new System.Drawing.Point(0, 3);
|
this.ModelsTreeView.Location = new System.Drawing.Point(0, 3);
|
||||||
this.ModelsTreeView.Name = "ModelsTreeView";
|
this.ModelsTreeView.Name = "ModelsTreeView";
|
||||||
this.ModelsTreeView.ShowRootLines = false;
|
this.ModelsTreeView.ShowRootLines = false;
|
||||||
this.ModelsTreeView.Size = new System.Drawing.Size(205, 497);
|
this.ModelsTreeView.Size = new System.Drawing.Size(217, 422);
|
||||||
this.ModelsTreeView.TabIndex = 1;
|
this.ModelsTreeView.TabIndex = 1;
|
||||||
this.ModelsTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.ModelsTreeView_AfterCheck);
|
this.ModelsTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.ModelsTreeView_AfterCheck);
|
||||||
this.ModelsTreeView.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.ModelsTreeView_NodeMouseDoubleClick);
|
this.ModelsTreeView.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.ModelsTreeView_NodeMouseDoubleClick);
|
||||||
@@ -680,7 +690,7 @@
|
|||||||
this.ToolsDragPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
this.ToolsDragPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.ToolsDragPanel.Cursor = System.Windows.Forms.Cursors.VSplit;
|
this.ToolsDragPanel.Cursor = System.Windows.Forms.Cursors.VSplit;
|
||||||
this.ToolsDragPanel.Location = new System.Drawing.Point(215, 0);
|
this.ToolsDragPanel.Location = new System.Drawing.Point(227, 0);
|
||||||
this.ToolsDragPanel.Name = "ToolsDragPanel";
|
this.ToolsDragPanel.Name = "ToolsDragPanel";
|
||||||
this.ToolsDragPanel.Size = new System.Drawing.Size(4, 559);
|
this.ToolsDragPanel.Size = new System.Drawing.Size(4, 559);
|
||||||
this.ToolsDragPanel.TabIndex = 17;
|
this.ToolsDragPanel.TabIndex = 17;
|
||||||
@@ -702,6 +712,63 @@
|
|||||||
//
|
//
|
||||||
this.SaveFileDialog.Filter = "All files|*.*";
|
this.SaveFileDialog.Filter = "All files|*.*";
|
||||||
//
|
//
|
||||||
|
// EnableRootMotionCheckBox
|
||||||
|
//
|
||||||
|
this.EnableRootMotionCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.EnableRootMotionCheckBox.AutoSize = true;
|
||||||
|
this.EnableRootMotionCheckBox.Location = new System.Drawing.Point(50, 483);
|
||||||
|
this.EnableRootMotionCheckBox.Name = "EnableRootMotionCheckBox";
|
||||||
|
this.EnableRootMotionCheckBox.Size = new System.Drawing.Size(114, 17);
|
||||||
|
this.EnableRootMotionCheckBox.TabIndex = 37;
|
||||||
|
this.EnableRootMotionCheckBox.Text = "Enable root motion";
|
||||||
|
this.EnableRootMotionCheckBox.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// label22
|
||||||
|
//
|
||||||
|
this.label22.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.label22.AutoSize = true;
|
||||||
|
this.label22.Location = new System.Drawing.Point(23, 461);
|
||||||
|
this.label22.Name = "label22";
|
||||||
|
this.label22.Size = new System.Drawing.Size(27, 13);
|
||||||
|
this.label22.TabIndex = 36;
|
||||||
|
this.label22.Text = "Clip:";
|
||||||
|
//
|
||||||
|
// ClipComboBox
|
||||||
|
//
|
||||||
|
this.ClipComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.ClipComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||||
|
this.ClipComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
|
||||||
|
this.ClipComboBox.FormattingEnabled = true;
|
||||||
|
this.ClipComboBox.Location = new System.Drawing.Point(50, 458);
|
||||||
|
this.ClipComboBox.Name = "ClipComboBox";
|
||||||
|
this.ClipComboBox.Size = new System.Drawing.Size(167, 21);
|
||||||
|
this.ClipComboBox.TabIndex = 35;
|
||||||
|
this.ClipComboBox.TextChanged += new System.EventHandler(this.ClipComboBox_TextChanged);
|
||||||
|
//
|
||||||
|
// label21
|
||||||
|
//
|
||||||
|
this.label21.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.label21.AutoSize = true;
|
||||||
|
this.label21.Location = new System.Drawing.Point(1, 434);
|
||||||
|
this.label21.Name = "label21";
|
||||||
|
this.label21.Size = new System.Drawing.Size(49, 13);
|
||||||
|
this.label21.TabIndex = 34;
|
||||||
|
this.label21.Text = "Clip Dict:";
|
||||||
|
//
|
||||||
|
// ClipDictComboBox
|
||||||
|
//
|
||||||
|
this.ClipDictComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.ClipDictComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||||
|
this.ClipDictComboBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
|
||||||
|
this.ClipDictComboBox.FormattingEnabled = true;
|
||||||
|
this.ClipDictComboBox.Location = new System.Drawing.Point(50, 431);
|
||||||
|
this.ClipDictComboBox.Name = "ClipDictComboBox";
|
||||||
|
this.ClipDictComboBox.Size = new System.Drawing.Size(167, 21);
|
||||||
|
this.ClipDictComboBox.TabIndex = 33;
|
||||||
|
this.ClipDictComboBox.TextChanged += new System.EventHandler(this.ClipDictComboBox_TextChanged);
|
||||||
|
//
|
||||||
// ModelForm
|
// ModelForm
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
@@ -734,6 +801,7 @@
|
|||||||
this.MainToolbar.PerformLayout();
|
this.MainToolbar.PerformLayout();
|
||||||
this.ToolsTabControl.ResumeLayout(false);
|
this.ToolsTabControl.ResumeLayout(false);
|
||||||
this.ToolsModelsTabPage.ResumeLayout(false);
|
this.ToolsModelsTabPage.ResumeLayout(false);
|
||||||
|
this.ToolsModelsTabPage.PerformLayout();
|
||||||
this.ToolsMaterialsTabPage.ResumeLayout(false);
|
this.ToolsMaterialsTabPage.ResumeLayout(false);
|
||||||
this.ToolsDetailsTabPage.ResumeLayout(false);
|
this.ToolsDetailsTabPage.ResumeLayout(false);
|
||||||
this.ToolsOptionsTabPage.ResumeLayout(false);
|
this.ToolsOptionsTabPage.ResumeLayout(false);
|
||||||
@@ -798,5 +866,10 @@
|
|||||||
private System.Windows.Forms.ToolStripMenuItem SaveMenuButton;
|
private System.Windows.Forms.ToolStripMenuItem SaveMenuButton;
|
||||||
private System.Windows.Forms.ToolStripMenuItem SaveAsMenuButton;
|
private System.Windows.Forms.ToolStripMenuItem SaveAsMenuButton;
|
||||||
private System.Windows.Forms.SaveFileDialog SaveFileDialog;
|
private System.Windows.Forms.SaveFileDialog SaveFileDialog;
|
||||||
|
private System.Windows.Forms.CheckBox EnableRootMotionCheckBox;
|
||||||
|
private System.Windows.Forms.Label label22;
|
||||||
|
private System.Windows.Forms.ComboBox ClipComboBox;
|
||||||
|
private System.Windows.Forms.Label label21;
|
||||||
|
private System.Windows.Forms.ComboBox ClipDictComboBox;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+142
-22
@@ -101,12 +101,20 @@ namespace CodeWalker.Forms
|
|||||||
|
|
||||||
|
|
||||||
ModelMatForm materialForm = null;
|
ModelMatForm materialForm = null;
|
||||||
private bool modelModified = false;
|
bool modelModified = false;
|
||||||
|
|
||||||
ExploreForm exploreForm = null;
|
ExploreForm exploreForm = null;
|
||||||
RpfFileEntry rpfFileEntry = null;
|
RpfFileEntry rpfFileEntry = null;
|
||||||
|
|
||||||
|
|
||||||
|
bool animsInited = false;
|
||||||
|
YcdFile Ycd = null;
|
||||||
|
ClipMapEntry AnimClip = null;
|
||||||
|
|
||||||
|
MetaHash ModelHash;
|
||||||
|
Archetype ModelArchetype = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public ModelForm(ExploreForm ExpForm = null)
|
public ModelForm(ExploreForm ExpForm = null)
|
||||||
{
|
{
|
||||||
@@ -314,6 +322,11 @@ namespace CodeWalker.Forms
|
|||||||
timecycle.SetTime(Renderer.timeofday);
|
timecycle.SetTime(Renderer.timeofday);
|
||||||
//UpdateStatus("Timecycles loaded.");
|
//UpdateStatus("Timecycles loaded.");
|
||||||
}
|
}
|
||||||
|
if (!animsInited)
|
||||||
|
{
|
||||||
|
InitAnimation();
|
||||||
|
animsInited = true;
|
||||||
|
}
|
||||||
if (Renderer.renderskydome)
|
if (Renderer.renderskydome)
|
||||||
{
|
{
|
||||||
if (!weather.Inited)
|
if (!weather.Inited)
|
||||||
@@ -355,6 +368,35 @@ namespace CodeWalker.Forms
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void InitAnimation()
|
||||||
|
{
|
||||||
|
if (InvokeRequired)
|
||||||
|
{
|
||||||
|
BeginInvoke(new Action(() => { InitAnimation(); }));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClipComboBox.Items.Clear();
|
||||||
|
ClipDictComboBox.Items.Clear();
|
||||||
|
var ycds = gameFileCache.YcdDict.Values.ToList();
|
||||||
|
ycds.Sort((a, b) => { return a.Name.CompareTo(b.Name); });
|
||||||
|
ClipDictComboBox.AutoCompleteCustomSource.Clear();
|
||||||
|
List<string> ycdlist = new List<string>();
|
||||||
|
foreach (var ycde in ycds)
|
||||||
|
{
|
||||||
|
ycdlist.Add(ycde.GetShortName());
|
||||||
|
}
|
||||||
|
ClipDictComboBox.AutoCompleteCustomSource.AddRange(ycdlist.ToArray());
|
||||||
|
ClipDictComboBox.Text = "";
|
||||||
|
|
||||||
|
TrySelectClipDict();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void LoadSettings()
|
private void LoadSettings()
|
||||||
{
|
{
|
||||||
@@ -479,17 +521,13 @@ namespace CodeWalker.Forms
|
|||||||
private void RenderSingleItem()
|
private void RenderSingleItem()
|
||||||
{
|
{
|
||||||
|
|
||||||
uint hash = 0;
|
|
||||||
Archetype arch = null;
|
|
||||||
|
|
||||||
if (Ydr != null)
|
if (Ydr != null)
|
||||||
{
|
{
|
||||||
if (Ydr.Loaded)
|
if (Ydr.Loaded)
|
||||||
{
|
{
|
||||||
hash = Ydr?.RpfFileEntry?.ShortNameHash ?? 0;
|
if (ModelArchetype == null) ModelArchetype = TryGetArchetype(ModelHash);
|
||||||
arch = TryGetArchetype(hash);
|
|
||||||
|
|
||||||
Renderer.RenderDrawable(Ydr.Drawable, arch, null, hash);
|
Renderer.RenderDrawable(Ydr.Drawable, ModelArchetype, null, ModelHash, null, null, AnimClip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Ydd != null)
|
else if (Ydd != null)
|
||||||
@@ -501,9 +539,9 @@ namespace CodeWalker.Forms
|
|||||||
{
|
{
|
||||||
if (!DrawableDrawFlags.ContainsKey(kvp.Value))//only render if it's checked...
|
if (!DrawableDrawFlags.ContainsKey(kvp.Value))//only render if it's checked...
|
||||||
{
|
{
|
||||||
arch = TryGetArchetype(kvp.Key);
|
var arch = TryGetArchetype(kvp.Key);
|
||||||
|
|
||||||
Renderer.RenderDrawable(kvp.Value, arch, null, Ydd.RpfFileEntry.ShortNameHash);
|
Renderer.RenderDrawable(kvp.Value, arch, null, Ydd.RpfFileEntry.ShortNameHash, null, null, AnimClip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -516,9 +554,9 @@ namespace CodeWalker.Forms
|
|||||||
{
|
{
|
||||||
if (!DrawableDrawFlags.ContainsKey(kvp.Value))//only render if it's checked...
|
if (!DrawableDrawFlags.ContainsKey(kvp.Value))//only render if it's checked...
|
||||||
{
|
{
|
||||||
arch = TryGetArchetype(kvp.Key);
|
if (ModelArchetype == null) ModelArchetype = TryGetArchetype(kvp.Key);
|
||||||
|
|
||||||
Renderer.RenderDrawable(kvp.Value, arch, null, kvp.Key);
|
Renderer.RenderDrawable(kvp.Value, ModelArchetype, null, kvp.Key, null, null, AnimClip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -531,17 +569,9 @@ namespace CodeWalker.Forms
|
|||||||
{
|
{
|
||||||
var f = Yft.Fragment;
|
var f = Yft.Fragment;
|
||||||
|
|
||||||
hash = Yft.RpfFileEntry?.ShortNameHash ?? 0;
|
if (ModelArchetype == null) ModelArchetype = TryGetArchetype(ModelHash);
|
||||||
|
|
||||||
var namelower = Yft.RpfFileEntry?.GetShortNameLower();
|
Renderer.RenderFragment(ModelArchetype, null, f, ModelHash, AnimClip);
|
||||||
if (namelower?.EndsWith("_hi") ?? false)
|
|
||||||
{
|
|
||||||
hash = JenkHash.GenHash(namelower.Substring(0, namelower.Length - 3));
|
|
||||||
}
|
|
||||||
|
|
||||||
arch = TryGetArchetype(hash);
|
|
||||||
|
|
||||||
Renderer.RenderFragment(arch, null, f, hash);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -577,6 +607,11 @@ namespace CodeWalker.Forms
|
|||||||
FileName = ydr.Name;
|
FileName = ydr.Name;
|
||||||
Ydr = ydr;
|
Ydr = ydr;
|
||||||
rpfFileEntry = Ydr.RpfFileEntry;
|
rpfFileEntry = Ydr.RpfFileEntry;
|
||||||
|
ModelHash = Ydr.RpfFileEntry?.ShortNameHash ?? 0;
|
||||||
|
if (ModelHash != 0)
|
||||||
|
{
|
||||||
|
ModelArchetype = TryGetArchetype(ModelHash);
|
||||||
|
}
|
||||||
|
|
||||||
if (ydr.Drawable != null)
|
if (ydr.Drawable != null)
|
||||||
{
|
{
|
||||||
@@ -614,6 +649,17 @@ namespace CodeWalker.Forms
|
|||||||
FileName = yft.Name;
|
FileName = yft.Name;
|
||||||
Yft = yft;
|
Yft = yft;
|
||||||
rpfFileEntry = Yft.RpfFileEntry;
|
rpfFileEntry = Yft.RpfFileEntry;
|
||||||
|
ModelHash = Yft.RpfFileEntry?.ShortNameHash ?? 0;
|
||||||
|
var namelower = Yft.RpfFileEntry?.GetShortNameLower();
|
||||||
|
if (namelower?.EndsWith("_hi") ?? false)
|
||||||
|
{
|
||||||
|
ModelHash = JenkHash.GenHash(namelower.Substring(0, namelower.Length - 3));
|
||||||
|
}
|
||||||
|
if (ModelHash != 0)
|
||||||
|
{
|
||||||
|
ModelArchetype = TryGetArchetype(ModelHash);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var dr = yft.Fragment?.Drawable;
|
var dr = yft.Fragment?.Drawable;
|
||||||
if (dr != null)
|
if (dr != null)
|
||||||
@@ -680,7 +726,14 @@ namespace CodeWalker.Forms
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void TrySelectClipDict()
|
||||||
|
{
|
||||||
|
if (ModelArchetype != null)
|
||||||
|
{
|
||||||
|
var str = ModelArchetype.ClipDict.ToCleanString();
|
||||||
|
ClipDictComboBox.Text = str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -728,6 +781,63 @@ namespace CodeWalker.Forms
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void LoadClipDict(string name)
|
||||||
|
{
|
||||||
|
if (gameFileCache == null) return;
|
||||||
|
if (!gameFileCache.IsInited) return;//what to do here? wait for it..?
|
||||||
|
|
||||||
|
var ycdhash = JenkHash.GenHash(name.ToLowerInvariant());
|
||||||
|
var ycd = gameFileCache.GetYcd(ycdhash);
|
||||||
|
while ((ycd != null) && (!ycd.Loaded))
|
||||||
|
{
|
||||||
|
Thread.Sleep(20);//kinda hacky
|
||||||
|
ycd = gameFileCache.GetYcd(ycdhash);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ycd = ycd;
|
||||||
|
|
||||||
|
ClipComboBox.Items.Clear();
|
||||||
|
ClipComboBox.Items.Add("");
|
||||||
|
|
||||||
|
if (ycd?.ClipMapEntries == null)
|
||||||
|
{
|
||||||
|
ClipComboBox.SelectedIndex = 0;
|
||||||
|
AnimClip = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> items = new List<string>();
|
||||||
|
foreach (var cme in ycd.ClipMapEntries)
|
||||||
|
{
|
||||||
|
if (cme.Clip != null)
|
||||||
|
{
|
||||||
|
items.Add(cme.Clip.ShortName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
items.Sort();
|
||||||
|
foreach (var item in items)
|
||||||
|
{
|
||||||
|
ClipComboBox.Items.Add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SelectClip(string name)
|
||||||
|
{
|
||||||
|
MetaHash cliphash = JenkHash.GenHash(name);
|
||||||
|
ClipMapEntry cme = null;
|
||||||
|
Ycd?.ClipMap?.TryGetValue(cliphash, out cme);
|
||||||
|
AnimClip = cme;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void UpdateTimeOfDayLabel()
|
private void UpdateTimeOfDayLabel()
|
||||||
{
|
{
|
||||||
int v = TimeOfDayTrackBar.Value;
|
int v = TimeOfDayTrackBar.Value;
|
||||||
@@ -1865,5 +1975,15 @@ namespace CodeWalker.Forms
|
|||||||
{
|
{
|
||||||
Save(true);
|
Save(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ClipDictComboBox_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
LoadClipDict(ClipDictComboBox.Text);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ClipComboBox_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SelectClip(ClipComboBox.Text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+12
-13
@@ -76,6 +76,7 @@
|
|||||||
this.PedNameComboBox = new System.Windows.Forms.ComboBox();
|
this.PedNameComboBox = new System.Windows.Forms.ComboBox();
|
||||||
this.StatsUpdateTimer = new System.Windows.Forms.Timer(this.components);
|
this.StatsUpdateTimer = new System.Windows.Forms.Timer(this.components);
|
||||||
this.ToolsPedTabPage = new System.Windows.Forms.TabPage();
|
this.ToolsPedTabPage = new System.Windows.Forms.TabPage();
|
||||||
|
this.EnableRootMotionCheckBox = new System.Windows.Forms.CheckBox();
|
||||||
this.label23 = new System.Windows.Forms.Label();
|
this.label23 = new System.Windows.Forms.Label();
|
||||||
this.label22 = new System.Windows.Forms.Label();
|
this.label22 = new System.Windows.Forms.Label();
|
||||||
this.ClipComboBox = new System.Windows.Forms.ComboBox();
|
this.ClipComboBox = new System.Windows.Forms.ComboBox();
|
||||||
@@ -108,7 +109,6 @@
|
|||||||
this.label4 = new System.Windows.Forms.Label();
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
this.ToolsTabControl = new System.Windows.Forms.TabControl();
|
this.ToolsTabControl = new System.Windows.Forms.TabControl();
|
||||||
this.ToolsPanel = new System.Windows.Forms.Panel();
|
this.ToolsPanel = new System.Windows.Forms.Panel();
|
||||||
this.EnableRootMotionCheckBox = new System.Windows.Forms.CheckBox();
|
|
||||||
this.ConsolePanel.SuspendLayout();
|
this.ConsolePanel.SuspendLayout();
|
||||||
this.ToolsOptionsTabPage.SuspendLayout();
|
this.ToolsOptionsTabPage.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.TimeOfDayTrackBar)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.TimeOfDayTrackBar)).BeginInit();
|
||||||
@@ -697,6 +697,17 @@
|
|||||||
this.ToolsPedTabPage.Text = "Ped";
|
this.ToolsPedTabPage.Text = "Ped";
|
||||||
this.ToolsPedTabPage.UseVisualStyleBackColor = true;
|
this.ToolsPedTabPage.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
|
// EnableRootMotionCheckBox
|
||||||
|
//
|
||||||
|
this.EnableRootMotionCheckBox.AutoSize = true;
|
||||||
|
this.EnableRootMotionCheckBox.Location = new System.Drawing.Point(54, 503);
|
||||||
|
this.EnableRootMotionCheckBox.Name = "EnableRootMotionCheckBox";
|
||||||
|
this.EnableRootMotionCheckBox.Size = new System.Drawing.Size(114, 17);
|
||||||
|
this.EnableRootMotionCheckBox.TabIndex = 32;
|
||||||
|
this.EnableRootMotionCheckBox.Text = "Enable root motion";
|
||||||
|
this.EnableRootMotionCheckBox.UseVisualStyleBackColor = true;
|
||||||
|
this.EnableRootMotionCheckBox.CheckedChanged += new System.EventHandler(this.EnableRootMotionCheckBox_CheckedChanged);
|
||||||
|
//
|
||||||
// label23
|
// label23
|
||||||
//
|
//
|
||||||
this.label23.AutoSize = true;
|
this.label23.AutoSize = true;
|
||||||
@@ -726,7 +737,6 @@
|
|||||||
this.ClipComboBox.Name = "ClipComboBox";
|
this.ClipComboBox.Name = "ClipComboBox";
|
||||||
this.ClipComboBox.Size = new System.Drawing.Size(182, 21);
|
this.ClipComboBox.Size = new System.Drawing.Size(182, 21);
|
||||||
this.ClipComboBox.TabIndex = 29;
|
this.ClipComboBox.TabIndex = 29;
|
||||||
this.ClipComboBox.SelectedIndexChanged += new System.EventHandler(this.ClipComboBox_SelectedIndexChanged);
|
|
||||||
this.ClipComboBox.TextChanged += new System.EventHandler(this.ClipComboBox_TextChanged);
|
this.ClipComboBox.TextChanged += new System.EventHandler(this.ClipComboBox_TextChanged);
|
||||||
//
|
//
|
||||||
// label21
|
// label21
|
||||||
@@ -1066,17 +1076,6 @@
|
|||||||
this.ToolsPanel.TabIndex = 7;
|
this.ToolsPanel.TabIndex = 7;
|
||||||
this.ToolsPanel.Visible = false;
|
this.ToolsPanel.Visible = false;
|
||||||
//
|
//
|
||||||
// EnableRootMotionCheckBox
|
|
||||||
//
|
|
||||||
this.EnableRootMotionCheckBox.AutoSize = true;
|
|
||||||
this.EnableRootMotionCheckBox.Location = new System.Drawing.Point(54, 503);
|
|
||||||
this.EnableRootMotionCheckBox.Name = "EnableRootMotionCheckBox";
|
|
||||||
this.EnableRootMotionCheckBox.Size = new System.Drawing.Size(114, 17);
|
|
||||||
this.EnableRootMotionCheckBox.TabIndex = 32;
|
|
||||||
this.EnableRootMotionCheckBox.Text = "Enable root motion";
|
|
||||||
this.EnableRootMotionCheckBox.UseVisualStyleBackColor = true;
|
|
||||||
this.EnableRootMotionCheckBox.CheckedChanged += new System.EventHandler(this.EnableRootMotionCheckBox_CheckedChanged);
|
|
||||||
//
|
|
||||||
// PedsForm
|
// PedsForm
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
|||||||
+2
-17
@@ -1007,24 +1007,14 @@ namespace CodeWalker.Peds
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<string> items = new List<string>();
|
List<string> items = new List<string>();
|
||||||
|
|
||||||
foreach (var cme in ycd.ClipMapEntries)
|
foreach (var cme in ycd.ClipMapEntries)
|
||||||
{
|
{
|
||||||
var animclip = cme.Clip as ClipAnimation;
|
if (cme.Clip != null)
|
||||||
if (animclip != null)
|
|
||||||
{
|
{
|
||||||
items.Add(animclip.ShortName);
|
items.Add(cme.Clip.ShortName);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
var animcliplist = cme.Clip as ClipAnimationList;
|
|
||||||
if (animcliplist?.Animations?.Data != null)
|
|
||||||
{
|
|
||||||
items.Add(animcliplist.ShortName);
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
items.Sort();
|
items.Sort();
|
||||||
foreach (var item in items)
|
foreach (var item in items)
|
||||||
{
|
{
|
||||||
@@ -1871,11 +1861,6 @@ namespace CodeWalker.Peds
|
|||||||
LoadClipDict(ClipDictComboBox.Text);
|
LoadClipDict(ClipDictComboBox.Text);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ClipComboBox_SelectedIndexChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
SelectClip(ClipComboBox.Text);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ClipComboBox_TextChanged(object sender, EventArgs e)
|
private void ClipComboBox_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SelectClip(ClipComboBox.Text);
|
SelectClip(ClipComboBox.Text);
|
||||||
|
|||||||
@@ -2255,14 +2255,14 @@ namespace CodeWalker.Rendering
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public bool RenderFragment(Archetype arch, YmapEntityDef ent, FragType f, uint txdhash = 0)
|
public bool RenderFragment(Archetype arch, YmapEntityDef ent, FragType f, uint txdhash = 0, ClipMapEntry animClip = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
RenderDrawable(f.Drawable, arch, ent, txdhash);
|
RenderDrawable(f.Drawable, arch, ent, txdhash, null, null, animClip);
|
||||||
|
|
||||||
if (f.Drawable2 != null) //cloth
|
if (f.Drawable2 != null) //cloth
|
||||||
{
|
{
|
||||||
RenderDrawable(f.Drawable2, arch, ent, txdhash);
|
RenderDrawable(f.Drawable2, arch, ent, txdhash, null, null, animClip);
|
||||||
}
|
}
|
||||||
|
|
||||||
//vehicle wheels...
|
//vehicle wheels...
|
||||||
@@ -2308,7 +2308,7 @@ namespace CodeWalker.Rendering
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
||||||
RenderDrawable(pch.Drawable1, arch, ent, txdhash);
|
RenderDrawable(pch.Drawable1, arch, ent, txdhash, null, null, animClip);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2318,7 +2318,7 @@ namespace CodeWalker.Rendering
|
|||||||
{ }
|
{ }
|
||||||
if ((pch.Drawable2 != null) && (pch.Drawable2.AllModels.Length != 0))
|
if ((pch.Drawable2 != null) && (pch.Drawable2.AllModels.Length != 0))
|
||||||
{
|
{
|
||||||
RenderDrawable(pch.Drawable2, arch, ent, txdhash);
|
RenderDrawable(pch.Drawable2, arch, ent, txdhash, null, null, animClip);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ }
|
{ }
|
||||||
@@ -2385,7 +2385,7 @@ namespace CodeWalker.Rendering
|
|||||||
//dwbl.VertexDecls = dwblcopy.VertexDecls;
|
//dwbl.VertexDecls = dwblcopy.VertexDecls;
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderDrawable(dwbl, arch, ent, txdhash);
|
RenderDrawable(dwbl, arch, ent, txdhash /*, null, null, animClip*/);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user