Example #1
0
    def unpack(self, rename_map={}, parent_node=None, only_in_map=False):
        hou = get_hou()
        if parent_node is None:
            parent_node = hou.node(u"/obj")
        subn, _ = hou.hipFile.importFBX(
            self.fbx_path,
            convert_into_y_up_coordinate_system=False,
            override_framerate=False,
            resample_animation=False,
            framerate=int(self.fps)
        )
        for ch in subn.children():
            name = ch.name()
            if name in rename_map:
                ch.setName(rename_map[name])
            else:
                if only_in_map:
                    ch.destroy()
                    continue
            existing = parent_node.node(ch.name())
            if existing is not None:
                existing.destroy()

        moved = hou.moveNodesTo(subn.children(), parent_node)
        subn.destroy()
        return moved
Example #2
0
 def find_other_node_from_same_session(self):
     for n in get_hou().node("/obj").children():
         session_parm = n.parm("byplay_recording_session_id")
         if session_parm is not None and session_parm.eval(
         ) == self.recording.recording_session_id:
             return n
     return None
Example #3
0
def reload_recordings_list(node_path):
    try:
        hou = get_hou()
        node = hou.node(node_path)
        HoudiniParamsBuilder.set_byplay_recording_ids(node)
        log_amplitude(u"Recording list reloaded")
    except Exception, e:
        capture_exception()
        raise e
Example #4
0
def reload_all_modules():
    hou = get_hou()

    hou.ui.displayMessage(u"reloading")
    for name, module in sys.modules.items():
        if name.split(u".")[0] == u"byplay" and module is not None:
            print u"reloading {}".format(name)
            from importlib import reload
            reload(module)
    Config.read()
Example #5
0
def sys_info():
    sysname, nodename, release, version, machine, _processor = platform.uname()

    hou_platform = u"unk"
    hou_version = u"unk"
    try:
        hou = get_hou()
        hou_platform = hou.applicationPlatformInfo()
        hou_version = hou.applicationVersionString()
    except Exception, e:
        logging.error(e)
Example #6
0
def load_recording_for_ui(node_path):
    # try:
    hou = get_hou()
    node = hou.node(node_path)
    recording_id = node.parm(u"byplay_recording_id").evalAsString()
    log_amplitude(u"Recording loaded", recording_id=recording_id)

    if len(recording_id) < 18:
        hou.ui.displayMessage(u"Please select a recording", severity=hou.severityType.Error)
        return

    config = {
        u'set_30fps': node.parm(u"byplay_set_30fps").eval(),
        u'add_chopnet': node.parm(u"byplay_add_chopnet").eval(),
    }
    scene.load_recording_for_ui(recording_id, refined=True, config=config)
    node.setParms({u"byplay_loaded_recording_id": recording_id})
Example #7
0
def sys_info():
    sysname, nodename, release, version, machine, _processor = platform.uname()

    hou_platform = "unk"
    hou_version = "unk"
    try:
        hou = get_hou()
        hou_platform = hou.applicationPlatformInfo()
        hou_version = hou.applicationVersionString()
    except Exception as e:
        logging.error(e)

    return {
        "houdini.platform": hou_platform,
        "houdini.version": hou_version,
        "os.name": sysname,
        "node.name": nodename,
        "os.release": release,
        "os.version": version
    }
Example #8
0
def setup_byplay_helper_nodes(node):
    try:
        Config.setup_logger()
    except Exception as e:
        capture_exception()
        raise e

    try:
        Config.read()
    except Exception as e:
        capture_exception()
        hou = get_hou()
        hou.ui.displayMessage(
            "Could not read config file. Please open Byplay Desktop and set it up",
            severity=hou.severityType.Error)
        raise e

    try:
        logging.info("Creating byplay loader node")
        byplay_settings_container.ByplaySettingsContainer(node).setup()
    except Exception as e:
        capture_exception()
        raise e
Example #9
0
import byplay.wrappers.byplay_settings_container as byplay_settings_container
from byplay.wrappers.houdini_scene import HoudiniScene


def setup_byplay_helper_nodes(node):
    try:
        Config.setup_logger()
    except Exception, e:
        capture_exception()
        raise e

    try:
        Config.read()
    except Exception, e:
        capture_exception()
        hou = get_hou()
        hou.ui.displayMessage(
            u"Could not read config file. Please open Byplay Desktop and set it up",
            severity=hou.severityType.Error)
        raise e

    try:
        logging.info(u"Creating byplay loader node")
        byplay_settings_container.ByplaySettingsContainer(node).setup()
    except Exception, e:
        capture_exception()
        raise e


def load_recording(recording_id, refined):
    logging.info(u"loading {}".format(recording_id))
Example #10
0
 def connect_to_loader(self):
     loader = get_hou().node("/obj/byplayloader")
     if loader is None:
         return
     self.node.setInput(0, loader)
     self.node.moveToGoodPosition()