Implement query.state_time

This commit is contained in:
JannisX11 2024-09-12 23:57:59 +02:00
parent 51632d9a6d
commit 79a7a74f6e
2 changed files with 9 additions and 1 deletions

View File

@ -319,7 +319,6 @@ const Animator = {
let state_time = selected_state.getStateTime();
let blend_progress = (last_state && last_state.blend_transition) ? Math.clamp(state_time / last_state.blend_transition, 0, 1) : 1;
let blend_value = last_state?.calculateBlendValue(blend_progress) ?? blend_progress;
console.log(blend_progress, blend_value)
// Active State
Timeline.time = state_time;

View File

@ -30,6 +30,12 @@ Animator.MolangParser.global_variables = {
}
return 0
},
get 'query.state_time'() {
if (AnimationController.selected?.selected_state) {
AnimationController.selected.selected_state.getStateTime();
}
return Timeline.time
},
get 'query.any_animation_finished'() {
if (AnimationController.selected?.selected_state) {
let state = AnimationController.selected?.selected_state
@ -774,6 +780,9 @@ function sortAutocompleteResults(results, incomplete) {
.addQuery({
id: 'life_time',
})
.addQuery({
id: 'state_time',
})
.addQuery({
id: 'yaw_speed',
})