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
This commit is contained in:
Richard Harrison 2021-10-18 11:40:02 +02:00
parent 7ac90850d3
commit 148ba367ee

View File

@ -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 <global> in material animation is "