mcjHIDKit




 
 


HISTORY


 Feb 7 2013 10:00 pm
 Handles higher data rates like 30 Hz
Feb 6 2013 3:00 am  initial release, DS1, DS2 versions non-operational
Feb 6 2013 3:20 am  version for DS1 DS2 fixed
Feb 6 2013 4pm  de-selection of target nodes while the script is running - practical for Live Shows and screen-captures
   


Installation

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

it contains
  •     mcjHIDServer.exe a PC/DOS program that relays sound and gamepad events to the client script running in Daz Studio
  •     mcjClientDS1DS2.ds a Daz Script for Daz Studio 1 and 2
  •     mcjClient.dsa a Daz Script for Daz Studio 3 and 4

This zip file should be unzipped in your daz studio content folder

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, mcjClientDS1DS2.ds and mcjClient.dsa will be accessible in Daz Studio in the contents tab as

studio/scripts/mcasual/
or
My Library/scripts/mCasual


mcjHIDServer.exe will also be placed in this folder.


Version History




Requirements


- PC running Windows

- a gamepad with an HID driver ( all my tests were done using Logitech's Dual Action Rumblepad

- a sound card or device



Instructions


Make sure your game-pad is connected

Go in window's sound settings and make sure there's a "recording" device enabled


note that in my case i went in the "properties" of the webcam microphone

and disabled the "listen to this device" option to avoid feedback loops

and i adjusted the "levels"



In your daz scene, select the nodes you want to put under the control of the gamepad

example: Aiko's Head and Neck


Launch mcjClient.dsa




The "Client Channels" list now contains the list of parameters and morphs for the nodes you selected in the scene
  • Click on the Server Path button and browse up to mcjHIDServer.exe
  • Click on the Start Server button.

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



Press any button on the gamepad ... this will initiate the process



mcjHIDServer.exe attempted to communicate with the gamepad and the sound input device

if this worked, it then transmitted back to mcjClient.dsa  the names of available gamepad channels,

so the "Server Channels" List should now be filled with the list of gamepad channels.

ex : joy.btn.1.val which is the channel for gamepad's button #1
 



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 gamepad's buttons produce values ranging from 0 to 1.

lets say we want to control the "blink" morphs on Aiko3's head using button #1 of the gamepad

in the Server Channels List, select "joy.btn.1.val"

in the Client Channels List, select "blink Left"

when the button is released we want blink = 10% ( the value 0.1 )
when the button is pressed, we want blink = 60% ( the value 0.6 )
so we use Mult = 0.5 and Add = 0.1

click on the "add link" button

repeat this for the "blink Right" morph, note that the same gamepad button can control many morphs

you now control the blinks with your gamepad !

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 ! )


Enhanced button outputs

In the Server Channels list, each button has 4 outputs labeled .val, .dmp., .popo. and .dpopo.

.val.    the raw button state, 0 = button released, 1 = button pressed

.dmp.    the "dampened" button state, when you press the button, this output will ramp up from 0 to 1

.popo.    the "push-on-push-off" button state, the output toggles between 1 and 0 each time you press and release the button

.dpopo.    the combined effect of "dampened" and "push-on-push-off"



Settings

From the HIDServer's top menu you can access the settings menu

you can asjust the "dampening" of the buttons, default value is 500 milliseconds

you can also change the data rate, the default value is 10 Hertz ( 10 times per second )

unfortunately, something in Daz Studio seems to prevent higher data rates.

( possibly a mechanism to prevent stdin overflows )



 License

      mcjHIDServer.exe, mcjClient.dsa, mcjClient.ds *    written by mCasual/Jacques
     Copyright 2010
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 3 of the License, or
     (at your option) any later version.
 
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 



ċ
mcjHIDKit.rar
(45k)
mCasual Jacques,
Feb 7, 2013, 6:59 PM
ċ
mcjHIDKit.zip
(48k)
mCasual Jacques,
Feb 7, 2013, 6:59 PM
Comments