blender导入ninjaripper的rip文件的问题

blender导入ninjaripper的rip文件

提示

最终解决方案见 最终解决。

引子

玩AI少女的时候,捏了个老婆想把她导出来,发现了ninjaripper这个工具。导出的3D素材主要为.rip格式,不是常用的模型格式。百度一般的解决办法是用3dmax,导入转成.fbx,我电脑上只有blender,发现无论用什么都是需要从ninjaripper自带的tool,用脚本导入,正好也有blender的导入脚本。

插件安装问题

依照每个绅士都该学会提取老婆的模型操作基本的步骤,但是在开启插件的时候会报如下错误

Traceback (most recent call last):
  File "E:\Aplication\Blender\2.82\scripts\modules\addon_utils.py", line 330, in enable
    importlib.reload(mod)
  File "E:\Aplication\Blender\2.82\python\lib\importlib\__init__.py", line 169, in reload
    _bootstrap._exec(spec, module)
  File "<frozen importlib._bootstrap>", line 630, in _exec
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\hierfer\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\import-ninja.py", line 7, in <module>
    from bpy_extras.io_utils import ImportHelper, orientation_helper_factory, axis_conversion, _check_axis_conversion
ImportError: cannot import name 'orientation_helper_factory' from 'bpy_extras.io_utils' (E:\Aplication\Blender\2.82\scripts\modules\bpy_extras\io_utils.py)

本人不懂py,查了一下,是"bpy_extras.io_utils"不包含"orientation_helper_factory"。上blender 手册 查询,"bpy_extras.io_utils"确实没有"orientation_helper_factory"这个成员。最后在Blender 2.80: Helper Modules 查到原来这是2.7x的用法,2.8x改了。

2.7x:
from bpy_extras.io_utils import (
        ImportHelper,
        orientation_helper_factory,
        )

IOFBXOrientationHelper = orientation_helper_factory("IOFBXOrientationHelper", axis_forward='-Z', axis_up='Y')

class ImportFBX(bpy.types.Operator, ImportHelper, IOFBXOrientationHelper):
    pass
    
2.8x:
from bpy_extras.io_utils import (
        ImportHelper,
        orientation_helper,
        )

@orientation_helper(axis_forward='-Z', axis_up='Y')
class ImportFBX(bpy.types.Operator, ImportHelper):
    pass

看来直接把报错的"orientation_helper_factory"注了就行。把import处"orientation_helper_factory"注了,RipImporter定义改为"class RipImporter(bpy.types.Operator, ImportHelper):"。再次安装,没有报错,但是import菜单里并没有出现想要的import rip选项。问题依旧。

版本问题

由于不懂py,不想再看代码了。怀疑是版本太老的问题,我下载的是v1.7.1的汉化版。那么上官网,最新版依然是v1.7.1。查看脚本还是老样子。还是不行。

最终解决

也就是说官方的更新都是落后于版本的?那么官方一定被提交过issue吧。
用bing国际版搜索"blender import rip"相关问题。github上有一个项目RipImport 从描述上看,显然就是为了 blender 2.8x解决rip improt 问题的。下载,然后按照README.md提示操作。报错没有io_import_rip_2模块。把刚才复制的文件夹io_import_rip_2.8改名为io_import_rip_2再导入。成功。import中出现了导入rip的选项。导入时记得勾选整个文件夹导入。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章