• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythonwindowsphpgamebathyscapheguic翻訳omegattwitterframeworkbtronvb.net計画中(planning stage)testdomarduinodirectxpreviewerゲームエンジン

Commit MetaInfo

Revisionfec8c45c962b3fb50e6e0739bbb603c22f0796f9 (tree)
Time2013-11-09 21:18:06
AuthorHMML <hmml3939@gmai...>
CommiterHMML

Log Message

Save UI state to project file by ICanSavePlugin interface.

Change Summary

Incremental Difference

Binary files a/MMM_GraphEditor.v11.suo and b/MMM_GraphEditor.v11.suo differ
--- a/MMM_GraphEditor/GraphEditor.cs
+++ b/MMM_GraphEditor/GraphEditor.cs
@@ -7,16 +7,29 @@ using MikuMikuMoving.Plugin;
77 using MikuMikuPlugin;
88 using DxMath;
99 using System.Diagnostics;
10+using System.IO;
11+using System.Xml.Serialization;
12+using System.Reflection;
1013
1114 namespace MMM_GraphEditor
1215 {
13- public class GraphEditor : IResidentPlugin, IHaveUserControl
16+ public class GraphEditor : IResidentPlugin, IHaveUserControl, ICanSavePlugin
1417 {
15- protected GraphEditorControl control { get; set; }
18+ public class Config
19+ {
20+ public bool[] render_flags = { true, true, true, true, true, true };
21+ public bool[] edit_flags = { true, true, false };
22+ public int euler_rot_order = 0;
23+ public bool track_marker = true;
24+ public bool track_yzero = false;
25+ }
1626
27+
28+ protected GraphEditorControl control { get; set; }
1729 private const string func_label = "Editor";
1830 private int refresh_counter = 0;
1931 public int refresh_div = 10;
32+ public Config config;
2033
2134 public void Disabled()
2235 {
@@ -30,6 +43,7 @@ namespace MMM_GraphEditor
3043
3144 public void Initialize()
3245 {
46+ this.config = new Config();
3347 }
3448
3549 public void Update(float Frame, float ElapsedTime)
@@ -88,7 +102,57 @@ namespace MMM_GraphEditor
88102 public System.Windows.Forms.UserControl CreateControl()
89103 {
90104 this.control = new GraphEditorControl();
105+ this.control.config = this.config;
106+ this.control.UpdateUIStateByConfig();
91107 return this.control;
92108 }
109+
110+ /// <summary>
111+ /// プロジェクトへプラグインデータを保存する。
112+ /// プロジェクトが保存されたときに呼び出されます。
113+ /// なお、気持ち悪いかもしれませんがStreamは外でDisposeされます。
114+ /// </summary>
115+ /// <returns></returns>
116+ public Stream OnSaveProject()
117+ {
118+ MemoryStream stream = new MemoryStream();
119+ XmlSerializer serializer = new XmlSerializer(typeof(Config));
120+ serializer.Serialize(stream, config);
121+ return stream;
122+ }
123+
124+ /// <summary>
125+ /// プロジェクトからプラグインデータを読み込む。
126+ /// プロジェクトがロードされたときに呼び出されます。
127+ /// なお、気持ち悪いかもしれませんがStreamは外でDisposeされます。
128+ /// </summary>
129+ /// <param name="stream">データStream</param>
130+ public void OnLoadProject(Stream stream)
131+ {
132+ XmlSerializer serializer = new XmlSerializer(typeof(Config));
133+
134+ try
135+ {
136+ Config loadconf = (Config)serializer.Deserialize(stream);
137+ Type t = typeof(Config);
138+ foreach (MemberInfo m in t.GetMembers())
139+ {
140+ if (m.MemberType != MemberTypes.Field) continue;
141+ FieldInfo f = t.GetField(m.Name, BindingFlags.Public | BindingFlags.Instance);
142+ f.SetValue(this.config, f.GetValue(loadconf));
143+ }
144+ control.UpdateUIStateByConfig();
145+ }
146+ catch (Exception)
147+ {
148+ // ignore
149+ return;
150+ }
151+ finally
152+ {
153+ //やらなくてもいいですが、まあ一応。
154+ stream.Seek(0, SeekOrigin.Begin);
155+ }
156+ }
93157 }
94158 }
--- a/MMM_GraphEditor/GraphEditorControl.Designer.cs
+++ b/MMM_GraphEditor/GraphEditorControl.Designer.cs
@@ -28,7 +28,35 @@ namespace MMM_GraphEditor
2828 {
2929 base.OnLoad(e);
3030 this.Dock = System.Windows.Forms.DockStyle.Fill;
31+ UpdateUIStateByConfig();
32+ }
3133
34+ public void UpdateUIStateByConfig()
35+ {
36+ chk_track_merker.Checked = config.track_marker;
37+ chk_track_yzero.Checked = config.track_yzero;
38+ chk_edit_pos.Checked = config.edit_flags[GraphPort.IDX_EDIT_POS];
39+ chk_edit_pos_ip.Checked = config.edit_flags[GraphPort.IDX_EDIT_POS_IP];
40+ chk_edit_rot.Checked = config.edit_flags[GraphPort.IDX_EDIT_ROT];
41+ chk_plot_pos_x.Checked = config.render_flags[GraphPort.IDX_POS_X];
42+ chk_plot_pos_y.Checked = config.render_flags[GraphPort.IDX_POS_Y];
43+ chk_plot_pos_z.Checked = config.render_flags[GraphPort.IDX_POS_Z];
44+ chk_plot_rot_x.Checked = config.render_flags[GraphPort.IDX_ROT_R];
45+ chk_plot_rot_y.Checked = config.render_flags[GraphPort.IDX_ROT_P];
46+ chk_plot_rot_z.Checked = config.render_flags[GraphPort.IDX_ROT_Y];
47+ radio_zxy.Checked = radio_xzy.Checked = radio_xyz.Checked = false;
48+ switch (config.euler_rot_order)
49+ {
50+ case 1:
51+ radio_xyz.Checked = true;
52+ break;
53+ case 2:
54+ radio_xzy.Checked = true;
55+ break;
56+ default:
57+ radio_zxy.Checked = true;
58+ break;
59+ }
3260 }
3361
3462 protected override void OnResize(System.EventArgs e)
@@ -50,19 +78,19 @@ namespace MMM_GraphEditor
5078 this.components = new System.ComponentModel.Container();
5179 this.btn_plus = new System.Windows.Forms.Button();
5280 this.btn_minus = new System.Windows.Forms.Button();
53- this.btn_pos_x = new System.Windows.Forms.CheckBox();
54- this.btn_pos_y = new System.Windows.Forms.CheckBox();
55- this.btn_pos_z = new System.Windows.Forms.CheckBox();
56- this.btn_rot_x = new System.Windows.Forms.CheckBox();
57- this.btn_rot_y = new System.Windows.Forms.CheckBox();
58- this.btn_rot_z = new System.Windows.Forms.CheckBox();
81+ this.chk_plot_pos_x = new System.Windows.Forms.CheckBox();
82+ this.chk_plot_pos_y = new System.Windows.Forms.CheckBox();
83+ this.chk_plot_pos_z = new System.Windows.Forms.CheckBox();
84+ this.chk_plot_rot_x = new System.Windows.Forms.CheckBox();
85+ this.chk_plot_rot_y = new System.Windows.Forms.CheckBox();
86+ this.chk_plot_rot_z = new System.Windows.Forms.CheckBox();
5987 this.radio_zxy = new System.Windows.Forms.RadioButton();
60- this.radio_zyx = new System.Windows.Forms.RadioButton();
88+ this.radio_xyz = new System.Windows.Forms.RadioButton();
6189 this.radio_xzy = new System.Windows.Forms.RadioButton();
6290 this.btn_center = new System.Windows.Forms.Button();
6391 this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
64- this.chk_lock_horiz = new System.Windows.Forms.CheckBox();
65- this.chk_lock_virt = new System.Windows.Forms.CheckBox();
92+ this.chk_track_merker = new System.Windows.Forms.CheckBox();
93+ this.chk_track_yzero = new System.Windows.Forms.CheckBox();
6694 this.chk_edit_pos = new System.Windows.Forms.CheckBox();
6795 this.chk_edit_pos_ip = new System.Windows.Forms.CheckBox();
6896 this.chk_edit_rot = new System.Windows.Forms.CheckBox();
@@ -100,89 +128,89 @@ namespace MMM_GraphEditor
100128 this.btn_minus.UseVisualStyleBackColor = true;
101129 this.btn_minus.Click += new System.EventHandler(this.btn_minus_Click);
102130 //
103- // btn_pos_x
104- //
105- this.btn_pos_x.Appearance = System.Windows.Forms.Appearance.Button;
106- this.btn_pos_x.Checked = true;
107- this.btn_pos_x.CheckState = System.Windows.Forms.CheckState.Checked;
108- this.btn_pos_x.Location = new System.Drawing.Point(0, 156);
109- this.btn_pos_x.Name = "btn_pos_x";
110- this.btn_pos_x.Size = new System.Drawing.Size(18, 23);
111- this.btn_pos_x.TabIndex = 10;
112- this.btn_pos_x.Text = "X";
113- this.btn_pos_x.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
114- this.btn_pos_x.UseVisualStyleBackColor = true;
115- this.btn_pos_x.CheckedChanged += new System.EventHandler(this.btn_pos_x_CheckedChanged);
116- //
117- // btn_pos_y
118- //
119- this.btn_pos_y.Appearance = System.Windows.Forms.Appearance.Button;
120- this.btn_pos_y.Checked = true;
121- this.btn_pos_y.CheckState = System.Windows.Forms.CheckState.Checked;
122- this.btn_pos_y.Location = new System.Drawing.Point(17, 156);
123- this.btn_pos_y.Name = "btn_pos_y";
124- this.btn_pos_y.Size = new System.Drawing.Size(18, 23);
125- this.btn_pos_y.TabIndex = 11;
126- this.btn_pos_y.Text = "Y";
127- this.btn_pos_y.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
128- this.btn_pos_y.UseVisualStyleBackColor = true;
129- this.btn_pos_y.CheckedChanged += new System.EventHandler(this.btn_pos_y_CheckedChanged);
130- //
131- // btn_pos_z
132- //
133- this.btn_pos_z.Appearance = System.Windows.Forms.Appearance.Button;
134- this.btn_pos_z.Checked = true;
135- this.btn_pos_z.CheckState = System.Windows.Forms.CheckState.Checked;
136- this.btn_pos_z.Location = new System.Drawing.Point(34, 156);
137- this.btn_pos_z.Name = "btn_pos_z";
138- this.btn_pos_z.Size = new System.Drawing.Size(18, 23);
139- this.btn_pos_z.TabIndex = 12;
140- this.btn_pos_z.Text = "Z";
141- this.btn_pos_z.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
142- this.btn_pos_z.UseVisualStyleBackColor = true;
143- this.btn_pos_z.CheckedChanged += new System.EventHandler(this.btn_pos_z_CheckedChanged);
144- //
145- // btn_rot_x
146- //
147- this.btn_rot_x.Appearance = System.Windows.Forms.Appearance.Button;
148- this.btn_rot_x.Checked = true;
149- this.btn_rot_x.CheckState = System.Windows.Forms.CheckState.Checked;
150- this.btn_rot_x.Location = new System.Drawing.Point(0, 205);
151- this.btn_rot_x.Name = "btn_rot_x";
152- this.btn_rot_x.Size = new System.Drawing.Size(18, 23);
153- this.btn_rot_x.TabIndex = 13;
154- this.btn_rot_x.Text = "X";
155- this.btn_rot_x.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
156- this.btn_rot_x.UseVisualStyleBackColor = true;
157- this.btn_rot_x.CheckedChanged += new System.EventHandler(this.btn_rot_x_CheckedChanged);
158- //
159- // btn_rot_y
160- //
161- this.btn_rot_y.Appearance = System.Windows.Forms.Appearance.Button;
162- this.btn_rot_y.Checked = true;
163- this.btn_rot_y.CheckState = System.Windows.Forms.CheckState.Checked;
164- this.btn_rot_y.Location = new System.Drawing.Point(16, 205);
165- this.btn_rot_y.Name = "btn_rot_y";
166- this.btn_rot_y.Size = new System.Drawing.Size(18, 23);
167- this.btn_rot_y.TabIndex = 14;
168- this.btn_rot_y.Text = "Y";
169- this.btn_rot_y.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
170- this.btn_rot_y.UseVisualStyleBackColor = true;
171- this.btn_rot_y.CheckedChanged += new System.EventHandler(this.btn_rot_y_CheckedChanged);
172- //
173- // btn_rot_z
174- //
175- this.btn_rot_z.Appearance = System.Windows.Forms.Appearance.Button;
176- this.btn_rot_z.Checked = true;
177- this.btn_rot_z.CheckState = System.Windows.Forms.CheckState.Checked;
178- this.btn_rot_z.Location = new System.Drawing.Point(34, 205);
179- this.btn_rot_z.Name = "btn_rot_z";
180- this.btn_rot_z.Size = new System.Drawing.Size(18, 23);
181- this.btn_rot_z.TabIndex = 15;
182- this.btn_rot_z.Text = "Z";
183- this.btn_rot_z.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
184- this.btn_rot_z.UseVisualStyleBackColor = true;
185- this.btn_rot_z.CheckedChanged += new System.EventHandler(this.btn_rot_z_CheckedChanged);
131+ // chk_plot_pos_x
132+ //
133+ this.chk_plot_pos_x.Appearance = System.Windows.Forms.Appearance.Button;
134+ this.chk_plot_pos_x.Checked = true;
135+ this.chk_plot_pos_x.CheckState = System.Windows.Forms.CheckState.Checked;
136+ this.chk_plot_pos_x.Location = new System.Drawing.Point(0, 156);
137+ this.chk_plot_pos_x.Name = "chk_plot_pos_x";
138+ this.chk_plot_pos_x.Size = new System.Drawing.Size(18, 23);
139+ this.chk_plot_pos_x.TabIndex = 10;
140+ this.chk_plot_pos_x.Text = "X";
141+ this.chk_plot_pos_x.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
142+ this.chk_plot_pos_x.UseVisualStyleBackColor = true;
143+ this.chk_plot_pos_x.CheckedChanged += new System.EventHandler(this.btn_pos_x_CheckedChanged);
144+ //
145+ // chk_plot_pos_y
146+ //
147+ this.chk_plot_pos_y.Appearance = System.Windows.Forms.Appearance.Button;
148+ this.chk_plot_pos_y.Checked = true;
149+ this.chk_plot_pos_y.CheckState = System.Windows.Forms.CheckState.Checked;
150+ this.chk_plot_pos_y.Location = new System.Drawing.Point(17, 156);
151+ this.chk_plot_pos_y.Name = "chk_plot_pos_y";
152+ this.chk_plot_pos_y.Size = new System.Drawing.Size(18, 23);
153+ this.chk_plot_pos_y.TabIndex = 11;
154+ this.chk_plot_pos_y.Text = "Y";
155+ this.chk_plot_pos_y.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
156+ this.chk_plot_pos_y.UseVisualStyleBackColor = true;
157+ this.chk_plot_pos_y.CheckedChanged += new System.EventHandler(this.btn_pos_y_CheckedChanged);
158+ //
159+ // chk_plot_pos_z
160+ //
161+ this.chk_plot_pos_z.Appearance = System.Windows.Forms.Appearance.Button;
162+ this.chk_plot_pos_z.Checked = true;
163+ this.chk_plot_pos_z.CheckState = System.Windows.Forms.CheckState.Checked;
164+ this.chk_plot_pos_z.Location = new System.Drawing.Point(34, 156);
165+ this.chk_plot_pos_z.Name = "chk_plot_pos_z";
166+ this.chk_plot_pos_z.Size = new System.Drawing.Size(18, 23);
167+ this.chk_plot_pos_z.TabIndex = 12;
168+ this.chk_plot_pos_z.Text = "Z";
169+ this.chk_plot_pos_z.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
170+ this.chk_plot_pos_z.UseVisualStyleBackColor = true;
171+ this.chk_plot_pos_z.CheckedChanged += new System.EventHandler(this.btn_pos_z_CheckedChanged);
172+ //
173+ // chk_plot_rot_x
174+ //
175+ this.chk_plot_rot_x.Appearance = System.Windows.Forms.Appearance.Button;
176+ this.chk_plot_rot_x.Checked = true;
177+ this.chk_plot_rot_x.CheckState = System.Windows.Forms.CheckState.Checked;
178+ this.chk_plot_rot_x.Location = new System.Drawing.Point(0, 205);
179+ this.chk_plot_rot_x.Name = "chk_plot_rot_x";
180+ this.chk_plot_rot_x.Size = new System.Drawing.Size(18, 23);
181+ this.chk_plot_rot_x.TabIndex = 13;
182+ this.chk_plot_rot_x.Text = "X";
183+ this.chk_plot_rot_x.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
184+ this.chk_plot_rot_x.UseVisualStyleBackColor = true;
185+ this.chk_plot_rot_x.CheckedChanged += new System.EventHandler(this.btn_rot_x_CheckedChanged);
186+ //
187+ // chk_plot_rot_y
188+ //
189+ this.chk_plot_rot_y.Appearance = System.Windows.Forms.Appearance.Button;
190+ this.chk_plot_rot_y.Checked = true;
191+ this.chk_plot_rot_y.CheckState = System.Windows.Forms.CheckState.Checked;
192+ this.chk_plot_rot_y.Location = new System.Drawing.Point(16, 205);
193+ this.chk_plot_rot_y.Name = "chk_plot_rot_y";
194+ this.chk_plot_rot_y.Size = new System.Drawing.Size(18, 23);
195+ this.chk_plot_rot_y.TabIndex = 14;
196+ this.chk_plot_rot_y.Text = "Y";
197+ this.chk_plot_rot_y.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
198+ this.chk_plot_rot_y.UseVisualStyleBackColor = true;
199+ this.chk_plot_rot_y.CheckedChanged += new System.EventHandler(this.btn_rot_y_CheckedChanged);
200+ //
201+ // chk_plot_rot_z
202+ //
203+ this.chk_plot_rot_z.Appearance = System.Windows.Forms.Appearance.Button;
204+ this.chk_plot_rot_z.Checked = true;
205+ this.chk_plot_rot_z.CheckState = System.Windows.Forms.CheckState.Checked;
206+ this.chk_plot_rot_z.Location = new System.Drawing.Point(34, 205);
207+ this.chk_plot_rot_z.Name = "chk_plot_rot_z";
208+ this.chk_plot_rot_z.Size = new System.Drawing.Size(18, 23);
209+ this.chk_plot_rot_z.TabIndex = 15;
210+ this.chk_plot_rot_z.Text = "Z";
211+ this.chk_plot_rot_z.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
212+ this.chk_plot_rot_z.UseVisualStyleBackColor = true;
213+ this.chk_plot_rot_z.CheckedChanged += new System.EventHandler(this.btn_rot_z_CheckedChanged);
186214 //
187215 // radio_zxy
188216 //
@@ -197,16 +225,16 @@ namespace MMM_GraphEditor
197225 this.radio_zxy.UseVisualStyleBackColor = true;
198226 this.radio_zxy.CheckedChanged += new System.EventHandler(this.rot_axis_radio_changed);
199227 //
200- // radio_zyx
228+ // radio_xyz
201229 //
202- this.radio_zyx.AutoSize = true;
203- this.radio_zyx.Location = new System.Drawing.Point(0, 252);
204- this.radio_zyx.Name = "radio_zyx";
205- this.radio_zyx.Size = new System.Drawing.Size(56, 16);
206- this.radio_zyx.TabIndex = 21;
207- this.radio_zyx.Text = "X-Y-Z";
208- this.radio_zyx.UseVisualStyleBackColor = true;
209- this.radio_zyx.CheckedChanged += new System.EventHandler(this.rot_axis_radio_changed);
230+ this.radio_xyz.AutoSize = true;
231+ this.radio_xyz.Location = new System.Drawing.Point(0, 252);
232+ this.radio_xyz.Name = "radio_xyz";
233+ this.radio_xyz.Size = new System.Drawing.Size(56, 16);
234+ this.radio_xyz.TabIndex = 21;
235+ this.radio_xyz.Text = "X-Y-Z";
236+ this.radio_xyz.UseVisualStyleBackColor = true;
237+ this.radio_xyz.CheckedChanged += new System.EventHandler(this.rot_axis_radio_changed);
210238 //
211239 // radio_xzy
212240 //
@@ -231,30 +259,32 @@ namespace MMM_GraphEditor
231259 this.btn_center.UseVisualStyleBackColor = true;
232260 this.btn_center.Click += new System.EventHandler(this.btn_center_Click);
233261 //
234- // chk_lock_horiz
235- //
236- this.chk_lock_horiz.Appearance = System.Windows.Forms.Appearance.Button;
237- this.chk_lock_horiz.Checked = true;
238- this.chk_lock_horiz.CheckState = System.Windows.Forms.CheckState.Checked;
239- this.chk_lock_horiz.Location = new System.Drawing.Point(0, 41);
240- this.chk_lock_horiz.Name = "chk_lock_horiz";
241- this.chk_lock_horiz.Size = new System.Drawing.Size(51, 23);
242- this.chk_lock_horiz.TabIndex = 4;
243- this.chk_lock_horiz.Text = "マーカー";
244- this.toolTip1.SetToolTip(this.chk_lock_horiz, "常にマーカーを中央に維持");
245- this.chk_lock_horiz.UseVisualStyleBackColor = true;
246- //
247- // chk_lock_virt
248- //
249- this.chk_lock_virt.Appearance = System.Windows.Forms.Appearance.Button;
250- this.chk_lock_virt.Location = new System.Drawing.Point(0, 67);
251- this.chk_lock_virt.Name = "chk_lock_virt";
252- this.chk_lock_virt.Size = new System.Drawing.Size(51, 23);
253- this.chk_lock_virt.TabIndex = 5;
254- this.chk_lock_virt.Text = "Yゼロ";
255- this.chk_lock_virt.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
256- this.toolTip1.SetToolTip(this.chk_lock_virt, "常に縦軸に0を維持");
257- this.chk_lock_virt.UseVisualStyleBackColor = true;
262+ // chk_track_merker
263+ //
264+ this.chk_track_merker.Appearance = System.Windows.Forms.Appearance.Button;
265+ this.chk_track_merker.Checked = true;
266+ this.chk_track_merker.CheckState = System.Windows.Forms.CheckState.Checked;
267+ this.chk_track_merker.Location = new System.Drawing.Point(0, 41);
268+ this.chk_track_merker.Name = "chk_track_merker";
269+ this.chk_track_merker.Size = new System.Drawing.Size(51, 23);
270+ this.chk_track_merker.TabIndex = 4;
271+ this.chk_track_merker.Text = "マーカー";
272+ this.toolTip1.SetToolTip(this.chk_track_merker, "常にマーカーを中央に維持");
273+ this.chk_track_merker.UseVisualStyleBackColor = true;
274+ this.chk_track_merker.CheckedChanged += new System.EventHandler(this.chk_track_merker_CheckedChanged);
275+ //
276+ // chk_track_yzero
277+ //
278+ this.chk_track_yzero.Appearance = System.Windows.Forms.Appearance.Button;
279+ this.chk_track_yzero.Location = new System.Drawing.Point(0, 67);
280+ this.chk_track_yzero.Name = "chk_track_yzero";
281+ this.chk_track_yzero.Size = new System.Drawing.Size(51, 23);
282+ this.chk_track_yzero.TabIndex = 5;
283+ this.chk_track_yzero.Text = "Yゼロ";
284+ this.chk_track_yzero.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
285+ this.toolTip1.SetToolTip(this.chk_track_yzero, "常に縦軸に0を維持");
286+ this.chk_track_yzero.UseVisualStyleBackColor = true;
287+ this.chk_track_yzero.CheckedChanged += new System.EventHandler(this.chk_track_yzero_CheckedChanged);
258288 //
259289 // chk_edit_pos
260290 //
@@ -387,18 +417,18 @@ namespace MMM_GraphEditor
387417 this.Controls.Add(this.label3);
388418 this.Controls.Add(this.label2);
389419 this.Controls.Add(this.label1);
390- this.Controls.Add(this.chk_lock_virt);
391- this.Controls.Add(this.chk_lock_horiz);
420+ this.Controls.Add(this.chk_track_yzero);
421+ this.Controls.Add(this.chk_track_merker);
392422 this.Controls.Add(this.btn_center);
393423 this.Controls.Add(this.radio_xzy);
394- this.Controls.Add(this.radio_zyx);
424+ this.Controls.Add(this.radio_xyz);
395425 this.Controls.Add(this.radio_zxy);
396- this.Controls.Add(this.btn_rot_z);
397- this.Controls.Add(this.btn_rot_y);
398- this.Controls.Add(this.btn_rot_x);
399- this.Controls.Add(this.btn_pos_z);
400- this.Controls.Add(this.btn_pos_y);
401- this.Controls.Add(this.btn_pos_x);
426+ this.Controls.Add(this.chk_plot_rot_z);
427+ this.Controls.Add(this.chk_plot_rot_y);
428+ this.Controls.Add(this.chk_plot_rot_x);
429+ this.Controls.Add(this.chk_plot_pos_z);
430+ this.Controls.Add(this.chk_plot_pos_y);
431+ this.Controls.Add(this.chk_plot_pos_x);
402432 this.Controls.Add(this.btn_minus);
403433 this.Controls.Add(this.btn_plus);
404434 this.Controls.Add(this.graphPanelOuter);
@@ -419,19 +449,19 @@ namespace MMM_GraphEditor
419449 public GraphPanel graphPanelInnner;
420450 public GraphPort graphPort1;
421451 public FrameRuler frameRuler1;
422- private CheckBox btn_pos_x;
423- private CheckBox btn_pos_y;
424- private CheckBox btn_pos_z;
425- private CheckBox btn_rot_x;
426- private CheckBox btn_rot_y;
427- private CheckBox btn_rot_z;
452+ private CheckBox chk_plot_pos_x;
453+ private CheckBox chk_plot_pos_y;
454+ private CheckBox chk_plot_pos_z;
455+ private CheckBox chk_plot_rot_x;
456+ private CheckBox chk_plot_rot_y;
457+ private CheckBox chk_plot_rot_z;
428458 private RadioButton radio_zxy;
429- private RadioButton radio_zyx;
459+ private RadioButton radio_xyz;
430460 private RadioButton radio_xzy;
431461 private Button btn_center;
432462 private ToolTip toolTip1;
433- public CheckBox chk_lock_horiz;
434- public CheckBox chk_lock_virt;
463+ public CheckBox chk_track_merker;
464+ public CheckBox chk_track_yzero;
435465 private Label label1;
436466 private Label label2;
437467 private Label label3;
--- a/MMM_GraphEditor/GraphEditorControl.cs
+++ b/MMM_GraphEditor/GraphEditorControl.cs
@@ -23,6 +23,7 @@ namespace MMM_GraphEditor
2323
2424 private MikuMikuPlugin.Scene scene;
2525 private long lastMarkerPos = 0;
26+ public GraphEditor.Config config;
2627
2728 public MikuMikuPlugin.Scene Scene
2829 {
@@ -62,51 +63,47 @@ namespace MMM_GraphEditor
6263
6364 private void btn_pos_x_CheckedChanged(object sender, EventArgs e)
6465 {
65- graphPort1.render_flags[GraphPort.IDX_POS_X] = btn_pos_x.Checked;
66+ config.render_flags[GraphPort.IDX_POS_X] = chk_plot_pos_x.Checked;
6667 }
6768
6869 private void btn_pos_y_CheckedChanged(object sender, EventArgs e)
6970 {
70- graphPort1.render_flags[GraphPort.IDX_POS_Y] = btn_pos_y.Checked;
71+ config.render_flags[GraphPort.IDX_POS_Y] = chk_plot_pos_y.Checked;
7172 }
7273
7374 private void btn_pos_z_CheckedChanged(object sender, EventArgs e)
7475 {
75- graphPort1.render_flags[GraphPort.IDX_POS_Z] = btn_pos_z.Checked;
76+ config.render_flags[GraphPort.IDX_POS_Z] = chk_plot_pos_z.Checked;
7677 }
7778
7879 private void btn_rot_x_CheckedChanged(object sender, EventArgs e)
7980 {
80- graphPort1.render_flags[GraphPort.IDX_ROT_R] = btn_rot_x.Checked;
81+ config.render_flags[GraphPort.IDX_ROT_R] = chk_plot_rot_x.Checked;
8182 }
8283
8384 private void btn_rot_y_CheckedChanged(object sender, EventArgs e)
8485 {
85- graphPort1.render_flags[GraphPort.IDX_ROT_P] = btn_rot_y.Checked;
86+ config.render_flags[GraphPort.IDX_ROT_P] = chk_plot_rot_y.Checked;
8687 }
8788
8889 private void btn_rot_z_CheckedChanged(object sender, EventArgs e)
8990 {
90- graphPort1.render_flags[GraphPort.IDX_ROT_Y] = btn_rot_z.Checked;
91+ config.render_flags[GraphPort.IDX_ROT_Y] = chk_plot_rot_z.Checked;
9192 }
9293
9394 private void rot_axis_radio_changed(object sender, EventArgs e)
9495 {
9596 if (radio_zxy.Checked)
9697 {
97- graphPort1.default_rot_type = 0;
98+ config.euler_rot_order = 0;
9899 }
99- else if (radio_zyx.Checked)
100+ else if (radio_xyz.Checked)
100101 {
101- graphPort1.default_rot_type = 1;
102+ config.euler_rot_order = 1;
102103 }
103104 else if (radio_xzy.Checked)
104105 {
105- graphPort1.default_rot_type = 2;
106- }
107- else
108- {
109- graphPort1.default_rot_type = -1;
106+ config.euler_rot_order = 2;
110107 }
111108 }
112109
@@ -117,18 +114,28 @@ namespace MMM_GraphEditor
117114
118115 private void chk_edit_pos_CheckedChanged(object sender, EventArgs e)
119116 {
120- graphPort1.edit_flags[GraphPort.IDX_EDIT_POS] = chk_edit_pos.Checked;
117+
118+ config.edit_flags[GraphPort.IDX_EDIT_POS] = chk_edit_pos.Checked;
121119 }
122-
123120 private void chk_edit_pos_ip_CheckedChanged(object sender, EventArgs e)
124121 {
125- graphPort1.edit_flags[GraphPort.IDX_EDIT_POS_IP] = chk_edit_pos_ip.Checked;
122+ config.edit_flags[GraphPort.IDX_EDIT_POS_IP] = chk_edit_pos_ip.Checked;
126123
127124 }
128125
129126 private void chk_edit_rot_CheckedChanged(object sender, EventArgs e)
130127 {
131- graphPort1.edit_flags[GraphPort.IDX_EDIT_ROT] = chk_edit_rot.Checked;
128+ config.edit_flags[GraphPort.IDX_EDIT_ROT] = chk_edit_rot.Checked;
129+ }
130+
131+ private void chk_track_merker_CheckedChanged(object sender, EventArgs e)
132+ {
133+ config.track_marker = chk_track_merker.Checked;
134+ }
135+
136+ private void chk_track_yzero_CheckedChanged(object sender, EventArgs e)
137+ {
138+ config.track_yzero = chk_track_yzero.Checked;
132139 }
133140
134141 }
--- a/MMM_GraphEditor/GraphEditorControl.resx
+++ b/MMM_GraphEditor/GraphEditorControl.resx
@@ -120,4 +120,7 @@
120120 <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121121 <value>17, 17</value>
122122 </metadata>
123+ <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
124+ <value>17, 17</value>
125+ </metadata>
123126 </root>
\ No newline at end of file
--- a/MMM_GraphEditor/GraphPort.Designer.cs
+++ b/MMM_GraphEditor/GraphPort.Designer.cs
@@ -50,7 +50,6 @@ namespace MMM_GraphEditor
5050 public static float Graph_PenSize = 2f;
5151 public static Pen Ip_Pen = Pens.Black;
5252 public float ip_mark_size = 4f;
53- public int default_rot_type = 0;
5453 public Point cur_mouse_pos = new Point(0, 0);
5554 public static Color[] Graph_Colors = { Color.Red, Color.Green, Color.Blue, Color.DeepPink, Color.YellowGreen, Color.DodgerBlue };
5655 public static Brush[] Graph_Brushes = { Brushes.Red, Brushes.Green, Brushes.Blue,
@@ -83,14 +82,28 @@ namespace MMM_GraphEditor
8382 public Bone target_bone = null;
8483 public Quaternion target_local_rot;
8584 public Quaternion target_local_rot_rev;
86- public bool[] render_flags = { true, true, true, true, true, true };
87- public bool[] edit_flags = { true, true, false };
8885 public const int IDX_EDIT_POS = 0;
8986 public const int IDX_EDIT_POS_IP = 1;
9087 public const int IDX_EDIT_ROT = 2;
9188 public bool ip_val_limit = true;
9289 GraphPoint key_pointed = null;
9390
91+ public bool[] render_flags
92+ {
93+ get { return config.render_flags; }
94+ }
95+ public bool[] edit_flags
96+ {
97+ get { return config.edit_flags; }
98+ }
99+ public int euler_rot_order
100+ {
101+ get { return config.euler_rot_order; }
102+ }
103+ public GraphEditor.Config config
104+ {
105+ get { return MainControl.config; }
106+ }
94107
95108 /// <summary>
96109 /// 使用中のリソースをすべてクリーンアップします。
@@ -280,7 +293,7 @@ namespace MMM_GraphEditor
280293
281294 Quaternion rot = scene.MarkerPosition == fd.FrameNumber ? target_layer.CurrentLocalMotion.Rotation : fd.Quaternion;
282295 rot = Rot_World2Local(rot);
283- int rot_type = getRotType();
296+ int rot_type = euler_rot_order;
284297 Vector3 erot = Quaternion2Euler(rot, rot_type);
285298 Trace.WriteLine("Euler Rot: " + erot.ToString());
286299 foreach (int i in RPY)
@@ -621,25 +634,6 @@ namespace MMM_GraphEditor
621634 return m;
622635 }
623636
624- public int getRotType()
625- {
626- return default_rot_type;
627- }
628-
629- public String rotTypeName(int rot_type)
630- {
631- switch (rot_type)
632- {
633- case 0:
634- return "Z-X-Y";
635- case 1:
636- return "X-Y-Z";
637- case 2:
638- return "X-Z-Y";
639- }
640- return "Unknown";
641- }
642-
643637 #region コンポーネント デザイナーで生成されたコード
644638
645639 /// <summary>
--- a/MMM_GraphEditor/GraphPort.cs
+++ b/MMM_GraphEditor/GraphPort.cs
@@ -270,9 +270,9 @@ namespace MMM_GraphEditor
270270 public void centerMarker()
271271 {
272272 if (MainControl == null) return;
273- if (MainControl.chk_lock_horiz.Checked)
273+ if (config.track_marker)
274274 centerMarkerHorizonal();
275- if ( MainControl.chk_lock_virt.Checked)
275+ if (config.track_yzero)
276276 centerMarkerVirtical();
277277 }
278278