On Saturday 03 July 2004 09:49, Erik Hofman wrote: > Chris Metzler wrote: > > On Sat, 3 Jul 2004 01:19:27 +0100 > > > > Lee Elliott <[EMAIL PROTECTED]> wrote: > >>As I understand it, the 3d model and texture handling in FG is done via > >>plib, which treats the texture map path incorporated in the .ac model > >>file as a relative path. > > > > Relative to what? To the directory containing the .ac file that uses > > the texture? To the directory containing the .xml file that has the > > <Model> tags? Relative to something else?
It's relative to the directory containing the .ac model. The default is for the texture map to reside in the same directory as the .ac model but you can edit the .ac file to change the texture path. I just tried creating a 'Textures' sub-dir in the 'Models' dir, which holds the .ac file, and moved the texture into it so that the .ac file was in 'Models', together with the xxx-model.xml file, but the texture.rgb was in the 'Models/Textures' sub-dir. Then I edited the .ac file to change the 'texture' entries from 'texture.rgb' to 'Textures/texture.rgb' and this seemed to work ok in AC3D. This doesn't really help though because it's still hard-coded into the .ac file. > > > > Because if I understand it (and I may not), that's the heart of Erik's > > approach (and I'm hoping he'll jump in here if I've got it wrong). > > You have different subdirectories for each livery. Each one has the > > textures for that livery in it, as well as the xml file that specifies > > the 3D model, but NOT the 3D model itself (which is, say, in the parent > > directory). The .xml file gets read; the <Model><path> tags provide a > > relative pathname from where the .xml is located upstairs to the .ac > > file; the .ac file calls textures which are loaded from the directory > > the thread is currently in -- namely, the one with the .xml file. > > I just tried this out. It doesn't work. :-( > Plib expects the textures to be in the same directory as the geometry > file which (at this moment) means you will always have to duplicate the > ..ac file. See above, but you still need to duplicate the .ac file to specify different textures - wherever they're put. > > I think we need to push a patch to the plib developers list that > optionally lets one specify the texture directory when loading a > geometry file, but still default to the geometries own directory. > > I expect that approach might stand a chance of getting accepted. > > > Does this make sense? Am I understanding you, Erik? > > That is what I was hoping should work, but it doesn't. > > Erik A patch to plib that allowed a prefix to be added to the texture path specified in the .ac model is really the only answer to this problem. The prefix could be used to either specify a sub-dir containing the required texture.rgb or it could be a simple file prefix to allow choosing between say, UA-737.rgb or MyAirline-737.rgb textures - in this case the texture specified in the .ac file would just be 737.rgb As Innis suggested, it would be possible to replace the named texture with the one you want to use at run-time, and this could be coded into FG but it would have serious security implications. The FG user would need to have write permissions to the FG installation to permit the overwriting of the installed files, and that's not really on. LeeE _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
