Ok then, trying to make sense of this whole model & effects loading code...
In `modellib.cxx' the `loadFile' and `loadModel' functions, which check the file extensions for a `.ac' file and if so sets a flag for instantiation of effects. This flags is only checked in the 'ACOptimizePolicy::optimize' method in `ModelRegistry.cxx' and appears it's only purpose is to make sure non xml wrapped `.ac' files get the default model effect applied. This is done by calling an overloaded `instantiateEffects' function in `model.hxx' that simply calls the other version of the function with an empty effects property tree causing default model effect to get used. Ok... Now models wrapped in xml (and thus any model with an effect attached) of course don't get any flags set in the `load*' functions and go a whole different path...through `SGReaderWriterXML' and friends. So then `sgLoad3DModel_internal' from `SGReaderWriterXML' seems to handle most the heavy lifting of parsing the xml file including any `<effects>' elements, and then itself calls `instantiateEffects'. In this case though it calls the non overloaded version and passes in any effect properties it found...which if there were none again causes default model effect to get applied. Now, in this xml loading path any models loaded from inside it, `.ac' or otherwise, never find there way to the `load*' functions in `modellib.cxx' thus never getting the instantiate effect flag, thus ensuring that `ACOptimizePolicy' (which does still get called) doesn't call the overloaded `instantiateEffects' since xml loader will call the non overloaded itself. Phew...... So here is the kicker...`instantiateEffects' does indeed seem to be called for every single model wrapped in an xml regardless of whatever format that might be. So then it seems the effect code is simply failing silently on non ac3d formats. Perhaps in the `MakeEffectVisitor' or further up the chain somewhere who knows...deeper down the rabbit hole we go... So umm Tim...could you maybe explain the process of the whole model loading, getting effects applied, what the effects system expects from a model, the reasoning behind it and so on? There is a lot of static local functions and classes and so on in this code that is completely undocumented and not at all trivial to unwind and try and fit the pieces together. Would be really, really helpful if you could lay out the code flow here, what functions are involved and inter-dependent on each other, what processing is needed for the effect system to work, etc....in the mean time I'll keep digging. cheers! --Jacob ------------------------------------------------------------------------------ Lotusphere 2011 Register now for Lotusphere 2011 and learn how to connect the dots, take your collaborative environment to the next level, and enter the era of Social Business. http://p.sf.net/sfu/lotusphere-d2d _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel