absolute-quantum / cats-blender-plugin

:smiley_cat: A tool designed to shorten steps needed to import and optimize models into VRChat. Compatible models are: MMD, XNALara, Mixamo, DAZ/Poser, Blender Rigify, Sims 2, Motion Builder, 3DS Max and potentially more
https://catsblenderplugin.com
MIT License
3.53k stars 456 forks source link

"Apply as Rest Pose" fails in Blender 4.0+ #649

Open loriducci opened 1 year ago

loriducci commented 1 year ago

Currently using the development version of Cats from here with Blender 4.0.1, this same operation works on 3.6.2.

To reproduce: Enter pose mode>Deform armature>Apply as Rest Pose

Gives the following error:

bpy.ops.cats_manual.pose_to_rest()

Python: Traceback (most recent call last): File "C:\Users\lxadmin\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\cats-blender-plugin-development\tools\armature_manual.py", line 383, in execute PoseToRest.apply_armature_to_mesh_with_no_shape_keys(armature_obj, mesh_obj) File "C:\Users\lxadmin\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\cats-blender-plugin-development\tools\armature_manual.py", line 414, in apply_armature_to_mesh_with_no_shape_keys bpy.ops.object.modifier_move_to_index(context_override, modifier=mod_name, index=0) File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\modules\bpy\ops.py", line 106, in __call__ C_exec, C_undo = _BPyOpsSubModOp._parse_args(args) File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\modules\bpy\ops.py", line 60, in _parse_args raise ValueError("1-2 args execution context is supported") ValueError: 1-2 args execution context is supported

Yusarina commented 1 year ago

This is because of some big changes in 4.0 which breaks alot of plugins due to api changes.

I would not count on cats getting updated for 4.0 as the project seems mainly abandoned and quite a few things won't work as well due to MMD Tools not being updated to 4.0 as well.

However there is a pull request which does seem to fix the issue for pose mode https://github.com/absolute-quantum/cats-blender-plugin/pull/648

OneLegitDev commented 11 months ago

I have a version I edited which has this functionality working. Possibly thinking of making a fork and letting people use it!

Sabiryth commented 11 months ago

This is a VERY hackey fix, but I cloned the CATS repo into my blender addons dir and checked out the #648 branch. Blender happily enabled the custom addon and that branch fixes the "Apply as Rest Pose" feature.

OneLegitDev commented 11 months ago

I've also fixed this issue in my fork of the project https://github.com/OneLegitDev/cats-blender-plugin-4.0 as well as a few other fixes.

loriducci commented 10 months ago

The branch by @Yusarina also includes a fix for this and I've been using it successfully in 4.0+ Thanks everyone! https://github.com/Yusarina/Cats-Blender-Plugin-Unofficial-