digicreatures / rigacar

Blender addon to generate rig for cars
GNU General Public License v3.0
406 stars 59 forks source link

Blender 4.1 issues - signature of `bake_action` changed #132

Open mikecokina opened 3 months ago

mikecokina commented 3 months ago

Hi,

I've started learning car animation and encountered an issue with an addon. It seems that the developers of Blender have significantly changed the signature of the bake_action function within the anim_utils module. After some investigation, I've identified the issue and realized that updates need to be made in the addon file bake_operations.

Previously, the code snippet looked like this:

baked_action = bpy_extras.anim_utils.bake_action(
            context.object,
            action=None,
            frames=range(self.frame_start, self.frame_end + 1),
            only_selected=True,
            do_pose=True,
            do_object=False,
            do_visual_keying=True,
        )

Now, it requires something like this:

bake_options = bpy_extras.anim_utils.BakeOptions(
            only_selected=True,
            do_pose=True,
            do_object=False,
            do_visual_keying=True,
            do_constraint_clear=False,
            do_parents_clear=False,
            do_clean=False,
            do_location=True,
            do_scale=True,
            do_rotation=True,
            do_bbone=True,
            do_custom_props=True
        )

baked_action = bpy_extras.anim_utils.bake_action(
            context.object,
            action=None,
            frames=range(self.frame_start, self.frame_end + 1),
            bake_options=bake_options
        )

As a beginner with Blender, I'm not entirely sure what these new options actually do. If anyone is more familiar with the Blender API, please use this information as a starting point and make the necessary changes and pull requests. Thank you.

LohmingIDesgin commented 2 months ago

It still does not work after embedding. An error will be reported when turning to bake

mikecokina commented 2 months ago

You have to make an update within version fixed for blender 4.0 (https://github.com/webbertakken/rigacar/blob/main/bake_operators.py).