Exemple #1
0
def initialize(server_addrPort):
    """Initialize connections and configures facial subsystem"""
    import sys

    # for init, imports are done on demand
    print "LIGHTHEAD Facial Animation System, python version:", sys.version
    print "loaded module from", __path__[0]

    import comm
    from lightHead_server import lightHeadServer, lightHeadHandler
    G.server = comm.create_server(lightHeadServer, lightHeadHandler,
                                  server_addrPort, THREAD_INFO)
    G.server.create_protocol_handlers()

    # get driven objects
    objs = G.getCurrentScene().objects
    for obj_name in ('eye_L', 'eye_R', 'jaw', 'tongue'):
        try:
            setattr(G, obj_name, objs[OBJ_PREFIX+obj_name])
        except KeyError:
            try:
# WARNING: at least in python 2.6 capitalize and title docstrings are confused!
                setattr(G, obj_name, objs[OBJ_PREFIX+obj_name.title()])
            except KeyError, e:
                raise Exception('no object "%s" in blender file' % e[0][16:-18])
Exemple #2
0
                continue

            up_value = coeffs[0] * elapsed + coeffs[1]
            self.AUs[id][2:] = elapsed, up_value
            to_update.append((id, up_value))
        if self.thread_id != thread.get_ident():
            self.threadsafe_start()
        return to_update


try:
    from face.backend import main
except ImportError, e:
    print 
    print '*** FACE MISCONFIGURATION ***'
    print 'Make sure the FACE backend link points to your backend!'
    print 'for your information:', e
    raise 


if __name__ == '__main__':
    conf.name = sys.argv[-1]
    conf.load()
    try:
        server = comm.create_server(FaceServer, FaceClient, conf.conn_face)
    except UserWarning, err:
        comm.LOG.error("FATAL ERROR: %s (%s)", sys.argv[0], err)
        exit(-1)
    server.serve_forever()
    LOG.debug("Face server done")
Exemple #3
0
try:
    from spine.backend import SpineHW as Spine
except ImportError, e:
    print 
    print '*** SPINE MISCONFIGURATION ***'
    print 'Make sure the SPINE backend link points to your backend!'
    print 'for your information:', e
    raise 

__all__ = ['SpineHw', 'TorsoInfo', 'NeckInfo', 'NotImplemented', 'SpineException']


if __name__ == '__main__':
    import sys
    try:
        comm.set_default_logging(debug=True)
        conf.load()
        server = comm.create_server(Spine, SpineComm, conf.conn_spine,
                                    (False,False))
    except (conf.LoadException, UserWarning), err:
        comm.LOG.error("FATAL ERROR: %s (%s)", sys.argv[0], ':'.join(err))
        exit(-1)
    server.start()
    while server.running:
        try:
            server.serve_forever()
        except SpineProtocolError, e:
            print 'Protocol Error:', e
    LOG.debug("Spine server done")