vini-guerrero / godot_game_tools

This is a blender add-on that contains tools to ease the creation/import process of assets into Godot Game Engine
GNU General Public License v2.0
364 stars 34 forks source link

Error when adding root motion #64

Open pvini07BR opened 1 year ago

pvini07BR commented 1 year ago

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

TheCyberKid16 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

pvini07BR commented 1 year ago

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!

andreami commented 1 year ago

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

liyiz commented 1 year ago

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.

dirkk0 commented 1 year ago

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).