Board index FlightGear Development New features

Add a livery select tool to a new airplane?

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

Add a livery select tool to a new airplane?

Postby schnidiz » Sat Feb 15, 2014 7:32 pm

Can someone show me how to creat this? I try to make it buy i'm not able to finish this.
I make the steps how this instruction: http://wiki.flightgear.org/Livery_over_MP#Multiple_texture_files_per_livery%20in%20the told me but the result is that there only the livery select button in the menubar is there but it has no function.
Hope you can help me ;)
schnidiz
 
Posts: 16
Joined: Tue Feb 11, 2014 5:41 pm

Re: Add a livery select tool to a new airplane?

Postby Johan G » Sat Feb 15, 2014 10:18 pm

My best tip is to look in your ../dat/Aircraft/.. folders at some of the models that have a livery selection dialogue. That usually give some hints. Do note that some in operating systems paths are case sensitive.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: Add a livery select tool to a new airplane?

Postby Sascha » Sat Feb 22, 2014 10:36 pm

Hi,

I struggled with the livery select dialog, too. The solution was quite simple: I had a couple of errors in my XMLs. With some help from other guys in this forum, this is what I what I needed to do:
- checking (and correcting) all of the pathes in the XMLs
- making sure that no model-sections were declared twice/iteratively (file-a.xml:<model><path>file-b.xml</path></model>; file-b.xml: <model>....</model>)
- putting all of the " <animation> <type>material</type>..." to the right place.

Now the selection dialog works.

Maybe reading http://forum.flightgear.org/viewtopic.php?f=4&t=21869 helps you finding a solution.

Sascha
Sascha
 
Posts: 62
Joined: Sun Mar 03, 2013 4:31 pm

Re: Add a livery select tool to a new airplane?

Postby Johan G » Sun Feb 23, 2014 4:37 am

Since you have recent experience with this, could you have a look at the wiki articles Howto:Edit a livery and Livery over MP and see if you have suggestions for clarifications and improvements?
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: Add a livery select tool to a new airplane?

Postby Sascha » Mon Feb 24, 2014 10:50 pm

Sure!

Since I used Livery over MP, I think this is a very good explanation. However, there are a couple of things I struggled with:

1) In the howto, you use the 747 as an example. In the livery-xmls, there is (a) "<747-texture>Liveries/KLM.png</747-texture>" and in the models-xml, thie texture-prop is defined accordingly: (b) "<texture-prop>747-texture</texture-prop>". It took me a while to figure out that the XML-naming ist totaly free and that (b) defines the name to be used in (a). Most of the available aircrafts just use "livery". A small hint/explanation would be helpful to understand that this naming is free but has to match in both files.
2) In my first attempt, I forgot to add the .nas file. This resulted in a menue-item wich did not do anything at all.
3) As far as I can see, the howto does not give a hint on how to load the .nas file after it was generated. I added
Code: Select all
   <nasal>
      <A310>
        <file>Nasal/liveries.nas</file>
      </A310>
   </nasal>

to my -set.xml. Has this possibly been forgotten?
Without this entry, I see the same behaviour as in 2): A menu item without any reaction when clicking it.
4) The xml-parser does not like <model><model>...</model></model>. Example:
Aircraft/Models/A310-308.xml (the main model file):
Code: Select all
<PropertyList>

.......
 
<model>
 <name>Fuselage</name>
 <path>Aircraft/A310/Models/Fuselage.xml</path>
 <offsets>
  <x-m> 0.0</x-m>
  <y-m> 0.0</y-m>
  <z-m> -0.35</z-m>
 </offsets>
</model>

....

</PropertyList>


Aircraft/Models/Fuselage.xml:
Code: Select all
<PropertyList>

...

 <model>
   <path>Fuselage.ac</path>

  <animation>
  <type>material</type>
   <object-name>fuselage</object-name>
   <property-base>sim/model/livery</property-base>
   <texture-prop>texture</texture-prop>
   <texture>Liveries/HF90.png</texture>
 </animation>
</model>

...

</PropertyList>

This does not work because both files declare a <model> section inside each other. Removing the <model>-tag from fuselage.xml helped.[/list]
5) Maybe a "common errors" section could help. E.g.: "if your menu is visible but does not react on clicking, then your .nas or include section is wrong or the xml files are mixed up".

For the Howto:Edit a livery, there´s just one remark but I´, not sure if this is a bug in the rembrandt-engine or an intended feature:
If the initial livery is declared like this:
Code: Select all
  <animation>
  <type>material</type>
   <object-name>fuselage</object-name>
   <property-base>sim/model/livery</property-base>
   <texture-prop>texture</texture-prop>
   <texture>Liveries/HF90.png</texture>
 </animation>

Then this single png (here: HF90.png) is not allowed to contain any full or partly transparent pixels. An alpha channel is ok as it is does not affect any pixels. For all the other .png loaded by clicking on one of the menu-items, alpha-pixels are ok. Same for the .png noted inside the .ac files: no problem here. Once the initial .png is "contaminated" with an alpha, all parts of the aircraft covered by this file look funny orange-green:
Image
So: unless this is not fixed or declared a feature, a hint in the howto would help.

I hope this helps. Thank you for all the help and howtos!

Sascha
Sascha
 
Posts: 62
Joined: Sun Mar 03, 2013 4:31 pm

Re: Add a livery select tool to a new airplane?

Postby Hooray » Mon Feb 24, 2014 11:00 pm

Yes, this is great - please contribute this to the wiki and update the article there.
Regarding the potential issues mentioned by others (invalid XML, invalid paths) etc - that would be roughly 30-60 minutes of Nasal coding to use try/catch (via call) to validate the XML file and those new SGPath() bindings to validate each path. So if anybody is interested in doing that, let me know ...
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Add a livery select tool to a new airplane?

Postby AndersG » Mon Feb 24, 2014 11:04 pm

The "funny orange-green" colour looks like the mesh normals interpreted as colour. I don't know the internals of Rembrandt well but from your description it would seem the mesh is drawn as translucent but drawn with the Rembrandt shader for the geometry pass for opaque meshes. It might be that OSG is too clever (compared to Rembrandt that requires manual markup to treat a mesh as translucent) in classifying the mesh as translucent.
Make sure to remove the alpha channels to avoid this problem.

/Anders
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2524
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: Add a livery select tool to a new airplane?

Postby Sascha » Thu Mar 06, 2014 9:23 pm

I just included the content shown above into the Livery over MP howto and reorganized most of the article. Before publishing it, do you have some kind of sandbox to give you the chance to double check the structure and maybe check for grammar/writing?

I changed about 75% of the text, so I really think some people might want to check this first :-)

Sascha
Sascha
 
Posts: 62
Joined: Sun Mar 03, 2013 4:31 pm

Re: Add a livery select tool to a new airplane?

Postby Gijs » Thu Mar 06, 2014 9:25 pm

Hi Sascha,

you can create a sandbox as part of your user page. For example http://wiki.flightgear.org/User:Gijs/Sandbox
Looking forward to your improvements!

Cheers,
Gijs
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9544
Joined: Tue Jul 03, 2007 3:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Add a livery select tool to a new airplane?

Postby Sascha » Thu Mar 06, 2014 10:06 pm

Sascha
 
Posts: 62
Joined: Sun Mar 03, 2013 4:31 pm

Re: Add a livery select tool to a new airplane?

Postby Sascha » Mon Mar 24, 2014 11:25 pm

Hello Guys,

was anybody able to check the modifications to the wiki I proposed in my sandbox? There´s one missing step in the "Livery over MP" (including the NAS) which should be corrected asap. If there are doubts regarding the amount of modifications I proposed, we could start with just correcting this error first.

Sascha
Sascha
 
Posts: 62
Joined: Sun Mar 03, 2013 4:31 pm


Return to New features

Who is online

Users browsing this forum: No registered users and 4 guests