def init(self, world, timeline): """ """ if self.daefile is None: tmp_daefile = tempfile.mkstemp(suffix='scene.dae', text=True)[1] write_collada_scene(world, tmp_daefile, flat=self.flat) self.app_call[1] = tmp_daefile try: subprocess.Popen(self.app_call) SocketCom.init(self, world, timeline) except OSError: warnings.warn( "Cannot find program " + self.app_call[0] + ". Please check where the arboris viewer (daenim) is installed on your computer." ) self.world = world sleep(.1) if self.flat: name_all_elements(self.world.getbodies(), True) else: nonflatlist = [j.frames[1] for j in self.world.getjoints()] name_all_elements(nonflatlist, True) name_all_elements(self.world.itermovingsubframes(), True)
def __init__(self, daefile=None, daenim_path=None, host="127.0.0.1", port=5000, timeout=3, \ options = "", flat=False, name=None): """ """ SocketCom.__init__(self, host, port, timeout, name) self.daefile = daefile if daenim_path is None: daenim_path = get_daenim_path() self.app_call = \ [daenim_path, daefile, "-socket", self.host, str(self.port)] + \ shlex.split(options) self.flat = flat self.world = None
def init(self, world, timeline): """ """ if self.daefile is None: tmp_daefile = tempfile.mkstemp(suffix='scene.dae', text=True)[1] write_collada_scene(world, tmp_daefile, flat=self.flat) self.app_call[1] = tmp_daefile try: subprocess.Popen(self.app_call) SocketCom.init(self, world, timeline) except OSError: warnings.warn("Cannot find program "+self.app_call[0]+". Please check where the arboris viewer (daenim) is installed on your computer.") self.world = world sleep(.1) if self.flat: name_all_elements(self.world.getbodies(), True) else: nonflatlist = [j.frames[1] for j in self.world.getjoints()] name_all_elements(nonflatlist, True) name_all_elements(self.world.itermovingsubframes(), True)
def init(self,world,timeline): # timeline and world are ABSOLUTELY useless here, so pass anything you want subprocess.Popen(self.app_call) SocketCom.init(self, world, timeline) self.world = world
def finish(self): SocketCom.finish(self)
def __init__(self, Comp_thread_path, host="127.0.0.1", port=5556, options="", verbose=False): SocketCom.__init__(self, host, port, timeout = None) self.app_call = [abspath(Comp_thread_path), "-socket", self.host, str(self.port)] + shlex.split(options) self.verbose = verbose