Page 1 of 1

List of API functions

PostPosted: Wed May 25, 2022 10:10 pm
by KaiCode2
Hi there, does MH have a central list of all available functions? I've built a tool that connects to MH via sockets and sends functions to be executed. I've taken a look through the MH docs but can't seem to find a list of available functions. Any pointers would be much appreciated.

The specific functions I'm trying to locate are:
- Load model
- Apply clothes
- Save new model

Thanks,
KA

Re: List of API functions

PostPosted: Sat May 28, 2022 3:39 pm
by RobBaer
KaiCode2 wrote:Hi there, does MH have a central list of all available functions? I've built a tool that connects to MH via sockets and sends functions to be executed. I've taken a look through the MH docs but can't seem to find a list of available functions. Any pointers would be much appreciated.

The specific functions I'm trying to locate are:
- Load model
- Apply clothes
- Save new model

Thanks,
KA

Not sure about Apply clothes, but the other two are:
# loadModel(<model name>,[path])
#
# This will load a human model from an MHM file. The <model name> part should be a string without spaces
# and without the .MHM extension. The [path] part defaults to the user's makehuman/models directory.

MHScript.loadModel('myTestModel')

# saveModel(<model name>,[path])
#
# This will save the human model to an MHM file. The <model name> part should be a string without spaces
# and without the .MHM extension. The [path] part defaults to the user's makehuman/models directory.
# Note that this will not save any thumbnail.

MHScript.saveModel('myTestModel')

You can see at least a partial list of exposed MAPI by choosing Utilities | Sculpting from the menu. If this does not show up for you, you will need to enable the plugins that are unchecked by default by going to Settings | Plugins. I believe the #7 plugins are unchecked by default.