0
$\begingroup$

error code when face flexing

I'm attempting to face flex a mesh for TF2 using a TF2 face flex addon. but when I try to flex it, it gives me this error code. It seems very easy to get ride of but I don't know how to do it. Can someone show me what to type? Thank you!

blender_tf_flex.py

bpy.ops.object.surfacedeform_bind({'object': shape_obj}, modifier=sdef)

C_exec, C_undo = _BPyOpsSubModOp._parse_args(args)

raise ValueError("1-2 args execution context is supported")
$\endgroup$
1
  • $\begingroup$ Sorry, we are no developers here and not affiliated with the Blender Foundation, we cannot help with bugs etc., only with using Blender. And when this is a third-party addon it is off-topic here as well, please contact the addon developers for support. But just in general: you are using Blender 4.2, there have been a lot of changes in this version. Is this an up-to-date addon, is it compatible with 4.2? $\endgroup$ Commented Aug 27 at 7:11

1 Answer 1

1
$\begingroup$

The new context override method is bpy.context.temp_override not passing as a first argument.

Here is a cross version method.

import typing
import bpy


def call_with_override(override: typing.Dict[str, typing.Any], func: typing.Callable, *args, **kwargs):

    if bpy.app.version > (3, 2, 0):
        with bpy.context.temp_override(**override):
            result = func(*args, **kwargs)
    else:
        result =  func(override, *args, **kwargs)

    if 'CANCELLED' in result:
        raise Exception(f"CANCELLED:\noverride: {override}\nfunc: {repr(func)}\nargs: {args}\nkwargs: {kwargs}")

    return result


call_with_override({'object': shape_obj}, bpy.ops.object.surfacedeform_bind, modifier=sdef)
$\endgroup$

Not the answer you're looking for? Browse other questions tagged .