Skip to content

Commit eed1857

Browse files
authored
Merge pull request #7 from DragonirHD/Version2.0.0
Version2.0.0
2 parents 10ef02c + 36f9e56 commit eed1857

File tree

11 files changed

+422
-405
lines changed

11 files changed

+422
-405
lines changed

MovementScriptGenerator/CircleControl.Designer.cs

Lines changed: 9 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MovementScriptGenerator/CircleControl.resx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,21 +126,26 @@ If this is left at 0, the FOV of the last move that overwrites the FOV will be u
126126
If no previous move has overwritten the cameras FOV, the original FOV will be used.
127127
</value>
128128
</data>
129+
<metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
130+
<value>17, 17</value>
131+
</metadata>
129132
<data name="lblIterations.ToolTip" xml:space="preserve">
130133
<value>Defines how many points the circle should consist of.
131134
The more points the more detailed the circle.
132135
One iteration will create 360 points. Two -&gt; 720 points. (if the sector is on 360)
133136
keeping this setting at 1 will be fine for most cases.
134-
Only change this setting if you feel like the movement of the camera is not smooth enough.</value>
137+
Only change this setting if you feel like the movement of the camera is not smooth enough!</value>
135138
</data>
136139
<data name="lblSector.ToolTip" xml:space="preserve">
137140
<value>defines the sector of the circle, in which the camera will move.
138141
The sector is the area of the circle between the starting point and this value.
139142
360 -&gt; the camera will do a full circle
140143
180 -&gt; the camera will do half of a circle
141144
720 -&gt; the camera will do two circles
142-
(If you want the camera to constantly rotate around you, leave this on 360 and
143-
don't add any other moves to the movementscript. The circle will repeat if it's
144-
the only move in the script)</value>
145+
(If you want the camera to constantly rotate around you, leave this on 360,
146+
don't add any other moves to the chain and make sure that the loop setting is activated.)</value>
145147
</data>
148+
<metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
149+
<value>17, 17</value>
150+
</metadata>
146151
</root>

MovementScriptGenerator/CompareObject.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public static class CompareObject
1212
public static bool Compare<T>(T e1, T e2)
1313
{
1414
bool flag = true;
15-
bool match = false;
15+
bool match;
1616
int countFirst, countSecond;
1717
foreach (PropertyInfo propObj1 in e1.GetType().GetProperties())
1818
{
@@ -32,6 +32,7 @@ public static bool Compare<T>(T e1, T e2)
3232
countSecond = objList2.Count - 1;
3333
while (countSecond > -1)
3434
{
35+
//TODO Compare throws an error here sometimes. Message: The type arguments for method cannot be inferred from the usage
3536
match = Compare(objList1[countFirst], objList2[countSecond]);
3637
if (match)
3738
{

MovementScriptGenerator/MainForm.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MovementScriptGenerator/MainForm.cs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public Main()
5757
{
5858
//TODO Create own form/implementation of MessageBox so that it can always be displayed in the middle of the parent window
5959
//TODO Find better name for "other Elements"
60-
//TODO Find name for Elements that change the behaviour of an existing move: MODIFIER / MODIFYING ELEMENTS
60+
//TODO Find name for Elements that change the behaviour of an existing move: modifier / modifying elements?
6161
InitializeComponent();
6262
InitializeComponentView();
6363
PopulateComponentsWithSavedSettings();
@@ -219,12 +219,18 @@ private void UpdateChainWindow()
219219
{
220220
tvChain.SelectedNode = tvChain.Nodes[tvChain.Nodes.Count - 1];
221221
}
222+
223+
tvChain.EndUpdate();
224+
222225
if (tvChain.SelectedNode == null)
223226
{
224227
DisableElementOptionsAll();
225228
}
226-
tvChain.EndUpdate();
227-
tvChain.SelectedNode.EnsureVisible();
229+
else
230+
{
231+
//Can't be done while in update block
232+
tvChain.SelectedNode.EnsureVisible();
233+
}
228234
}
229235

230236
private void UpdateChainWindow(int indexOfNodeToBeSelected)
@@ -247,12 +253,16 @@ private void UpdateChainWindow(int indexOfNodeToBeSelected)
247253
tvChain.SelectedNode = tvChain.Nodes[tvChain.Nodes.Count - 1];
248254
}
249255
}
250-
if(tvChain.SelectedNode == null)
256+
tvChain.EndUpdate();
257+
if (tvChain.SelectedNode == null)
251258
{
252259
DisableElementOptionsAll();
253260
}
254-
tvChain.EndUpdate();
255-
tvChain.SelectedNode.EnsureVisible();
261+
else
262+
{
263+
//Can't be done while in update block
264+
tvChain.SelectedNode.EnsureVisible();
265+
}
256266
}
257267

258268
private bool GenerateMovementScriptFile(MovementScript script, string filePath)

MovementScriptGenerator/MainForm.resx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@
120120
<metadata name="ToolTip.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="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
124-
<value>17, 17</value>
125-
</metadata>
126123
<data name="btnEditScriptPath.ToolTip" xml:space="preserve">
127124
<value>Select the directory in which the movement script file will be generated in.
128125
Make sure that this is the correct directory, else camera2 will not be able to use the script!
@@ -149,9 +146,6 @@ If a file with the same name exists, that file will be overwritten!</value>
149146
Useful for tweaking specific settings and then applying them again to the selected element.
150147
Can also be done by doubleclicking the element.</value>
151148
</data>
152-
<metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
153-
<value>17, 17</value>
154-
</metadata>
155149
<data name="lblType.ToolTip" xml:space="preserve">
156150
<value>Element types are divided into two subtypes:
157151
move

MovementScriptGenerator/Modules/Moves/Circle.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public Circle(
4242

4343
public override List<Frame> GenerateFrames()
4444
{
45+
//TODO Can this be simplified? Less inversion / *-1
4546
List<Frame> frames = new List<Frame>();
4647

4748
double verticalRadiant = RotVertical * Math.PI / 180;
@@ -53,13 +54,13 @@ public override List<Frame> GenerateFrames()
5354
float maxDegrees = SectorDegrees - 1;
5455
float initialDegreeAdded = 1;
5556

56-
if (!RotateClockwise) {
57+
if (RotateClockwise) {
5758
initialDegree *= -1;
5859
maxDegrees *= -1;
5960
initialDegreeAdded *= -1;
6061
}
6162

62-
for (float i = initialDegree; (RotateClockwise && i <= maxDegrees) || (!RotateClockwise && i >= maxDegrees); i += (float)initialDegreeAdded / Iterations)
63+
for (float i = initialDegree; (!RotateClockwise && i <= maxDegrees) || (RotateClockwise && i >= maxDegrees); i += (float)initialDegreeAdded / Iterations)
6364
{
6465
float currentHorizontalDegree = i + RotHorizontal;
6566
double currentHorizontalRadiant = currentHorizontalDegree * Math.PI / 180;
@@ -73,11 +74,11 @@ public override List<Frame> GenerateFrames()
7374

7475
frame.Position.x = xHorizontal * zVertical * Distance;
7576
frame.Position.y = yVertical * Distance + Height;
76-
frame.Position.z = zHorizontal * zVertical * Distance;
77+
frame.Position.z = (zHorizontal * -1) * zVertical * Distance;
7778

78-
frame.Rotation.x = RotVertical + RotX;
79-
frame.Rotation.y = currentHorizontalDegree + RotY -180;
80-
frame.Rotation.z = RotZ;
79+
frame.Rotation.x = RotVertical + (RotX * -1);
80+
frame.Rotation.y = (currentHorizontalDegree * -1) + RotY;
81+
frame.Rotation.z = (RotZ * -1);
8182

8283
frame.Duration = Duration / Math.Abs(maxDegrees) / Iterations;
8384

MovementScriptGenerator/Modules/Moves/Spiral.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ public override List<Frame> GenerateFrames()
7171
{
7272
x = xHorizontal * zVertical * StartDistance,
7373
y = yVertical * StartDistance + Height,
74-
z = zHorizontal * zVertical * StartDistance
74+
z = (zHorizontal *-1) * zVertical * StartDistance
7575
},
7676

7777
Rotation = new Rotation()
7878
{
79-
x = RotVertical + RotX,
80-
y = RotHorizontal + RotY - 180,
81-
z = 0 + RotZ
79+
x = RotVertical + (RotX * -1),
80+
y = (RotHorizontal * -1) + RotY,
81+
z = 0 + (RotZ * -1)
8282
},
8383

8484
HoldTime = StartHold,
@@ -103,14 +103,14 @@ public override List<Frame> GenerateFrames()
103103
{
104104
x = xHorizontal * zVertical * spiralFrameDistance,
105105
y = yVertical * spiralFrameDistance + Height,
106-
z = zHorizontal * zVertical * spiralFrameDistance
106+
z = (zHorizontal * -1) * zVertical * spiralFrameDistance
107107
},
108108

109109
Rotation = new Rotation()
110110
{
111-
x = RotVertical + RotX,
112-
y = RotHorizontal + RotY - 180,
113-
z = SpiralClockwise ? -rotation + RotZ : rotation + RotZ
111+
x = RotVertical + (RotX * -1),
112+
y = (RotHorizontal * -1) + RotY,
113+
z = SpiralClockwise ? -rotation + (RotZ * -1): rotation + (RotZ * -1)
114114
},
115115

116116
Duration = Duration / SpiralAmmount / 360,
@@ -130,14 +130,14 @@ public override List<Frame> GenerateFrames()
130130
{
131131
x = xHorizontal * zVertical * EndDistance,
132132
y = yVertical * EndDistance + Height,
133-
z = zHorizontal * zVertical * EndDistance
133+
z = (zHorizontal *-1) * zVertical * EndDistance
134134
},
135135

136136
Rotation = new Rotation()
137137
{
138-
x = RotVertical + RotX,
139-
y = RotHorizontal + RotY - 180,
140-
z = SpiralAmmount > 0 ? (SpiralClockwise ? -360 + RotZ : 360 + RotZ) : 0 + RotZ
138+
x = RotVertical + (RotX * -1),
139+
y = (RotHorizontal *-1) + RotY,
140+
z = SpiralAmmount > 0 ? (SpiralClockwise ? -360 + (RotZ * -1) : 360 + (RotZ * -1)) : 0 + (RotZ * -1)
141141
},
142142

143143
HoldTime = EndHold,

0 commit comments

Comments
 (0)