Fixed ModelForm controls anchoring, use archetype bounds for camera position in ModelForm

This commit is contained in:
dexy 2022-01-11 04:59:25 +11:00
parent e461de4cfd
commit 0f92b25b7b
3 changed files with 47 additions and 31 deletions

View File

@ -420,7 +420,7 @@
this.ClipComboBox.FormattingEnabled = true; this.ClipComboBox.FormattingEnabled = true;
this.ClipComboBox.Location = new System.Drawing.Point(50, 458); this.ClipComboBox.Location = new System.Drawing.Point(50, 458);
this.ClipComboBox.Name = "ClipComboBox"; this.ClipComboBox.Name = "ClipComboBox";
this.ClipComboBox.Size = new System.Drawing.Size(167, 21); this.ClipComboBox.Size = new System.Drawing.Size(191, 21);
this.ClipComboBox.TabIndex = 35; this.ClipComboBox.TabIndex = 35;
this.ClipComboBox.TextChanged += new System.EventHandler(this.ClipComboBox_TextChanged); this.ClipComboBox.TextChanged += new System.EventHandler(this.ClipComboBox_TextChanged);
// //
@ -443,7 +443,7 @@
this.ClipDictComboBox.FormattingEnabled = true; this.ClipDictComboBox.FormattingEnabled = true;
this.ClipDictComboBox.Location = new System.Drawing.Point(50, 431); this.ClipDictComboBox.Location = new System.Drawing.Point(50, 431);
this.ClipDictComboBox.Name = "ClipDictComboBox"; this.ClipDictComboBox.Name = "ClipDictComboBox";
this.ClipDictComboBox.Size = new System.Drawing.Size(167, 21); this.ClipDictComboBox.Size = new System.Drawing.Size(191, 21);
this.ClipDictComboBox.TabIndex = 33; this.ClipDictComboBox.TabIndex = 33;
this.ClipDictComboBox.TextChanged += new System.EventHandler(this.ClipDictComboBox_TextChanged); this.ClipDictComboBox.TextChanged += new System.EventHandler(this.ClipDictComboBox_TextChanged);
// //
@ -456,7 +456,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(217, 422); this.ModelsTreeView.Size = new System.Drawing.Size(241, 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);
@ -526,7 +526,7 @@
this.DetailsPropertyGrid.Name = "DetailsPropertyGrid"; this.DetailsPropertyGrid.Name = "DetailsPropertyGrid";
this.DetailsPropertyGrid.PropertySort = System.Windows.Forms.PropertySort.NoSort; this.DetailsPropertyGrid.PropertySort = System.Windows.Forms.PropertySort.NoSort;
this.DetailsPropertyGrid.ReadOnly = true; this.DetailsPropertyGrid.ReadOnly = true;
this.DetailsPropertyGrid.Size = new System.Drawing.Size(217, 497); this.DetailsPropertyGrid.Size = new System.Drawing.Size(241, 497);
this.DetailsPropertyGrid.TabIndex = 1; this.DetailsPropertyGrid.TabIndex = 1;
this.DetailsPropertyGrid.ToolbarVisible = false; this.DetailsPropertyGrid.ToolbarVisible = false;
// //
@ -596,7 +596,7 @@
"Texture coord 3"}); "Texture coord 3"});
this.RenderModeComboBox.Location = new System.Drawing.Point(86, 15); this.RenderModeComboBox.Location = new System.Drawing.Point(86, 15);
this.RenderModeComboBox.Name = "RenderModeComboBox"; this.RenderModeComboBox.Name = "RenderModeComboBox";
this.RenderModeComboBox.Size = new System.Drawing.Size(114, 21); this.RenderModeComboBox.Size = new System.Drawing.Size(132, 21);
this.RenderModeComboBox.TabIndex = 12; this.RenderModeComboBox.TabIndex = 12;
this.RenderModeComboBox.SelectedIndexChanged += new System.EventHandler(this.RenderModeComboBox_SelectedIndexChanged); this.RenderModeComboBox.SelectedIndexChanged += new System.EventHandler(this.RenderModeComboBox_SelectedIndexChanged);
// //
@ -677,7 +677,7 @@
"Texture coord 3"}); "Texture coord 3"});
this.TextureCoordsComboBox.Location = new System.Drawing.Point(86, 69); this.TextureCoordsComboBox.Location = new System.Drawing.Point(86, 69);
this.TextureCoordsComboBox.Name = "TextureCoordsComboBox"; this.TextureCoordsComboBox.Name = "TextureCoordsComboBox";
this.TextureCoordsComboBox.Size = new System.Drawing.Size(114, 21); this.TextureCoordsComboBox.Size = new System.Drawing.Size(132, 21);
this.TextureCoordsComboBox.TabIndex = 16; this.TextureCoordsComboBox.TabIndex = 16;
this.TextureCoordsComboBox.SelectedIndexChanged += new System.EventHandler(this.TextureCoordsComboBox_SelectedIndexChanged); this.TextureCoordsComboBox.SelectedIndexChanged += new System.EventHandler(this.TextureCoordsComboBox_SelectedIndexChanged);
// //
@ -688,7 +688,7 @@
this.TextureSamplerComboBox.FormattingEnabled = true; this.TextureSamplerComboBox.FormattingEnabled = true;
this.TextureSamplerComboBox.Location = new System.Drawing.Point(86, 42); this.TextureSamplerComboBox.Location = new System.Drawing.Point(86, 42);
this.TextureSamplerComboBox.Name = "TextureSamplerComboBox"; this.TextureSamplerComboBox.Name = "TextureSamplerComboBox";
this.TextureSamplerComboBox.Size = new System.Drawing.Size(114, 21); this.TextureSamplerComboBox.Size = new System.Drawing.Size(132, 21);
this.TextureSamplerComboBox.TabIndex = 14; this.TextureSamplerComboBox.TabIndex = 14;
this.TextureSamplerComboBox.SelectedIndexChanged += new System.EventHandler(this.TextureSamplerComboBox_SelectedIndexChanged); this.TextureSamplerComboBox.SelectedIndexChanged += new System.EventHandler(this.TextureSamplerComboBox_SelectedIndexChanged);
// //
@ -745,7 +745,7 @@
"100"}); "100"});
this.GridCountComboBox.Location = new System.Drawing.Point(86, 308); this.GridCountComboBox.Location = new System.Drawing.Point(86, 308);
this.GridCountComboBox.Name = "GridCountComboBox"; this.GridCountComboBox.Name = "GridCountComboBox";
this.GridCountComboBox.Size = new System.Drawing.Size(114, 21); this.GridCountComboBox.Size = new System.Drawing.Size(132, 21);
this.GridCountComboBox.TabIndex = 21; this.GridCountComboBox.TabIndex = 21;
this.GridCountComboBox.SelectedIndexChanged += new System.EventHandler(this.GridCountComboBox_SelectedIndexChanged); this.GridCountComboBox.SelectedIndexChanged += new System.EventHandler(this.GridCountComboBox_SelectedIndexChanged);
// //
@ -780,7 +780,7 @@
"100"}); "100"});
this.GridSizeComboBox.Location = new System.Drawing.Point(86, 281); this.GridSizeComboBox.Location = new System.Drawing.Point(86, 281);
this.GridSizeComboBox.Name = "GridSizeComboBox"; this.GridSizeComboBox.Name = "GridSizeComboBox";
this.GridSizeComboBox.Size = new System.Drawing.Size(114, 21); this.GridSizeComboBox.Size = new System.Drawing.Size(132, 21);
this.GridSizeComboBox.TabIndex = 19; this.GridSizeComboBox.TabIndex = 19;
this.GridSizeComboBox.SelectedIndexChanged += new System.EventHandler(this.GridSizeComboBox_SelectedIndexChanged); this.GridSizeComboBox.SelectedIndexChanged += new System.EventHandler(this.GridSizeComboBox_SelectedIndexChanged);
// //
@ -820,7 +820,7 @@
this.OptionsLightingTabPage.Location = new System.Drawing.Point(4, 22); this.OptionsLightingTabPage.Location = new System.Drawing.Point(4, 22);
this.OptionsLightingTabPage.Name = "OptionsLightingTabPage"; this.OptionsLightingTabPage.Name = "OptionsLightingTabPage";
this.OptionsLightingTabPage.Padding = new System.Windows.Forms.Padding(3); this.OptionsLightingTabPage.Padding = new System.Windows.Forms.Padding(3);
this.OptionsLightingTabPage.Size = new System.Drawing.Size(209, 474); this.OptionsLightingTabPage.Size = new System.Drawing.Size(233, 474);
this.OptionsLightingTabPage.TabIndex = 1; this.OptionsLightingTabPage.TabIndex = 1;
this.OptionsLightingTabPage.Text = "Lighting"; this.OptionsLightingTabPage.Text = "Lighting";
this.OptionsLightingTabPage.UseVisualStyleBackColor = true; this.OptionsLightingTabPage.UseVisualStyleBackColor = true;
@ -880,7 +880,7 @@
this.TimeOfDayTrackBar.Location = new System.Drawing.Point(3, 163); this.TimeOfDayTrackBar.Location = new System.Drawing.Point(3, 163);
this.TimeOfDayTrackBar.Maximum = 1440; this.TimeOfDayTrackBar.Maximum = 1440;
this.TimeOfDayTrackBar.Name = "TimeOfDayTrackBar"; this.TimeOfDayTrackBar.Name = "TimeOfDayTrackBar";
this.TimeOfDayTrackBar.Size = new System.Drawing.Size(205, 45); this.TimeOfDayTrackBar.Size = new System.Drawing.Size(229, 45);
this.TimeOfDayTrackBar.TabIndex = 6; this.TimeOfDayTrackBar.TabIndex = 6;
this.TimeOfDayTrackBar.TickFrequency = 60; this.TimeOfDayTrackBar.TickFrequency = 60;
this.TimeOfDayTrackBar.Value = 720; this.TimeOfDayTrackBar.Value = 720;

