mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-12-25 01:17:10 +01:00
Initial set rest pose implementation for the bone editor. Doesn't work properly yet.
This commit is contained in:
parent
242321fd7a
commit
d9e0ed3741
@ -10,6 +10,8 @@ export(bool) var edit_bone_hierarchy : bool = false
|
|||||||
export(String) var add_bone_name : String = ""
|
export(String) var add_bone_name : String = ""
|
||||||
export(bool) var add_bone : bool = false setget set_add_bone, get_add_bone
|
export(bool) var add_bone : bool = false setget set_add_bone, get_add_bone
|
||||||
|
|
||||||
|
export(bool) var set_pose_as_rest : bool = false setget set_set_pose_as_rest, get_add_bone
|
||||||
|
|
||||||
var skeleton:Skeleton = null
|
var skeleton:Skeleton = null
|
||||||
var animation_player:AnimationPlayer = null
|
var animation_player:AnimationPlayer = null
|
||||||
var first_call:bool = true
|
var first_call:bool = true
|
||||||
@ -233,3 +235,13 @@ func get_add_bone():
|
|||||||
|
|
||||||
func is_done_editor():
|
func is_done_editor():
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
func set_set_pose_as_rest(val):
|
||||||
|
if val:
|
||||||
|
for n in bone_handle_nodes:
|
||||||
|
n.set_as_rest_pose()
|
||||||
|
|
||||||
|
for n in bone_handle_nodes:
|
||||||
|
n._ready()
|
||||||
|
|
||||||
|
#load_poses()
|
||||||
|
@ -36,6 +36,12 @@ func set_pose( basis:Basis, origin:Vector3 ):
|
|||||||
self.transform.origin = self.original_global_rest_origin + self.original_parent_rest.basis.xform( origin )
|
self.transform.origin = self.original_global_rest_origin + self.original_parent_rest.basis.xform( origin )
|
||||||
# printt( self.bone_name, basis, origin )
|
# printt( self.bone_name, basis, origin )
|
||||||
|
|
||||||
|
func set_as_rest_pose():
|
||||||
|
original_rest = self.pose
|
||||||
|
self.skeleton.set_bone_rest(self.bone_id, original_rest)
|
||||||
|
self.skeleton.set_bone_pose( self.bone_id, Transform( ))
|
||||||
|
|
||||||
|
|
||||||
func _process( delta:float ):
|
func _process( delta:float ):
|
||||||
if self.skeleton == null or self.bone_id == -1:
|
if self.skeleton == null or self.bone_id == -1:
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user