Open lxrchen opened 5 months ago
Personally I would not be using MMD tools on Blender 4.0, as the developer as stated in other issues, there don't plan on releasing it unto the LTS for 4.2 comes out.
see this for more info, key word is it's under development.
There for this means the blender-v4 branch is not stable and may not be unto later this year.
https://docs.blender.org/api/current/bpy.ops.html#overriding-context
It was because bpy changes api, so I change the blender-v4 branch code and install mmd_tool again , and it works.
file path: mmd_tools\operators\rigid_body.py,
def execute(self, context: bpy.types.Context):
override: Dict = context.copy()
override.update({"scene": context.scene, "point_cache": context.scene.rigidbody_world.point_cache})
# origin code
# bpy.ops.ptcache.bake(override, "INVOKE_DEFAULT", bake=True)
# new code
with bpy.context.temp_override(**override):
bpy.ops.ptcache.bake("INVOKE_DEFAULT", bake=True)
return {"FINISHED"}
def execute(self, context: bpy.types.Context):
override: Dict = context.copy()
override.update({"scene": context.scene, "point_cache": context.scene.rigidbody_world.point_cache})
# origin code
# bpy.ops.ptcache.free_bake(override, "INVOKE_DEFAULT")
# new code
with bpy.context.temp_override(**override):
bpy.ops.ptcache.free_bake("INVOKE_DEFAULT")
return {"FINISHED"}
Please try MMD Tools v4.x and give us feedback.
Python: Traceback (most recent call last): File "C:\Users\23026\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\mmd_tools\operators\rigid_body.py", line 294, in execute bpy.ops.ptcache.bake(override, "INVOKE_DEFAULT", bake=True) File "E:\Blender\4.0\scripts\modules\bpy\ops.py", line 106, in call C_exec, C_undo = _BPyOpsSubModOp._parse_args(args) File "E:\Blender\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