View File

@ -730,7 +730,15 @@ namespace CodeWalker.Forms
if (ydr.Drawable != null) if (ydr.Drawable != null)
{ {
MoveCameraToView(ydr.Drawable.BoundingCenter, ydr.Drawable.BoundingSphereRadius); var cen = ydr.Drawable.BoundingCenter;
var rad = ydr.Drawable.BoundingSphereRadius;
if (ModelArchetype != null)
{
cen = ModelArchetype.BSCenter;
rad = ModelArchetype.BSRadius;
}
MoveCameraToView(cen, rad);
Skeleton = ydr.Drawable.Skeleton; Skeleton = ydr.Drawable.Skeleton;
} }
@ -800,7 +808,15 @@ namespace CodeWalker.Forms
var dr = yft.Fragment?.Drawable; var dr = yft.Fragment?.Drawable;
if (dr != null) if (dr != null)
{ {
MoveCameraToView(dr.BoundingCenter, dr.BoundingSphereRadius); var cen = dr.BoundingCenter;
var rad = dr.BoundingSphereRadius;
if (ModelArchetype != null)
{
cen = ModelArchetype.BSCenter;
rad = ModelArchetype.BSRadius;
}
MoveCameraToView(cen, rad);
Skeleton = dr.Skeleton; Skeleton = dr.Skeleton;
} }

View File

@ -131,18 +131,18 @@
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0I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rqD3d09vH2zxaSzs16I4hi30NqqQ11dHdRqNQgrozENDg5yj6SCfFhaWmYj/ZKhL57PwznpxNDQMLq7 99Ed7O7u4e2bLSadnfVCFMe4hdZWHerq6qBWq0FYGY1pcHCQeyQV5MPS0jIb6ZcMffF8Hs5JJ4aGhtHd
DdBoNKiurkZxcTEIywRGYw+sD6wYl0jc7qds2pz3GWYkwomJSdhsj2AymdDWpkdDQwPKy8uRn5+fJCAZ bYBGo0F1dTWKi4tBWCYwGntgfWDFuETidj9l0+a8zzAjEU5MTMJmewSTyYS2Nj0aGhpQXl6O/Pz8JAHJ
ZrMZBoOBTbKN2CA+FlnyqH0UVutDaXwmtLd3QBAEVFVVobCwEDU1NckWyAjqsbm5GZ0dnTAajFyNVm9P MJvNMBgMbJJtxAbxsciSR+2jsFofSuMzob29A4IgoKqqCoWFhaipqUm2QEZQj83Nzejs6ITRYORqtHp7
L7q67vPoVCoVg0pKSpCbmwu73Z40kUZBIyFpjY2NaNI0oaVFC61Wy6SCoIZSqeTKBM7Ly0N2djbi8Xhy etHVdZ9Hp1KpGFRSUoLc3FzY7fakiTQKGglJa2xsRJOmCS0tWmi1WiYVBDWUSiVXJnBeXh6ys7MRj8eT
jKm34AmFQqioqGCDamsVUCgUXLFSXomysjIUFBQgJycH6enp8Pl8vx8Sxe1T9vv9KC0tRVFRES/qlcwi Y0y9BU8oFEJFRQUbVFurgEKh4IqV8kqUlZWhoKAAOTk5SE9Ph8/n+/2QKG6fst/vR2lpKYqKinhRr2QW
yRkZGcjKymIw5f73PxArSRNFkasTIDMzE3K5nHtOyb77mf4M6ovMIYdpTLRoT2d0l0pLhUz2EyCChEMn Sc7IyEBWVhaDKfe//4FYSZooilydAJmZmZDL5dxzSvbdz/RnUF9kDjlMY6JFezqju1RaKmSyn++nhCv9
c3MnAAAAAElFTkSuQmCC J3dAAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="ToolbarTextureEditorButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="ToolbarTextureEditorButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@ -157,12 +157,12 @@
<data name="ToolbarLightEditorButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="ToolbarLightEditorButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEdSURBVDhPnZI7boQwEIY5wh4hR8gRcpQcJQV9aqocJUdI YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEeSURBVDhPnZJNboQwDIU5whyhR+gRepQepQv2XbPqUXqE
w0NAESGEEAhwwav0+iO2Fzksq+SXRtY8/n/GY3suhBCXeZ7flmURwzDIruskp/IlcV12DMiq8KttW5kk bvgRsKgQQggEZMHfMpOPJhmUMozaJ1lRbL9nx47nQghxmef5bVkWMQyD7LpOcqq7xK/TjgFZJX61bSuT
iQzD0FoURbKua0Q+dPlv0AHynuiaFjmehLHdzq4xCXWacsM0Tc/c1RT2fS/VlazhQybHXtZ1fdHUHxDY JJFhGFqLokjWdY3Ih07/DSpA3hNd0yLHndC2W9k1OiFPU26YpumZt5rEvu+lepI17pCJMZd1XV809Qc4
C0Aqy1JmWSaLongsANi0KYrjeBNJ03Q78YmTH8eR2EXTblAC7yxpP4URMLHTl0BVJT+rqrLFCDRNs/nE 9gKQyrKUWZbJoigeCwAmbZLiON5E0jTdTu74iY/jiO+iaTcogXeGtO/CCBjf6SZQVcHPqqpsMgJN02x3
eebD7gYk1YjfeZ7brhivw/ZPyQZqQa/ufzh9fxd0YaGuHW7+HiD4vm/tXwKu/VVABEGwdefUAk86/Rh8 /Kz5sLoBQdXid57ntirGdpj+KdlADejV/Q+n+3dBFQbq2uHk7wGC7/vW/iXg2l8FRBAEW3VOLfCkw4/B
bbVIwU9UO7nT3fOukLMAQJKEVWEAAAAASUVORK5CYII= 11brE/xENZM71T3vCpBKAD1CW/uhAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="ToolbarMoveButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="ToolbarMoveButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">