Skip to content

Commit

Permalink
added refetch command line options to get current state to script
Browse files Browse the repository at this point in the history
  • Loading branch information
IASpaceAdmin committed Feb 12, 2021
1 parent 2a06274 commit 74ee670
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ the following commands are implemented:

+ /motive/command refetch

will return all rigidbodies and skeletons currently streaming
will return all command options and all rigidbodies and skeletons currently streaming

* /motive/update/start
+ /motive/rigidbody/id \<rigidbodyName> \<rigidbodyID>
Expand Down
32 changes: 31 additions & 1 deletion source/NatNetThree2OSC/NatNetThree2OSC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ static void Run(Options opts)

/* [NatNet] Re-fetch the updated list of descriptors */
fetchDataDescriptor();
fetchOptions();
Console.WriteLine("===============================================================================\n");
mAssetChanged = false;
}
Expand All @@ -414,7 +415,7 @@ static void Run(Options opts)
OSCsender.Close();
}

/// <summary>
/// <summary>
/// [NatNet] parseFrameData will be called when a frame of Mocap
/// data has is received from the server application.
///
Expand Down Expand Up @@ -945,6 +946,35 @@ static void fetchDataDescriptor()
Console.WriteLine("\n");
}

/**
* Gets the current CLI options
*/
static void fetchOptions()
{
var message = new OscMessage("/script/oscModeSparck", mOscModeSparck);
OSCsender.Send(message);
message = new OscMessage("/script/oscModeMax", mOscModeMax);
OSCsender.Send(message);
message = new OscMessage("/script/oscModeIsaodra", mOscModeIsa);
OSCsender.Send(message);
message = new OscMessage("/script/oscModeTouch", mOscModeTouch);
OSCsender.Send(message);
message = new OscMessage("/script/leftHanded", mleftHanded);
OSCsender.Send(message);
message = new OscMessage("/script/zUpAxis", mUpAxis);
OSCsender.Send(message);
message = new OscMessage("/script/sendSkeletons", mSendSkeletons);
OSCsender.Send(message);
message = new OscMessage("/script/sendMarkerInfo", mSendMarkerInfo);
OSCsender.Send(message);
message = new OscMessage("/script/bundled", mBundled);
OSCsender.Send(message);
message = new OscMessage("/script/calcMatrix", mMatrix);
OSCsender.Send(message);
message = new OscMessage("/script/calcInvMatrix", mInvMatrix);
OSCsender.Send(message);
}

static void parseDataDescriptor(List<NatNetML.DataDescriptor> description)
{
// [NatNet] Request a description of the Active Model List from the server.
Expand Down

0 comments on commit 74ee670

Please sign in to comment.