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 2: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: 267
Joined: Tue Jan 14, 2014 3:36 pm
Location: Dresden
Version: 3.0
OS: Windows 7

Re: Slider Hangar Door

Postby wlbragg » Fri May 18, 2018 6: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(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 3945
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Slider Hangar Door

Postby portreekid » Fri May 18, 2018 7: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: 267
Joined: Tue Jan 14, 2014 3:36 pm
Location: Dresden
Version: 3.0
OS: Windows 7

Re: Slider Hangar Door

Postby Thorsten » Sat May 19, 2018 5: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: 9366
Joined: Mon Nov 02, 2009 8:33 am

Re: Slider Hangar Door

Postby wlbragg » Sat May 19, 2018 5: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(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 3945
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Slider Hangar Door

Postby portreekid » Sun May 20, 2018 6: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: 267
Joined: Tue Jan 14, 2014 3:36 pm
Location: Dresden
Version: 3.0
OS: Windows 7

Re: Slider Hangar Door

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

I now used a translate animation. That works as intended.
portreekid
 
Posts: 267
Joined: Tue Jan 14, 2014 3:36 pm
Location: Dresden
Version: 3.0
OS: Windows 7


Return to Scenery

Who is online

Users browsing this forum: No registered users and 4 guests