Board index FlightGear Development Scenery

Slider Hangar Door  Topic is solved

Questions and discussion about enhancing and populating the FlightGear world.

Slider Hangar Door  

Postby portreekid » Fri May 18, 2018 3:10 pm

I'm trying to build a hangar with 6 doors. Some aren't working like others.
Code: Select all
<?xml version="1.0"?>

<PropertyList>

  <path>edoe_tower.ac</path>
 
  <nasal>
  <load>
   if (!contains(globals, "scenery")) globals["scenery"] = {};
   if (!contains(scenery, "EDOE")) scenery["EDOE"] = {};
   if (!contains(scenery.EDOE, "hangar")) scenery.EDOE["hangar"] = [nil];
   scenery.EDOE.hangar[0] =
     { door :
       [aircraft.door.new("/scenery/EDOE/hangar[0]/door[0]", 10),
        aircraft.door.new("/scenery/EDOE/hangar[0]/door[1]", 10),
        aircraft.door.new("/scenery/EDOE/hangar[0]/door[2]", 10),
        aircraft.door.new("/scenery/EDOE/hangar[0]/door[3]", 10),
        aircraft.door.new("/scenery/EDOE/hangar[0]/door[4]", 10),
        aircraft.door.new("/scenery/EDOE/hangar[0]/door[5]", 10)
       ]
     };
  </load>
 </nasal>
 
    <animation>
        <type>slider</type>
        <object-name>door1</object-name>
        <property>/scenery/EDOE/hangar[0]/door[0]/enabled</property>
        <factor>5</factor>
        <axis>
            <x>0</x>
            <y>1</y>
            <z>0</z>
        </axis>
        <action>
            <binding>
                <command>property-toggle</command>
                <property>/scenery/EDOE/hangar[0]/door[0]/enabled</property>
            </binding>
        </action>
    </animation>
    <animation>
        <type>slider</type>
        <object-name>door2</object-name>
        <property>/scenery/EDOE/hangar[0]/door[1]/enabled</property>
        <factor>5</factor>
        <axis>
            <x>0</x>
            <y>1</y>
            <z>0</z>
        </axis>
        <action>
            <binding>
                <command>property-toggle</command>
                <property>/scenery/EDOE/hangar[0]/door[1]/enabled</property>
            </binding>
        </action>
    </animation>
    <animation>
        <type>slider</type>
        <object-name>door3</object-name>
        <property>/scenery/EDOE/hangar[0]/door[2]/enabled</property>
        <factor>5</factor>
        <axis>
            <x>0</x>
            <y>1</y>
            <z>0</z>
        </axis>
        <action>
            <binding>
                <command>property-toggle</command>
                <property>/scenery/EDOE/hangar[0]/door[2]/enabled</property>
            </binding>
        </action>
    </animation>
    <animation>
        <type>slider</type>
        <object-name>door4</object-name>
        <property>/scenery/EDOE/hangar[0]/door[3]/enabled</property>
        <factor>5</factor>
        <axis>
            <x>0</x>
            <y>1</y>
            <z>0</z>
        </axis>
        <action>
            <binding>
                <command>property-toggle</command>
                <property>/scenery/EDOE/hangar[0]/door[3]/enabled</property>
            </binding>
        </action>
    </animation>
    <animation>
        <type>slider</type>
        <object-name>door5</object-name>
        <property>/scenery/EDOE/hangar[0]/door[4]/enabled</property>
        <factor>5</factor>
        <axis>
            <x>0</x>
            <y>1</y>
            <z>0</z>
        </axis>
        <action>
            <binding>
                <command>property-toggle</command>
                <property>/scenery/EDOE/hangar[0]/door[4]/enabled</property>
            </binding>
        </action>
    </animation>
    <animation>
        <type>slider</type>
        <object-name>door6</object-name>
        <property>/scenery/EDOE/hangar[0]/door[5]/enabled</property>
        <factor>5</factor>
        <axis>
            <x>0</x>
            <y>1</y>
            <z>0</z>
        </axis>
        <action>
            <binding>
                <command>property-toggle</command>
                <property>/scenery/EDOE/hangar[0]/door[5]/enabled</property>
            </binding>
        </action>
    </animation>
</PropertyList>


5/6 don't move in the same direction. In Blender they seem to be oriented the same. Where can I see that? How can I slow the animation down?
portreekid
 
Posts: 651
Joined: Tue Jan 14, 2014 4:36 pm
Location: Leipzig
Callsign: PORTREE
Version: 2020.2.1
OS: Windows 10

Re: Slider Hangar Door

Postby wlbragg » Fri May 18, 2018 7:30 pm

If no one gives you a sufficient answer, I may be able to help you if I can have access to the blend or .ac. I just don't know the answer without visualizing what's happening in the blend and code.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7587
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Slider Hangar Door

Postby portreekid » Fri May 18, 2018 8:41 pm

https://www.dropbox.com/sh/jz9gh9khjgomkxe/AABVh8nnGiNWKkixWJjWcIHMa?dl=0

No Problem. GPL anyway. Any idea helps. I can fiddle with the x,y,z but that would look funny in the xml
portreekid
 
Posts: 651
Joined: Tue Jan 14, 2014 4:36 pm
Location: Leipzig
Callsign: PORTREE
Version: 2020.2.1
OS: Windows 10

Re: Slider Hangar Door

Postby Thorsten » Sat May 19, 2018 6:47 am

How can I slow the animation down?


Where you instance the aircraft.door code - it takes the number of seconds for the transition as the second argument and you set it to 10 - if you want it slower, choose a different number.

(Or I misunderstood the question, this seems so simple?)
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Slider Hangar Door

Postby wlbragg » Sat May 19, 2018 6:17 pm

@portreekid

What I normally would do in Blender is to Apply/Rotation and Scaled to each door, then Origin/ Origin to geometry. Then if you look at each door you'll see 5 and 6 Y axis is not 0. I think that may be the issue.
5 = 1.47522
6 = 1.53465
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7587
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Slider Hangar Door

Postby portreekid » Sun May 20, 2018 7:54 pm

Thanks @wlbragg. That did the trick. Didn't see the origins were all wrong.
The aircraft.door.new("/scenery/EDOE/hangar[0]/door[0]", 1000) doesn't seem to influence the slider animation. I'll try a translate one.
portreekid
 
Posts: 651
Joined: Tue Jan 14, 2014 4:36 pm
Location: Leipzig
Callsign: PORTREE
Version: 2020.2.1
OS: Windows 10

Re: Slider Hangar Door

Postby portreekid » Tue May 22, 2018 10:10 am

I now used a translate animation. That works as intended.
portreekid
 
Posts: 651
Joined: Tue Jan 14, 2014 4:36 pm
Location: Leipzig
Callsign: PORTREE
Version: 2020.2.1
OS: Windows 10


Return to Scenery

Who is online

Users browsing this forum: No registered users and 6 guests