def main():
    print "MakeHuman v%s" % getVersionDigitsStr()
    print getCopyrightMessage(short=True) + "\n"

    try:
        set_sys_path()
        make_user_dir()
        get_platform_paths()
        redirect_standard_streams()
        get_hg_revision()
        os.environ['MH_VERSION'] = getVersionStr()
        os.environ['MH_SHORT_VERSION'] = getShortVersion()
        os.environ['MH_MESH_VERSION'] = getBasemeshVersion()
        args = parse_arguments()
        init_logging()
    except Exception as e:
        print >> sys.stderr,  "error: " + format(unicode(e))
        import traceback
        bt = traceback.format_exc()
        print >> sys.stderr, bt
        return

    # Pass release info to debug dump using environment variables
    os.environ['MH_FROZEN'] = "Yes" if isBuild() else "No"
    os.environ['MH_RELEASE'] = "Yes" if isRelease() else "No"

    debug_dump()
    from core import G
    G.args = args

    # Set numpy properties
    if not args.get('debugnumpy', False):
        import numpy
        # Suppress runtime errors
        numpy.seterr(all = 'ignore')

    # -o or --output option given -> run in headless mode
    runHeadless = bool( args.get("output", None) )

    if runHeadless:
        import headless
        headless.run(args)
    else:
        # Here pyQt and PyOpenGL will be imported
        from mhmain import MHApplication

        application = MHApplication()
        application.run()

    #import cProfile
    #cProfile.run('application.run()')

    close_standard_streams()
Пример #2
0
def main():
    # print "MakeHuman v%s" % getVersionDigitsStr()
    # print getCopyrightMessage(short=True) + "\n"

    try:
        set_sys_path()
        make_user_dir()
        get_platform_paths()
        redirect_standard_streams()
        get_hg_revision()
        os.environ['MH_VERSION'] = getVersionStr()
        os.environ['MH_SHORT_VERSION'] = getShortVersion()
        os.environ['MH_MESH_VERSION'] = getBasemeshVersion()
        args = parse_arguments()
        init_logging()
    except Exception as e:
        print >> sys.stderr, "error: " + format(unicode(e))
        import traceback
        bt = traceback.format_exc()
        print >> sys.stderr, bt
        return

    # Pass release info to debug dump using environment variables
    os.environ['MH_FROZEN'] = "Yes" if isBuild() else "No"
    os.environ['MH_RELEASE'] = "Yes" if isRelease() else "No"

    debug_dump()
    from core import G
    G.args = args

    # Set numpy properties
    if not args.get('debugnumpy', False):
        import numpy
        # Suppress runtime errors
        numpy.seterr(all='ignore')

    # -o or --output option given -> run in headless mode
    runHeadless = bool(args.get("output", None))

    if runHeadless:
        import headless
        headless.run(args)
    else:
        # Here pyQt and PyOpenGL will be imported
        from mhmain import MHApplication

        application = MHApplication()
        application.run()

    #import cProfile
    #cProfile.run('application.run()')

    close_standard_streams()
Пример #3
0
def main():
    try:
        set_sys_path()
        make_user_dir()
        get_platform_paths()
        redirect_standard_streams()
        get_hg_revision()
        os.environ['MH_VERSION'] = getVersionStr()
        os.environ['MH_SHORT_VERSION'] = getShortVersion()
        os.environ['MH_MESH_VERSION'] = getBasemeshVersion()
        args = parse_arguments()
        init_logging()
    except Exception as e:
        print >> sys.stderr,  "error: " + format(unicode(e))
        import traceback
        bt = traceback.format_exc()
        print >> sys.stderr, bt
        return

    # Pass release info to debug dump using environment variables
    os.environ['MH_FROZEN'] = "Yes" if isBuild() else "No"
    os.environ['MH_RELEASE'] = "Yes" if isRelease() else "No"

    debug_dump()

    from core import G
    G.args = args

    # Set numpy properties
    if not args.get('debugnumpy', False):
        import numpy
        # Suppress runtime errors
        numpy.seterr(all = 'ignore')

    # Here pyQt and PyOpenGL will be imported
    from mhmain import MHApplication
    application = MHApplication()
    # application.run() we want to run the startup sequence synchronously
    application.startupSequence()
    
    #application2= MHApplication();
    #application2.startupSequence();

    #import cProfile
    #cProfile.run('application.run()')

    close_standard_streams()
Пример #4
0
def main():
    get_platform_paths()
    redirect_standard_streams()
    set_sys_path()
    get_svn_revision()
    make_user_dir()
    init_logging()
    debug_dump()

    from mhmain import MHApplication
    application = MHApplication()
    application.run()

    #import cProfile
    #cProfile.run('application.run()')

    close_standard_streams()
Пример #5
0
def main():
    get_platform_paths()
    redirect_standard_streams()
    get_svn_revision()
    set_sys_path()
    make_user_dir()
    init_logging()
    debug_dump()

    from mhmain import MHApplication
    application = MHApplication()
    application.run()

    #import cProfile
    #cProfile.run('application.run()')

    close_standard_streams()
Пример #6
0
def main():
    print(getCopyrightMessage(short=True) + "\n")

    try:
        set_sys_path()
        args = parse_arguments()
        from core import G
        G.args = args
        make_user_dir()
        get_platform_paths()
        redirect_standard_streams()
        get_hg_revision()
        os.environ['MH_VERSION'] = getVersionStr()
        os.environ['MH_SHORT_VERSION'] = getShortVersion()
        os.environ['MH_MESH_VERSION'] = getBasemeshVersion()
        init_logging()
    except Exception as e:
        print("error: " + format(str(e)), file=sys.stderr)
        import traceback
        bt = traceback.format_exc()
        print(bt, file=sys.stderr)
        return

    # Pass release info to debug dump using environment variables
    os.environ['MH_FROZEN'] = "Yes" if isBuild() else "No"
    os.environ['MH_RELEASE'] = "Yes" if isRelease() else "No"

    debug_dump()
    
           
    # Set numpy properties
    if not G.args.get('debugnumpy', False):
        import numpy
        # Suppress runtime errors
        numpy.seterr(all = 'ignore')

    # Here pyQt and PyOpenGL will be imported
    from mhmain import MHApplication
    application = MHApplication()
    application.run()

    #import cProfile
    #cProfile.run('application.run()')

    close_standard_streams()
Пример #7
0
def result():
    weight = float(request.form.get('weight').upper())
    muscle = float(request.form.get('muscle').upper())
    chest = float(request.form.get('chest').upper())
    hip = float(request.form.get('hip').upper())
    waist = float(request.form.get('waist').upper())
    age = float(request.form.get('age').upper())

    set_sys_path()

    from core import Globals, G
    g.G = Globals()

    make_user_dir()
    get_platform_paths()
    redirect_standard_streams()
    # init_logging()

    from core import G
    G.args = dict()

    from mhmain import MHApplication
    application = MHApplication()
    application.startupSequence()

    from webfunctions import support, webfunctions

    id = str(uuid.uuid4())
    directory = os.path.dirname(
        os.path.realpath(__file__)) + '/static/models/' + id
    os.makedirs(directory)
    filename = directory + '/model.obj'
    # log.message('Requesting model ' + filename)
    support.exportObj(filename, age, weight, muscle, chest, waist, hip)

    #clean up
    close_standard_streams()
    return jsonify(model='/models/' + id + '/model.obj',
                   texture='/models/' + id + '/model.mtl')