def make_mathutils_rule(config: 'fbm.PackageGeneratorConfig') -> 'fbm.PackageGenerationRule': files = glob.glob(INPUT_DIR + "/mathutils*.rst") mod_files = [ "{}/mods/common/analyzer/mathutils.json".format(MOD_FILES_DIR).replace("\\", "/"), ] if config.mod_version in ["2.78", "2.79"]: mod_files.append("{}/mods/{}/analyzer/mathutils.json".format(MOD_FILES_DIR, config.mod_version).replace("\\", "/")) return fbm.PackageGenerationRule("mathutils", files, fbm.AnalyzerWithModFile(mod_files), fbm.BaseGenerator()) else: return fbm.PackageGenerationRule("mathutils", files, fbm.AnalyzerWithModFile(mod_files), fbm.BaseGenerator())
def make_bmesh_rule() -> 'fbm.PackageGenerationRule': files = glob.glob(INPUT_DIR + "/bmesh*.xml") mod_file = "{}/mods/analyzer/bmesh.json".format(MOD_FILES_DIR) mod_file = mod_file.replace("\\", "/") return fbm.PackageGenerationRule("bmesh", files, fbm.AnalyzerWithModFile(mod_file), fbm.BaseGenerator())
def make_other_rules( config: 'fbm.PackageGeneratorConfig' ) -> List['fbm.PackageGenerationRule']: mod_files = glob.glob( "{}/mods/generated_mods/gen_modules_modfile/*.json".format( MOD_FILES_DIR).replace("\\", "/")) mod_files += glob.glob( "{}/mods/generated_mods/gen_startup_modfile/*.json".format( MOD_FILES_DIR).replace("\\", "/")) mod_files = set(mod_files) - { "{}/mods/generated_mods/gen_modules_modfile/bpy.json".format( MOD_FILES_DIR).replace("\\", "/"), "{}/mods/generated_mods/gen_modules_modfile/bpy_extras.json".format( MOD_FILES_DIR).replace("\\", "/"), "{}/mods/generated_mods/gen_startup_modfile/bpy.json".format( MOD_FILES_DIR).replace("\\", "/"), } if config.mod_version not in ["2.78", "2.79"]: mod_files -= { "{}/mods/generated_mods/gen_modules_modfile/gpu_extras.json". format(MOD_FILES_DIR).replace("\\", "/"), } rules = [] for mod_file in mod_files: mod_name = mod_file[mod_file.rfind("/") + 1:].replace(".json", "") rules.append( fbm.PackageGenerationRule(mod_name, [], fbm.AnalyzerWithModFile([mod_file]), fbm.BaseGenerator())) return rules
def make_bpy_rule() -> 'fbm.PackageGenerationRule': all_files = glob.glob(INPUT_DIR + "/bpy*.xml") excludes_files = glob.glob(INPUT_DIR + "/bpy_extras*.xml") files = list(set(all_files) - set(excludes_files)) mod_file = "{}/mods/analyzer/bpy.json".format(MOD_FILES_DIR) mod_file = mod_file.replace("\\", "/") return fbm.PackageGenerationRule("bpy", files, fbm.AnalyzerWithModFile(mod_file), fbm.BaseGenerator())
def make_bpy_rule(config: 'fbm.PackageGeneratorConfig') -> 'fbm.PackageGenerationRule': all_files = glob.glob(INPUT_DIR + "/bpy*.rst") excludes_files = glob.glob(INPUT_DIR + "/bpy_extras*.rst") files = list(set(all_files) - set(excludes_files)) mod_files = [ "{}/mods/generated_mods/gen_startup_modfile/bpy.json".format(MOD_FILES_DIR).replace("\\", "/"), "{}/mods/generated_mods/gen_modules_modfile/bpy.json".format(MOD_FILES_DIR).replace("\\", "/"), ] return fbm.PackageGenerationRule("bpy", files, fbm.AnalyzerWithModFile(mod_files), fbm.BaseGenerator())
def make_bmesh_rule( config: 'fbm.PackageGeneratorConfig') -> 'fbm.PackageGenerationRule': files = glob.glob(INPUT_DIR + "/bmesh*.xml") mod_files = [ "{}/mods/common/analyzer/bmesh.json".format(MOD_FILES_DIR).replace( "\\", "/"), ] return fbm.PackageGenerationRule("bmesh", files, fbm.AnalyzerWithModFile(mod_files), fbm.BaseGenerator())
def make_freestyle_rule( config: 'fbm.PackageGeneratorConfig') -> 'fbm.PackageGenerationRule': files = glob.glob(INPUT_DIR + "/freestyle*.rst") mod_files = [ "{}/mods/common/analyzer/freestyle.json".format(MOD_FILES_DIR).replace( "\\", "/"), ] return fbm.PackageGenerationRule("freestyle", files, fbm.AnalyzerWithModFile(mod_files), fbm.BaseGenerator())
def make_bgl_rule( config: 'fbm.PackageGeneratorConfig') -> 'fbm.PackageGenerationRule': files = glob.glob(INPUT_DIR + "/bgl*.rst") mod_files = [ "{}/mods/generated_mods/gen_bgl_modfile/bgl.json".format( MOD_FILES_DIR).replace("\\", "/"), ] return fbm.PackageGenerationRule("bgl", files, fbm.AnalyzerWithModFile(mod_files), fbm.BaseGenerator())
def make_gpu_extras_rule( config: 'fbm.PackageGeneratorConfig') -> 'fbm.PackageGenerationRule': files = glob.glob(INPUT_DIR + "/gpu_extras*.rst") mod_files = [] if config.mod_version not in ["2.78", "2.79"]: mod_files.append( "{}/mods/generated_mods/gen_modules_modfile/gpu_extras.json". format(MOD_FILES_DIR).replace("\\", "/")) return fbm.PackageGenerationRule("gpu_extras", files, fbm.AnalyzerWithModFile(mod_files), fbm.BaseGenerator())
def make_bpy_extras_rule( config: 'fbm.PackageGeneratorConfig') -> 'fbm.PackageGenerationRule': files = glob.glob(INPUT_DIR + "/bpy_extras*.xml") mod_files = [ "{}/mods/common/analyzer/bpy_extras.json".format( MOD_FILES_DIR).replace("\\", "/"), "{}/mods/generated_mods/gen_modules_modfile/bpy_extras.json".format( MOD_FILES_DIR).replace("\\", "/") ] return fbm.PackageGenerationRule("bpy_extras", files, fbm.AnalyzerWithModFile(mod_files), fbm.BaseGenerator())
def make_gpu_extras_rule( config: 'fbm.PackageGeneratorConfig') -> 'fbm.PackageGenerationRule': all_files = glob.glob(INPUT_DIR + "/bpy_extras*.xml") excludes_files = glob.glob(INPUT_DIR + "/bpy_extras*.xml") files = list(set(all_files) - set(excludes_files)) mod_files = [] if config.mod_version in ["2.80", "2.81", "2.82"]: mod_files.append( "{}/mods/generated_mods/gen_modules_modfile/gpu_extras.json". format(MOD_FILES_DIR).replace("\\", "/")) return fbm.PackageGenerationRule("gpu_extras", files, fbm.AnalyzerWithModFile(mod_files), fbm.BaseGenerator())