Esempio n. 1
0
 def parse_meta(self):
     meta_file = [
         item.endswith(self.META_EXT) for item in os.listdir(self.path)
     ][0]  # type: str
     self.name = meta_file.split(self.META_EXT)[0]
     meta_data = fileFn.load_json(meta_file)
     self.engine_version = meta_data.get("EngineAssociation")
Esempio n. 2
0
    def load(cls):
        """Load config as dict

        Returns:
            dict: Config dictionary
        """
        return fileFn.load_json(cls.get_config_path())
Esempio n. 3
0
    def meta_data(self):
        meta_dict = {}
        if os.path.isfile(self.meta_path):
            meta_dict = fileFn.load_json(self.meta_path)

        for category in os.listdir(self.path):
            category_path = os.path.join(self.path, category)
            if os.path.isdir(category_path):
                asset_dirs = filter(os.path.isdir, [
                    os.path.join(category_path, item)
                    for item in os.listdir(category_path)
                ])
                meta_dict[category] = [
                    os.path.basename(asset) for asset in asset_dirs
                ]
        return meta_dict
Esempio n. 4
0
    def _add_external_tools(cls):
        register = fileFn.load_json(directories.EXTERNAL_TOOLS_REGISTER)
        found = set(register).intersection(set(pm.moduleInfo(lm=1)))
        if not found:
            return

        tools_menu = MenuUtil.addSubMenu(cls.MAIN_MENU_ID,
                                         label="External",
                                         tear_off=1,
                                         icon="")
        for tool in found:
            MenuUtil.addMenuItem(
                tools_menu,
                label=register[tool].get("label"),
                command=register[tool].get("command"),
                icon=register[tool].get("icon"),
                use_maya_icons=register[tool].get("useMayaIcon"))
            Logger.info("Added {0} to luna >> Tools menu".format(tool))
Esempio n. 5
0
 def meta_data(self):
     meta_dict = {}
     if os.path.isfile(self.meta_path):
         meta_dict = fileFn.load_json(self.meta_path)
     return meta_dict