On 16 Jan 2011, at 21:05, Martin Spott wrote:

>> The solution as I think has been said is to figure out if there is a
>> way to get the name of the top level folder using Nasal, or to figure
>> out a way to use nasal within the scenery folder?  You could always
>> try calling the nasal script from the xml (I have absolutely no idea
>> if this will work or not and it may well be impossible).
> 
> Mmmm, guessing directory path names from an embedded script smells like
> it's calling for permenant maintenance trouble in the long run  ;-)

Right, the solution is to expose the path resolve / resource logic I added, to 
Nasal. This takes a relative path (and some context) and finds the best match 
among the defined scenery/model paths. Thats exactly how the aircraft-dir 
support coded up, and how existing models are found. Nasal currently can't hook 
into that, but it could be done.

Of course the best thing from my point of view, would be if Nasal always passed 
a relative path, treating it like an opaque ID rather than an actual 
file-system path, and then the C++ layer dealt with converting it (using the 
resource code, as it already does). I.e you shouldn't ever be dealing with 
absolute paths in Nasal, hopefully.

James


------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to