diff --git a/CodeWalker.Core/GameFiles/Resources/Drawable.cs b/CodeWalker.Core/GameFiles/Resources/Drawable.cs index fa9123d..0cdc9f6 100644 --- a/CodeWalker.Core/GameFiles/Resources/Drawable.cs +++ b/CodeWalker.Core/GameFiles/Resources/Drawable.cs @@ -4547,7 +4547,45 @@ namespace CodeWalker.GameFiles public MetaHash ProjectedTextureHash { get; set; } public uint Unknown_A4h { get; set; } // 0x00000000 - public bool HasChanged = false; //used by model light form + public bool UpdateRenderable = false; //used by model light form + + + public Quaternion Orientation + { + get + { + Vector3 tx = new Vector3(); + Vector3 ty = new Vector3(); + + switch (Type) + { + case LightType.Point: + return Quaternion.Identity; + case LightType.Spot: + tx = Vector3.Normalize(Tangent); + ty = Vector3.Normalize(Vector3.Cross(Direction, Tangent)); + break; + case LightType.Capsule: + tx = -Vector3.Normalize(Tangent); + ty = Vector3.Normalize(Vector3.Cross(Direction, Tangent)); + break; + } + + var m = new Matrix(); + m.Row1 = new Vector4(tx, 0); + m.Row2 = new Vector4(ty, 0); + m.Row3 = new Vector4(Direction, 0); + return Quaternion.RotationMatrix(m); + } + set + { + var inv = Quaternion.Invert(Orientation); + var delta = value * inv; + Direction = Vector3.Normalize(delta.Multiply(Direction)); + Tangent = Vector3.Normalize(delta.Multiply(Tangent)); + } + } + public override void Read(ResourceDataReader reader, params object[] parameters) { @@ -4729,39 +4767,6 @@ namespace CodeWalker.GameFiles ProjectedTextureHash = XmlMeta.GetHash(Xml.GetChildInnerText(node, "ProjectedTextureHash")); } - public Quaternion GetRotation() - { - Vector3 tx = new Vector3(); - Vector3 ty = new Vector3(); - - switch (Type) - { - case LightType.Point: - return Quaternion.Identity; - case LightType.Spot: - tx = Vector3.Normalize(Direction.GetPerpVec()); - ty = Vector3.Normalize(Vector3.Cross(Direction, Tangent)); - break; - case LightType.Capsule: - tx = -Vector3.Normalize(Direction.GetPerpVec()); - ty = Vector3.Normalize(Vector3.Cross(Direction, Tangent)); - break; - } - - var m = new Matrix(); - m.Row1 = new Vector4(tx, 0); - m.Row2 = new Vector4(ty, 0); - m.Row3 = new Vector4(Direction, 0); - return Quaternion.RotationMatrix(m); - } - - public void SetRotation(Quaternion rot) - { - var inv = Quaternion.Invert(GetRotation()); - var delta = rot * inv; - Direction = Vector3.Normalize(delta.Multiply(Direction)); - Tangent = Vector3.Normalize(Direction.GetPerpVec()); - } } diff --git a/CodeWalker/Forms/ModelForm.Designer.cs b/CodeWalker/Forms/ModelForm.Designer.cs index 733f0e0..f3ca898 100644 --- a/CodeWalker/Forms/ModelForm.Designer.cs +++ b/CodeWalker/Forms/ModelForm.Designer.cs @@ -40,6 +40,14 @@ this.ToolsPanel = new System.Windows.Forms.Panel(); this.MainToolbarPanel = new System.Windows.Forms.Panel(); this.MainToolbar = new System.Windows.Forms.ToolStrip(); + this.ToolbarMaterialEditorButton = new System.Windows.Forms.ToolStripButton(); + this.ToolbarTextureEditorButton = new System.Windows.Forms.ToolStripButton(); + this.ToolbarLightEditorButton = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.ToolbarMoveButton = new System.Windows.Forms.ToolStripButton(); + this.ToolbarRotateButton = new System.Windows.Forms.ToolStripButton(); + this.ToolbarScaleButton = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.SaveButton = new System.Windows.Forms.ToolStripSplitButton(); this.SaveMenuButton = new System.Windows.Forms.ToolStripMenuItem(); this.SaveAsMenuButton = new System.Windows.Forms.ToolStripMenuItem(); @@ -52,13 +60,14 @@ this.ClipDictComboBox = new System.Windows.Forms.ComboBox(); this.ModelsTreeView = new CodeWalker.WinForms.TreeViewFix(); this.ToolsMaterialsTabPage = new System.Windows.Forms.TabPage(); - this.TextureViewerButton = new System.Windows.Forms.Button(); + this.TextureEditorButton = new System.Windows.Forms.Button(); this.TexturesTreeView = new CodeWalker.WinForms.TreeViewFix(); + this.MaterialEditorButton = new System.Windows.Forms.Button(); this.ToolsDetailsTabPage = new System.Windows.Forms.TabPage(); this.DetailsPropertyGrid = new CodeWalker.WinForms.ReadOnlyPropertyGrid(); this.ToolsOptionsTabPage = new System.Windows.Forms.TabPage(); this.OptionsTabControl = new System.Windows.Forms.TabControl(); - this.tabPage1 = new System.Windows.Forms.TabPage(); + this.OptionsRenderTabPage = new System.Windows.Forms.TabPage(); this.RenderModeComboBox = new System.Windows.Forms.ComboBox(); this.FragGlassCheckBox = new System.Windows.Forms.CheckBox(); this.label14 = new System.Windows.Forms.Label(); @@ -78,8 +87,9 @@ this.GridSizeComboBox = new System.Windows.Forms.ComboBox(); this.StatusBarCheckBox = new System.Windows.Forms.CheckBox(); this.label1 = new System.Windows.Forms.Label(); - this.tabPage2 = new System.Windows.Forms.TabPage(); + this.OptionsLightingTabPage = new System.Windows.Forms.TabPage(); this.DeferredShadingCheckBox = new System.Windows.Forms.CheckBox(); + this.LightEditorButton = new System.Windows.Forms.Button(); this.HDLightsCheckBox = new System.Windows.Forms.CheckBox(); this.label19 = new System.Windows.Forms.Label(); this.HDRRenderingCheckBox = new System.Windows.Forms.CheckBox(); @@ -88,9 +98,6 @@ this.ControlLightDirCheckBox = new System.Windows.Forms.CheckBox(); this.SkydomeCheckBox = new System.Windows.Forms.CheckBox(); this.TimeOfDayLabel = new System.Windows.Forms.Label(); - this.tabPage3 = new System.Windows.Forms.TabPage(); - this.LightEditorButton = new System.Windows.Forms.Button(); - this.MaterialEditorButton = new System.Windows.Forms.Button(); this.ToolsPanelHideButton = new System.Windows.Forms.Button(); this.ToolsDragPanel = new System.Windows.Forms.Panel(); this.ToolsPanelShowButton = new System.Windows.Forms.Button(); @@ -106,10 +113,9 @@ this.ToolsDetailsTabPage.SuspendLayout(); this.ToolsOptionsTabPage.SuspendLayout(); this.OptionsTabControl.SuspendLayout(); - this.tabPage1.SuspendLayout(); - this.tabPage2.SuspendLayout(); + this.OptionsRenderTabPage.SuspendLayout(); + this.OptionsLightingTabPage.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.TimeOfDayTrackBar)).BeginInit(); - this.tabPage3.SuspendLayout(); this.SuspendLayout(); // // StatsUpdateTimer @@ -195,27 +201,110 @@ // // MainToolbarPanel // - 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.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.MainToolbarPanel.BackColor = System.Drawing.SystemColors.ControlDark; this.MainToolbarPanel.Controls.Add(this.MainToolbar); - this.MainToolbarPanel.Location = new System.Drawing.Point(193, 2); + this.MainToolbarPanel.Location = new System.Drawing.Point(39, 2); this.MainToolbarPanel.Name = "MainToolbarPanel"; - this.MainToolbarPanel.Size = new System.Drawing.Size(34, 24); + this.MainToolbarPanel.Size = new System.Drawing.Size(188, 24); this.MainToolbarPanel.TabIndex = 4; // // MainToolbar // this.MainToolbar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; this.MainToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.ToolbarMaterialEditorButton, + this.ToolbarTextureEditorButton, + this.ToolbarLightEditorButton, + this.toolStripSeparator1, + this.ToolbarMoveButton, + this.ToolbarRotateButton, + this.ToolbarScaleButton, + this.toolStripSeparator2, this.SaveButton}); this.MainToolbar.Location = new System.Drawing.Point(0, 0); this.MainToolbar.Name = "MainToolbar"; - this.MainToolbar.Size = new System.Drawing.Size(34, 25); + this.MainToolbar.Size = new System.Drawing.Size(188, 25); this.MainToolbar.TabIndex = 7; this.MainToolbar.Text = "Main Toolbar"; // + // ToolbarMaterialEditorButton + // + this.ToolbarMaterialEditorButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.ToolbarMaterialEditorButton.Image = ((System.Drawing.Image)(resources.GetObject("ToolbarMaterialEditorButton.Image"))); + this.ToolbarMaterialEditorButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.ToolbarMaterialEditorButton.Name = "ToolbarMaterialEditorButton"; + this.ToolbarMaterialEditorButton.Size = new System.Drawing.Size(23, 22); + this.ToolbarMaterialEditorButton.Text = "Material Editor"; + this.ToolbarMaterialEditorButton.Click += new System.EventHandler(this.ToolbarMaterialEditorButton_Click); + // + // ToolbarTextureEditorButton + // + this.ToolbarTextureEditorButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.ToolbarTextureEditorButton.Image = ((System.Drawing.Image)(resources.GetObject("ToolbarTextureEditorButton.Image"))); + this.ToolbarTextureEditorButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.ToolbarTextureEditorButton.Name = "ToolbarTextureEditorButton"; + this.ToolbarTextureEditorButton.Size = new System.Drawing.Size(23, 22); + this.ToolbarTextureEditorButton.Text = "Texture Editor"; + this.ToolbarTextureEditorButton.Click += new System.EventHandler(this.ToolbarTextureEditorButton_Click); + // + // ToolbarLightEditorButton + // + this.ToolbarLightEditorButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.ToolbarLightEditorButton.Image = ((System.Drawing.Image)(resources.GetObject("ToolbarLightEditorButton.Image"))); + this.ToolbarLightEditorButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.ToolbarLightEditorButton.Name = "ToolbarLightEditorButton"; + this.ToolbarLightEditorButton.Size = new System.Drawing.Size(23, 22); + this.ToolbarLightEditorButton.Text = "Light Editor"; + this.ToolbarLightEditorButton.Click += new System.EventHandler(this.ToolbarLightEditorButton_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25); + // + // ToolbarMoveButton + // + this.ToolbarMoveButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.ToolbarMoveButton.Image = ((System.Drawing.Image)(resources.GetObject("ToolbarMoveButton.Image"))); + this.ToolbarMoveButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.ToolbarMoveButton.Name = "ToolbarMoveButton"; + this.ToolbarMoveButton.Size = new System.Drawing.Size(23, 22); + this.ToolbarMoveButton.Text = "Move"; + this.ToolbarMoveButton.ToolTipText = "Move"; + this.ToolbarMoveButton.Click += new System.EventHandler(this.ToolbarMoveButton_Click); + // + // ToolbarRotateButton + // + this.ToolbarRotateButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.ToolbarRotateButton.Image = ((System.Drawing.Image)(resources.GetObject("ToolbarRotateButton.Image"))); + this.ToolbarRotateButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.ToolbarRotateButton.Name = "ToolbarRotateButton"; + this.ToolbarRotateButton.Size = new System.Drawing.Size(23, 22); + this.ToolbarRotateButton.Text = "Rotate"; + this.ToolbarRotateButton.ToolTipText = "Rotate"; + this.ToolbarRotateButton.Click += new System.EventHandler(this.ToolbarRotateButton_Click); + // + // ToolbarScaleButton + // + this.ToolbarScaleButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.ToolbarScaleButton.Image = ((System.Drawing.Image)(resources.GetObject("ToolbarScaleButton.Image"))); + this.ToolbarScaleButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.ToolbarScaleButton.Name = "ToolbarScaleButton"; + this.ToolbarScaleButton.Size = new System.Drawing.Size(23, 22); + this.ToolbarScaleButton.Text = "Scale"; + this.ToolbarScaleButton.ToolTipText = "Scale"; + this.ToolbarScaleButton.Click += new System.EventHandler(this.ToolbarScaleButton_Click); + // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25); + // // SaveButton // + this.SaveButton.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; this.SaveButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.SaveButton.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.SaveMenuButton, @@ -223,7 +312,7 @@ this.SaveButton.Image = ((System.Drawing.Image)(resources.GetObject("SaveButton.Image"))); this.SaveButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.SaveButton.Name = "SaveButton"; - this.SaveButton.Size = new System.Drawing.Size(32, 22); + this.SaveButton.Size = new System.Drawing.Size(32, 20); this.SaveButton.Text = "Save"; this.SaveButton.ButtonClick += new System.EventHandler(this.SaveButton_ButtonClick); // @@ -349,8 +438,9 @@ // // ToolsMaterialsTabPage // - this.ToolsMaterialsTabPage.Controls.Add(this.TextureViewerButton); + this.ToolsMaterialsTabPage.Controls.Add(this.TextureEditorButton); this.ToolsMaterialsTabPage.Controls.Add(this.TexturesTreeView); + this.ToolsMaterialsTabPage.Controls.Add(this.MaterialEditorButton); this.ToolsMaterialsTabPage.Location = new System.Drawing.Point(4, 22); this.ToolsMaterialsTabPage.Name = "ToolsMaterialsTabPage"; this.ToolsMaterialsTabPage.Padding = new System.Windows.Forms.Padding(3); @@ -359,27 +449,37 @@ this.ToolsMaterialsTabPage.Text = "Materials"; this.ToolsMaterialsTabPage.UseVisualStyleBackColor = true; // - // TextureViewerButton + // TextureEditorButton // - this.TextureViewerButton.Location = new System.Drawing.Point(111, 6); - this.TextureViewerButton.Name = "TextureViewerButton"; - this.TextureViewerButton.Size = new System.Drawing.Size(91, 23); - this.TextureViewerButton.TabIndex = 2; - this.TextureViewerButton.Text = "Texture viewer"; - this.TextureViewerButton.UseVisualStyleBackColor = true; - this.TextureViewerButton.Click += new System.EventHandler(this.TextureViewerButton_Click); + this.TextureEditorButton.Location = new System.Drawing.Point(111, 3); + this.TextureEditorButton.Name = "TextureEditorButton"; + this.TextureEditorButton.Size = new System.Drawing.Size(100, 23); + this.TextureEditorButton.TabIndex = 2; + this.TextureEditorButton.Text = "Texture editor..."; + this.TextureEditorButton.UseVisualStyleBackColor = true; + this.TextureEditorButton.Click += new System.EventHandler(this.TextureEditorButton_Click); // // TexturesTreeView // this.TexturesTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.TexturesTreeView.Location = new System.Drawing.Point(0, 34); + this.TexturesTreeView.Location = new System.Drawing.Point(0, 32); this.TexturesTreeView.Name = "TexturesTreeView"; this.TexturesTreeView.ShowRootLines = false; - this.TexturesTreeView.Size = new System.Drawing.Size(205, 466); + this.TexturesTreeView.Size = new System.Drawing.Size(217, 468); this.TexturesTreeView.TabIndex = 1; // + // MaterialEditorButton + // + this.MaterialEditorButton.Location = new System.Drawing.Point(6, 3); + this.MaterialEditorButton.Name = "MaterialEditorButton"; + this.MaterialEditorButton.Size = new System.Drawing.Size(100, 23); + this.MaterialEditorButton.TabIndex = 3; + this.MaterialEditorButton.Text = "Material editor..."; + this.MaterialEditorButton.UseVisualStyleBackColor = true; + this.MaterialEditorButton.Click += new System.EventHandler(this.MaterialEditorButton_Click); + // // ToolsDetailsTabPage // this.ToolsDetailsTabPage.Controls.Add(this.DetailsPropertyGrid); @@ -400,7 +500,7 @@ this.DetailsPropertyGrid.Name = "DetailsPropertyGrid"; this.DetailsPropertyGrid.PropertySort = System.Windows.Forms.PropertySort.NoSort; this.DetailsPropertyGrid.ReadOnly = true; - this.DetailsPropertyGrid.Size = new System.Drawing.Size(205, 497); + this.DetailsPropertyGrid.Size = new System.Drawing.Size(217, 497); this.DetailsPropertyGrid.TabIndex = 1; this.DetailsPropertyGrid.ToolbarVisible = false; // @@ -416,9 +516,8 @@ // // OptionsTabControl // - this.OptionsTabControl.Controls.Add(this.tabPage1); - this.OptionsTabControl.Controls.Add(this.tabPage2); - this.OptionsTabControl.Controls.Add(this.tabPage3); + this.OptionsTabControl.Controls.Add(this.OptionsRenderTabPage); + this.OptionsTabControl.Controls.Add(this.OptionsLightingTabPage); this.OptionsTabControl.Dock = System.Windows.Forms.DockStyle.Fill; this.OptionsTabControl.Location = new System.Drawing.Point(0, 0); this.OptionsTabControl.Name = "OptionsTabControl"; @@ -426,34 +525,34 @@ this.OptionsTabControl.Size = new System.Drawing.Size(217, 500); this.OptionsTabControl.TabIndex = 26; // - // tabPage1 + // OptionsRenderTabPage // - this.tabPage1.Controls.Add(this.RenderModeComboBox); - this.tabPage1.Controls.Add(this.FragGlassCheckBox); - this.tabPage1.Controls.Add(this.label14); - this.tabPage1.Controls.Add(this.HDTexturesCheckBox); - this.tabPage1.Controls.Add(this.AnisotropicFilteringCheckBox); - this.tabPage1.Controls.Add(this.SkeletonsCheckBox); - this.tabPage1.Controls.Add(this.label10); - this.tabPage1.Controls.Add(this.TextureCoordsComboBox); - this.tabPage1.Controls.Add(this.TextureSamplerComboBox); - this.tabPage1.Controls.Add(this.label11); - this.tabPage1.Controls.Add(this.WireframeCheckBox); - this.tabPage1.Controls.Add(this.ShowCollisionMeshesCheckBox); - this.tabPage1.Controls.Add(this.GridCheckBox); - this.tabPage1.Controls.Add(this.GridCountComboBox); - this.tabPage1.Controls.Add(this.label2); - this.tabPage1.Controls.Add(this.ErrorConsoleCheckBox); - this.tabPage1.Controls.Add(this.GridSizeComboBox); - this.tabPage1.Controls.Add(this.StatusBarCheckBox); - this.tabPage1.Controls.Add(this.label1); - this.tabPage1.Location = new System.Drawing.Point(4, 22); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(209, 474); - this.tabPage1.TabIndex = 0; - this.tabPage1.Text = "Render"; - this.tabPage1.UseVisualStyleBackColor = true; + this.OptionsRenderTabPage.Controls.Add(this.RenderModeComboBox); + this.OptionsRenderTabPage.Controls.Add(this.FragGlassCheckBox); + this.OptionsRenderTabPage.Controls.Add(this.label14); + this.OptionsRenderTabPage.Controls.Add(this.HDTexturesCheckBox); + this.OptionsRenderTabPage.Controls.Add(this.AnisotropicFilteringCheckBox); + this.OptionsRenderTabPage.Controls.Add(this.SkeletonsCheckBox); + this.OptionsRenderTabPage.Controls.Add(this.label10); + this.OptionsRenderTabPage.Controls.Add(this.TextureCoordsComboBox); + this.OptionsRenderTabPage.Controls.Add(this.TextureSamplerComboBox); + this.OptionsRenderTabPage.Controls.Add(this.label11); + this.OptionsRenderTabPage.Controls.Add(this.WireframeCheckBox); + this.OptionsRenderTabPage.Controls.Add(this.ShowCollisionMeshesCheckBox); + this.OptionsRenderTabPage.Controls.Add(this.GridCheckBox); + this.OptionsRenderTabPage.Controls.Add(this.GridCountComboBox); + this.OptionsRenderTabPage.Controls.Add(this.label2); + this.OptionsRenderTabPage.Controls.Add(this.ErrorConsoleCheckBox); + this.OptionsRenderTabPage.Controls.Add(this.GridSizeComboBox); + this.OptionsRenderTabPage.Controls.Add(this.StatusBarCheckBox); + this.OptionsRenderTabPage.Controls.Add(this.label1); + this.OptionsRenderTabPage.Location = new System.Drawing.Point(4, 22); + this.OptionsRenderTabPage.Name = "OptionsRenderTabPage"; + this.OptionsRenderTabPage.Padding = new System.Windows.Forms.Padding(3); + this.OptionsRenderTabPage.Size = new System.Drawing.Size(209, 474); + this.OptionsRenderTabPage.TabIndex = 0; + this.OptionsRenderTabPage.Text = "Render"; + this.OptionsRenderTabPage.UseVisualStyleBackColor = true; // // RenderModeComboBox // @@ -681,24 +780,25 @@ this.label1.TabIndex = 18; this.label1.Text = "Grid unit size:"; // - // tabPage2 + // OptionsLightingTabPage // - this.tabPage2.Controls.Add(this.DeferredShadingCheckBox); - this.tabPage2.Controls.Add(this.HDLightsCheckBox); - this.tabPage2.Controls.Add(this.label19); - this.tabPage2.Controls.Add(this.HDRRenderingCheckBox); - this.tabPage2.Controls.Add(this.TimeOfDayTrackBar); - this.tabPage2.Controls.Add(this.ShadowsCheckBox); - this.tabPage2.Controls.Add(this.ControlLightDirCheckBox); - this.tabPage2.Controls.Add(this.SkydomeCheckBox); - this.tabPage2.Controls.Add(this.TimeOfDayLabel); - this.tabPage2.Location = new System.Drawing.Point(4, 22); - this.tabPage2.Name = "tabPage2"; - this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(209, 474); - this.tabPage2.TabIndex = 1; - this.tabPage2.Text = "Lighting"; - this.tabPage2.UseVisualStyleBackColor = true; + this.OptionsLightingTabPage.Controls.Add(this.DeferredShadingCheckBox); + this.OptionsLightingTabPage.Controls.Add(this.LightEditorButton); + this.OptionsLightingTabPage.Controls.Add(this.HDLightsCheckBox); + this.OptionsLightingTabPage.Controls.Add(this.label19); + this.OptionsLightingTabPage.Controls.Add(this.HDRRenderingCheckBox); + this.OptionsLightingTabPage.Controls.Add(this.TimeOfDayTrackBar); + this.OptionsLightingTabPage.Controls.Add(this.ShadowsCheckBox); + this.OptionsLightingTabPage.Controls.Add(this.ControlLightDirCheckBox); + this.OptionsLightingTabPage.Controls.Add(this.SkydomeCheckBox); + this.OptionsLightingTabPage.Controls.Add(this.TimeOfDayLabel); + this.OptionsLightingTabPage.Location = new System.Drawing.Point(4, 22); + this.OptionsLightingTabPage.Name = "OptionsLightingTabPage"; + this.OptionsLightingTabPage.Padding = new System.Windows.Forms.Padding(3); + this.OptionsLightingTabPage.Size = new System.Drawing.Size(209, 474); + this.OptionsLightingTabPage.TabIndex = 1; + this.OptionsLightingTabPage.Text = "Lighting"; + this.OptionsLightingTabPage.UseVisualStyleBackColor = true; // // DeferredShadingCheckBox // @@ -711,6 +811,16 @@ this.DeferredShadingCheckBox.UseVisualStyleBackColor = true; this.DeferredShadingCheckBox.CheckedChanged += new System.EventHandler(this.DeferredShadingCheckBox_CheckedChanged); // + // LightEditorButton + // + this.LightEditorButton.Location = new System.Drawing.Point(7, 214); + this.LightEditorButton.Name = "LightEditorButton"; + this.LightEditorButton.Size = new System.Drawing.Size(90, 23); + this.LightEditorButton.TabIndex = 37; + this.LightEditorButton.Text = "Light editor..."; + this.LightEditorButton.UseVisualStyleBackColor = true; + this.LightEditorButton.Click += new System.EventHandler(this.LightEditorButton_Click); + // // HDLightsCheckBox // this.HDLightsCheckBox.AutoSize = true; @@ -788,6 +898,8 @@ // SkydomeCheckBox // this.SkydomeCheckBox.AutoSize = true; + this.SkydomeCheckBox.Checked = true; + this.SkydomeCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; this.SkydomeCheckBox.Location = new System.Drawing.Point(7, 75); this.SkydomeCheckBox.Name = "SkydomeCheckBox"; this.SkydomeCheckBox.Size = new System.Drawing.Size(70, 17); @@ -805,38 +917,6 @@ this.TimeOfDayLabel.TabIndex = 5; this.TimeOfDayLabel.Text = "12:00"; // - // tabPage3 - // - this.tabPage3.Controls.Add(this.LightEditorButton); - this.tabPage3.Controls.Add(this.MaterialEditorButton); - this.tabPage3.Location = new System.Drawing.Point(4, 22); - this.tabPage3.Name = "tabPage3"; - this.tabPage3.Padding = new System.Windows.Forms.Padding(3); - this.tabPage3.Size = new System.Drawing.Size(209, 474); - this.tabPage3.TabIndex = 2; - this.tabPage3.Text = "Editors"; - this.tabPage3.UseVisualStyleBackColor = true; - // - // LightEditorButton - // - this.LightEditorButton.Location = new System.Drawing.Point(6, 35); - this.LightEditorButton.Name = "LightEditorButton"; - this.LightEditorButton.Size = new System.Drawing.Size(197, 23); - this.LightEditorButton.TabIndex = 37; - this.LightEditorButton.Text = "Light editor"; - this.LightEditorButton.UseVisualStyleBackColor = true; - this.LightEditorButton.Click += new System.EventHandler(this.LightEditorButton_Click); - // - // MaterialEditorButton - // - this.MaterialEditorButton.Location = new System.Drawing.Point(6, 6); - this.MaterialEditorButton.Name = "MaterialEditorButton"; - this.MaterialEditorButton.Size = new System.Drawing.Size(197, 23); - this.MaterialEditorButton.TabIndex = 3; - this.MaterialEditorButton.Text = "Material editor"; - this.MaterialEditorButton.UseVisualStyleBackColor = true; - this.MaterialEditorButton.Click += new System.EventHandler(this.MaterialEditorButton_Click); - // // ToolsPanelHideButton // this.ToolsPanelHideButton.Location = new System.Drawing.Point(3, 3); @@ -911,12 +991,11 @@ this.ToolsDetailsTabPage.ResumeLayout(false); this.ToolsOptionsTabPage.ResumeLayout(false); this.OptionsTabControl.ResumeLayout(false); - this.tabPage1.ResumeLayout(false); - this.tabPage1.PerformLayout(); - this.tabPage2.ResumeLayout(false); - this.tabPage2.PerformLayout(); + this.OptionsRenderTabPage.ResumeLayout(false); + this.OptionsRenderTabPage.PerformLayout(); + this.OptionsLightingTabPage.ResumeLayout(false); + this.OptionsLightingTabPage.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.TimeOfDayTrackBar)).EndInit(); - this.tabPage3.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -967,7 +1046,7 @@ private System.Windows.Forms.Label label19; private System.Windows.Forms.TrackBar TimeOfDayTrackBar; private System.Windows.Forms.CheckBox SkeletonsCheckBox; - private System.Windows.Forms.Button TextureViewerButton; + private System.Windows.Forms.Button TextureEditorButton; private System.Windows.Forms.CheckBox HDTexturesCheckBox; private System.Windows.Forms.Button MaterialEditorButton; private System.Windows.Forms.Panel MainToolbarPanel; @@ -983,11 +1062,18 @@ private System.Windows.Forms.ComboBox ClipDictComboBox; private System.Windows.Forms.CheckBox FragGlassCheckBox; private System.Windows.Forms.TabControl OptionsTabControl; - private System.Windows.Forms.TabPage tabPage1; - private System.Windows.Forms.TabPage tabPage2; + private System.Windows.Forms.TabPage OptionsRenderTabPage; + private System.Windows.Forms.TabPage OptionsLightingTabPage; private System.Windows.Forms.CheckBox HDLightsCheckBox; private System.Windows.Forms.CheckBox DeferredShadingCheckBox; - private System.Windows.Forms.TabPage tabPage3; private System.Windows.Forms.Button LightEditorButton; + private System.Windows.Forms.ToolStripButton ToolbarMaterialEditorButton; + private System.Windows.Forms.ToolStripButton ToolbarTextureEditorButton; + private System.Windows.Forms.ToolStripButton ToolbarLightEditorButton; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripButton ToolbarMoveButton; + private System.Windows.Forms.ToolStripButton ToolbarRotateButton; + private System.Windows.Forms.ToolStripButton ToolbarScaleButton; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; } } \ No newline at end of file diff --git a/CodeWalker/Forms/ModelForm.cs b/CodeWalker/Forms/ModelForm.cs index 92438d5..9d9fd30 100644 --- a/CodeWalker/Forms/ModelForm.cs +++ b/CodeWalker/Forms/ModelForm.cs @@ -176,9 +176,11 @@ namespace CodeWalker.Forms Widget.Position = new Vector3(0f, 0f, 0f); Widget.Rotation = Quaternion.Identity; Widget.Scale = Vector3.One; + Widget.SnapAngleDegrees = 0; Widget.Visible = false; Widget.OnPositionChange += Widget_OnPositionChange; Widget.OnRotationChange += Widget_OnRotationChange; + Widget.OnScaleChange += Widget_OnScaleChange; ShaderParamNames[] texsamplers = RenderableGeometry.GetTextureSamplerList(); foreach (var texsampler in texsamplers) @@ -568,50 +570,24 @@ namespace CodeWalker.Forms { Widget.Update(camera); } - public void UpdateWidget(bool rotate = false) + public void SetWidgetTransform(Vector3 p, Quaternion q, Vector3 s) { - if(selectedLight != null) - { - if (!rotate) - { - SetWidgetPosition(selectedLight.Position); - } - else - { - SetWidgetRotation(selectedLight.GetRotation()); - } - } - } - public void SetWidgetPosition(Vector3 pos) - { - SetWidgetMode("Position"); - Widget.Position = pos; - } - public void SetWidgetRotation(Quaternion q) - { - SetWidgetMode("Rotation"); + Widget.Position = p; Widget.Rotation = q; + Widget.Scale = s; } - public void SetWidgetMode(string mode) + public void SetWidgetMode(WidgetMode mode) { lock (Renderer.RenderSyncRoot) { - switch (mode) - { - case "Default": - Widget.Mode = WidgetMode.Default; - break; - case "Position": - Widget.Mode = WidgetMode.Position; - break; - case "Rotation": - Widget.Mode = WidgetMode.Rotation; - break; - case "Scale": - Widget.Mode = WidgetMode.Scale; - break; - } + Widget.Mode = mode; } + + ToolbarMoveButton.Checked = (mode == WidgetMode.Position); + ToolbarRotateButton.Checked = (mode == WidgetMode.Rotation); + ToolbarScaleButton.Checked = (mode == WidgetMode.Scale); + + lightForm?.SetWidgetModeUI(mode); } private void Widget_OnPositionChange(Vector3 newpos, Vector3 oldpos) { @@ -619,15 +595,23 @@ namespace CodeWalker.Forms if (newpos == oldpos) return; if (selectedLight == null || lightForm == null || !editingLights) return; selectedLight.Position = newpos; - selectedLight.HasChanged = true; + selectedLight.UpdateRenderable = true; } private void Widget_OnRotationChange(Quaternion newrot, Quaternion oldrot) { //called during UpdateWidgets() if (newrot == oldrot) return; if (selectedLight == null || lightForm == null || !editingLights) return; - selectedLight.SetRotation(newrot); - selectedLight.HasChanged = true; + selectedLight.Orientation = newrot; + selectedLight.UpdateRenderable = true; + } + private void Widget_OnScaleChange(Vector3 newscale, Vector3 oldscale) + { + //called during UpdateWidgets() + if (newscale == oldscale) return; + if (selectedLight == null || lightForm == null || !editingLights) return; + selectedLight.Falloff = newscale.Z; + selectedLight.UpdateRenderable = true; } @@ -2053,7 +2037,7 @@ namespace CodeWalker.Forms StatusStrip.Visible = StatusBarCheckBox.Checked; } - private void TextureViewerButton_Click(object sender, EventArgs e) + private void TextureEditorButton_Click(object sender, EventArgs e) { TextureDictionary td = null; @@ -2189,6 +2173,7 @@ namespace CodeWalker.Forms } lightForm.Focus(); } + DeferredShadingCheckBox.Checked = true; //make sure we can see the lights we're editing (maybe this is bad for potatoes but meh) } private void SaveButton_ButtonClick(object sender, EventArgs e) @@ -2230,5 +2215,35 @@ namespace CodeWalker.Forms { Renderer.renderlights = HDLightsCheckBox.Checked; } + + private void ToolbarMaterialEditorButton_Click(object sender, EventArgs e) + { + MaterialEditorButton_Click(sender, e); + } + + private void ToolbarTextureEditorButton_Click(object sender, EventArgs e) + { + TextureEditorButton_Click(sender, e); + } + + private void ToolbarLightEditorButton_Click(object sender, EventArgs e) + { + LightEditorButton_Click(sender, e); + } + + private void ToolbarMoveButton_Click(object sender, EventArgs e) + { + SetWidgetMode(ToolbarMoveButton.Checked ? WidgetMode.Default : WidgetMode.Position); + } + + private void ToolbarRotateButton_Click(object sender, EventArgs e) + { + SetWidgetMode(ToolbarRotateButton.Checked ? WidgetMode.Default : WidgetMode.Rotation); + } + + private void ToolbarScaleButton_Click(object sender, EventArgs e) + { + SetWidgetMode(ToolbarScaleButton.Checked ? WidgetMode.Default : WidgetMode.Scale); + } } } diff --git a/CodeWalker/Forms/ModelForm.resx b/CodeWalker/Forms/ModelForm.resx index 138334d..ae93a48 100644 --- a/CodeWalker/Forms/ModelForm.resx +++ b/CodeWalker/Forms/ModelForm.resx @@ -126,11 +126,75 @@ 276, 17 - - 276, 17 - - + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAKmSURBVDhPjVPbTlpREOUL+jn8gIn3xHiPEW8YNHIIKiJq + rKAiQUtVij2aoqA0Ira1SSWRi1a8Ja0WqtZL40MrDaXxwfqoDz64emZA09Y+dJLJSfaZWbPWmr1lf8fl + 5aX86urKKX3jUl6nM54+k6fL7sfNzc0DqcB78fMC0WgUS0sBzPvmMT09A8+MB8FgCGdnZ6Aaqk23pYIO + pAk7Jycn3Ph2ZRWrqxEEAyEsLLyGy+XGyMgo+vv7sbW5Bar9A4RQj48/w7/ox+bGFvZ29/Fp/wDb2zsI + h8LwSUzGxycwMGCBXq9HJBJhJrfN8vPzc6YbCoYRi8YQP/2GZPIHDg+PsL6+wSycz5wYtA7CYDBAUAvS + /ySByGVkzlpkDd5ZLwNEP8Tw9cspvieSODyQANbW7wCsVisDNKga4Ha7SYqTGMRJ44xk1uIbP0/8GNvF + 3t4+3r/bZtC5OR9EcZwltLXpUV9fD41GQwziBHA9NDTEGokF+bC8vMJGBiRDX71cgGvKheHhEfT0GKHV + alFTU4OSkhICuGYAk6kXtkc2TEggHs9zNm3e9wKzEuDk5BTs9icwm81obzegsbERFRUVKCgouAOIWywW + GI1GNsk+aof4VGTKY44x2GyPpfWZ0dHRCUEQUF1djaKiItTW1qYkkBGksaWlBV2dXTAZTTyNsq+3D93d + D3l1arWam0pLS5GXlweHw3FnopxWQtSamprQrG1Ga6sOOp2OQQVBA5VKxZOpOT8/Hzk5OUgkEqk1pu+C + NxwOo7Kykg2qq1NCqVTyxCpFFcrLy1FYWIjc3FxkZGTA7/dTc+oiUdxe5UAggLKyMhQXF3OSVjKLKGdm + ZiI7O5ubqfaf74FQiZooijydGrKysqBQKFhzmvb9x/R7kC4yR/r+x3OWyX4BFI2EuwQc/DwAAAAASUVO + RK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAC3SURBVDhPrZPREcIgEEQpxVqoxDpozhJSStQIfOK98+Jg + JMFJ3Blmsne7O3AQt0TO+RxjvKSUSr2o0TPZN6R5EuEQH7GEEIr3vlzHmy6+qdFDg9ZsL5h5nO7T27AM + mDkatB8hpNLYMtbcQgY1cy62tmVocTx4HcNpnbnHdSbiZfs/GVocrwb0hGv8fwE94RrXgMNDPHyNQLay + /yEBnqUU9j9lYCH7fqYanIvhiFCnPC9q9ExmcO4J1fij9+UBu9sAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEcSURBVDhPnZI7boQwEIY5wh4hR8gRcpQcJQV9aqocJUdI + w0NAESGEEAhwwav0+iO2Fzksq+SXRtY8/n/GY3suhBCXeZ7flmURwzDIruskp/IlcV12DMiq8KttW5kk + iQzD0FoURbKua0Q+dPlv0AHynuiaFjmehLHdzq4xCXWacsM0Tc/c1RT2fS/VlazhQybHXtZ1fdHUHxDY + C0Aqy1JmWSaLongsANi0KYrjeBNJ03Q78YmTH8eR2EXTblAC7yxpP4URMLHTl0BVJT+rqrLFCDRNs/nE + eebD7gZa5DvPc9sV43XY/inZQC3o1f0Pp+/vgi4s1LXDzd8DBN/3rf1LwLW/CoggCLbunFrgSacfg6+t + fp/gJ6qd3OnueVecFABPrjJDigAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACrSURBVDhPpVJbDoAgDONInoHD8c9J/SH8Kl02rZORGJs0 + DNaWh6YZWmtb730vpRwgaqxpew0255yFn0K82YeoLMYQXQY2Y0RPZU/YsSEAdbcrgNeU93X8nVUoYRww + 00jIpLGkD0m24AnxrGbC+z8Ax7CQWquIVzQtxjHfo0cU2k429+bXl2AhRg7g4MH4rzSj7cY1eiqLgXQ2 + cwh6Kovh34TN4bE9OGRtTukExpYH+BWfUFQAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFRSURBVDhPfZMxboNAEEU5Qo6QI+QIET1SWncp6OmpUrm1 + 6JFSuuQGuKaioQ89xRYYKDfz1jt4TYhX+trRnz9/2Z0h+m9N0/Q1z7MFxJ5+vpZleRfx9ziOP03T2MPh + 4EAMRw6Nl9+XkK+SvHDaMAy2KAobx/ED4Mj5L7oYY17WYiENApJd19k0Tf8YwJFDU5Ylu3iIiQQVBCKS + SZLYuq6dSIuJ4cihUY4rYbAKwzjPc3d3QLynIV4NjsfjQxJwIgg5NGg1dgacIHu7NdgDGoHxNTcDf7oz + oG17hUC/Mqi5X+F8Pjti20Z9VKCdQkvuwQBkWeaEcDwerdOdPAZoVO8MGIrwRE0I2r7vd2cCUENtdL1e + 30Rs9GUBBhRvO6Dw9zfUumn0Jq32HIOtKdDZ4L9Yi8MlY/0phRUGahpOZGB+8iXPF7OOiXbB/0yV3P3j + poiiXxmvX1sw0rqWAAAAAElFTkSuQmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAB4SURBVDhP3ZC7DcAgDEQZKTMwHOvSIFriS7BlEB+HMic9 + QJbvFThLUkpXzjkSpaeuzMPlEELx3jdsBauyCHBY6UWYPQI93KEljQD3jL6EGzN6x0bASyNYwkKU8Udm + gd6TMnIikDJyIqjVNz8T7FgKrAwFX6lVinM3aJ05lWDPRRcAAAAASUVORK5CYII= + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABWSURBVDhPY6AK+Pbt238S8PsvX74YQLVCAEjCyckJjj+8 @@ -138,7 +202,7 @@ lQAAAABJRU5ErkJggg== - + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABWSURBVDhPY6AK+Pbt238S8PsvX74YQLVCAEjCyckJjj+8 diff --git a/CodeWalker/Forms/ModelLightForm.Designer.cs b/CodeWalker/Forms/ModelLightForm.Designer.cs index 19f4e75..4822ec1 100644 --- a/CodeWalker/Forms/ModelLightForm.Designer.cs +++ b/CodeWalker/Forms/ModelLightForm.Designer.cs @@ -30,15 +30,31 @@ { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ModelLightForm)); this.MainSplitContainer = new System.Windows.Forms.SplitContainer(); + this.DeleteLightButton = new System.Windows.Forms.Button(); + this.NewLightButton = new System.Windows.Forms.Button(); this.LightsTreeView = new CodeWalker.WinForms.TreeViewFix(); - this.label1 = new System.Windows.Forms.Label(); this.LightPropertiesPanel = new System.Windows.Forms.Panel(); + this.VolumetricFadeDistanceUpDown = new System.Windows.Forms.NumericUpDown(); + this.SpecularFadeDistanceUpDown = new System.Windows.Forms.NumericUpDown(); + this.ShadowFadeDistanceUpDown = new System.Windows.Forms.NumericUpDown(); + this.LightFadeDistanceUpDown = new System.Windows.Forms.NumericUpDown(); + this.ShadowBlurUpDown = new System.Windows.Forms.NumericUpDown(); + this.GroupIDUpDown = new System.Windows.Forms.NumericUpDown(); + this.BoneIDUpDown = new System.Windows.Forms.NumericUpDown(); + this.FlashinessUpDown = new System.Windows.Forms.NumericUpDown(); + this.CoronaIntensityTextBox = new System.Windows.Forms.TextBox(); + this.OuterAngleTextBox = new System.Windows.Forms.TextBox(); + this.InnerAngleTextBox = new System.Windows.Forms.TextBox(); + this.IntensityTextBox = new System.Windows.Forms.TextBox(); + this.FlagsTextBox = new System.Windows.Forms.TextBox(); + this.label32 = new System.Windows.Forms.Label(); + this.NormalizeTangentButton = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.TangentTextBox = new System.Windows.Forms.TextBox(); this.label30 = new System.Windows.Forms.Label(); this.CullingPlaneOffsetTextBox = new System.Windows.Forms.TextBox(); this.label24 = new System.Windows.Forms.Label(); this.CullingPlaneNormalTextBox = new System.Windows.Forms.TextBox(); - this.GroupIDTextBox = new System.Windows.Forms.TextBox(); - this.BoneIDTextBox = new System.Windows.Forms.TextBox(); this.label29 = new System.Windows.Forms.Label(); this.TimeFlagsPMCheckedListBox = new System.Windows.Forms.CheckedListBox(); this.TimeFlagsAMCheckedListBox = new System.Windows.Forms.CheckedListBox(); @@ -50,17 +66,13 @@ this.label27 = new System.Windows.Forms.Label(); this.ShadowNearClipTextBox = new System.Windows.Forms.TextBox(); this.label26 = new System.Windows.Forms.Label(); - this.VolumetricFadeDistanceTextBox = new System.Windows.Forms.TextBox(); this.label25 = new System.Windows.Forms.Label(); - this.SpecularFadeDistanceTextBox = new System.Windows.Forms.TextBox(); this.VolumeColorBUpDown = new System.Windows.Forms.NumericUpDown(); this.VolumeColorGUpDown = new System.Windows.Forms.NumericUpDown(); this.VolumeColorRUpDown = new System.Windows.Forms.NumericUpDown(); this.VolumeColorLabel = new System.Windows.Forms.Label(); this.label22 = new System.Windows.Forms.Label(); - this.ShadowFadeDistanceTextBox = new System.Windows.Forms.TextBox(); this.label23 = new System.Windows.Forms.Label(); - this.LightFadeDistanceTextBox = new System.Windows.Forms.TextBox(); this.label21 = new System.Windows.Forms.Label(); this.VolumeOuterExponentTextBox = new System.Windows.Forms.TextBox(); this.label20 = new System.Windows.Forms.Label(); @@ -69,30 +81,24 @@ this.label18 = new System.Windows.Forms.Label(); this.VolumeIntensityTextBox = new System.Windows.Forms.TextBox(); this.label16 = new System.Windows.Forms.Label(); - this.ShadowBlurTextBox = new System.Windows.Forms.TextBox(); this.label12 = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label(); - this.FlashinessTextBox = new System.Windows.Forms.TextBox(); this.label15 = new System.Windows.Forms.Label(); this.CoronaSizeTextBox = new System.Windows.Forms.TextBox(); this.label14 = new System.Windows.Forms.Label(); this.ColourBUpDown = new System.Windows.Forms.NumericUpDown(); this.ColourGUpDown = new System.Windows.Forms.NumericUpDown(); this.ColourRUpDown = new System.Windows.Forms.NumericUpDown(); - this.CoronaIntensityUpDown = new System.Windows.Forms.NumericUpDown(); this.label9 = new System.Windows.Forms.Label(); - this.OuterAngleUpDown = new System.Windows.Forms.NumericUpDown(); this.label8 = new System.Windows.Forms.Label(); - this.InnerAngleUpDown = new System.Windows.Forms.NumericUpDown(); this.label7 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); - this.HashTextBox = new System.Windows.Forms.TextBox(); + this.TextureHashTextBox = new System.Windows.Forms.TextBox(); this.label5 = new System.Windows.Forms.Label(); this.FalloffExponentTextBox = new System.Windows.Forms.TextBox(); this.label4 = new System.Windows.Forms.Label(); this.FalloffTextBox = new System.Windows.Forms.TextBox(); this.TypeComboBox = new System.Windows.Forms.ComboBox(); - this.IntensityUpDown = new System.Windows.Forms.NumericUpDown(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); @@ -103,30 +109,35 @@ this.GoToButton = new System.Windows.Forms.Button(); this.PositionTextBox = new System.Windows.Forms.TextBox(); this.label31 = new System.Windows.Forms.Label(); - this.menuStripFix1 = new CodeWalker.WinForms.MenuStripFix(); - this.createToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.lightToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.deleteLightToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.showGizmosToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.moveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.rotateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.MainMenu = new CodeWalker.WinForms.MenuStripFix(); + this.EditMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.EditNewLightMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.EditDeleteLightMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.OptionsMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.OptionsShowOutlinesMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.MoveMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.RotateMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ScaleMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.MainSplitContainer)).BeginInit(); this.MainSplitContainer.Panel1.SuspendLayout(); this.MainSplitContainer.Panel2.SuspendLayout(); this.MainSplitContainer.SuspendLayout(); this.LightPropertiesPanel.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.VolumetricFadeDistanceUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.SpecularFadeDistanceUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.ShadowFadeDistanceUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.LightFadeDistanceUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.ShadowBlurUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.GroupIDUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.BoneIDUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.FlashinessUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.VolumeColorBUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.VolumeColorGUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.VolumeColorRUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ColourBUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ColourGUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ColourRUpDown)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.CoronaIntensityUpDown)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.OuterAngleUpDown)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.InnerAngleUpDown)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.IntensityUpDown)).BeginInit(); - this.menuStripFix1.SuspendLayout(); + this.MainMenu.SuspendLayout(); this.SuspendLayout(); // // MainSplitContainer @@ -137,16 +148,40 @@ // // MainSplitContainer.Panel1 // + this.MainSplitContainer.Panel1.Controls.Add(this.DeleteLightButton); + this.MainSplitContainer.Panel1.Controls.Add(this.NewLightButton); this.MainSplitContainer.Panel1.Controls.Add(this.LightsTreeView); - this.MainSplitContainer.Panel1.Controls.Add(this.label1); // // MainSplitContainer.Panel2 // this.MainSplitContainer.Panel2.Controls.Add(this.LightPropertiesPanel); - this.MainSplitContainer.Size = new System.Drawing.Size(732, 544); - this.MainSplitContainer.SplitterDistance = 171; + this.MainSplitContainer.Size = new System.Drawing.Size(733, 523); + this.MainSplitContainer.SplitterDistance = 184; this.MainSplitContainer.TabIndex = 0; // + // DeleteLightButton + // + this.DeleteLightButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.DeleteLightButton.Enabled = false; + this.DeleteLightButton.Location = new System.Drawing.Point(96, 494); + this.DeleteLightButton.Name = "DeleteLightButton"; + this.DeleteLightButton.Size = new System.Drawing.Size(80, 23); + this.DeleteLightButton.TabIndex = 7; + this.DeleteLightButton.Text = "Delete Light"; + this.DeleteLightButton.UseVisualStyleBackColor = true; + this.DeleteLightButton.Click += new System.EventHandler(this.DeleteLightButton_Click); + // + // NewLightButton + // + this.NewLightButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.NewLightButton.Location = new System.Drawing.Point(7, 494); + this.NewLightButton.Name = "NewLightButton"; + this.NewLightButton.Size = new System.Drawing.Size(80, 23); + this.NewLightButton.TabIndex = 6; + this.NewLightButton.Text = "New Light"; + this.NewLightButton.UseVisualStyleBackColor = true; + this.NewLightButton.Click += new System.EventHandler(this.NewLightButton_Click); + // // LightsTreeView // this.LightsTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -154,34 +189,40 @@ | System.Windows.Forms.AnchorStyles.Right))); this.LightsTreeView.FullRowSelect = true; this.LightsTreeView.HideSelection = false; - this.LightsTreeView.Location = new System.Drawing.Point(3, 24); + this.LightsTreeView.Location = new System.Drawing.Point(3, 3); this.LightsTreeView.Name = "LightsTreeView"; this.LightsTreeView.ShowRootLines = false; - this.LightsTreeView.Size = new System.Drawing.Size(192, 521); + this.LightsTreeView.Size = new System.Drawing.Size(178, 485); this.LightsTreeView.TabIndex = 5; this.LightsTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.LightsTreeView_AfterSelect); // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 9); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(62, 13); - this.label1.TabIndex = 4; - this.label1.Text = "Select light:"; - // // LightPropertiesPanel // this.LightPropertiesPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.LightPropertiesPanel.AutoScroll = true; + this.LightPropertiesPanel.Controls.Add(this.VolumetricFadeDistanceUpDown); + this.LightPropertiesPanel.Controls.Add(this.SpecularFadeDistanceUpDown); + this.LightPropertiesPanel.Controls.Add(this.ShadowFadeDistanceUpDown); + this.LightPropertiesPanel.Controls.Add(this.LightFadeDistanceUpDown); + this.LightPropertiesPanel.Controls.Add(this.ShadowBlurUpDown); + this.LightPropertiesPanel.Controls.Add(this.GroupIDUpDown); + this.LightPropertiesPanel.Controls.Add(this.BoneIDUpDown); + this.LightPropertiesPanel.Controls.Add(this.FlashinessUpDown); + this.LightPropertiesPanel.Controls.Add(this.CoronaIntensityTextBox); + this.LightPropertiesPanel.Controls.Add(this.OuterAngleTextBox); + this.LightPropertiesPanel.Controls.Add(this.InnerAngleTextBox); + this.LightPropertiesPanel.Controls.Add(this.IntensityTextBox); + this.LightPropertiesPanel.Controls.Add(this.FlagsTextBox); + this.LightPropertiesPanel.Controls.Add(this.label32); + this.LightPropertiesPanel.Controls.Add(this.NormalizeTangentButton); + this.LightPropertiesPanel.Controls.Add(this.label1); + this.LightPropertiesPanel.Controls.Add(this.TangentTextBox); this.LightPropertiesPanel.Controls.Add(this.label30); this.LightPropertiesPanel.Controls.Add(this.CullingPlaneOffsetTextBox); this.LightPropertiesPanel.Controls.Add(this.label24); this.LightPropertiesPanel.Controls.Add(this.CullingPlaneNormalTextBox); - this.LightPropertiesPanel.Controls.Add(this.GroupIDTextBox); - this.LightPropertiesPanel.Controls.Add(this.BoneIDTextBox); this.LightPropertiesPanel.Controls.Add(this.label29); this.LightPropertiesPanel.Controls.Add(this.TimeFlagsPMCheckedListBox); this.LightPropertiesPanel.Controls.Add(this.TimeFlagsAMCheckedListBox); @@ -193,17 +234,13 @@ this.LightPropertiesPanel.Controls.Add(this.label27); this.LightPropertiesPanel.Controls.Add(this.ShadowNearClipTextBox); this.LightPropertiesPanel.Controls.Add(this.label26); - this.LightPropertiesPanel.Controls.Add(this.VolumetricFadeDistanceTextBox); this.LightPropertiesPanel.Controls.Add(this.label25); - this.LightPropertiesPanel.Controls.Add(this.SpecularFadeDistanceTextBox); this.LightPropertiesPanel.Controls.Add(this.VolumeColorBUpDown); this.LightPropertiesPanel.Controls.Add(this.VolumeColorGUpDown); this.LightPropertiesPanel.Controls.Add(this.VolumeColorRUpDown); this.LightPropertiesPanel.Controls.Add(this.VolumeColorLabel); this.LightPropertiesPanel.Controls.Add(this.label22); - this.LightPropertiesPanel.Controls.Add(this.ShadowFadeDistanceTextBox); this.LightPropertiesPanel.Controls.Add(this.label23); - this.LightPropertiesPanel.Controls.Add(this.LightFadeDistanceTextBox); this.LightPropertiesPanel.Controls.Add(this.label21); this.LightPropertiesPanel.Controls.Add(this.VolumeOuterExponentTextBox); this.LightPropertiesPanel.Controls.Add(this.label20); @@ -212,30 +249,24 @@ this.LightPropertiesPanel.Controls.Add(this.label18); this.LightPropertiesPanel.Controls.Add(this.VolumeIntensityTextBox); this.LightPropertiesPanel.Controls.Add(this.label16); - this.LightPropertiesPanel.Controls.Add(this.ShadowBlurTextBox); this.LightPropertiesPanel.Controls.Add(this.label12); this.LightPropertiesPanel.Controls.Add(this.label11); - this.LightPropertiesPanel.Controls.Add(this.FlashinessTextBox); this.LightPropertiesPanel.Controls.Add(this.label15); this.LightPropertiesPanel.Controls.Add(this.CoronaSizeTextBox); this.LightPropertiesPanel.Controls.Add(this.label14); this.LightPropertiesPanel.Controls.Add(this.ColourBUpDown); this.LightPropertiesPanel.Controls.Add(this.ColourGUpDown); this.LightPropertiesPanel.Controls.Add(this.ColourRUpDown); - this.LightPropertiesPanel.Controls.Add(this.CoronaIntensityUpDown); this.LightPropertiesPanel.Controls.Add(this.label9); - this.LightPropertiesPanel.Controls.Add(this.OuterAngleUpDown); this.LightPropertiesPanel.Controls.Add(this.label8); - this.LightPropertiesPanel.Controls.Add(this.InnerAngleUpDown); this.LightPropertiesPanel.Controls.Add(this.label7); this.LightPropertiesPanel.Controls.Add(this.label6); - this.LightPropertiesPanel.Controls.Add(this.HashTextBox); + this.LightPropertiesPanel.Controls.Add(this.TextureHashTextBox); this.LightPropertiesPanel.Controls.Add(this.label5); this.LightPropertiesPanel.Controls.Add(this.FalloffExponentTextBox); this.LightPropertiesPanel.Controls.Add(this.label4); this.LightPropertiesPanel.Controls.Add(this.FalloffTextBox); this.LightPropertiesPanel.Controls.Add(this.TypeComboBox); - this.LightPropertiesPanel.Controls.Add(this.IntensityUpDown); this.LightPropertiesPanel.Controls.Add(this.label3); this.LightPropertiesPanel.Controls.Add(this.label2); this.LightPropertiesPanel.Controls.Add(this.label13); @@ -248,66 +279,273 @@ this.LightPropertiesPanel.Controls.Add(this.label31); this.LightPropertiesPanel.Location = new System.Drawing.Point(4, 3); this.LightPropertiesPanel.Name = "LightPropertiesPanel"; - this.LightPropertiesPanel.Size = new System.Drawing.Size(550, 537); + this.LightPropertiesPanel.Size = new System.Drawing.Size(538, 517); this.LightPropertiesPanel.TabIndex = 1; // + // VolumetricFadeDistanceUpDown + // + this.VolumetricFadeDistanceUpDown.Location = new System.Drawing.Point(372, 212); + this.VolumetricFadeDistanceUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.VolumetricFadeDistanceUpDown.Name = "VolumetricFadeDistanceUpDown"; + this.VolumetricFadeDistanceUpDown.Size = new System.Drawing.Size(156, 20); + this.VolumetricFadeDistanceUpDown.TabIndex = 372; + this.VolumetricFadeDistanceUpDown.Value = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.VolumetricFadeDistanceUpDown.ValueChanged += new System.EventHandler(this.VolumetricFadeDistanceUpDown_ValueChanged); + // + // SpecularFadeDistanceUpDown + // + this.SpecularFadeDistanceUpDown.Location = new System.Drawing.Point(372, 189); + this.SpecularFadeDistanceUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.SpecularFadeDistanceUpDown.Name = "SpecularFadeDistanceUpDown"; + this.SpecularFadeDistanceUpDown.Size = new System.Drawing.Size(156, 20); + this.SpecularFadeDistanceUpDown.TabIndex = 362; + this.SpecularFadeDistanceUpDown.Value = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.SpecularFadeDistanceUpDown.ValueChanged += new System.EventHandler(this.SpecularFadeDistanceUpDown_ValueChanged); + // + // ShadowFadeDistanceUpDown + // + this.ShadowFadeDistanceUpDown.Location = new System.Drawing.Point(372, 166); + this.ShadowFadeDistanceUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.ShadowFadeDistanceUpDown.Name = "ShadowFadeDistanceUpDown"; + this.ShadowFadeDistanceUpDown.Size = new System.Drawing.Size(156, 20); + this.ShadowFadeDistanceUpDown.TabIndex = 352; + this.ShadowFadeDistanceUpDown.Value = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.ShadowFadeDistanceUpDown.ValueChanged += new System.EventHandler(this.ShadowFadeDistanceUpDown_ValueChanged); + // + // LightFadeDistanceUpDown + // + this.LightFadeDistanceUpDown.Location = new System.Drawing.Point(88, 419); + this.LightFadeDistanceUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.LightFadeDistanceUpDown.Name = "LightFadeDistanceUpDown"; + this.LightFadeDistanceUpDown.Size = new System.Drawing.Size(154, 20); + this.LightFadeDistanceUpDown.TabIndex = 282; + this.LightFadeDistanceUpDown.Value = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.LightFadeDistanceUpDown.ValueChanged += new System.EventHandler(this.LightFadeDistanceUpDown_ValueChanged); + // + // ShadowBlurUpDown + // + this.ShadowBlurUpDown.Location = new System.Drawing.Point(88, 396); + this.ShadowBlurUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.ShadowBlurUpDown.Name = "ShadowBlurUpDown"; + this.ShadowBlurUpDown.Size = new System.Drawing.Size(154, 20); + this.ShadowBlurUpDown.TabIndex = 272; + this.ShadowBlurUpDown.Value = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.ShadowBlurUpDown.ValueChanged += new System.EventHandler(this.ShadowBlurUpDown_ValueChanged); + // + // GroupIDUpDown + // + this.GroupIDUpDown.Location = new System.Drawing.Point(88, 212); + this.GroupIDUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.GroupIDUpDown.Name = "GroupIDUpDown"; + this.GroupIDUpDown.Size = new System.Drawing.Size(154, 20); + this.GroupIDUpDown.TabIndex = 192; + this.GroupIDUpDown.Value = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.GroupIDUpDown.ValueChanged += new System.EventHandler(this.GroupIDUpDown_ValueChanged); + // + // BoneIDUpDown + // + this.BoneIDUpDown.Location = new System.Drawing.Point(88, 189); + this.BoneIDUpDown.Maximum = new decimal(new int[] { + 65535, + 0, + 0, + 0}); + this.BoneIDUpDown.Name = "BoneIDUpDown"; + this.BoneIDUpDown.Size = new System.Drawing.Size(154, 20); + this.BoneIDUpDown.TabIndex = 182; + this.BoneIDUpDown.Value = new decimal(new int[] { + 65535, + 0, + 0, + 0}); + this.BoneIDUpDown.ValueChanged += new System.EventHandler(this.BoneIDUpDown_ValueChanged); + // + // FlashinessUpDown + // + this.FlashinessUpDown.Location = new System.Drawing.Point(88, 166); + this.FlashinessUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.FlashinessUpDown.Name = "FlashinessUpDown"; + this.FlashinessUpDown.Size = new System.Drawing.Size(154, 20); + this.FlashinessUpDown.TabIndex = 172; + this.FlashinessUpDown.Value = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.FlashinessUpDown.ValueChanged += new System.EventHandler(this.FlashinessUpDown_ValueChanged); + // + // CoronaIntensityTextBox + // + this.CoronaIntensityTextBox.Location = new System.Drawing.Point(88, 350); + this.CoronaIntensityTextBox.Name = "CoronaIntensityTextBox"; + this.CoronaIntensityTextBox.Size = new System.Drawing.Size(154, 20); + this.CoronaIntensityTextBox.TabIndex = 252; + this.CoronaIntensityTextBox.TextChanged += new System.EventHandler(this.CoronaIntensityTextBox_TextChanged); + // + // OuterAngleTextBox + // + this.OuterAngleTextBox.Location = new System.Drawing.Point(88, 304); + this.OuterAngleTextBox.Name = "OuterAngleTextBox"; + this.OuterAngleTextBox.Size = new System.Drawing.Size(154, 20); + this.OuterAngleTextBox.TabIndex = 232; + this.OuterAngleTextBox.TextChanged += new System.EventHandler(this.OuterAngleTextBox_TextChanged); + // + // InnerAngleTextBox + // + this.InnerAngleTextBox.Location = new System.Drawing.Point(88, 281); + this.InnerAngleTextBox.Name = "InnerAngleTextBox"; + this.InnerAngleTextBox.Size = new System.Drawing.Size(154, 20); + this.InnerAngleTextBox.TabIndex = 222; + this.InnerAngleTextBox.TextChanged += new System.EventHandler(this.InnerAngleTextBox_TextChanged); + // + // IntensityTextBox + // + this.IntensityTextBox.Location = new System.Drawing.Point(88, 120); + this.IntensityTextBox.Name = "IntensityTextBox"; + this.IntensityTextBox.Size = new System.Drawing.Size(154, 20); + this.IntensityTextBox.TabIndex = 152; + this.IntensityTextBox.TextChanged += new System.EventHandler(this.IntensityTextBox_TextChanged); + // + // FlagsTextBox + // + this.FlagsTextBox.Location = new System.Drawing.Point(88, 143); + this.FlagsTextBox.Name = "FlagsTextBox"; + this.FlagsTextBox.Size = new System.Drawing.Size(154, 20); + this.FlagsTextBox.TabIndex = 162; + this.FlagsTextBox.TextChanged += new System.EventHandler(this.FlagsTextBox_TextChanged); + // + // label32 + // + this.label32.AutoSize = true; + this.label32.Location = new System.Drawing.Point(3, 146); + this.label32.Name = "label32"; + this.label32.Size = new System.Drawing.Size(35, 13); + this.label32.TabIndex = 161; + this.label32.Text = "Flags:"; + // + // NormalizeTangentButton + // + this.NormalizeTangentButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.NormalizeTangentButton.Location = new System.Drawing.Point(461, 46); + this.NormalizeTangentButton.Name = "NormalizeTangentButton"; + this.NormalizeTangentButton.Size = new System.Drawing.Size(68, 23); + this.NormalizeTangentButton.TabIndex = 123; + this.NormalizeTangentButton.Text = "Normalize"; + this.NormalizeTangentButton.UseVisualStyleBackColor = true; + this.NormalizeTangentButton.Click += new System.EventHandler(this.NormalizeTangentButton_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(3, 51); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(50, 13); + this.label1.TabIndex = 121; + this.label1.Text = "Tangent:"; + // + // TangentTextBox + // + this.TangentTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.TangentTextBox.Location = new System.Drawing.Point(88, 48); + this.TangentTextBox.Name = "TangentTextBox"; + this.TangentTextBox.Size = new System.Drawing.Size(367, 20); + this.TangentTextBox.TabIndex = 122; + this.TangentTextBox.TextChanged += new System.EventHandler(this.TangentTextBox_TextChanged); + // // label30 // this.label30.AutoSize = true; - this.label30.Location = new System.Drawing.Point(261, 301); + this.label30.Location = new System.Drawing.Point(262, 284); this.label30.Name = "label30"; this.label30.Size = new System.Drawing.Size(99, 13); - this.label30.TabIndex = 218; + this.label30.TabIndex = 401; this.label30.Text = "Culling plane offset:"; // // CullingPlaneOffsetTextBox // - this.CullingPlaneOffsetTextBox.Location = new System.Drawing.Point(365, 296); + this.CullingPlaneOffsetTextBox.Location = new System.Drawing.Point(372, 281); this.CullingPlaneOffsetTextBox.Name = "CullingPlaneOffsetTextBox"; this.CullingPlaneOffsetTextBox.Size = new System.Drawing.Size(156, 20); - this.CullingPlaneOffsetTextBox.TabIndex = 219; + this.CullingPlaneOffsetTextBox.TabIndex = 402; this.CullingPlaneOffsetTextBox.TextChanged += new System.EventHandler(this.CullingPlaneOffsetTextBox_TextChanged); // // label24 // this.label24.AutoSize = true; - this.label24.Location = new System.Drawing.Point(261, 275); + this.label24.Location = new System.Drawing.Point(262, 261); this.label24.Name = "label24"; this.label24.Size = new System.Drawing.Size(104, 13); - this.label24.TabIndex = 216; + this.label24.TabIndex = 391; this.label24.Text = "Culling plane normal:"; // // CullingPlaneNormalTextBox // - this.CullingPlaneNormalTextBox.Location = new System.Drawing.Point(365, 270); + this.CullingPlaneNormalTextBox.Location = new System.Drawing.Point(372, 258); this.CullingPlaneNormalTextBox.Name = "CullingPlaneNormalTextBox"; this.CullingPlaneNormalTextBox.Size = new System.Drawing.Size(156, 20); - this.CullingPlaneNormalTextBox.TabIndex = 217; + this.CullingPlaneNormalTextBox.TabIndex = 392; this.CullingPlaneNormalTextBox.TextChanged += new System.EventHandler(this.CullingPlaneNormalTextBox_TextChanged); // - // GroupIDTextBox - // - this.GroupIDTextBox.Location = new System.Drawing.Point(88, 195); - this.GroupIDTextBox.Name = "GroupIDTextBox"; - this.GroupIDTextBox.Size = new System.Drawing.Size(154, 20); - this.GroupIDTextBox.TabIndex = 215; - this.GroupIDTextBox.TextChanged += new System.EventHandler(this.GroupIDTextBox_TextChanged); - // - // BoneIDTextBox - // - this.BoneIDTextBox.Location = new System.Drawing.Point(88, 169); - this.BoneIDTextBox.Name = "BoneIDTextBox"; - this.BoneIDTextBox.Size = new System.Drawing.Size(154, 20); - this.BoneIDTextBox.TabIndex = 214; - this.BoneIDTextBox.TextChanged += new System.EventHandler(this.BoneIDTextBox_TextChanged); - // // label29 // this.label29.AutoSize = true; - this.label29.Location = new System.Drawing.Point(10, 380); + this.label29.Location = new System.Drawing.Point(3, 376); this.label29.Name = "label29"; this.label29.Size = new System.Drawing.Size(40, 13); - this.label29.TabIndex = 212; + this.label29.TabIndex = 261; this.label29.Text = "Extent:"; // // TimeFlagsPMCheckedListBox @@ -327,10 +565,10 @@ "21:00 - 22:00", "22:00 - 23:00", "23:00 - 00:00"}); - this.TimeFlagsPMCheckedListBox.Location = new System.Drawing.Point(426, 348); + this.TimeFlagsPMCheckedListBox.Location = new System.Drawing.Point(433, 327); this.TimeFlagsPMCheckedListBox.Name = "TimeFlagsPMCheckedListBox"; this.TimeFlagsPMCheckedListBox.Size = new System.Drawing.Size(95, 184); - this.TimeFlagsPMCheckedListBox.TabIndex = 168; + this.TimeFlagsPMCheckedListBox.TabIndex = 414; this.TimeFlagsPMCheckedListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.TimeFlagsPMCheckedListBox_ItemCheck); // // TimeFlagsAMCheckedListBox @@ -350,108 +588,92 @@ "09:00 - 10:00", "10:00 - 11:00", "11:00 - 12:00"}); - this.TimeFlagsAMCheckedListBox.Location = new System.Drawing.Point(325, 348); + this.TimeFlagsAMCheckedListBox.Location = new System.Drawing.Point(332, 327); this.TimeFlagsAMCheckedListBox.Name = "TimeFlagsAMCheckedListBox"; this.TimeFlagsAMCheckedListBox.Size = new System.Drawing.Size(95, 184); - this.TimeFlagsAMCheckedListBox.TabIndex = 167; + this.TimeFlagsAMCheckedListBox.TabIndex = 413; this.TimeFlagsAMCheckedListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.TimeFlagsAMCheckedListBox_ItemCheck); // // ExtentTextBox // - this.ExtentTextBox.Location = new System.Drawing.Point(88, 377); + this.ExtentTextBox.Location = new System.Drawing.Point(88, 373); this.ExtentTextBox.Name = "ExtentTextBox"; this.ExtentTextBox.Size = new System.Drawing.Size(154, 20); - this.ExtentTextBox.TabIndex = 213; + this.ExtentTextBox.TabIndex = 262; this.ExtentTextBox.TextChanged += new System.EventHandler(this.ExtentTextBox_TextChanged); // // label10 // this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(261, 328); + this.label10.Location = new System.Drawing.Point(262, 307); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(58, 13); - this.label10.TabIndex = 169; + this.label10.TabIndex = 411; this.label10.Text = "Time flags:"; // // label28 // this.label28.AutoSize = true; - this.label28.Location = new System.Drawing.Point(10, 458); + this.label28.Location = new System.Drawing.Point(3, 445); this.label28.Name = "label28"; this.label28.Size = new System.Drawing.Size(71, 13); - this.label28.TabIndex = 210; + this.label28.TabIndex = 291; this.label28.Text = "Corona zbias:"; // // TimeFlagsTextBox // - this.TimeFlagsTextBox.Location = new System.Drawing.Point(365, 322); + this.TimeFlagsTextBox.Location = new System.Drawing.Point(372, 304); this.TimeFlagsTextBox.Name = "TimeFlagsTextBox"; this.TimeFlagsTextBox.Size = new System.Drawing.Size(156, 20); - this.TimeFlagsTextBox.TabIndex = 170; + this.TimeFlagsTextBox.TabIndex = 412; this.TimeFlagsTextBox.TextChanged += new System.EventHandler(this.TimeFlagsTextBox_TextChanged); // // CoronaZBiasTextBox // - this.CoronaZBiasTextBox.Location = new System.Drawing.Point(88, 455); + this.CoronaZBiasTextBox.Location = new System.Drawing.Point(88, 442); this.CoronaZBiasTextBox.Name = "CoronaZBiasTextBox"; this.CoronaZBiasTextBox.Size = new System.Drawing.Size(154, 20); - this.CoronaZBiasTextBox.TabIndex = 211; + this.CoronaZBiasTextBox.TabIndex = 292; this.CoronaZBiasTextBox.TextChanged += new System.EventHandler(this.CoronaZBiasTextBox_TextChanged); // // label27 // this.label27.AutoSize = true; - this.label27.Location = new System.Drawing.Point(261, 247); + this.label27.Location = new System.Drawing.Point(262, 238); this.label27.Name = "label27"; this.label27.Size = new System.Drawing.Size(92, 13); - this.label27.TabIndex = 208; + this.label27.TabIndex = 381; this.label27.Text = "Shadow near clip:"; // // ShadowNearClipTextBox // - this.ShadowNearClipTextBox.Location = new System.Drawing.Point(365, 244); + this.ShadowNearClipTextBox.Location = new System.Drawing.Point(372, 235); this.ShadowNearClipTextBox.Name = "ShadowNearClipTextBox"; this.ShadowNearClipTextBox.Size = new System.Drawing.Size(156, 20); - this.ShadowNearClipTextBox.TabIndex = 209; + this.ShadowNearClipTextBox.TabIndex = 382; this.ShadowNearClipTextBox.TextChanged += new System.EventHandler(this.ShadowNearClipTextBox_TextChanged); // // label26 // this.label26.AutoSize = true; - this.label26.Location = new System.Drawing.Point(261, 221); + this.label26.Location = new System.Drawing.Point(262, 214); this.label26.Name = "label26"; this.label26.Size = new System.Drawing.Size(100, 13); - this.label26.TabIndex = 206; + this.label26.TabIndex = 371; this.label26.Text = "Volumetric fade dst:"; // - // VolumetricFadeDistanceTextBox - // - this.VolumetricFadeDistanceTextBox.Location = new System.Drawing.Point(365, 218); - this.VolumetricFadeDistanceTextBox.Name = "VolumetricFadeDistanceTextBox"; - this.VolumetricFadeDistanceTextBox.Size = new System.Drawing.Size(156, 20); - this.VolumetricFadeDistanceTextBox.TabIndex = 207; - this.VolumetricFadeDistanceTextBox.TextChanged += new System.EventHandler(this.VolumetricFadeDistance_TextChanged); - // // label25 // this.label25.AutoSize = true; - this.label25.Location = new System.Drawing.Point(261, 195); + this.label25.Location = new System.Drawing.Point(262, 191); this.label25.Name = "label25"; this.label25.Size = new System.Drawing.Size(93, 13); - this.label25.TabIndex = 204; + this.label25.TabIndex = 361; this.label25.Text = "Specular fade dst:"; // - // SpecularFadeDistanceTextBox - // - this.SpecularFadeDistanceTextBox.Location = new System.Drawing.Point(365, 192); - this.SpecularFadeDistanceTextBox.Name = "SpecularFadeDistanceTextBox"; - this.SpecularFadeDistanceTextBox.Size = new System.Drawing.Size(156, 20); - this.SpecularFadeDistanceTextBox.TabIndex = 205; - this.SpecularFadeDistanceTextBox.TextChanged += new System.EventHandler(this.SpecularFadeDistanceTextBox_TextChanged); - // // VolumeColorBUpDown // - this.VolumeColorBUpDown.Location = new System.Drawing.Point(483, 115); + this.VolumeColorBUpDown.Location = new System.Drawing.Point(483, 120); this.VolumeColorBUpDown.Maximum = new decimal(new int[] { 255, 0, @@ -459,7 +681,7 @@ 0}); this.VolumeColorBUpDown.Name = "VolumeColorBUpDown"; this.VolumeColorBUpDown.Size = new System.Drawing.Size(38, 20); - this.VolumeColorBUpDown.TabIndex = 203; + this.VolumeColorBUpDown.TabIndex = 335; this.VolumeColorBUpDown.Value = new decimal(new int[] { 255, 0, @@ -469,7 +691,7 @@ // // VolumeColorGUpDown // - this.VolumeColorGUpDown.Location = new System.Drawing.Point(440, 115); + this.VolumeColorGUpDown.Location = new System.Drawing.Point(447, 119); this.VolumeColorGUpDown.Maximum = new decimal(new int[] { 255, 0, @@ -477,7 +699,7 @@ 0}); this.VolumeColorGUpDown.Name = "VolumeColorGUpDown"; this.VolumeColorGUpDown.Size = new System.Drawing.Size(38, 20); - this.VolumeColorGUpDown.TabIndex = 202; + this.VolumeColorGUpDown.TabIndex = 334; this.VolumeColorGUpDown.Value = new decimal(new int[] { 255, 0, @@ -487,7 +709,7 @@ // // VolumeColorRUpDown // - this.VolumeColorRUpDown.Location = new System.Drawing.Point(399, 115); + this.VolumeColorRUpDown.Location = new System.Drawing.Point(406, 119); this.VolumeColorRUpDown.Maximum = new decimal(new int[] { 255, 0, @@ -495,7 +717,7 @@ 0}); this.VolumeColorRUpDown.Name = "VolumeColorRUpDown"; this.VolumeColorRUpDown.Size = new System.Drawing.Size(38, 20); - this.VolumeColorRUpDown.TabIndex = 201; + this.VolumeColorRUpDown.TabIndex = 333; this.VolumeColorRUpDown.Value = new decimal(new int[] { 255, 0, @@ -507,178 +729,146 @@ // this.VolumeColorLabel.BackColor = System.Drawing.Color.White; this.VolumeColorLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.VolumeColorLabel.Location = new System.Drawing.Point(365, 114); + this.VolumeColorLabel.Location = new System.Drawing.Point(372, 119); this.VolumeColorLabel.Name = "VolumeColorLabel"; - this.VolumeColorLabel.Size = new System.Drawing.Size(30, 21); - this.VolumeColorLabel.TabIndex = 200; + this.VolumeColorLabel.Size = new System.Drawing.Size(30, 20); + this.VolumeColorLabel.TabIndex = 332; this.VolumeColorLabel.Click += new System.EventHandler(this.VolumeColorLabel_Click); // // label22 // this.label22.AutoSize = true; - this.label22.Location = new System.Drawing.Point(261, 169); + this.label22.Location = new System.Drawing.Point(262, 168); this.label22.Name = "label22"; this.label22.Size = new System.Drawing.Size(90, 13); - this.label22.TabIndex = 198; + this.label22.TabIndex = 351; this.label22.Text = "Shadow fade dst:"; // - // ShadowFadeDistanceTextBox - // - this.ShadowFadeDistanceTextBox.Location = new System.Drawing.Point(365, 166); - this.ShadowFadeDistanceTextBox.Name = "ShadowFadeDistanceTextBox"; - this.ShadowFadeDistanceTextBox.Size = new System.Drawing.Size(156, 20); - this.ShadowFadeDistanceTextBox.TabIndex = 199; - this.ShadowFadeDistanceTextBox.TextChanged += new System.EventHandler(this.ShadowFadeDistanceTextBox_TextChanged); - // // label23 // this.label23.AutoSize = true; - this.label23.Location = new System.Drawing.Point(10, 432); + this.label23.Location = new System.Drawing.Point(3, 421); this.label23.Name = "label23"; this.label23.Size = new System.Drawing.Size(74, 13); - this.label23.TabIndex = 196; + this.label23.TabIndex = 281; this.label23.Text = "Light fade dst:"; // - // LightFadeDistanceTextBox - // - this.LightFadeDistanceTextBox.Location = new System.Drawing.Point(88, 429); - this.LightFadeDistanceTextBox.Name = "LightFadeDistanceTextBox"; - this.LightFadeDistanceTextBox.Size = new System.Drawing.Size(154, 20); - this.LightFadeDistanceTextBox.TabIndex = 197; - this.LightFadeDistanceTextBox.TextChanged += new System.EventHandler(this.LightFadeDistanceTextBox_TextChanged); - // // label21 // this.label21.AutoSize = true; - this.label21.Location = new System.Drawing.Point(259, 144); + this.label21.Location = new System.Drawing.Point(262, 146); this.label21.Name = "label21"; this.label21.Size = new System.Drawing.Size(92, 13); - this.label21.TabIndex = 194; + this.label21.TabIndex = 341; this.label21.Text = "Volume outer exp:"; // // VolumeOuterExponentTextBox // - this.VolumeOuterExponentTextBox.Location = new System.Drawing.Point(365, 140); + this.VolumeOuterExponentTextBox.Location = new System.Drawing.Point(372, 143); this.VolumeOuterExponentTextBox.Name = "VolumeOuterExponentTextBox"; this.VolumeOuterExponentTextBox.Size = new System.Drawing.Size(156, 20); - this.VolumeOuterExponentTextBox.TabIndex = 195; + this.VolumeOuterExponentTextBox.TabIndex = 342; this.VolumeOuterExponentTextBox.TextChanged += new System.EventHandler(this.VolumeOuterExponentTextBox_TextChanged); // // label20 // this.label20.AutoSize = true; - this.label20.Location = new System.Drawing.Point(257, 117); + this.label20.Location = new System.Drawing.Point(262, 121); this.label20.Name = "label20"; this.label20.Size = new System.Drawing.Size(109, 13); - this.label20.TabIndex = 192; + this.label20.TabIndex = 331; this.label20.Text = "Volume colour (RGB):"; // // label19 // this.label19.AutoSize = true; - this.label19.Location = new System.Drawing.Point(257, 91); + this.label19.Location = new System.Drawing.Point(262, 99); this.label19.Name = "label19"; this.label19.Size = new System.Drawing.Size(94, 13); - this.label19.TabIndex = 190; + this.label19.TabIndex = 321; this.label19.Text = "Volume size scale:"; // // VolumeSizeScaleTextBox // - this.VolumeSizeScaleTextBox.Location = new System.Drawing.Point(365, 88); + this.VolumeSizeScaleTextBox.Location = new System.Drawing.Point(372, 96); this.VolumeSizeScaleTextBox.Name = "VolumeSizeScaleTextBox"; this.VolumeSizeScaleTextBox.Size = new System.Drawing.Size(156, 20); - this.VolumeSizeScaleTextBox.TabIndex = 191; + this.VolumeSizeScaleTextBox.TabIndex = 322; this.VolumeSizeScaleTextBox.TextChanged += new System.EventHandler(this.VolumeSizeScaleTextBox_TextChanged); // // label18 // this.label18.AutoSize = true; - this.label18.Location = new System.Drawing.Point(257, 65); + this.label18.Location = new System.Drawing.Point(262, 76); this.label18.Name = "label18"; this.label18.Size = new System.Drawing.Size(86, 13); - this.label18.TabIndex = 188; + this.label18.TabIndex = 311; this.label18.Text = "Volume intensity:"; // // VolumeIntensityTextBox // - this.VolumeIntensityTextBox.Location = new System.Drawing.Point(365, 62); + this.VolumeIntensityTextBox.Location = new System.Drawing.Point(372, 73); this.VolumeIntensityTextBox.Name = "VolumeIntensityTextBox"; this.VolumeIntensityTextBox.Size = new System.Drawing.Size(156, 20); - this.VolumeIntensityTextBox.TabIndex = 189; + this.VolumeIntensityTextBox.TabIndex = 312; this.VolumeIntensityTextBox.TextChanged += new System.EventHandler(this.VolumeIntensityTextBox_TextChanged); // // label16 // this.label16.AutoSize = true; - this.label16.Location = new System.Drawing.Point(10, 406); + this.label16.Location = new System.Drawing.Point(3, 398); this.label16.Name = "label16"; this.label16.Size = new System.Drawing.Size(69, 13); - this.label16.TabIndex = 186; + this.label16.TabIndex = 271; this.label16.Text = "Shadow blur:"; // - // ShadowBlurTextBox - // - this.ShadowBlurTextBox.Location = new System.Drawing.Point(88, 403); - this.ShadowBlurTextBox.Name = "ShadowBlurTextBox"; - this.ShadowBlurTextBox.Size = new System.Drawing.Size(154, 20); - this.ShadowBlurTextBox.TabIndex = 187; - this.ShadowBlurTextBox.TextChanged += new System.EventHandler(this.ShadowBlurTextBox_TextChanged); - // // label12 // this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(10, 197); + this.label12.Location = new System.Drawing.Point(3, 214); this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(50, 13); - this.label12.TabIndex = 184; - this.label12.Text = "Group id:"; + this.label12.Size = new System.Drawing.Size(53, 13); + this.label12.TabIndex = 191; + this.label12.Text = "Group ID:"; // // label11 // this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(10, 171); + this.label11.Location = new System.Drawing.Point(3, 191); this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(46, 13); - this.label11.TabIndex = 182; - this.label11.Text = "Bone id:"; - // - // FlashinessTextBox - // - this.FlashinessTextBox.Location = new System.Drawing.Point(88, 143); - this.FlashinessTextBox.Name = "FlashinessTextBox"; - this.FlashinessTextBox.Size = new System.Drawing.Size(154, 20); - this.FlashinessTextBox.TabIndex = 181; - this.FlashinessTextBox.TextChanged += new System.EventHandler(this.FlashinessTextBox_TextChanged); + this.label11.Size = new System.Drawing.Size(49, 13); + this.label11.TabIndex = 181; + this.label11.Text = "Bone ID:"; // // label15 // this.label15.AutoSize = true; - this.label15.Location = new System.Drawing.Point(10, 146); + this.label15.Location = new System.Drawing.Point(3, 168); this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(56, 13); - this.label15.TabIndex = 180; - this.label15.Text = "Flashiness"; + this.label15.Size = new System.Drawing.Size(59, 13); + this.label15.TabIndex = 171; + this.label15.Text = "Flashiness:"; // // CoronaSizeTextBox // - this.CoronaSizeTextBox.Location = new System.Drawing.Point(88, 325); + this.CoronaSizeTextBox.Location = new System.Drawing.Point(88, 327); this.CoronaSizeTextBox.Name = "CoronaSizeTextBox"; this.CoronaSizeTextBox.Size = new System.Drawing.Size(154, 20); - this.CoronaSizeTextBox.TabIndex = 179; + this.CoronaSizeTextBox.TabIndex = 242; this.CoronaSizeTextBox.TextChanged += new System.EventHandler(this.CoronaSizeTextBox_TextChanged); // // label14 // this.label14.AutoSize = true; - this.label14.Location = new System.Drawing.Point(10, 328); + this.label14.Location = new System.Drawing.Point(3, 330); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(65, 13); - this.label14.TabIndex = 178; + this.label14.TabIndex = 241; this.label14.Text = "Corona size:"; // // ColourBUpDown // - this.ColourBUpDown.Location = new System.Drawing.Point(204, 91); + this.ColourBUpDown.Location = new System.Drawing.Point(204, 97); this.ColourBUpDown.Maximum = new decimal(new int[] { 255, 0, @@ -686,7 +876,7 @@ 0}); this.ColourBUpDown.Name = "ColourBUpDown"; this.ColourBUpDown.Size = new System.Drawing.Size(38, 20); - this.ColourBUpDown.TabIndex = 177; + this.ColourBUpDown.TabIndex = 145; this.ColourBUpDown.Value = new decimal(new int[] { 255, 0, @@ -696,7 +886,7 @@ // // ColourGUpDown // - this.ColourGUpDown.Location = new System.Drawing.Point(163, 91); + this.ColourGUpDown.Location = new System.Drawing.Point(163, 97); this.ColourGUpDown.Maximum = new decimal(new int[] { 255, 0, @@ -704,7 +894,7 @@ 0}); this.ColourGUpDown.Name = "ColourGUpDown"; this.ColourGUpDown.Size = new System.Drawing.Size(38, 20); - this.ColourGUpDown.TabIndex = 176; + this.ColourGUpDown.TabIndex = 144; this.ColourGUpDown.Value = new decimal(new int[] { 255, 0, @@ -714,7 +904,7 @@ // // ColourRUpDown // - this.ColourRUpDown.Location = new System.Drawing.Point(122, 91); + this.ColourRUpDown.Location = new System.Drawing.Point(122, 97); this.ColourRUpDown.Maximum = new decimal(new int[] { 255, 0, @@ -722,7 +912,7 @@ 0}); this.ColourRUpDown.Name = "ColourRUpDown"; this.ColourRUpDown.Size = new System.Drawing.Size(38, 20); - this.ColourRUpDown.TabIndex = 175; + this.ColourRUpDown.TabIndex = 143; this.ColourRUpDown.Value = new decimal(new int[] { 255, 0, @@ -730,136 +920,82 @@ 0}); this.ColourRUpDown.ValueChanged += new System.EventHandler(this.ColourRUpDown_ValueChanged); // - // CoronaIntensityUpDown - // - this.CoronaIntensityUpDown.Location = new System.Drawing.Point(88, 351); - this.CoronaIntensityUpDown.Maximum = new decimal(new int[] { - 255, - 0, - 0, - 0}); - this.CoronaIntensityUpDown.Name = "CoronaIntensityUpDown"; - this.CoronaIntensityUpDown.Size = new System.Drawing.Size(154, 20); - this.CoronaIntensityUpDown.TabIndex = 166; - this.CoronaIntensityUpDown.Value = new decimal(new int[] { - 255, - 0, - 0, - 0}); - this.CoronaIntensityUpDown.ValueChanged += new System.EventHandler(this.CoronaIntensityUpDown_ValueChanged); - // // label9 // this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(10, 353); + this.label9.Location = new System.Drawing.Point(3, 353); this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(44, 13); - this.label9.TabIndex = 165; - this.label9.Text = "Corona:"; - // - // OuterAngleUpDown - // - this.OuterAngleUpDown.Location = new System.Drawing.Point(88, 299); - this.OuterAngleUpDown.Maximum = new decimal(new int[] { - 255, - 0, - 0, - 0}); - this.OuterAngleUpDown.Name = "OuterAngleUpDown"; - this.OuterAngleUpDown.Size = new System.Drawing.Size(154, 20); - this.OuterAngleUpDown.TabIndex = 164; - this.OuterAngleUpDown.Value = new decimal(new int[] { - 255, - 0, - 0, - 0}); - this.OuterAngleUpDown.ValueChanged += new System.EventHandler(this.OuterAngleUpDown_ValueChanged); + this.label9.Size = new System.Drawing.Size(85, 13); + this.label9.TabIndex = 251; + this.label9.Text = "Corona intensity:"; // // label8 // this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(10, 301); + this.label8.Location = new System.Drawing.Point(3, 307); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(65, 13); - this.label8.TabIndex = 163; + this.label8.TabIndex = 231; this.label8.Text = "Outer angle:"; // - // InnerAngleUpDown - // - this.InnerAngleUpDown.Location = new System.Drawing.Point(88, 273); - this.InnerAngleUpDown.Maximum = new decimal(new int[] { - 255, - 0, - 0, - 0}); - this.InnerAngleUpDown.Name = "InnerAngleUpDown"; - this.InnerAngleUpDown.Size = new System.Drawing.Size(154, 20); - this.InnerAngleUpDown.TabIndex = 162; - this.InnerAngleUpDown.Value = new decimal(new int[] { - 255, - 0, - 0, - 0}); - this.InnerAngleUpDown.ValueChanged += new System.EventHandler(this.InnerAngleUpDown_ValueChanged); - // // label7 // this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(10, 275); + this.label7.Location = new System.Drawing.Point(3, 284); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(63, 13); - this.label7.TabIndex = 161; + this.label7.TabIndex = 221; this.label7.Text = "Inner angle:"; // // label6 // this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(10, 484); + this.label6.Location = new System.Drawing.Point(3, 468); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(51, 13); - this.label6.TabIndex = 159; - this.label6.Text = "Txt hash:"; + this.label6.Size = new System.Drawing.Size(72, 13); + this.label6.TabIndex = 301; + this.label6.Text = "Texture hash:"; // - // HashTextBox + // TextureHashTextBox // - this.HashTextBox.Location = new System.Drawing.Point(88, 481); - this.HashTextBox.Name = "HashTextBox"; - this.HashTextBox.Size = new System.Drawing.Size(154, 20); - this.HashTextBox.TabIndex = 160; - this.HashTextBox.TextChanged += new System.EventHandler(this.HashTextBox_TextChanged); + this.TextureHashTextBox.Location = new System.Drawing.Point(88, 465); + this.TextureHashTextBox.Name = "TextureHashTextBox"; + this.TextureHashTextBox.Size = new System.Drawing.Size(154, 20); + this.TextureHashTextBox.TabIndex = 302; + this.TextureHashTextBox.TextChanged += new System.EventHandler(this.TextureHashTextBox_TextChanged); // // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(10, 250); + this.label5.Location = new System.Drawing.Point(3, 261); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(58, 13); - this.label5.TabIndex = 157; + this.label5.TabIndex = 211; this.label5.Text = "Falloff exp:"; // // FalloffExponentTextBox // - this.FalloffExponentTextBox.Location = new System.Drawing.Point(88, 247); + this.FalloffExponentTextBox.Location = new System.Drawing.Point(88, 258); this.FalloffExponentTextBox.Name = "FalloffExponentTextBox"; this.FalloffExponentTextBox.Size = new System.Drawing.Size(154, 20); - this.FalloffExponentTextBox.TabIndex = 158; + this.FalloffExponentTextBox.TabIndex = 212; this.FalloffExponentTextBox.TextChanged += new System.EventHandler(this.FalloffExponentTextBox_TextChanged); // // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(10, 224); + this.label4.Location = new System.Drawing.Point(3, 238); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(38, 13); - this.label4.TabIndex = 155; + this.label4.TabIndex = 201; this.label4.Text = "Falloff:"; // // FalloffTextBox // - this.FalloffTextBox.Location = new System.Drawing.Point(88, 221); + this.FalloffTextBox.Location = new System.Drawing.Point(88, 235); this.FalloffTextBox.Name = "FalloffTextBox"; this.FalloffTextBox.Size = new System.Drawing.Size(154, 20); - this.FalloffTextBox.TabIndex = 156; + this.FalloffTextBox.TabIndex = 202; this.FalloffTextBox.TextChanged += new System.EventHandler(this.FalloffTextBox_TextChanged); // // TypeComboBox @@ -870,74 +1006,56 @@ "Point", "Spot", "Capsule"}); - this.TypeComboBox.Location = new System.Drawing.Point(88, 62); + this.TypeComboBox.Location = new System.Drawing.Point(88, 73); this.TypeComboBox.Name = "TypeComboBox"; this.TypeComboBox.Size = new System.Drawing.Size(154, 21); - this.TypeComboBox.TabIndex = 154; + this.TypeComboBox.TabIndex = 132; this.TypeComboBox.SelectedIndexChanged += new System.EventHandler(this.TypeComboBox_SelectedIndexChanged); // - // IntensityUpDown - // - this.IntensityUpDown.Location = new System.Drawing.Point(88, 117); - this.IntensityUpDown.Maximum = new decimal(new int[] { - 100000000, - 0, - 0, - 0}); - this.IntensityUpDown.Name = "IntensityUpDown"; - this.IntensityUpDown.Size = new System.Drawing.Size(154, 20); - this.IntensityUpDown.TabIndex = 153; - this.IntensityUpDown.Value = new decimal(new int[] { - 255, - 0, - 0, - 0}); - this.IntensityUpDown.ValueChanged += new System.EventHandler(this.IntensityUpDown_ValueChanged); - // // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(10, 119); + this.label3.Location = new System.Drawing.Point(3, 123); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(49, 13); - this.label3.TabIndex = 152; + this.label3.TabIndex = 151; this.label3.Text = "Intensity:"; // // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(10, 93); + this.label2.Location = new System.Drawing.Point(3, 99); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(72, 13); - this.label2.TabIndex = 151; + this.label2.TabIndex = 141; this.label2.Text = "Colour (RGB):"; // // label13 // this.label13.AutoSize = true; - this.label13.Location = new System.Drawing.Point(10, 65); + this.label13.Location = new System.Drawing.Point(3, 76); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(34, 13); - this.label13.TabIndex = 150; + this.label13.TabIndex = 131; this.label13.Text = "Type:"; // // ColourLabel // this.ColourLabel.BackColor = System.Drawing.Color.White; this.ColourLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.ColourLabel.Location = new System.Drawing.Point(88, 90); + this.ColourLabel.Location = new System.Drawing.Point(88, 97); this.ColourLabel.Name = "ColourLabel"; - this.ColourLabel.Size = new System.Drawing.Size(30, 21); - this.ColourLabel.TabIndex = 149; + this.ColourLabel.Size = new System.Drawing.Size(30, 20); + this.ColourLabel.TabIndex = 142; this.ColourLabel.Click += new System.EventHandler(this.ColourLabel_Click); // // NormalizeDirectionButton // this.NormalizeDirectionButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.NormalizeDirectionButton.Location = new System.Drawing.Point(473, 34); + this.NormalizeDirectionButton.Location = new System.Drawing.Point(461, 23); this.NormalizeDirectionButton.Name = "NormalizeDirectionButton"; this.NormalizeDirectionButton.Size = new System.Drawing.Size(68, 23); - this.NormalizeDirectionButton.TabIndex = 148; + this.NormalizeDirectionButton.TabIndex = 113; this.NormalizeDirectionButton.Text = "Normalize"; this.NormalizeDirectionButton.UseVisualStyleBackColor = true; this.NormalizeDirectionButton.Click += new System.EventHandler(this.NormalizeDirectionButton_Click); @@ -945,29 +1063,29 @@ // label17 // this.label17.AutoSize = true; - this.label17.Location = new System.Drawing.Point(10, 39); + this.label17.Location = new System.Drawing.Point(3, 28); this.label17.Name = "label17"; this.label17.Size = new System.Drawing.Size(52, 13); - this.label17.TabIndex = 146; + this.label17.TabIndex = 111; this.label17.Text = "Direction:"; // // DirectionTextBox // this.DirectionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.DirectionTextBox.Location = new System.Drawing.Point(88, 36); + this.DirectionTextBox.Location = new System.Drawing.Point(88, 25); this.DirectionTextBox.Name = "DirectionTextBox"; - this.DirectionTextBox.Size = new System.Drawing.Size(379, 20); - this.DirectionTextBox.TabIndex = 147; + this.DirectionTextBox.Size = new System.Drawing.Size(367, 20); + this.DirectionTextBox.TabIndex = 112; this.DirectionTextBox.TextChanged += new System.EventHandler(this.DirectionTextBox_TextChanged); // // GoToButton // this.GoToButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.GoToButton.Location = new System.Drawing.Point(473, 8); + this.GoToButton.Location = new System.Drawing.Point(461, 0); this.GoToButton.Name = "GoToButton"; this.GoToButton.Size = new System.Drawing.Size(68, 23); - this.GoToButton.TabIndex = 145; + this.GoToButton.TabIndex = 102; this.GoToButton.Text = "Go to"; this.GoToButton.UseVisualStyleBackColor = true; this.GoToButton.Click += new System.EventHandler(this.GoToButton_Click); @@ -976,120 +1094,135 @@ // this.PositionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.PositionTextBox.Location = new System.Drawing.Point(88, 10); + this.PositionTextBox.Location = new System.Drawing.Point(88, 2); this.PositionTextBox.Name = "PositionTextBox"; - this.PositionTextBox.Size = new System.Drawing.Size(379, 20); - this.PositionTextBox.TabIndex = 144; + this.PositionTextBox.Size = new System.Drawing.Size(367, 20); + this.PositionTextBox.TabIndex = 101; this.PositionTextBox.TextChanged += new System.EventHandler(this.PositionTextBox_TextChanged); // // label31 // this.label31.AutoSize = true; - this.label31.Location = new System.Drawing.Point(10, 13); + this.label31.Location = new System.Drawing.Point(3, 5); this.label31.Name = "label31"; this.label31.Size = new System.Drawing.Size(47, 13); - this.label31.TabIndex = 143; + this.label31.TabIndex = 100; this.label31.Text = "Position:"; // - // menuStripFix1 + // MainMenu // - this.menuStripFix1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.createToolStripMenuItem, - this.optionsToolStripMenuItem, - this.moveToolStripMenuItem, - this.rotateToolStripMenuItem}); - this.menuStripFix1.Location = new System.Drawing.Point(0, 0); - this.menuStripFix1.Name = "menuStripFix1"; - this.menuStripFix1.Size = new System.Drawing.Size(732, 24); - this.menuStripFix1.TabIndex = 1; - this.menuStripFix1.Text = "menuStripFix1"; + this.MainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.EditMenu, + this.OptionsMenu, + this.MoveMenuItem, + this.RotateMenuItem, + this.ScaleMenuItem}); + this.MainMenu.Location = new System.Drawing.Point(0, 0); + this.MainMenu.Name = "MainMenu"; + this.MainMenu.Size = new System.Drawing.Size(733, 24); + this.MainMenu.TabIndex = 1; + this.MainMenu.Text = "menuStripFix1"; // - // createToolStripMenuItem + // EditMenu // - this.createToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.lightToolStripMenuItem, - this.deleteLightToolStripMenuItem}); - this.createToolStripMenuItem.Name = "createToolStripMenuItem"; - this.createToolStripMenuItem.Size = new System.Drawing.Size(39, 20); - this.createToolStripMenuItem.Text = "Edit"; + this.EditMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.EditNewLightMenu, + this.EditDeleteLightMenu}); + this.EditMenu.Name = "EditMenu"; + this.EditMenu.Size = new System.Drawing.Size(39, 20); + this.EditMenu.Text = "Edit"; // - // lightToolStripMenuItem + // EditNewLightMenu // - this.lightToolStripMenuItem.Name = "lightToolStripMenuItem"; - this.lightToolStripMenuItem.Size = new System.Drawing.Size(137, 22); - this.lightToolStripMenuItem.Text = "New Light"; - this.lightToolStripMenuItem.Click += new System.EventHandler(this.lightToolStripMenuItem_Click); + this.EditNewLightMenu.Name = "EditNewLightMenu"; + this.EditNewLightMenu.Size = new System.Drawing.Size(180, 22); + this.EditNewLightMenu.Text = "New Light"; + this.EditNewLightMenu.Click += new System.EventHandler(this.EditNewLightMenu_Click); // - // deleteLightToolStripMenuItem + // EditDeleteLightMenu // - this.deleteLightToolStripMenuItem.Name = "deleteLightToolStripMenuItem"; - this.deleteLightToolStripMenuItem.Size = new System.Drawing.Size(137, 22); - this.deleteLightToolStripMenuItem.Text = "Delete Light"; - this.deleteLightToolStripMenuItem.Click += new System.EventHandler(this.deleteLightToolStripMenuItem_Click); + this.EditDeleteLightMenu.Enabled = false; + this.EditDeleteLightMenu.Name = "EditDeleteLightMenu"; + this.EditDeleteLightMenu.Size = new System.Drawing.Size(180, 22); + this.EditDeleteLightMenu.Text = "Delete Light"; + this.EditDeleteLightMenu.Click += new System.EventHandler(this.EditDeleteLightMenu_Click); // - // optionsToolStripMenuItem + // OptionsMenu // - this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.showGizmosToolStripMenuItem}); - this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; - this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20); - this.optionsToolStripMenuItem.Text = "Options"; + this.OptionsMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.OptionsShowOutlinesMenu}); + this.OptionsMenu.Name = "OptionsMenu"; + this.OptionsMenu.Size = new System.Drawing.Size(61, 20); + this.OptionsMenu.Text = "Options"; // - // showGizmosToolStripMenuItem + // OptionsShowOutlinesMenu // - this.showGizmosToolStripMenuItem.Checked = true; - this.showGizmosToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.showGizmosToolStripMenuItem.Name = "showGizmosToolStripMenuItem"; - this.showGizmosToolStripMenuItem.Size = new System.Drawing.Size(175, 22); - this.showGizmosToolStripMenuItem.Text = "Show Light Gizmos"; - this.showGizmosToolStripMenuItem.Click += new System.EventHandler(this.showGizmosToolStripMenuItem_Click); + this.OptionsShowOutlinesMenu.Checked = true; + this.OptionsShowOutlinesMenu.CheckState = System.Windows.Forms.CheckState.Checked; + this.OptionsShowOutlinesMenu.Name = "OptionsShowOutlinesMenu"; + this.OptionsShowOutlinesMenu.Size = new System.Drawing.Size(180, 22); + this.OptionsShowOutlinesMenu.Text = "Show Light Outlines"; + this.OptionsShowOutlinesMenu.Click += new System.EventHandler(this.OptionsShowOutlinesMenu_Click); // - // moveToolStripMenuItem + // MoveMenuItem // - this.moveToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - this.moveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("moveToolStripMenuItem.Image"))); - this.moveToolStripMenuItem.Name = "moveToolStripMenuItem"; - this.moveToolStripMenuItem.Size = new System.Drawing.Size(28, 20); - this.moveToolStripMenuItem.Click += new System.EventHandler(this.moveToolStripMenuItem_Click); + this.MoveMenuItem.BackColor = System.Drawing.SystemColors.Control; + this.MoveMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("MoveMenuItem.Image"))); + this.MoveMenuItem.Name = "MoveMenuItem"; + this.MoveMenuItem.Size = new System.Drawing.Size(28, 20); + this.MoveMenuItem.ToolTipText = "Move"; + this.MoveMenuItem.Click += new System.EventHandler(this.MoveMenuItem_Click); // - // rotateToolStripMenuItem + // RotateMenuItem // - this.rotateToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("rotateToolStripMenuItem.Image"))); - this.rotateToolStripMenuItem.Name = "rotateToolStripMenuItem"; - this.rotateToolStripMenuItem.Size = new System.Drawing.Size(28, 20); - this.rotateToolStripMenuItem.Click += new System.EventHandler(this.rotateToolStripMenuItem_Click); + this.RotateMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("RotateMenuItem.Image"))); + this.RotateMenuItem.Name = "RotateMenuItem"; + this.RotateMenuItem.Size = new System.Drawing.Size(28, 20); + this.RotateMenuItem.ToolTipText = "Rotate"; + this.RotateMenuItem.Click += new System.EventHandler(this.RotateMenuItem_Click); + // + // ScaleMenuItem + // + this.ScaleMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("ScaleMenuItem.Image"))); + this.ScaleMenuItem.Name = "ScaleMenuItem"; + this.ScaleMenuItem.Size = new System.Drawing.Size(28, 20); + this.ScaleMenuItem.ToolTipText = "Scale"; + this.ScaleMenuItem.Click += new System.EventHandler(this.ScaleMenuItem_Click); // // ModelLightForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(732, 568); + this.ClientSize = new System.Drawing.Size(733, 547); this.Controls.Add(this.MainSplitContainer); - this.Controls.Add(this.menuStripFix1); + this.Controls.Add(this.MainMenu); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MainMenuStrip = this.menuStripFix1; + this.MainMenuStrip = this.MainMenu; this.Name = "ModelLightForm"; - this.Text = "ModelLightForm - CodeWalker by dexyfex"; + this.Text = "Light Editor - CodeWalker by dexyfex"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ModelLightForm_FormClosed); this.MainSplitContainer.Panel1.ResumeLayout(false); - this.MainSplitContainer.Panel1.PerformLayout(); this.MainSplitContainer.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.MainSplitContainer)).EndInit(); this.MainSplitContainer.ResumeLayout(false); this.LightPropertiesPanel.ResumeLayout(false); this.LightPropertiesPanel.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.VolumetricFadeDistanceUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.SpecularFadeDistanceUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.ShadowFadeDistanceUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.LightFadeDistanceUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.ShadowBlurUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.GroupIDUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.BoneIDUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.FlashinessUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.VolumeColorBUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.VolumeColorGUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.VolumeColorRUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.ColourBUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.ColourGUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.ColourRUpDown)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.CoronaIntensityUpDown)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.OuterAngleUpDown)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.InnerAngleUpDown)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.IntensityUpDown)).EndInit(); - this.menuStripFix1.ResumeLayout(false); - this.menuStripFix1.PerformLayout(); + this.MainMenu.ResumeLayout(false); + this.MainMenu.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -1098,7 +1231,6 @@ #endregion private System.Windows.Forms.SplitContainer MainSplitContainer; - private System.Windows.Forms.Label label1; private WinForms.TreeViewFix LightsTreeView; private System.Windows.Forms.Panel LightPropertiesPanel; private System.Windows.Forms.NumericUpDown ColourBUpDown; @@ -1108,20 +1240,16 @@ private System.Windows.Forms.Label label10; private System.Windows.Forms.CheckedListBox TimeFlagsPMCheckedListBox; private System.Windows.Forms.CheckedListBox TimeFlagsAMCheckedListBox; - private System.Windows.Forms.NumericUpDown CoronaIntensityUpDown; private System.Windows.Forms.Label label9; - private System.Windows.Forms.NumericUpDown OuterAngleUpDown; private System.Windows.Forms.Label label8; - private System.Windows.Forms.NumericUpDown InnerAngleUpDown; private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label6; - private System.Windows.Forms.TextBox HashTextBox; + private System.Windows.Forms.TextBox TextureHashTextBox; private System.Windows.Forms.Label label5; private System.Windows.Forms.TextBox FalloffExponentTextBox; private System.Windows.Forms.Label label4; private System.Windows.Forms.TextBox FalloffTextBox; private System.Windows.Forms.ComboBox TypeComboBox; - private System.Windows.Forms.NumericUpDown IntensityUpDown; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label13; @@ -1136,16 +1264,13 @@ private System.Windows.Forms.Label label14; private System.Windows.Forms.Label label15; private System.Windows.Forms.Label label11; - private System.Windows.Forms.TextBox FlashinessTextBox; private System.Windows.Forms.Label label12; private System.Windows.Forms.NumericUpDown VolumeColorBUpDown; private System.Windows.Forms.NumericUpDown VolumeColorGUpDown; private System.Windows.Forms.NumericUpDown VolumeColorRUpDown; private System.Windows.Forms.Label VolumeColorLabel; private System.Windows.Forms.Label label22; - private System.Windows.Forms.TextBox ShadowFadeDistanceTextBox; private System.Windows.Forms.Label label23; - private System.Windows.Forms.TextBox LightFadeDistanceTextBox; private System.Windows.Forms.Label label21; private System.Windows.Forms.TextBox VolumeOuterExponentTextBox; private System.Windows.Forms.Label label20; @@ -1154,30 +1279,45 @@ private System.Windows.Forms.Label label18; private System.Windows.Forms.TextBox VolumeIntensityTextBox; private System.Windows.Forms.Label label16; - private System.Windows.Forms.TextBox ShadowBlurTextBox; private System.Windows.Forms.Label label28; private System.Windows.Forms.TextBox CoronaZBiasTextBox; private System.Windows.Forms.Label label27; private System.Windows.Forms.TextBox ShadowNearClipTextBox; private System.Windows.Forms.Label label26; - private System.Windows.Forms.TextBox VolumetricFadeDistanceTextBox; private System.Windows.Forms.Label label25; - private System.Windows.Forms.TextBox SpecularFadeDistanceTextBox; private System.Windows.Forms.Label label29; private System.Windows.Forms.TextBox ExtentTextBox; - private WinForms.MenuStripFix menuStripFix1; - private System.Windows.Forms.ToolStripMenuItem createToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem lightToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem deleteLightToolStripMenuItem; - private System.Windows.Forms.TextBox GroupIDTextBox; - private System.Windows.Forms.TextBox BoneIDTextBox; - private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem showGizmosToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem moveToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem rotateToolStripMenuItem; + private WinForms.MenuStripFix MainMenu; + private System.Windows.Forms.ToolStripMenuItem EditMenu; + private System.Windows.Forms.ToolStripMenuItem EditNewLightMenu; + private System.Windows.Forms.ToolStripMenuItem EditDeleteLightMenu; + private System.Windows.Forms.ToolStripMenuItem OptionsMenu; + private System.Windows.Forms.ToolStripMenuItem OptionsShowOutlinesMenu; + private System.Windows.Forms.ToolStripMenuItem MoveMenuItem; + private System.Windows.Forms.ToolStripMenuItem RotateMenuItem; private System.Windows.Forms.Label label24; private System.Windows.Forms.TextBox CullingPlaneNormalTextBox; private System.Windows.Forms.Label label30; private System.Windows.Forms.TextBox CullingPlaneOffsetTextBox; + private System.Windows.Forms.ToolStripMenuItem ScaleMenuItem; + private System.Windows.Forms.Button NormalizeTangentButton; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox TangentTextBox; + private System.Windows.Forms.TextBox FlagsTextBox; + private System.Windows.Forms.Label label32; + private System.Windows.Forms.TextBox IntensityTextBox; + private System.Windows.Forms.TextBox OuterAngleTextBox; + private System.Windows.Forms.TextBox InnerAngleTextBox; + private System.Windows.Forms.TextBox CoronaIntensityTextBox; + private System.Windows.Forms.NumericUpDown VolumetricFadeDistanceUpDown; + private System.Windows.Forms.NumericUpDown SpecularFadeDistanceUpDown; + private System.Windows.Forms.NumericUpDown ShadowFadeDistanceUpDown; + private System.Windows.Forms.NumericUpDown LightFadeDistanceUpDown; + private System.Windows.Forms.NumericUpDown ShadowBlurUpDown; + private System.Windows.Forms.NumericUpDown GroupIDUpDown; + private System.Windows.Forms.NumericUpDown BoneIDUpDown; + private System.Windows.Forms.NumericUpDown FlashinessUpDown; + private System.Windows.Forms.Button DeleteLightButton; + private System.Windows.Forms.Button NewLightButton; } } \ No newline at end of file diff --git a/CodeWalker/Forms/ModelLightForm.cs b/CodeWalker/Forms/ModelLightForm.cs index 0a68b2e..91dcda9 100644 --- a/CodeWalker/Forms/ModelLightForm.cs +++ b/CodeWalker/Forms/ModelLightForm.cs @@ -1,4 +1,5 @@ using CodeWalker.GameFiles; +using CodeWalker.World; using SharpDX; using System; using System.Collections.Generic; @@ -92,7 +93,7 @@ namespace CodeWalker.Forms { var tnc = LightsTreeView.Nodes; var light = lights[mi]; - string mprefix = "Light" + (mi + 1).ToString(); + string mprefix = "Light" + (mi + 1).ToString() + " : " + light.Type.ToString(); var mnode = parent == null ? tnc.Add(mprefix) : parent.Nodes.Add(mprefix); mnode.Tag = light; mnode.Expand(); @@ -108,37 +109,40 @@ namespace CodeWalker.Forms if(light == null) { + DeleteLightButton.Enabled = false; + EditDeleteLightMenu.Enabled = false; populatingui = true; PositionTextBox.Text = ""; DirectionTextBox.Text = ""; + TangentTextBox.Text = ""; TypeComboBox.SelectedItem = "Point"; ColourRUpDown.Value = 0; ColourGUpDown.Value = 0; ColourBUpDown.Value = 0; - IntensityUpDown.Value = 0; - FlashinessTextBox.Text = ""; - BoneIDTextBox.Text = ""; - GroupIDTextBox.Text = ""; + IntensityTextBox.Text = ""; + FlashinessUpDown.Value = 0; + BoneIDUpDown.Value = 0; + GroupIDUpDown.Value = 0; FalloffTextBox.Text = ""; FalloffExponentTextBox.Text = ""; - InnerAngleUpDown.Value = 0; - OuterAngleUpDown.Value = 0; + InnerAngleTextBox.Text = ""; + OuterAngleTextBox.Text = ""; CoronaSizeTextBox.Text = ""; - CoronaIntensityUpDown.Value = 0; + CoronaIntensityTextBox.Text = ""; ExtentTextBox.Text = ""; - ShadowBlurTextBox.Text = ""; - LightFadeDistanceTextBox.Text = ""; + ShadowBlurUpDown.Value = 0; + LightFadeDistanceUpDown.Value = 0; CoronaZBiasTextBox.Text = ""; - HashTextBox.Text = ""; + TextureHashTextBox.Text = ""; VolumeIntensityTextBox.Text = ""; VolumeSizeScaleTextBox.Text = ""; VolumeColorRUpDown.Value = 0; VolumeColorGUpDown.Value = 0; VolumeColorBUpDown.Value = 0; VolumeOuterExponentTextBox.Text = ""; - ShadowFadeDistanceTextBox.Text = ""; - SpecularFadeDistanceTextBox.Text = ""; - VolumetricFadeDistanceTextBox.Text = ""; + ShadowFadeDistanceUpDown.Value = 0; + SpecularFadeDistanceUpDown.Value = 0; + VolumetricFadeDistanceUpDown.Value = 0; ShadowNearClipTextBox.Text = ""; CullingPlaneNormalTextBox.Text = ""; CullingPlaneOffsetTextBox.Text = ""; @@ -147,29 +151,32 @@ namespace CodeWalker.Forms } else { + DeleteLightButton.Enabled = true; + EditDeleteLightMenu.Enabled = true; populatingui = true; PositionTextBox.Text = FloatUtil.GetVector3String(light.Position); DirectionTextBox.Text = FloatUtil.GetVector3String(light.Direction); + TangentTextBox.Text = FloatUtil.GetVector3String(light.Tangent); TypeComboBox.SelectedItem = light.Type.ToString(); ColourRUpDown.Value = light.ColorR; ColourGUpDown.Value = light.ColorG; ColourBUpDown.Value = light.ColorB; ColourLabel.BackColor = System.Drawing.Color.FromArgb(light.ColorR, light.ColorG, light.ColorB); - IntensityUpDown.Value = (decimal)light.Intensity > IntensityUpDown.Maximum ? IntensityUpDown.Maximum : (decimal)light.Intensity; - FlashinessTextBox.Text = FloatUtil.ToString(light.Flashiness); - BoneIDTextBox.Text = FloatUtil.ToString(light.BoneId); - GroupIDTextBox.Text = FloatUtil.ToString(light.GroupId); + IntensityTextBox.Text = FloatUtil.ToString(light.Intensity); + FlashinessUpDown.Value = light.Flashiness; + BoneIDUpDown.Value = light.BoneId; + GroupIDUpDown.Value = light.GroupId; FalloffTextBox.Text = FloatUtil.ToString(light.Falloff); FalloffExponentTextBox.Text = FloatUtil.ToString(light.FalloffExponent); - InnerAngleUpDown.Value = (decimal)light.ConeInnerAngle > InnerAngleUpDown.Maximum ? InnerAngleUpDown.Maximum : (decimal)light.ConeInnerAngle; - OuterAngleUpDown.Value = (decimal)light.ConeOuterAngle > OuterAngleUpDown.Maximum ? OuterAngleUpDown.Maximum : (decimal)light.ConeOuterAngle; + InnerAngleTextBox.Text = FloatUtil.ToString(light.ConeInnerAngle); + OuterAngleTextBox.Text = FloatUtil.ToString(light.ConeOuterAngle); CoronaSizeTextBox.Text = FloatUtil.ToString(light.CoronaSize); - CoronaIntensityUpDown.Value = (decimal)light.CoronaIntensity > CoronaIntensityUpDown.Maximum ? CoronaIntensityUpDown.Maximum : (decimal)light.CoronaIntensity; + CoronaIntensityTextBox.Text = FloatUtil.ToString(light.CoronaIntensity); ExtentTextBox.Text = FloatUtil.GetVector3String(light.Extent); - ShadowBlurTextBox.Text = FloatUtil.ToString(light.ShadowBlur); - LightFadeDistanceTextBox.Text = FloatUtil.ToString(light.LightFadeDistance); + ShadowBlurUpDown.Value = light.ShadowBlur; + LightFadeDistanceUpDown.Value = light.LightFadeDistance; CoronaZBiasTextBox.Text = FloatUtil.ToString(light.CoronaZBias); - HashTextBox.Text = light.ProjectedTextureHash.Hash.ToString(); + TextureHashTextBox.Text = light.ProjectedTextureHash.ToCleanString(); VolumeIntensityTextBox.Text = FloatUtil.ToString(light.VolumeIntensity); VolumeSizeScaleTextBox.Text = FloatUtil.ToString(light.VolumeSizeScale); VolumeColorRUpDown.Value = light.VolumeOuterColorR; @@ -177,9 +184,9 @@ namespace CodeWalker.Forms VolumeColorBUpDown.Value = light.VolumeOuterColorB; VolumeColorLabel.BackColor = System.Drawing.Color.FromArgb(light.VolumeOuterColorR, light.VolumeOuterColorG, light.VolumeOuterColorB); VolumeOuterExponentTextBox.Text = FloatUtil.ToString(light.VolumeOuterExponent); - ShadowFadeDistanceTextBox.Text = FloatUtil.ToString(light.ShadowFadeDistance); - SpecularFadeDistanceTextBox.Text = FloatUtil.ToString(light.SpecularFadeDistance); - VolumetricFadeDistanceTextBox.Text = FloatUtil.ToString(light.VolumetricFadeDistance); + ShadowFadeDistanceUpDown.Value = light.ShadowFadeDistance; + SpecularFadeDistanceUpDown.Value = light.SpecularFadeDistance; + VolumetricFadeDistanceUpDown.Value = light.VolumetricFadeDistance; ShadowNearClipTextBox.Text = FloatUtil.ToString(light.ShadowNearClip); CullingPlaneNormalTextBox.Text = FloatUtil.GetVector3String(light.CullingPlaneNormal); CullingPlaneOffsetTextBox.Text = FloatUtil.ToString(light.CullingPlaneOffset); @@ -191,7 +198,8 @@ namespace CodeWalker.Forms public void UpdateLightParams() { - selectedLight.HasChanged = true; + if (selectedLight == null) return; + selectedLight.UpdateRenderable = true; } @@ -199,8 +207,8 @@ namespace CodeWalker.Forms { LightAttributes light = new LightAttributes(); light.Direction = Vector3.BackwardLH; - light.Tangent = Vector3.Normalize(Vector3.BackwardLH.GetPerpVec()); - light.Intensity = 20; + light.Tangent = Vector3.Right; + light.Intensity = 5; light.ConeInnerAngle = 5; light.ConeOuterAngle = 35; light.Extent = Vector3.One; @@ -209,6 +217,7 @@ namespace CodeWalker.Forms light.ColorR = 255; light.ColorG = 255; light.ColorB = 255; + light.TimeFlags = 14680191; return light; } private void SelectLight(LightAttributes light) @@ -218,30 +227,57 @@ namespace CodeWalker.Forms selectedLight = null; ModelForm.selectedLight = null; UpdateUI(); - ModelForm.UpdateWidget(); } else { selectedLight = light; ModelForm.selectedLight = light; UpdateUI(); - ModelForm.UpdateWidget(); + ModelForm.SetWidgetTransform(light.Position, light.Orientation, new Vector3(light.Falloff)); + } + } + private void SelectLightTreeNode(LightAttributes light) + { + foreach (TreeNode rn in LightsTreeView.Nodes) + { + if (rn.Tag == light) + { + LightsTreeView.SelectedNode = rn; + break; + } + var found = false; + foreach (TreeNode tn in rn.Nodes) + { + if (tn.Tag == light) + { + LightsTreeView.SelectedNode = tn; + found = true; + break; + } + } + if (found) + { + break; + } } } private void CreateLight() { + selectedLight = NewLightAttribute(); if(Drawable != null) { - List lights = Drawable.LightAttributes.data_items.ToList(); - lights.Add(NewLightAttribute()); + if (Drawable.LightAttributes == null) Drawable.LightAttributes = new ResourceSimpleList64(); + List lights = Drawable.LightAttributes.data_items?.ToList() ?? new List(); + lights.Add(selectedLight); Drawable.LightAttributes.data_items = lights.ToArray(); UpdateLightParams(); LoadModel(Drawable); } else if(FragDrawable != null) { - List lights = FragDrawable.OwnerFragment.LightAttributes.data_items.ToList(); - lights.Add(NewLightAttribute()); + if (FragDrawable.OwnerFragment.LightAttributes == null) FragDrawable.OwnerFragment.LightAttributes = new ResourceSimpleList64(); + List lights = FragDrawable.OwnerFragment.LightAttributes.data_items?.ToList() ?? new List(); + lights.Add(selectedLight); FragDrawable.OwnerFragment.LightAttributes.data_items = lights.ToArray(); UpdateLightParams(); LoadModel(FragDrawable); @@ -255,14 +291,16 @@ namespace CodeWalker.Forms if (dr == null) { dr = n.Parent.Tag as Drawable; } //try parent node tag also if (dr!= null) { - List lights = dr.LightAttributes.data_items.ToList(); - lights.Add(NewLightAttribute()); + if (dr.LightAttributes == null) dr.LightAttributes = new ResourceSimpleList64(); + List lights = dr.LightAttributes.data_items?.ToList() ?? new List(); + lights.Add(selectedLight); dr.LightAttributes.data_items = lights.ToArray(); UpdateLightParams(); LoadModels(DrawableDict); } } } + SelectLightTreeNode(selectedLight); } private void DeleteLight() { @@ -372,6 +410,21 @@ namespace CodeWalker.Forms } } + + + public void SetWidgetModeUI(WidgetMode mode) + { + MoveMenuItem.Checked = (mode == WidgetMode.Position); + MoveMenuItem.BackColor = (mode == WidgetMode.Position) ? SystemColors.GradientActiveCaption : SystemColors.Control; + RotateMenuItem.Checked = (mode == WidgetMode.Rotation); + RotateMenuItem.BackColor = (mode == WidgetMode.Rotation) ? SystemColors.GradientActiveCaption : SystemColors.Control; + ScaleMenuItem.Checked = (mode == WidgetMode.Scale); + ScaleMenuItem.BackColor = (mode == WidgetMode.Scale) ? SystemColors.GradientActiveCaption : SystemColors.Control; + } + + + + private void LightsTreeView_AfterSelect(object sender, TreeViewEventArgs e) { SelectLight(e.Node.Tag as LightAttributes); @@ -387,12 +440,6 @@ namespace CodeWalker.Forms ModelForm.SetCameraPosition(selectedLight.Position, selectedLight.Falloff * 2f); } - private void NormalizeDirectionButton_Click(object sender, EventArgs e) - { - Vector3 d = Vector3.Normalize(FloatUtil.ParseVector3String(DirectionTextBox.Text)); - DirectionTextBox.Text = FloatUtil.GetVector3String(d); - } - private void PositionTextBox_TextChanged(object sender, EventArgs e) { if (populatingui) return; @@ -425,11 +472,11 @@ namespace CodeWalker.Forms UpdateLightParams(); } - private void IntensityUpDown_ValueChanged(object sender, EventArgs e) + private void IntensityTextBox_TextChanged(object sender, EventArgs e) { if (populatingui) return; if (selectedLight == null) return; - float v = FloatUtil.Parse(IntensityUpDown.Text); + float v = FloatUtil.Parse(IntensityTextBox.Text); if (selectedLight.Intensity != v) { selectedLight.Intensity = v; @@ -488,11 +535,11 @@ namespace CodeWalker.Forms } } - private void InnerAngleUpDown_ValueChanged(object sender, EventArgs e) + private void InnerAngleTextBox_TextChanged(object sender, EventArgs e) { if (populatingui) return; if (selectedLight == null) return; - float v = FloatUtil.Parse(InnerAngleUpDown.Text); + float v = FloatUtil.Parse(InnerAngleTextBox.Text); if (selectedLight.ConeInnerAngle != v) { selectedLight.ConeInnerAngle = v; @@ -500,11 +547,11 @@ namespace CodeWalker.Forms } } - private void OuterAngleUpDown_ValueChanged(object sender, EventArgs e) + private void OuterAngleTextBox_TextChanged(object sender, EventArgs e) { if (populatingui) return; if (selectedLight == null) return; - float v = FloatUtil.Parse(OuterAngleUpDown.Text); + float v = FloatUtil.Parse(OuterAngleTextBox.Text); if (selectedLight.ConeOuterAngle != v) { selectedLight.ConeOuterAngle = v; @@ -512,11 +559,11 @@ namespace CodeWalker.Forms } } - private void CoronaIntensityUpDown_ValueChanged(object sender, EventArgs e) + private void CoronaIntensityTextBox_TextChanged(object sender, EventArgs e) { if (populatingui) return; if (selectedLight == null) return; - float v = FloatUtil.Parse(CoronaIntensityUpDown.Text); + float v = FloatUtil.Parse(CoronaIntensityTextBox.Text); if (selectedLight.CoronaIntensity != v) { selectedLight.CoronaIntensity = v; @@ -544,43 +591,79 @@ namespace CodeWalker.Forms if (selectedLight.Direction != v) { selectedLight.Direction = v; - selectedLight.Tangent = Vector3.Normalize(selectedLight.Direction.GetPerpVec()); UpdateLightParams(); } } - private void FlashinessTextBox_TextChanged(object sender, EventArgs e) + private void NormalizeDirectionButton_Click(object sender, EventArgs e) + { + Vector3 d = Vector3.Normalize(FloatUtil.ParseVector3String(DirectionTextBox.Text)); + DirectionTextBox.Text = FloatUtil.GetVector3String(d); + } + + private void TangentTextBox_TextChanged(object sender, EventArgs e) { if (populatingui) return; if (selectedLight == null) return; - float v = FloatUtil.Parse(FlashinessTextBox.Text); + Vector3 v = FloatUtil.ParseVector3String(TangentTextBox.Text); + if (selectedLight.Tangent != v) + { + selectedLight.Tangent = v; + UpdateLightParams(); + } + } + + private void NormalizeTangentButton_Click(object sender, EventArgs e) + { + Vector3 t = Vector3.Normalize(FloatUtil.ParseVector3String(TangentTextBox.Text)); + TangentTextBox.Text = FloatUtil.GetVector3String(t); + } + + private void FlagsTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + uint.TryParse(FlagsTextBox.Text, out uint v); + if (selectedLight.Flags != v) + { + selectedLight.Flags = v; + UpdateLightParams(); + } + + } + + private void FlashinessUpDown_ValueChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + var v = (byte)FlashinessUpDown.Value; if (selectedLight.Flashiness != v) { - selectedLight.Flashiness = (byte)v; + selectedLight.Flashiness = v; UpdateLightParams(); } } - private void BoneIDTextBox_TextChanged(object sender, EventArgs e) + private void BoneIDUpDown_ValueChanged(object sender, EventArgs e) { if (populatingui) return; if (selectedLight == null) return; - float v = FloatUtil.Parse(BoneIDTextBox.Text); + var v = (ushort)BoneIDUpDown.Value; if (selectedLight.BoneId != v) { - selectedLight.BoneId = (ushort)v; + selectedLight.BoneId = v; UpdateLightParams(); } } - private void GroupIDTextBox_TextChanged(object sender, EventArgs e) + private void GroupIDUpDown_ValueChanged(object sender, EventArgs e) { if (populatingui) return; if (selectedLight == null) return; - float v = FloatUtil.Parse(GroupIDTextBox.Text); + var v = (byte)GroupIDUpDown.Value; if (selectedLight.GroupId != v) { - selectedLight.GroupId = (byte)v; + selectedLight.GroupId = v; UpdateLightParams(); } } @@ -597,26 +680,26 @@ namespace CodeWalker.Forms } } - private void ShadowBlurTextBox_TextChanged(object sender, EventArgs e) + private void ShadowBlurUpDown_ValueChanged(object sender, EventArgs e) { if (populatingui) return; if (selectedLight == null) return; - float v = FloatUtil.Parse(ShadowBlurTextBox.Text); + var v = (byte)ShadowBlurUpDown.Value; if (selectedLight.ShadowBlur != v) { - selectedLight.ShadowBlur = (byte)v; + selectedLight.ShadowBlur = v; UpdateLightParams(); } } - private void LightFadeDistanceTextBox_TextChanged(object sender, EventArgs e) + private void LightFadeDistanceUpDown_ValueChanged(object sender, EventArgs e) { if (populatingui) return; if (selectedLight == null) return; - float v = FloatUtil.Parse(LightFadeDistanceTextBox.Text); + var v = (byte)LightFadeDistanceUpDown.Value; if (selectedLight.LightFadeDistance != v) { - selectedLight.LightFadeDistance = (byte)v; + selectedLight.LightFadeDistance = v; UpdateLightParams(); } } @@ -669,38 +752,38 @@ namespace CodeWalker.Forms } } - private void ShadowFadeDistanceTextBox_TextChanged(object sender, EventArgs e) + private void ShadowFadeDistanceUpDown_ValueChanged(object sender, EventArgs e) { if (populatingui) return; if (selectedLight == null) return; - float v = FloatUtil.Parse(ShadowFadeDistanceTextBox.Text); + var v = (byte)ShadowFadeDistanceUpDown.Value; if (selectedLight.ShadowFadeDistance != v) { - selectedLight.ShadowFadeDistance = (byte)v; + selectedLight.ShadowFadeDistance = v; UpdateLightParams(); } } - private void SpecularFadeDistanceTextBox_TextChanged(object sender, EventArgs e) + private void SpecularFadeDistanceUpDown_ValueChanged(object sender, EventArgs e) { if (populatingui) return; if (selectedLight == null) return; - float v = FloatUtil.Parse(SpecularFadeDistanceTextBox.Text); + var v = (byte)SpecularFadeDistanceUpDown.Value; if (selectedLight.SpecularFadeDistance != v) { - selectedLight.SpecularFadeDistance = (byte)v; + selectedLight.SpecularFadeDistance = v; UpdateLightParams(); } } - private void VolumetricFadeDistance_TextChanged(object sender, EventArgs e) + private void VolumetricFadeDistanceUpDown_ValueChanged(object sender, EventArgs e) { if (populatingui) return; if (selectedLight == null) return; - float v = FloatUtil.Parse(VolumetricFadeDistanceTextBox.Text); + var v = (byte)VolumetricFadeDistanceUpDown.Value; if (selectedLight.VolumetricFadeDistance != v) { - selectedLight.VolumetricFadeDistance = (byte)v; + selectedLight.VolumetricFadeDistance = v; UpdateLightParams(); } } @@ -790,11 +873,14 @@ namespace CodeWalker.Forms populatingui = false; } - private void HashTextBox_TextChanged(object sender, EventArgs e) + private void TextureHashTextBox_TextChanged(object sender, EventArgs e) { if (populatingui) return; if (selectedLight == null) return; - uint.TryParse(HashTextBox.Text, out uint v); + if (!uint.TryParse(TextureHashTextBox.Text, out uint v)) + { + v = JenkHash.GenHash(TextureHashTextBox.Text); + } if (selectedLight.ProjectedTextureHash != v) { selectedLight.ProjectedTextureHash = v; @@ -824,54 +910,51 @@ namespace CodeWalker.Forms } } - private void lightToolStripMenuItem_Click(object sender, EventArgs e) + private void EditNewLightMenu_Click(object sender, EventArgs e) { CreateLight(); } - private void deleteLightToolStripMenuItem_Click(object sender, EventArgs e) + private void EditDeleteLightMenu_Click(object sender, EventArgs e) { DeleteLight(); } - private void showGizmosToolStripMenuItem_Click(object sender, EventArgs e) + private void OptionsShowOutlinesMenu_Click(object sender, EventArgs e) { - showGizmosToolStripMenuItem.Checked = !showGizmosToolStripMenuItem.Checked; - ModelForm.showLightGizmos = showGizmosToolStripMenuItem.Checked; + OptionsShowOutlinesMenu.Checked = !OptionsShowOutlinesMenu.Checked; + ModelForm.showLightGizmos = OptionsShowOutlinesMenu.Checked; } - private void moveToolStripMenuItem_Click(object sender, EventArgs e) + private void MoveMenuItem_Click(object sender, EventArgs e) { - moveToolStripMenuItem.Checked = !moveToolStripMenuItem.Checked; - if (moveToolStripMenuItem.Checked) - { - moveToolStripMenuItem.BackColor = System.Drawing.SystemColors.GradientActiveCaption; - rotateToolStripMenuItem.Checked = false; - rotateToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - ModelForm.SetWidgetMode("Position"); - } - else - { - moveToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - ModelForm.SetWidgetMode("Default"); - } + var mode = MoveMenuItem.Checked ? WidgetMode.Default : WidgetMode.Position; + SetWidgetModeUI(mode); + ModelForm.SetWidgetMode(mode); } - private void rotateToolStripMenuItem_Click(object sender, EventArgs e) + private void RotateMenuItem_Click(object sender, EventArgs e) { - rotateToolStripMenuItem.Checked = !rotateToolStripMenuItem.Checked; - if (rotateToolStripMenuItem.Checked) - { - rotateToolStripMenuItem.BackColor = System.Drawing.SystemColors.GradientActiveCaption; - moveToolStripMenuItem.Checked = false; - moveToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - ModelForm.SetWidgetMode("Rotation"); - } - else - { - rotateToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; - ModelForm.SetWidgetMode("Default"); - } + var mode = RotateMenuItem.Checked ? WidgetMode.Default : WidgetMode.Rotation; + SetWidgetModeUI(mode); + ModelForm.SetWidgetMode(mode); + } + + private void ScaleMenuItem_Click(object sender, EventArgs e) + { + var mode = ScaleMenuItem.Checked ? WidgetMode.Default : WidgetMode.Scale; + SetWidgetModeUI(mode); + ModelForm.SetWidgetMode(mode); + } + + private void NewLightButton_Click(object sender, EventArgs e) + { + CreateLight(); + } + + private void DeleteLightButton_Click(object sender, EventArgs e) + { + DeleteLight(); } } } diff --git a/CodeWalker/Forms/ModelLightForm.resx b/CodeWalker/Forms/ModelLightForm.resx index 3825ee4..7b5727d 100644 --- a/CodeWalker/Forms/ModelLightForm.resx +++ b/CodeWalker/Forms/ModelLightForm.resx @@ -117,11 +117,11 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 17, 17 - + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO vAAADrwBlbxySQAAAKtJREFUOE+lUlsOgCAM40iegcPxz0n9IfwqXTatk5EYmzQM1paHphlaa1vvfS+l @@ -130,7 +130,7 @@ ZG1O6QTGlgf4FZ9QVAAAAABJRU5ErkJggg== - + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO vAAADrwBlbxySQAAAVFJREFUOE99kzFug0AQRTlCjpAj5AgRPVJadyno6alSubXokVK65Aa4pqKhDz3F @@ -140,6 +140,14 @@ O2LbRn1UoJ1CS+7BAGRZ5oRwPB6t0508BmhU7wwYivBETQjavu93ZwJQQ210vV7fRGz0ZQEGFG87oPD3 N9S6afQmrfYcg60p0Nngv1iLwyVj/SmFFQZqGk5kYH7yJc8Xs46JdsH/TJXc/eOmiKJfGa9fWzDSupYA AAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAHhJREFUOE/dkLsNwCAMRBkpMzAc69IgWuJLsGUQH4cyJz1Alu8VOEtSSlfOORKl + p67Mw+UQQvHeN2wFq7IIcFjpRZg9Aj3coSWNAPeMvoQbM3rHRsBLI1jCQpTxR2aB3pMyciKQMnIiqNU3 + PxPsWAqsDAVfqVWKczdonTmVYM9FFwAAAABJRU5ErkJggg== diff --git a/CodeWalker/Rendering/Renderable.cs b/CodeWalker/Rendering/Renderable.cs index 411cdea..b2dd047 100644 --- a/CodeWalker/Rendering/Renderable.cs +++ b/CodeWalker/Rendering/Renderable.cs @@ -325,15 +325,7 @@ namespace CodeWalker.Rendering } if (lights != null) { - var rlights = new RenderableLight[lights.Length]; - for (int i = 0; i < lights.Length; i++) - { - var rlight = new RenderableLight(); - rlight.Owner = this; - rlight.Init(lights[i]); - rlights[i] = rlight; - } - Lights = rlights; + InitLights(lights); } @@ -341,6 +333,19 @@ namespace CodeWalker.Rendering } + public void InitLights(LightAttributes[] lights) + { + var rlights = new RenderableLight[lights.Length]; + for (int i = 0; i < lights.Length; i++) + { + var rlight = new RenderableLight(); + rlight.Owner = this; + rlight.Init(lights[i]); + rlights[i] = rlight; + } + Lights = rlights; + } + private RenderableModel InitModel(DrawableModel dm) { var rmodel = new RenderableModel(); diff --git a/CodeWalker/Rendering/Renderer.cs b/CodeWalker/Rendering/Renderer.cs index ccf967d..52b75ea 100644 --- a/CodeWalker/Rendering/Renderer.cs +++ b/CodeWalker/Rendering/Renderer.cs @@ -3304,16 +3304,32 @@ namespace CodeWalker.Rendering { entity?.EnsureLights(rndbl.Key); + + + //reinit lights when added/removed from editor + var dd = rndbl.Key as Drawable; + var fd = rndbl.Key as FragDrawable; + var lights = dd?.LightAttributes?.data_items; + if ((lights == null) && (fd != null) && (fd?.OwnerFragment?.Drawable == fd)) + { + lights = fd.OwnerFragment.LightAttributes?.data_items; + } + if ((lights != null) && (lights.Length != rndbl.Lights.Length)) + { + rndbl.InitLights(lights); + } + + var linst = new RenderableLightInst(); for (int i = 0; i < rndbl.Lights.Length; i++) { var rndlight = rndbl.Lights[i]; var light = rndlight.OwnerLight; - if (light.HasChanged == true) + if (light.UpdateRenderable == true) { rndlight.Init(light); - light.HasChanged = false; + light.UpdateRenderable = false; } linst.EntityPosition = position;