The OSG warning about shininess value being clipped has no mention of the model file where it encounters that problem, making it impossible to trace it:
4.96 [WARN]:OSG Warning: Material::setShininess() of 254 is above permitted maximum, clamping to 128.
Just tried a quick workaround.
1st step (using fgdata as an example):
$ cd /path/to/fgdata
$ grep -R MATERIAL . > /tmp/materials.txt
2nd step (quick and dirty Python script):
This script will print an error on some unusual material definitions, like e.g. material name having spaces in it, but should otherwise be useful.
Last edit: Mariusz Matuszek 2022-08-03
Additional modification, replacing the test with
if int(line.strip().split()[19]) > 128:will catch (as parse errors) shininess specified as non integer values
We can add this script to fgmeta (we have some similar scripts already), but we could also make a patch to OSG (as we have some already) to actuall show the filename.
.. looking at osg/src/osgPlugings/ac3d.cpp, there is this code:
"""
stream >> shininess;
mMaterial->setShininess(osg::Material::FRONT_AND_BACK, shininess);
""
... so we can easily add an OSG WARN there, we know the filename, and we capture the OSG warning stream into the Simgear logs.
I think it's good when we have both a better runtime error but also the offline script, since different people approach fixing this in different ways.
One more modification, as spaces in directory names also resulted in false positives.
I think it may come handy for bulk inspection of whole directories, be it fgdata or Aircraft.
Maybe even some sort of automated check?
James, if you want to add it to fgmeta I am more than happy.
yeah we actual had the idea to automate such checks in the aircraft-hanagr script which creates the zips automatically. It already reports some issues, but only to a local log, so not easily visible: so far we did not find an easy way to get the errors generated bye ach aircraft in front of the correct person/team.
Anyway, I can add the script, it's a good start.
Great.
There is a similar issue (not printing the offending file name) with detected incorrect RGB profiles. Not sure if it merits a separate ticket, as it seems very similar to this one, so I'll just mention it here.