Board index FlightGear Development Aircraft Liveries

Livery selection - all objects use the new texture

Discussion of aircraft textures and liveries

Livery selection - all objects use the new texture

Postby legoboyvdlp » Sun Aug 30, 2020 7:25 pm

Hello,

We have been having issues with the livery selection mechanism.

We have a xml structure as such:
- aircraft.xml which loads the -common xml, as well as the correct engine per variant
- -common.xml which refers to various files constant per variant, including fuselage.xml
- fuselage.xml which calls in the fuselage .ac file


At present, we can change livery:
In the common.xml file we have a animation as such:

Code: Select all
   <animation>
      <type>material</type>
      <!-- Fuselage -->
      <object-name>Fuselage</object-name>
      <property-base>sim/model/livery/</property-base>
      <texture-prop>texture-fuselage</texture-prop>
      <texture>Fuse-Main.png</texture>
   </animation>


The livery structure is then as such:
Code: Select all
<livery>
            <name>AAL American</name>
            <texture-fuselage>Liveries/A320/IAE/AAL-fuselage.png</texture-fuselage>
            <texture-engine>Liveries/A320/IAE/AAL-engine.png</texture-engine>
         </livery>

For one reason or another the livery selection only works if you have the animation in the -common.xml. It does not switch texture, if you put the material animation in the -fuselage.xml.

Regardless to this, the specific problem is that the new texture is not only applied to Fuselage. It is applied to all objects. As you can see, all objects have the new texture applied, including objects that are not mapped to the texture Fuse-Main.png

Image

The landing gears are nothing at all to do with the Fuselage object. They have a texture LandingGears.png. That's supposed to remain unchanged! There are also other objects which use Static-Elements.png -- they are not visible in the image, but also should remain unchanged.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Livery selection - all objects use the new texture

Postby wlbragg » Sun Aug 30, 2020 7:57 pm

I'm not sure I understand without seeing all the files and all the pertaining code and how they call each other.
Is there a reason you don't want to set it up in the default way that we know works?
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7609
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Livery selection - all objects use the new texture

Postby legoboyvdlp » Sun Aug 30, 2020 8:09 pm

What way is that? This is the only way that has worked. I've been going by the wiki article, are there other documentations elsewhere?

The thing is, that we need the gear to keep using LandingGear.png. It shouldn't be set to "SAS-fuselage.png".

It doesn't make sense that everything now uses the livery texture that has been chosen, I don't want that to happen! I don't want every object to use "SAS-fuselage.png", I want only the objects that are chosen to use "SAS-fuselage.png" (that is, in this case, Fuselage.)

Edit - you can see the code at https://github.com/legoboyvdlp/A320-fam ... /3D/Models , starting from https://github.com/legoboyvdlp/A320-fam ... 00-IAE.xml.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Livery selection - all objects use the new texture

Postby legoboyvdlp » Sun Aug 30, 2020 8:46 pm

Well - this explains it -- the <model> <name>Fuselage</name></model> was overwriting the Fuselage object-name in the .ac :D

Thank you, regardless.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Livery selection - all objects use the new texture

Postby Gijs » Sun Aug 30, 2020 8:46 pm

In your -common.xml you apply the animation to <object-name>Fuselage</object-name>. And your fuselage.xml is given that name by the <name>Fuselage</name>. So I'd expect all objects in the fuselage.xml to see the livery animaton applied.

Code: Select all
   <animation>
      <type>material</type>
      ...
      <object-name>Fuselage</object-name>
      ...
      <property-base>sim/model/livery/</property-base>
      <texture-prop>texture-fuselage</texture-prop>
      <texture>Fuse-Main.png</texture>
   </animation>

   <model>
      <name>Fuselage</name>
      <path>Aircraft/A320-family/Models/Fuselages/A320/fuselage.xml</path>
   </model>


EDIT: You beat me to it by a millisecond :P
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9549
Joined: Tue Jul 03, 2007 3:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Livery selection - all objects use the new texture

Postby wlbragg » Sun Aug 30, 2020 9:45 pm

I didn't think anything had changes, thus why I couldn't figure out with only a verbal description why it wasn't working as it normally does.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7609
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070


Return to Liveries

Who is online

Users browsing this forum: No registered users and 6 guests