Socket call from external application

If you have problems understanding something or getting started, ask here

Moderator: joepal

Socket call from external application

Postby Valentin5 » Sat Apr 18, 2020 2:47 am

Hi everybody,

I'd like to create an external call (from a C# code - Unity) to the MakeHuman socket server.
I'd like to send basic information (weight, height, muscle, neck circumference...) and export an FBX (or at least just save a MHM file).
Do you know if it's doable ?
If so, is there a list of commands that I can send to the socket server ? I cannot find it anywhere.

For the information, I got the version 1.2.0-A3 (with the Socket tab activated and waiting for a connection).

Thanks a lot !
Valentin5
 
Posts: 3
Joined: Sat Apr 18, 2020 2:07 am

Re: Socket call from external application

Postby loki1950 » Sat Apr 18, 2020 2:59 am

The simple answer is no as there is no context(not connected to mesh data) and the MHM file is just a list of targets and their value(between 0-1) that are applied to the basic mesh within Mh. As for the commands the server uses have closer look at the readme files that are part of the zip you downloaded IIRC they are specific to blender not any other App.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo Ideapad 320-15ABR Win 10/Mint 19
User avatar
loki1950
 
Posts: 1219
Joined: Thu Dec 18, 2014 6:27 pm
Location: Ottawa,Ontario

Re: Socket call from external application

Postby Valentin5 » Sat Apr 18, 2020 3:14 am

loki1950 wrote:The simple answer is no as there is no context(not connected to mesh data) and the MHM file is just a list of targets and their value(between 0-1) that are applied to the basic mesh within Mh. As for the commands the server uses have closer look at the readme files that are part of the zip you downloaded IIRC they are specific to blender not any other App.

Enjoy the Choice :)


Thanks for the quick answer !
I'll try something else then :D
Valentin5
 
Posts: 3
Joined: Sat Apr 18, 2020 2:07 am

Re: Socket call from external application

Postby joepal » Mon Apr 20, 2020 1:28 pm

Actually, it is pretty doable. You can use the socket server to adjust target settings. You'll just have to wait a few hundred milliesconds here and there for updates to finish. It's possible that the export functionality isn't exposed via the socket interface yet, but it's available in MHAPI. So it shouldn't be much trouble to add in the same pattern as the other functions.

Example scripts for calling the socket server from python are available here: https://github.com/makehumancommunity/c ... master/cli. Basically you just send in a JSON object.

The full code for the socket server is here: https://github.com/makehumancommunity/c ... ver_socket

The intention is that this should just be a thin wrapper around MHAPI, which is available here: https://github.com/makehumancommunity/c ... gins-mhapi
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am


Return to Newbies

Who is online

Users browsing this forum: No registered users and 1 guest