Page 1 of 1

Read values via CLI interface

PostPosted: Fri Oct 16, 2020 10:16 am
by b4rosz
Hello all!

I have been trying to read the heightCm value via CLI, is there any ready-made solution?

I found in socket plugins (https://github.com/brueli/community-plu ... odifier.py) applyModifier method for setHeight applied - here it works and now I would like to read height in cm using socket CLI.

A good solution would be to use a ready-made method, but I can only use it in the build-in Mahekuman shell:
G.app.selectedHuman.getHeightCm()
>>136.58567428588867

Can this be triggered by socket CLI? I need to bring this value out.

Thank you for your help!

Re: Read values via CLI interface

PostPosted: Fri Oct 23, 2020 1:44 pm
by joepal
The socket plugin only exposes a few methods. If you want more information, you'd have to add another wrapper method.

Since you already know what call you want to make, that should not be rocket science. In https://github.com/makehumancommunity/c ... meshops.py add another method "getHeightCm" using the same pattern as the other methods. Without testing, something like:

Code: Select all
def getHeighCm(self,conn,jsonCall):
    jsonCall.data = G.app.selectedHuman.getHeightCm()


Add the method in the method array in the init method, using the same pattern as on line 23.