How to init G.app

Posted:
Wed Aug 16, 2023 8:07 am
by LLX_Code
Hello guys, I have generated a bunch of mhm files through the mass production. However, I want to get each mhm file's corresponding mesh, like obj file. I read through the forum and could not find an effective guidance. I also followed some instructions but it always returns that G.app is a nonetype, and I do not know how to initialise it. I know this would just be a few lines of codes but I just don't know how to write this.
Re: How to init G.app

Posted:
Wed Aug 16, 2023 8:11 am
by LLX_Code
For example, I tried the following:
- Code: Select all
from core import G
application=MHApplication
#application.__init__(G.app)
mhapi = G.app.mhapi
human = mhapi.internals.getHuman()
directory = "C:\\Users\\My_name\\Documents\\makehuman\\v1py3\\models"
for filename in os.listdir(directory):
if filename.endswith(".mhm"):
human.load("C:\\Users\\My_name\\Documents\\makehuman\\v1py3\\models\\" + filename, True)
mhapi.exports.exportAsOBJ(
"C:\\Users\\My_name\\Documents\\makehuman\\v1py3\\models\\" + filename[0:-4] + ".obj")
else:
continue
from one of the screenshot forum, it returns that G.app is a nonetype