Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions MovementScriptGenerator/CircleControl.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions MovementScriptGenerator/CircleControl.resx
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,26 @@ If this is left at 0, the FOV of the last move that overwrites the FOV will be u
If no previous move has overwritten the cameras FOV, the original FOV will be used.
</value>
</data>
<metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="lblIterations.ToolTip" xml:space="preserve">
<value>Defines how many points the circle should consist of.
The more points the more detailed the circle.
One iteration will create 360 points. Two -&gt; 720 points. (if the sector is on 360)
keeping this setting at 1 will be fine for most cases.
Only change this setting if you feel like the movement of the camera is not smooth enough.</value>
Only change this setting if you feel like the movement of the camera is not smooth enough!</value>
</data>
<data name="lblSector.ToolTip" xml:space="preserve">
<value>defines the sector of the circle, in which the camera will move.
The sector is the area of the circle between the starting point and this value.
360 -&gt; the camera will do a full circle
180 -&gt; the camera will do half of a circle
720 -&gt; the camera will do two circles
(If you want the camera to constantly rotate around you, leave this on 360 and
don't add any other moves to the movementscript. The circle will repeat if it's
the only move in the script)</value>
(If you want the camera to constantly rotate around you, leave this on 360,
don't add any other moves to the chain and make sure that the loop setting is activated.)</value>
</data>
<metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
3 changes: 2 additions & 1 deletion MovementScriptGenerator/CompareObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static class CompareObject
public static bool Compare<T>(T e1, T e2)
{
bool flag = true;
bool match = false;
bool match;
int countFirst, countSecond;
foreach (PropertyInfo propObj1 in e1.GetType().GetProperties())
{
Expand All @@ -32,6 +32,7 @@ public static bool Compare<T>(T e1, T e2)
countSecond = objList2.Count - 1;
while (countSecond > -1)
{
//TODO Compare throws an error here sometimes. Message: The type arguments for method cannot be inferred from the usage
match = Compare(objList1[countFirst], objList2[countSecond]);
if (match)
{
Expand Down
2 changes: 1 addition & 1 deletion MovementScriptGenerator/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 16 additions & 6 deletions MovementScriptGenerator/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public Main()
{
//TODO Create own form/implementation of MessageBox so that it can always be displayed in the middle of the parent window
//TODO Find better name for "other Elements"
//TODO Find name for Elements that change the behaviour of an existing move: MODIFIER / MODIFYING ELEMENTS
//TODO Find name for Elements that change the behaviour of an existing move: modifier / modifying elements?
InitializeComponent();
InitializeComponentView();
PopulateComponentsWithSavedSettings();
Expand Down Expand Up @@ -219,12 +219,18 @@ private void UpdateChainWindow()
{
tvChain.SelectedNode = tvChain.Nodes[tvChain.Nodes.Count - 1];
}

tvChain.EndUpdate();

if (tvChain.SelectedNode == null)
{
DisableElementOptionsAll();
}
tvChain.EndUpdate();
tvChain.SelectedNode.EnsureVisible();
else
{
//Can't be done while in update block
tvChain.SelectedNode.EnsureVisible();
}
}

private void UpdateChainWindow(int indexOfNodeToBeSelected)
Expand All @@ -247,12 +253,16 @@ private void UpdateChainWindow(int indexOfNodeToBeSelected)
tvChain.SelectedNode = tvChain.Nodes[tvChain.Nodes.Count - 1];
}
}
if(tvChain.SelectedNode == null)
tvChain.EndUpdate();
if (tvChain.SelectedNode == null)
{
DisableElementOptionsAll();
}
tvChain.EndUpdate();
tvChain.SelectedNode.EnsureVisible();
else
{
//Can't be done while in update block
tvChain.SelectedNode.EnsureVisible();
}
}

private bool GenerateMovementScriptFile(MovementScript script, string filePath)
Expand Down
6 changes: 0 additions & 6 deletions MovementScriptGenerator/MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@
<metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="btnEditScriptPath.ToolTip" xml:space="preserve">
<value>Select the directory in which the movement script file will be generated in.
Make sure that this is the correct directory, else camera2 will not be able to use the script!
Expand All @@ -149,9 +146,6 @@ If a file with the same name exists, that file will be overwritten!</value>
Useful for tweaking specific settings and then applying them again to the selected element.
Can also be done by doubleclicking the element.</value>
</data>
<metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="lblType.ToolTip" xml:space="preserve">
<value>Element types are divided into two subtypes:
move
Expand Down
13 changes: 7 additions & 6 deletions MovementScriptGenerator/Modules/Moves/Circle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public Circle(

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

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

if (!RotateClockwise) {
if (RotateClockwise) {
initialDegree *= -1;
maxDegrees *= -1;
initialDegreeAdded *= -1;
}

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

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

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

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

Expand Down
24 changes: 12 additions & 12 deletions MovementScriptGenerator/Modules/Moves/Spiral.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ public override List<Frame> GenerateFrames()
{
x = xHorizontal * zVertical * StartDistance,
y = yVertical * StartDistance + Height,
z = zHorizontal * zVertical * StartDistance
z = (zHorizontal *-1) * zVertical * StartDistance
},

Rotation = new Rotation()
{
x = RotVertical + RotX,
y = RotHorizontal + RotY - 180,
z = 0 + RotZ
x = RotVertical + (RotX * -1),
y = (RotHorizontal * -1) + RotY,
z = 0 + (RotZ * -1)
},

HoldTime = StartHold,
Expand All @@ -103,14 +103,14 @@ public override List<Frame> GenerateFrames()
{
x = xHorizontal * zVertical * spiralFrameDistance,
y = yVertical * spiralFrameDistance + Height,
z = zHorizontal * zVertical * spiralFrameDistance
z = (zHorizontal * -1) * zVertical * spiralFrameDistance
},

Rotation = new Rotation()
{
x = RotVertical + RotX,
y = RotHorizontal + RotY - 180,
z = SpiralClockwise ? -rotation + RotZ : rotation + RotZ
x = RotVertical + (RotX * -1),
y = (RotHorizontal * -1) + RotY,
z = SpiralClockwise ? -rotation + (RotZ * -1): rotation + (RotZ * -1)
},

Duration = Duration / SpiralAmmount / 360,
Expand All @@ -130,14 +130,14 @@ public override List<Frame> GenerateFrames()
{
x = xHorizontal * zVertical * EndDistance,
y = yVertical * EndDistance + Height,
z = zHorizontal * zVertical * EndDistance
z = (zHorizontal *-1) * zVertical * EndDistance
},

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

HoldTime = EndHold,
Expand Down
Loading