Effects: pass model XML file path, not dir path
Pass the full path to the XML file, not is containg directory, through effects, so that it's available for error reporting. Convert to an actual directory when using the path to lookup other resources.
This commit is contained in:
@@ -116,7 +116,7 @@ Effect* makeEffect(const string& name,
|
||||
}
|
||||
string effectFileName(name);
|
||||
effectFileName += ".eff";
|
||||
string absFileName = SGModelLib::findDataFile(effectFileName, options, modelPath);
|
||||
string absFileName = SGModelLib::findDataFile(effectFileName, options, modelPath.dir());
|
||||
if (absFileName.empty()) {
|
||||
simgear::reportFailure(simgear::LoadFailure::NotFound, simgear::ErrorCode::LoadEffectsShaders, "Couldn't find Effect:" + effectFileName);
|
||||
return nullptr;
|
||||
|
||||
@@ -801,7 +801,7 @@ sgLoad3DModel_internal(const SGPath& path,
|
||||
makeEffectAnimations(animation_nodes, effect_nodes);
|
||||
{
|
||||
ref_ptr<Node> modelWithEffects = instantiateEffects(group.get(), effect_nodes, options.get(),
|
||||
path.dirPath());
|
||||
path);
|
||||
group = static_cast<Group*>(modelWithEffects.get());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user