mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 21:29:33 +02:00
added a property check in renderableModelEntity for the animation url this fixes the bug stopping you from changing animations on an entity
This commit is contained in:
parent
fda4cf10b9
commit
4eb2a5cf5e
2 changed files with 16 additions and 1 deletions
|
@ -1394,7 +1394,19 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce
|
||||||
// That is where _currentFrame and _lastAnimated were updated.
|
// That is where _currentFrame and _lastAnimated were updated.
|
||||||
if (_animating) {
|
if (_animating) {
|
||||||
DETAILED_PROFILE_RANGE(simulation_physics, "Animate");
|
DETAILED_PROFILE_RANGE(simulation_physics, "Animate");
|
||||||
if (!jointsMapped()) {
|
// check animation url change
|
||||||
|
auto newprops = entity->getAnimationProperties();
|
||||||
|
if (newprops != _previousAnimationProperties) {
|
||||||
|
if (newprops.getURL() != _previousAnimationProperties.getURL()) {
|
||||||
|
_animation = DependencyManager::get<AnimationCache>()->getAnimation(entity->getAnimationURL());
|
||||||
|
_jointMappingCompleted = false;
|
||||||
|
mapJoints(entity, model->getJointNames());
|
||||||
|
}
|
||||||
|
_previousAnimationProperties = newprops;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (!jointsMapped() || _animation->getURL().toString() != entity->getAnimationURL()) {
|
||||||
|
qCDebug(entitiesrenderer) << "changed animation or started animation";
|
||||||
mapJoints(entity, model->getJointNames());
|
mapJoints(entity, model->getJointNames());
|
||||||
}
|
}
|
||||||
if (!(entity->getAnimationFirstFrame() < 0) && !(entity->getAnimationFirstFrame() > entity->getAnimationLastFrame())) {
|
if (!(entity->getAnimationFirstFrame() < 0) && !(entity->getAnimationFirstFrame() > entity->getAnimationLastFrame())) {
|
||||||
|
|
|
@ -193,6 +193,9 @@ private:
|
||||||
bool _animating { false };
|
bool _animating { false };
|
||||||
uint64_t _lastAnimated { 0 };
|
uint64_t _lastAnimated { 0 };
|
||||||
|
|
||||||
|
//fix test
|
||||||
|
AnimationPropertyGroup _previousAnimationProperties;
|
||||||
|
|
||||||
render::ItemKey _itemKey { render::ItemKey::Builder().withTypeMeta() };
|
render::ItemKey _itemKey { render::ItemKey::Builder().withTypeMeta() };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue