Batch model export

Discussions that concern the community rather than the makehuman software

Batch model export

Postby doc555 » Thu Feb 07, 2019 10:57 pm

Is there any way to batch export mhm files to fbx instead of I must load and export individually? I think for example command line solution or any other way.
Thanks.
Laszlo Maczo
founder, previs artist
Prewizards Studio
www.linkedin.com/in/laszlomaczo
www.prewizards.com
www.maczolaci.hu
User avatar
doc555
 
Posts: 7
Joined: Fri Apr 28, 2017 3:54 pm
Location: Hungary

Re: Batch model export

Postby joepal » Fri Feb 08, 2019 8:43 am

No, there is no such functionality atm.

But I recently adapted the MHAPI plugin to have an export API: https://github.com/makehumancommunity/c ... gins-mhapi

With this, it should be reasonably easy to write a script (for example in the utility->scripting tab) to iterate over files in a directory and export them.

This is a code outline and not tested:

Code: Select all
from core import G
mhapi = G.app.mhapi
human = mhapi.internals.getHuman()

human.load("/full/path/to/mhm/myHuman.mhm", True)
mhapi.export.exportAsFBX("/full/path/to/output/myHuman.fbx")


Note that this currently requires that you have manually downloaded MHAPI, as the exports subset of the API was added after the release of alpha 2.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am

Re: Batch model export

Postby doc555 » Thu Mar 07, 2019 11:00 pm

Thank you for your info.
I tried the code but I got this error message:
"The script produced an exception: 'API' object has no attribute 'exports'"
Laszlo Maczo
founder, previs artist
Prewizards Studio
www.linkedin.com/in/laszlomaczo
www.prewizards.com
www.maczolaci.hu
User avatar
doc555
 
Posts: 7
Joined: Fri Apr 28, 2017 3:54 pm
Location: Hungary

Re: Batch model export

Postby joepal » Fri Mar 08, 2019 6:12 am

Which I think means you didn't update to the latest MHAPI.

Or you could wait a few days and download alpha 3 when it is released. It will include the latest MHAPI.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am

Re: Batch model export

Postby doc555 » Thu Apr 18, 2019 7:40 am

Thank you. I'm checking it.
Laszlo Maczo
founder, previs artist
Prewizards Studio
www.linkedin.com/in/laszlomaczo
www.prewizards.com
www.maczolaci.hu
User avatar
doc555
 
Posts: 7
Joined: Fri Apr 28, 2017 3:54 pm
Location: Hungary


Return to Community discussions

Who is online

Users browsing this forum: No registered users and 1 guest