kuligs2 whats a shape key?
Surprising question… well it's a mesh change (similar to what you're doing), just in a different, more traditional way.
kuligs2 whats a shape key?
Surprising question… well it's a mesh change (similar to what you're doing), just in a different, more traditional way.
xyz Blend shapes are per-vertex animation technique.
I mean, both are changes to the meshes. Yeah, in different ways. But they're similar enough in appearance. We don't know the end goal thoroughly. Somehow modifying by bones is supposed to be easier for the engine (so it's sometimes claimed). I want to try it, though I'm still vague about how it might be.
Tomcat so its a blender thing.. not really what im looking for unless the "end" goal i have in mind can be achieved with this.
I agree with xyz, its always transforms..
Tomcat well i didnt know any other way to do what i want - change for instance character shape.. i havent tested this with baked in animations, how it will all work, but the goal is to have character manipulation thingie, that players can set up their char face or any other bone/mesh the way they want.. with limits tho ..
I kinda hate when devs take a shortcut and just give few options to change the hair or have pre baked faces or body types..
I think something similar is in ARK survival game, tho i dont remember if you could adjust face.. i mean if you can adjust bone then face should be no problem.. ??
kuligs2 so its a blender thing.. not really what im looking for unless the "end" goal i have in mind can be achieved with this.
Well, those keys can be transferred to the engine.
well i didnt know any other way to do what i want - change for instance character shape..
Yep, that's exactly what the keys are for.
But character customization is a bit more complicated. Just to give you a very brief rundown on that: you have to be careful to match the rig and the mesh.
Tomcat Well, those keys can be transferred to the engine.
from what i seen keys are like linear manipulation, but idk.. yes i saw you can export to godot, but i dont like that you have to manually select vertices and move to a "maximum" distortion value rather than just modifying the root deformation bone somehow.. idk.. maybe the bone thing wont work out with animations etc.. need more testing..
Tomcat But character customization is a bit more complicated. Just to give you a very brief rundown on that: you have to be careful to match the rig and the mesh.
yeah this i learned, but you need to scale rig + mesh at the same time, and it should be ok, pretty easy to do in godot on node level.
kuligs2 need more testing..
Yeah, I want to try that too.
but you need to scale rig + mesh at the same time, and it should be ok, pretty easy to do in godot on node level.
No, it's not the size (not only the size) but the ratio of the different bones that changes, and this leads to severe distortions.
So i keep breaking things, not sure how and why..
Idea today was to create function that resets the bones to the initial positions. But somehow when i do that the mesh is mangled up.
As a bonus i figured out why the child bone didnt work properly. It was that function that get triggered when the skeleton is updated, so i disabled it and now i can move child bones and the bone/ball is not jumping away from my grip but the mesh is still deforming in not the bone direction but opposite (child bones)
Working code so far:
func get_bones():
var bone_count = skeleton_3d.get_bone_count()
if bone_count <1:
return
for b_index in range(0,bone_count-1):
# works
var b_pos = skeleton_3d.get_bone_global_pose(b_index)
var pos = skeleton_3d.global_transform * b_pos
var new_ball:Ball = ball.instantiate()
new_ball.ball_position_changed.connect(_on_ball_position_changed)
new_ball.bone_index = b_index
new_ball.cam = cam
new_ball.global_transform = pos
ball_nodes.add_child(new_ball)
get_bone_reset_postions()
pass
func _on_ball_position_changed(bone_index, bone_pos):
# works
var pos = bone_pos * skeleton_3d.global_transform
skeleton_3d.set_bone_pose_position(bone_index,pos)
pass
func get_bone_reset_postions():
var bone_count = skeleton_3d.get_bone_count()
if bone_count <1:
return
for b_index in range(0,bone_count-1):
# works
var b_pos = skeleton_3d.get_bone_global_pose(b_index)
var pos = skeleton_3d.global_transform * b_pos
reset_bones_positions[b_index] = pos
print("Reset position get")
func set_bone_reset_postions():
for child:Ball in ball_nodes.get_children():
child.global_transform = reset_bones_positions[child.bone_index]
var pos = reset_bones_positions[child.bone_index].origin * skeleton_3d.global_transform
skeleton_3d.set_bone_pose_position(child.bone_index,pos)
print("Reset position set")
Its all inside the garbanzo - the face scene where i have access to skeleton and ball_node which contains balls that gets spawned by get_bones()
Continuing observations..
Godot does not import last added bone in blender..
I created new mesh and new bones from scratch. And now the movements are again flipped.. its not consistent.. script hasnt changed..
And same script with the other mesh
Not sure how and why this is happening and how to proceed..
Maybe its time to investigate shape keys??
EDIT:
One thing i noticed while here is that bone direction are different in blender, maybe thats the reason?
While the garbanzo works decent on the bones that are not the nose, the suzy bones do not at all..
EDIT2:
Ah yes.. yes yes yes.. this is quite peculiar.
TLDR:
Cannot chain bones if you want to deform mesh
Remember to add last sacrificial bone in blender because godot is too based to import it.
In blender, create bones that are Z-aligned (call em Z-bones) Z- axis in godot, in blender it could be either x or y
Note:
So for deformation in godot, you want to create separate armature that is based on the things i mentioned above.
Next:
Try to create idle animation for the mesh, then deform bones in godot and see how animation looks after deform.
Next - to last:
Try to save deform bone transforms to import them from either file or memory and apply it to the current session.
works just fine on my end, just downloaded the zip, added the extracted zip folder and imported and edit in godot.