mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 16:30:39 +02:00
only set animation properties if they actually changed
This commit is contained in:
parent
43f44f4131
commit
ea0022501b
1 changed files with 19 additions and 2 deletions
|
@ -22,6 +22,8 @@ EntityPropertyDialogBox = (function () {
|
||||||
var dimensionZ;
|
var dimensionZ;
|
||||||
var rescalePercentage;
|
var rescalePercentage;
|
||||||
var editModelID = -1;
|
var editModelID = -1;
|
||||||
|
var previousAnimationFrameIndex;
|
||||||
|
var previousAnimationSettings;
|
||||||
|
|
||||||
that.cleanup = function () {
|
that.cleanup = function () {
|
||||||
};
|
};
|
||||||
|
@ -51,8 +53,10 @@ EntityPropertyDialogBox = (function () {
|
||||||
array.push({ label: "Animation FPS:", value: properties.animationFPS });
|
array.push({ label: "Animation FPS:", value: properties.animationFPS });
|
||||||
index++;
|
index++;
|
||||||
array.push({ label: "Animation Frame:", value: properties.animationFrameIndex });
|
array.push({ label: "Animation Frame:", value: properties.animationFrameIndex });
|
||||||
|
previousAnimationFrameIndex = properties.animationFrameIndex;
|
||||||
index++;
|
index++;
|
||||||
array.push({ label: "Animation Settings:", value: properties.animationSettings });
|
array.push({ label: "Animation Settings:", value: properties.animationSettings });
|
||||||
|
previousAnimationSettings = properties.animationSettings;
|
||||||
index++;
|
index++;
|
||||||
array.push({ label: "Textures:", value: properties.textures });
|
array.push({ label: "Textures:", value: properties.textures });
|
||||||
index++;
|
index++;
|
||||||
|
@ -241,8 +245,21 @@ EntityPropertyDialogBox = (function () {
|
||||||
properties.animationURL = array[index++].value;
|
properties.animationURL = array[index++].value;
|
||||||
properties.animationIsPlaying = array[index++].value;
|
properties.animationIsPlaying = array[index++].value;
|
||||||
properties.animationFPS = array[index++].value;
|
properties.animationFPS = array[index++].value;
|
||||||
properties.animationFrameIndex = array[index++].value;
|
|
||||||
properties.animationSettings = array[index++].value;
|
var newAnimationFrameIndex = array[index++].value;
|
||||||
|
var newAnimationSettings = array[index++].value;
|
||||||
|
|
||||||
|
if (previousAnimationFrameIndex != newAnimationFrameIndex) {
|
||||||
|
properties.animationFrameIndex = newAnimationFrameIndex;
|
||||||
|
} else {
|
||||||
|
delete properties.animationFrameIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (previousAnimationSettings != newAnimationSettings) {
|
||||||
|
properties.animationSettings = newAnimationSettings;
|
||||||
|
} else {
|
||||||
|
delete properties.animationSettings;
|
||||||
|
}
|
||||||
properties.textures = array[index++].value;
|
properties.textures = array[index++].value;
|
||||||
index++; // skip textureNames label
|
index++; // skip textureNames label
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue