mcjComKit

Introduction

If you have an arduino, or in fact anything that "talks" over the serial port of your PC

then using this kit of software, you can control the movements of actors and objects in your Daz Studio scene.

This is for Windows PCs only ... unless someone can come up with a simple Terminal for Macs

Installation

The installation zip packages can be found at the bottom of this web page in the attachments section

The 3 important parts:

    • mcjCommtty.exe A PC/DOS program kown as a "terminal" It is the communication bridge between the Arduino and DazStudio
    • mcjComClient.dsa A Daz Studio script which obtains data from the arduino through mcjCommTty
    • mcjArduinoMocap001.ino An arduino app (sketch) that transmits the readings of its 6 Analog inputs to Daz Studio, through

mcjComClient.zip contains mcjComClient.dsa

Typically it means:

c:\program files\daz\studio\contents

or

C:\Program Files (x86)\DAZ\Studio\content

or

C:\Users\YOURUSERNAME\Documents\DAZ 3D\Studio\My Library\

if installed properly, mcjComClient.dsa will be accessible in Daz Studio in the contents tab as

studio/scripts/mcasual/

or

My Library/scripts/mCasual

mcjComtty.zip contains mcjCommtty.exe and mcjCommtty.cpp the source code

you will also find in the attachments the Arduino sketch mcjArduinoMocap001.ino

which is really really an essential part

Version History

October 13th 2016 5PM Release

Requirements

- PC running Windows

- An arduino or in fact anything that can send data to your PC through one of the COM ports

Instructions

Upload mcjArduinoMocap001.ino to your Arduino

In the Daz Studio scene, select the figure joints or the objects, cameras, lights you want to animate

example: i select Aiko's Head and Neck joints

Start the mcjComClient.dsa script which should be somewhere in your Content Library under DazStudio Files / scripts/ mcasual

Note:Elsewhere on my site there's a similar kit that interfaces Daz Studio to a Wii-mote, another one that interfaces to a gamepad and microphone and one that interfaces to networked devices like your android phone/tablet. They all use the old version of mcjComClient

The "Client Channels" list now contains the list of parameters and morphs for the nodes you selected in the scene

    • Click on the Select Server button and browse up to mcjCommtty.exe
    • Set the communication parameters that fit your Arduino, the default is COM4, 9600 baud
    • Set the motion capture data rate, the default is 100ms which gices you 10 captures per second
    • Click on the Start Server button.

If all went well, mcjCommtty.exe in now running.

though mcjCommtty is not visible,

Not too long after this, mcjComClient will use mcjCommtty to request the data labels/names from the Arduino

it will also tell the arduino to adopt the sampling data rate you specified

onve it receives the name of the data channels ( ex: A0 A1 ...A5 )

they will be displayed in mcjComClient's "Server Channels" List

Select a Server Channel, select a Client channel, type in values for "Mult" and "Add" use the "Add Link" button

Before being applied to the Client Channel, the value coming from the Wii is multiplied

by the value "Mult" then the offset "Add" is added.

The Arduino Analog Inputs give us a number between 0 and 1023

lets say we want to control the Aiko3's Shoulder Bend Angle using the Arduino Analog Input A0

in the Server Channels List, select "A0"

in the Client Channels List, select "rShldr Bend"

when the A0 is at 0 we want Bend to be -50 degrees

when the A0 is at 1000 we want Bend to be -50 degrees

so we use Mult = 0.1 and Add = -50

click on the "add link" button

you now control the arm with your arduino

f you click on the record button, mcjClient.dsa will advance the timeline frame number as it receives new data.

it's mocap !

( dont forget to stop the recording ! )

// =====================================================================

License and credits for mcjCommtty.exe

// =====================================================================

copyright 2016 mCasualJacques

permission to use in other programs is granted.

this is an almost unmodified version of commtty.c

by Robert Mashlan

copyright 1996 Robert Mashlan rmashlan@r2m.com

permission to use in other programs is granted.

http://nersp.nerdc.ufl.edu/~esi4161/files/commtty.c

// =====================================================================

// License and credits for mcjComClient.dsa

// =====================================================================

// mcjComClient.dsa by mCasual/Jacques c2016

// You can use this script freely for personal or commercial use.

// You may not sell, resell, sub-license or rent this script in any way.

// you may credit this script to mCasual/Jacques

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,

// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES

// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND

// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT

// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,

// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR

// OTHER DEALINGS IN THE SOFTWARE.

// =====================================================================

// =====================================================================

License and credits for mcjCommtty.exe

// =====================================================================

// You can use this sketch freely for personal or commercial use.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,

// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES

// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND

// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT

// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,

// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR

// OTHER DEALINGS IN THE SOFTWARE.

// =====================================================================