Jump to content
Sign in to follow this  
tatfsn

GOING CRAZY SEARCHING FOR BASIC XML ANIMATION MODELING INFO

Recommended Posts

I’ve recently gotten back into aircraft modeling for Flight Simulator after a long hiatus.  The last plane I designed for FS was back when FS9 was the latest version.   I used FSDS, and had by then gotten a very decent handle on it and the use of the stock animation nomenclature.

 

Now I’ve been sinking my teeth into Gmax, and am well on the way in the process of building some viable designs.   It is clear, however, that designing aircraft for FSX is a whole new ballgame, and that I’m going to have to gain some brand new skill sets if I’m to have any hope of getting my creations flying in FSX.   It looks as if XML programming knowledge is all but indispensable in that regard.     All the more daunting, as my forte is the artistic aspect of design as opposed to that of coding.

 

Even more frustrating in that finding information regarding the basics of XML programming, in regards to FSX aircraft modeling, is probably the most difficult of any kind that I recall.   I’ve spent hours, literally, Google searching and surfing the Net, using any keywords that I can think of, regarding a basic tutorial on how to get started, with little luck.   I’ve installed and waded through most of the SDK, but it appears that the bulk of the XML guidance it provides pertains to the design of gauges, and not modeling/animating aircraft in Gmax. :search: 

 

Can some of you XML aircraft design gurus share answers to the very basic questions of a poor newbie?

 

I’ve looked over a ton of sample code that folks have shared on this and other sites, and I think with some persistence I’ll be able to figure out how to do it.   However, I’m dead in the water until I finally get some guidance regarding the following:

 

  1. Where does the actual XML code for the animation of a given aircraft in FSX reside?    Is it the .mdl folder, after it is compiled?      In other words, at what stage in say, the Gmax aircraft modeling process would I need to write that code, and where would it be inputted?

 

  1. Is it true that none of the stock animations work in FSX?   Does any and all animation that I would want to equip my aircraft model with have to be accomplished through XML code?

 

  1. Is it all compiled in Gmax, or do I need another program?

 

(This is a bit embarrasing as I feel like a 1st grader in the midst of PhDs) :im Not Worthy: .

 

I would greatly appreciate any help! 

 

 

 

 

 

Share this post


Link to post
Share on other sites

Okay, in brief form I'll state up front that I'm unaware of any real "tutorial" per se regarding model animation XML scripts. That is, no one document that can be downloaded and studied.

 

Now, that said, there is a ton of information available via forum postings. Once of the very best sources is a dedicated forum at Freeflight Design cleverly named "WORKING XML Code Library (Parts and Gauges)

(See: http://www.aerodynamika.com/cgi-bin/yabb2/YaBB.pl for a full list of forums)

 

Another terrific resource are the forums at FS Developer (See: http://fsdeveloper.com/forum/ for a list of forums). 

 

Perhaps if I explain how XML scripted animations are created, implemented in Max/GMax/FSDS, then compiled into the final model (.mdl) file it will help clarify some issues.

 

First of all, "stock animations" as used in FS9 still work, but not via "partnames" as they used to. The XML scripts required for "stock animations" however are already done for you, and are supplied in the shipped "modeldef.xml" file found in the FSX SDK's ..\bin folder. The names given to those scripts is not too surprisingly identical to the "partnames" used in FS9! B)

 

As I said earlier, all animations are created in Max/GMax/FSDS by tagging the object to be animated using the FSX SDK Tools. Since you have said that you are now using GMax, I'm going to pretend that FSDS doesn't exist for the rest of this post, because it simply introduces another complication to the process that would simply "muddy the water" so to speak.

 

To keep things simple, I'm going to explain how a simple animated object is animated in Max/GMax using the "default scripts" that're supplied to us in the stock modeldef.xml file, and how the exporter module and compiler module use the modeldef.xml file to create the finished .mdl file. So, let's look at our "elevator" object!

 

In the stock modeldef.xml file you will find the supplied entry for the "elevator." For our example I'm picking the "elevator_percent_key" as it works best for FSX. Each animation entry has two parts. The first defines the <Animation> and provides the unique GUID for that animaton, in another section is the actual animation script that's linked by name to the <Animation> entry. Here are the two parts of the "elevator_percent_key" script:

 

<Animation name="elevator_percent_key" guid="69fced03-9a10-49a7-aa82-2b79ab5b63e0" length="100" type="Sim" typeParam2="elevator_percent_key" typeParam="AutoPlay" />
 
<PartInfo>
     <Name>elevator_percent_key</Name>
     <AnimLength>100</AnimLength>
     <Animation>
          <Parameter>
               <Sim>
                   <Variable>ELEVATOR DEFLECTION PCT</Variable>
                   <Units>percent</Units>
                   <Bias>50</Bias>
               </Sim>
          </Parameter>
     </Animation>
</PartInfo>

 

Four important things to note in the above is the "name", the length of the animation (100 frames), the Units (percent), and the Bias (50 frames). The last item indicates that the middle of the animation range is "neutral", the Unit length indicates that 0 percent is fully down, and 100 percent is fully up.

 

Now in Max/GMax we need to select the elevator object and keyframe animate it such that frame 0 is fully down, frame 50 is "neutral" and frame 100 is fully up. I'm not going to explain here how to create the animation, that is better explained elsewhere.

 

After the animation is completed and with the elevator object still selected, we need to open the FSX Tools' "Animation Manager." With that open, we type in the start and ending frames, which in this case would be 0 and 100 respectively. We then pick the "elevator_percent_key" entry from the list, and click on the Create button. Done!

 

When we "export" the Max/GMax scene, the export module will parse the modeldef.xml file and create two separate files: the modelname.x and modelname.xanim files. The first contains the vertices and material/texture information, the latter contains some animation information that was taken from the modeldef.xml file.

 

When we "compile" the modelname.x file using the supplied xtomdl.exe program, we pass the name of the modelname.xanim file at the same time, along with the full path to the modeldef.xml file. The "compiler" will take the data from the .xanim file and parse the modeldef.xml file once again to incorporate the actual "XML script" into the .mdl file.

 

That in short is the complete process that occurs. The rest is just more details that may be added to the process such as "mouse points," "effect files" and "visibility" conditions.

 

I certainly hope this helps! :Big Grin:

 

 

 

 

 


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Bill,

 

I've been reading, and benefitting, from your posts (including your XML advice) for years.   You're TRULY one of the

Flight Simulator gurus.  :im Not Worthy:

 

I'm beyond grateful that you took the time to provide such a comprehensive and helpful reply.   It is just the

information I've been looking for!! :smile:

 

Time for me to get back to work on my dream machines.   A thousand thanks!  

Share this post


Link to post
Share on other sites

You are very welcome. Actually, on further reflection I decided to promote my reply into a new "Tutorial" so that it won't get lost here having been buried by time... :lol:


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...