godot_game_tools icon indicating copy to clipboard operation
godot_game_tools copied to clipboard

Error when adding root motion

Open pvini07BR opened this issue 3 years ago • 7 comments

The following pops on the Blender Info Log:

Python: Traceback (most recent call last):
  File "C:\Users\pvini\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\src\operators\rootmotion_controller.py", line 337, in execute
    scene.frame_set(index)
TypeError: Scene.frame_set(): error with argument 1, "frame" -  Function.frame expected an int type, not float

And also, when you join an animation that has movement baked in (like the walking animations on Mixamo when the option "In Place" is turned off), for some reason the plugin removes that movement and makes the animation in-place, this should not happen.

I'm running Blender 3.2.1, with Godot Game Tools plugin version 2.1.0

pvini07BR avatar Jul 10 '22 21:07 pvini07BR

I have the same error, I have character from mixamo and i'm joining animations with "in place" turned off

And the animations look very weird when the plugin makes the animation in-place

TheCyberKid16 avatar Jul 11 '22 11:07 TheCyberKid16

After seeing the other open issues, these kinda errors are occuring on Blender 3.2, These errors have one thing in common: In these functions The frame values need to be an int, Tho the script gets a float value.

This is just a guess, I may be wrong idk

TheCyberKid16 avatar Jul 11 '22 11:07 TheCyberKid16

Just found a fix: https://www.reddit.com/r/godot/comments/v5669u/for_those_with_problems_with_godot_game_tools/ Guy added a cast to Int

TheCyberKid16 avatar Jul 11 '22 12:07 TheCyberKid16

Just found a fix: https://www.reddit.com/r/godot/comments/v5669u/for_those_with_problems_with_godot_game_tools/ Guy added a cast to Int

it worked, thanks!

pvini07BR avatar Jul 11 '22 12:07 pvini07BR

Will be solved with this https://github.com/vini-guerrero/godot_game_tools/pull/65 :)

andreami avatar Jul 14 '22 21:07 andreami

I'm getting the same error in the latest version of GTT (2.1.1) and Blender (3.2.2)

Python: Traceback (most recent call last): File "C:\Users\USERNAME\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\src\operators\rootmotion_controller.py", line 337, in execute scene.frame_set(index) TypeError: Scene.frame_set(): error with argument 1, "frame" - Function.frame expected an int type, not float

Screenshot 2022-08-16 142755 From what I can tell, the RootMotion bone that gets added is a duplicate of the Hips bone. I still try to import into Godot to see what happens, and unfortunately all root motion is changed to an in-place animation.

liyiz avatar Aug 16 '22 13:08 liyiz

I just tried it and this also on GTT (2.1.1) and Blender (3.2.2) and it can (still) be fixed by applying scene.frame_set(int(index)) to line 337 in rootmotion_controller.py.

You need to find the file (it was /home/USERNAME/.config/blender/3.2/scripts/addons/src/operators/rootmotion_controller.py on POP_OS/manual install for me) and insert the int cast there.

Now I go and buy this awesome tool on itch.io to give the man some credit(s).

dirkk0 avatar Sep 14 '22 18:09 dirkk0