• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Mouse Rectangle appears but doesn't trigger/work?

Messages
45
Country
australia
Hi all,

I've been attempting to fix a screwy autobrake knob animation on an aircraft. I used the MCX tool to extract the .xanim and .x files and then spent weeks re-learning basic trigonometry and quarternion math to get the animation right. It works beautifully now.

When compiled and reviewed in MCX, the animation works as expected. The Object Hierarchy screen indicates that the mouse rectangle is active and assigned the correct name. Same goes for the animation.

When I use the VC in FSX, the mouse rectangle appears ok. That is, when I hover my mouse over the knob, a hand cursor appears. However, rolling the mouse wheel, clicking the mouse etc has no effect. Nothing occurs.

When I use the 2D panel and rotate the 2D autobrake knob, the VC knob rotates as expected. So there is no problem with the animation.

I can only figure that there is a problem with the mouse rectangle triggering the key event, but I can't figure it out. See the code below. I'd really appreciate any advice on this.

Thanks everyone!

Trent


From the .xanim file:

Code:
  <Anim name="switch_auto_brake" guid="385d4d52-3ab8-40bb-b408-a56a54c13cc1" length="100.000" type="Sim" typeParam="AutoPlay" typeParam2="switch_auto_brake">
    <AnimStream name="Rotation" id="0" partName="node70" length="50.000">
      <Keyframe time="0.000" type="Quaternion" data="0.000000;0.000000;0.000000;1.000000"/>
      <Keyframe time="10.000" type="Quaternion" data="0;-0.366544;-0.109963;0.92388"/>
      <Keyframe time="20.000" type="Quaternion" data="0;-0.677285;-0.203186;0.707107"/>
      <Keyframe time="30.000" type="Quaternion" data="0;-0.884916;-0.265475;0.382683"/>
      <Keyframe time="40.000" type="Quaternion" data="0;-0.957826;-0.287348;0"/>
      <Keyframe time="50.000" type="Quaternion" data="0;-0.884916;-0.265475;-0.382683"/>
    </AnimStream>
  </Anim>

From the Modeldef.xml file:

Code:
<Animation name="switch_auto_brake" guid="385d4d52-3ab8-40bb-b408-a56a54c13cc1" length="100" type="Sim" typeParam2="switch_auto_brake" typeParam="AutoPlay" />

<PartInfo>
    <Name>switch_auto_brake</Name>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <HelpID>HELPID_GAUGE_AUTOBRAKE_SWITCH</HelpID>
      <TooltipID>TOOLTIPTEXT_AUTOBRAKE_SWITCH</TooltipID>
      <MouseFlags>LeftSingle+LeftDrag+Wheel</MouseFlags>
      <CallbackJumpDragging>
        <XMovement>
          <Delta>10</Delta>
          <EventIdInc>INCREASE_AUTOBRAKE_CONTROL</EventIdInc>
          <EventIdDec>DECREASE_AUTOBRAKE_CONTROL</EventIdDec>
        </XMovement>
      </CallbackJumpDragging>
    </MouseRect>
    <AnimLength>50</AnimLength>
    <Animation>
      <Parameter>
        <Sim>
          <Variable>AUTO BRAKE SWITCH CB</Variable>
          <Units>enum</Units>
          <Scale>10</Scale>
          <Bias>0</Bias>
        </Sim>
        <Lag>400</Lag>
      </Parameter>
    </Animation>
  </PartInfo>
  <PartInfo>
 
Assuming your 2d 'gauge' is XML, try using the exact same script in your modeldef.xml file. Also, I note that you have length="100.000" defined in the .xanim file, but the actual length is 50 frames in the modeldef.xml file.
 
Hi all,

Firstly, thank you to Bill for your suggestions earlier.

The resolution was a little curious. I was trying to use a custom made mouse rectangle that was identical to the default one (switch_auto_brake) in every way but for the name. Anyhow, when I reassigned the mouse rectangle in MCX back to the default and re-compiled, the VC auto brake knob works as expected.

I'll continue to investigate why my custom one doesn't work and post any findings, but for now...happy days!

Thanks everyone!
 
Back
Top