addon.py 文件源码

python
阅读 84 收藏 0 点赞 0 评论 0

项目:io_scene_mk8muunt 作者: Syroot 项目源码 文件源码
def _load_model(name_or_id):
    # Find the path to the BFRES file of the Obj model and load it.
    model_ob = None
    for res_name in objflow.get_res_names_by_id(name_or_id):
        model_path = _get_model_path(res_name)
        if not model_path:
            continue
        # Create the object which will hold all child mesh objects.
        if not model_ob:
            model_ob = bpy.data.objects.new("MK8.{}".format(name_or_id), None)
        # Load the BFRES with the special parent object to which all FSHP mesh objects become children of.
        all_tex = bpy.context.user_preferences.addons[__package__].preferences.import_all_textures
        lod_idx = bpy.context.user_preferences.addons[__package__].preferences.lod_model_index
        bpy.ops.import_scene.bfres(filepath=model_path, parent_ob_name=model_ob.name, mat_name_prefix=res_name, lod_model_index=lod_idx,
                                   tex_import_normal=all_tex, tex_import_specular=all_tex, tex_import_emissive=all_tex)
    return model_ob
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号