def save_scene(self): # cache character info and motions character_motion_maps = [] character_infos = [] for t in self.toons: motion_maps = {} character_info = {} for joint in t.joint_list(): motion_maps[joint.name] = joint.generate_map_from_retargets() character_info[joint.name] = joint.get_info() character_motion_maps.append(motion_maps) character_infos.append(character_info) # organize into scene file scene_file = { "mocap": MocapHandle().last_loaded, "character_filepaths": self.toon_filepaths, "character_info": character_infos, "character_motion_maps": character_motion_maps, } # save filepath = Dialogs.save_file(self.p, AppSettings.save_dir)[0] f = open(filepath, "w") f.write(json.dumps(scene_file, sort_keys=True, indent=4, separators=(",", ": "))) f.close()
def save_graph(self, filepath=""): if filepath == "": filepath = Dialogs.save_file(self.p, AppSettings.demuddle_dir)[0] data_fp = filepath + ".meta.json" self.p.paintImage(filepath) self.save_meta_data(data_fp)