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

Create a simple cube rigging animation in Blender and use it Godot #74

Open
acs opened this issue Nov 16, 2022 · 1 comment
Open

Create a simple cube rigging animation in Blender and use it Godot #74

acs opened this issue Nov 16, 2022 · 1 comment

Comments

@acs
Copy link
Contributor

acs commented Nov 16, 2022

The goal is to show the simplest rig based animation created in Blender and used in Godot.

For doing it:

  • Start from Blender initial cube
  • Add a minimal skeleton to rig the cube
  • Animate the cube deforming it
  • Save the Blender cube animation
  • Import it in Godot
  • Create a scene using this cube animation
  • Implement some logic in the script to manage the animation

This is the first step before going to more elaborate models.

@acs
Copy link
Contributor Author

acs commented Nov 16, 2022

Screenshot from 2022-11-16 23-05-08

The video is not working ok:

Screencast.from.16-11-22.23.00.36.webm

But the process has been completed pretty quickly.

extends Node3D
const move_offset = 0.1
const anim_name = 'ArmatureAction'


# Called when the node enters the scene tree for the first time.
func _ready():
	var cube_anim = $AnimationPlayer.get_animation(anim_name)
	cube_anim.set_loop_mode(1)
	$AnimationPlayer.play(anim_name) # Replace with function body.

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
	pass
	
func _input(event):
	if Input.is_action_pressed("Up"):
		if $AnimationPlayer.is_playing():
			$AnimationPlayer.stop(false)
		else:
			$AnimationPlayer.play(anim_name)
	elif Input.is_action_pressed("Down"):
		if $AnimationPlayer.is_playing():
			$AnimationPlayer.stop(false)
		else:
			$AnimationPlayer.play_backwards(anim_name)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant