Skip to content

Hide/show object animation

Hi, it’s me again (sorry). I have an aircraft that I want to have a external crew ladder for which can be shown and hidden from a menu button. I know there are some wizards round here so thought I’d ask here how I would go about this?

CJ

OrbitalMartian

Callsigns: G-ORBI

Tagged:

Comments

  • Easiest way is to find a property the aircraft doesnt use and have a select animation for your object based on the property state ( true/false, or 1, 0 etc ). The state being set by your menu item.

  • So say, I take the show-yoke property then set the "yoke" as the ladder?

    CJ

    OrbitalMartian

    Callsigns: G-ORBI

  •  <animation>

        <type>select</type>

        <object-name>ladder</object-name> ------- Object name as it appears in AC3d or Blender etc

        <condition>

    <equals>

      <property>yoke property</property> ----- the yoke property path as it appears in the property tree

      <value>true</value> ------ this would show the ladder is the yoke property was set to true ( or 1 depending on the property format )

    </equals>

    </condition>

      </animation>


    This would go in your model XML, or if your ladder has its own XML, it could go it that.

    This will likely not work over multiplayer unless you assign a MP property to it in the set file.

  • If the model is in it's own AC file, is there somewhere to see the name of the object that I'd need to select?

    CJ

    OrbitalMartian

    Callsigns: G-ORBI

  • open the model in ac3d or blender

  • The file is called ladder.ac - I've imported into Blender, where would the object name be? The model itself is made up of lots of objects (cylinders and cubes, etc).

    CJ

    OrbitalMartian

    Callsigns: G-ORBI

  • Lovely. Exactly the kind of nightmare model I hate to see.

    You have 2 choices here. Ether list every single part in your select animation, or merge them all into 1 object and give that object 1 name.

    The Object name usually is shown in the object pane of blender ( which would be in pretty much any position on the screen depending on version and customisation ).

  • Ok so I have it working with the browse internal properties dialog, now I need to figure out the menu button code - I've got a button with the following code:

         <item>

           <label>Ladder (toggle)</label>

           <command>nasal</command>

           <script>aircraft.show-yoke.toggle()</script>

         </item>

    I am not sure whether this is correct or not. The property is listed as "show-yoke" and it is a boolean (I'm wanting to use 1 and 0 as the values).

    CJ

    OrbitalMartian

    Callsigns: G-ORBI

  • is this a standard FG property?

  • I believe so.

    CJ

    OrbitalMartian

    Callsigns: G-ORBI

  • Ok, so whats the property path

  • Just "show-yoke" by the looks of things.

    CJ

    OrbitalMartian

    Callsigns: G-ORBI

  • Unles its a custom command of some sort, it should exist in the property tree somewhere. like this one for lights:-

    controls/lighting/turn-off-lights

    The command " Turn-off-lights" exists in the "Controls" top level, then "Lighting" sub level.


    You know how to brose the property tree ??


  • Yes, I went into there and it was just at the bottom of the list.

    CJ

    OrbitalMartian

    Callsigns: G-ORBI

  • CJ

    OrbitalMartian

    Callsigns: G-ORBI

  • Its a custom property being injected by a script or something else in whatever aircraft you are working on., Im not sure what its parameters would be for an animation.

  • <animation>

     <type>select</type>

     <object-name>ladder</object-name>

     <condition>

      <property>show-yoke</property>

     </condition>

    </animation>


    It must be called by this code in the model file, is there a way to set a value of a boolean through the menu button?

    CJ

    OrbitalMartian

    Callsigns: G-ORBI

  • Its much easier to use a standard property.

  • Is there an easier way to do it then? Is there a boolean property?

    CJ

    OrbitalMartian

    Callsigns: G-ORBI

  • Menu entry as this:-


     </item>

      <item>

        <label>Toggle HDR panel lighting ( Use in HDR only ! )</label>

        <binding>

         <command>property-toggle</command>

         <property>controls/electric/engine[11]/generator</property> ----------- use this as your aircraft wont have 11 engines

        </binding>

       </item>


    Select animation:-


    <animation>

        <type>select</type>

       <object-name>ladder</object-name>

        <condition>

    <equals>

      <property>controls/electric/engine[11]/generator</property>

      <value>true</value>

    </equals>

    </condition>

      </animation>


    The default value is "false" so the ladder wont show until you use your menu item to toggle the value to "true".


    Again, this probably wont work over multiplayer until you assign a multiplayer property to it in the set file.

  • https://www.youtube.com/watch?v=VBu8MdWKNps

    Just wanted to share that it is working. (Yes it's the Hawk), also question about the audio, why is the engine sound stuttering, I've noticed it on a few jets.

    Forum didn't like the video file type, hence unlisted YT upload.

    CJ

    OrbitalMartian

    Callsigns: G-ORBI

  • Its an older sound file that probably didnt have things in place to prevent that.


    The ladder works but Its a tad bug for a hawk.

  • I’ll have a look around but I modelled it after the one with the Just Flight Hawk T1 for MSFS, maybe needs a tiny bit of scaling.

    CJ

    OrbitalMartian

    Callsigns: G-ORBI

  • In the daVinci_Mosquito I tied the ladder animation to the doors. When the doors open, the ladder appears.

    VooDoo

Sign In or Register to comment.