Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bake issue on Blender 3.1.0 #19

Closed
Theo-Cheynel opened this issue Mar 10, 2022 · 4 comments · Fixed by #20
Closed

Bake issue on Blender 3.1.0 #19

Theo-Cheynel opened this issue Mar 10, 2022 · 4 comments · Fixed by #20

Comments

@Theo-Cheynel
Copy link

When I try on the 3.1.0, I get the following error :

Error: Python: Traceback (most recent call last):
  File "/home/theo/.config/blender/3.1/scripts/addons/blender-animation-retargeting/baking.py", line 75, in execute
    transfer_anim(context)
  File "/home/theo/.config/blender/3.1/scripts/addons/blender-animation-retargeting/baking.py", line 52, in transfer_anim
    bpy.ops.nla.bake(
  File "/snap/blender/1925/3.1/scripts/modules/bpy/ops.py", line 132, in __call__
    ret = _op_call(self.idname_py(), None, kw)
TypeError: Converting py args to operator properties:  NLA_OT_bake.frame_start expected an int type, not float

However, on 3.0.0 it works fine...

@Mwni
Copy link
Owner

Mwni commented Mar 10, 2022

Perhaps a simple type cast would suffice:

bpy.ops.nla.bake(

bpy.ops.nla.bake(
	frame_start=int(min(keyframes)),
	frame_end=int(max(keyframes)),
	step=s.bake_step,
	visual_keying=True,
	use_current_action=True,
	bake_types={'POSE'},
	only_selected=False
)

@Andrej730
Copy link

Met the same issue at 3.1 - keyframe id is float and we need to cast it to int to make it work.
Not sure if it's actually float like "1.1" or just "1.0" and if it's important.

@Mwni
Copy link
Owner

Mwni commented May 22, 2022

I did not have time to dig into this, but it appears there was some code change from blender 3.0 to 3.1 that made this bake method stricter. I pushed a small fix to this repo: 042d633

@GlitchyPSIX
Copy link
Contributor

You missed one!

@Mwni Mwni closed this as completed in #20 Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants