Update Wintersky to 1.1.0
Fix issue where variables set by keyframes could no longer Fix sign of camera rotation queries on X axis
This commit is contained in:
parent
9adc6fc4f2
commit
79e371f621
@ -1455,10 +1455,14 @@ Animator.MolangParser.global_variables = {
|
|||||||
return Timeline.time;
|
return Timeline.time;
|
||||||
},
|
},
|
||||||
'query.camera_rotation'(axis) {
|
'query.camera_rotation'(axis) {
|
||||||
return cameraTargetToRotation(Preview.selected.camera.position.toArray(), Preview.selected.controls.target.toArray())[axis ? 0 : 1];
|
let val = cameraTargetToRotation(Preview.selected.camera.position.toArray(), Preview.selected.controls.target.toArray())[axis ? 0 : 1];
|
||||||
|
if (axis == 0) val *= -1;
|
||||||
|
return val;
|
||||||
},
|
},
|
||||||
'query.rotation_to_camera'(axis) {
|
'query.rotation_to_camera'(axis) {
|
||||||
return cameraTargetToRotation([0, 0, 0], Preview.selected.camera.position.toArray())[axis ? 0 : 1] ;
|
let val = cameraTargetToRotation([0, 0, 0], Preview.selected.camera.position.toArray())[axis ? 0 : 1] ;
|
||||||
|
if (axis == 0) val *= -1;
|
||||||
|
return val;
|
||||||
},
|
},
|
||||||
get 'query.distance_from_camera'() {
|
get 'query.distance_from_camera'() {
|
||||||
return Preview.selected.camera.position.length() / 16;
|
return Preview.selected.camera.position.length() / 16;
|
||||||
@ -2014,38 +2018,45 @@ Interface.definePanels(function() {
|
|||||||
this.buttons.forEach(b => old_values[b.id] = b.value);
|
this.buttons.forEach(b => old_values[b.id] = b.value);
|
||||||
this.buttons.empty();
|
this.buttons.empty();
|
||||||
|
|
||||||
let matches = this.text.toLowerCase().match(/(slider|toggle)\(.+\)/g);
|
let text = this.text.toLowerCase();
|
||||||
|
let matches = text.matchAll(/(slider|toggle)\(.+\)/g);
|
||||||
|
|
||||||
if (matches) {
|
for (let match of matches) {
|
||||||
matches.forEach(match => {
|
let [type, content] = match[0].substring(0, match[0].length - 1).split(/\(/);
|
||||||
let [type, content] = match.substring(0, match.length - 1).split(/\(/);
|
let [id, ...args] = content.split(/\(|, */);
|
||||||
let [id, ...args] = content.split(/\(|, */);
|
id = id.replace(/['"]/g, '');
|
||||||
id = id.replace(/['"]/g, '');
|
if (this.buttons.find(b => b.id == id)) return;
|
||||||
if (this.buttons.find(b => b.id == id)) return;
|
|
||||||
|
|
||||||
if (type == 'slider') {
|
let variable = text.substring(0, match.index).match(/[\w.-]+ *= *$/);
|
||||||
this.buttons.push({
|
variable = variable ? variable[0].replace(/[ =]+/g, '').replace(/^v\./, 'variable.').replace(/^q\./, 'query.').replace(/^t\./, 'temp.').replace(/^c\./, 'context.') : undefined;
|
||||||
type,
|
|
||||||
id,
|
if (type == 'slider') {
|
||||||
value: old_values[id] || 0,
|
this.buttons.push({
|
||||||
step: args[0],
|
type,
|
||||||
min: args[1],
|
id,
|
||||||
max: args[2]
|
value: old_values[id] || 0,
|
||||||
})
|
variable,
|
||||||
} else {
|
step: args[0],
|
||||||
this.buttons.push({
|
min: args[1],
|
||||||
type,
|
max: args[2]
|
||||||
id,
|
})
|
||||||
value: old_values[id] || 0,
|
} else {
|
||||||
})
|
this.buttons.push({
|
||||||
}
|
type,
|
||||||
})
|
id,
|
||||||
|
value: old_values[id] || 0,
|
||||||
|
variable,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeButtonValue(button, event) {
|
changeButtonValue(button, event) {
|
||||||
if (button.type == 'toggle') {
|
if (button.type == 'toggle') {
|
||||||
button.value = event.target.checked ? 1 : 0;
|
button.value = event.target.checked ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
if (button.variable) {
|
||||||
|
delete Animator.MolangParser.variables[button.variable];
|
||||||
|
}
|
||||||
Animator.preview();
|
Animator.preview();
|
||||||
},
|
},
|
||||||
slideButton(button, e1) {
|
slideButton(button, e1) {
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user