From 148ba367ee860b6f9ad5d9faa9c613049feebce4 Mon Sep 17 00:00:00 2001 From: Richard Harrison Date: Mon, 18 Oct 2021 11:40:02 +0200 Subject: [PATCH] Material animation include model directory Include model directory in the texture path - to allows short paths relative to model root when set via a texture-prop --- simgear/scene/model/SGMaterialAnimation.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/simgear/scene/model/SGMaterialAnimation.cxx b/simgear/scene/model/SGMaterialAnimation.cxx index 73712325..69973925 100644 --- a/simgear/scene/model/SGMaterialAnimation.cxx +++ b/simgear/scene/model/SGMaterialAnimation.cxx @@ -419,6 +419,11 @@ private: SGMaterialAnimation::SGMaterialAnimation(simgear::SGTransientModelData &modelData) : SGAnimation(modelData), texturePathList(modelData.getOptions()->getDatabasePathList()) { + // add model directory to texture path - this allows short paths relative to + // model root. + SGPath modelDir(_modelData.getPath()); + texturePathList.insert(texturePathList.begin(), modelDir.dir()); + if (modelData.getConfigNode()->hasChild("global")) SG_LOG(SG_IO, SG_DEV_ALERT, modelData.getPath() << ": Use of in material animation is "