Assigning animations and exporting error

#1
I am trying to assign unknown animations in an x-plane model (.obj) via the animation editor so it would write into the modeldef.xml and eventually export it to .mdl. I got an Invalid section length for section GEAR error. I know MCX current doesn't support xplane animations to be converted to .mdl...
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#2
Hi,

Such an error sounds like an invalid mdl. Most likely a mistake in the modeldef.xml file. Did you make a new entry there?
 
#3
Hi Arno,

I assigned the animation to the .obj file and it auto added the entry into modeldef.xml. During the export it throws the error as well.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#4
Not sure what you mean with assigned it in the obj file, animation support from obj file is quite limited. Can you explain a bit more what you did?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#6
Ah, you assign them in the animation editor, not in the OBJ file. That makes sense.

Which XtoMdl version are you using and which modeldef.xml? As long as you use the default animations I would not expect issues.

Can you show the export log as well?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#8
Did you assign all animations or are there still unknown ones as well in your model?
 
#9
I've tried both, assign all animations and assigning just 1 and the results are the same. It looks like the error happened on the import of the .mdl file and not export anymore.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#10
But the import error must be because something went wrong with the export and resulted in a corrupt mdl file.

Would it be possible to share your file for testing?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#12
Hi,

I had a look at the file and I found out what causes the error. When there are multiple animations of the same type attached to a node, XtoMDL seems to create an invalid MDL file.

So as a work around I have changed the XANIM writer to stop adding more animations when the node already has one per type. This will cause missing animations, but at least the MDL file is valid. The event log will contain a warning when this happens.
 
#13
Would that include animations for example (landing gear) Where c_gear is the main strut and the suspension parts could be named c_gear.1 c_gear.2 c_gear.3 ???
My problem starts when I try to add suspension and the two suspension scissor parts to the main landing gear strut (c_gear).
If I remove the suspension animation keyframed at 0-100-200 with 100-200 being the moving frames, the error does not occur.
Sophie
1.PNG
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#14
Hi,

I would have to see your hierarchy to answer that. Since you are talking about different parts of the gear, I suspect they become different nodes. This applies to multiple animations being assigned to one node.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#16
That's not what I saw in your model yesterday. There are nodes in that model that have 6 different animations assigned to them. That you set all these animation to the same animation type does not matter, if there are more than one quaternion or vector animation for a node XtoMDL doesn't like it.
 
#17
My landing gear as above has one triangle node to set the XYZ to zero. The main strut is the child of that triangle (c_gear), all else is attached in order as a child of c_gear. All animated parts are named as c_gear.1 c_gear.2 etc that operate the suspension and scissors. I noticed that when I assigned all c_gear parts with animations that run 0-100-200, the error no longer exists. But it means that hatch doors are keyframed like this... 0 - 25 -100 - 200 with 0 - 25 being the animation sequence. To tell you the truth, I don't think it is wise for people to use XtoMDL as its very difficult to align the animations and have them operate correctly. It was much easier to do animation in FS2004 via makeMDL. I've just spent the last hour trying to get a hatch door to drop correctly into position using XtoMDL protocols and default modeldef file and its still not aligning properly, and that's after resetting the triangle node, achieving the XYZ at zero. In FS2004, it takes less than a minute to do it but in order to have it your model work at its best in FSXa or P3Dv4, you need to find somebody that knows how to use Arno's MCX to convert the animations. I would do that my self if there were more info available on how to do it. All to hard so the model has been binned. Time to go flying instead.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#18
Let me see if I understand your workflow. You make the model as FS2004 MDL and then export to FSX with MCX. After that export you get the error when you try to import that FSX MDL file again. Right?

It would be interesting to see if the imported FS2004 MDL has too many animations like I found to be a problem yesterday.

Btw, are you using the latest development release already?

I'm not sure if I understand the alignment issue. In the end each animation is matter of building the right hierarchy and assigning it animation types. That's something that is done in tools like 3DS Max or Blender. Making the animations is a skill, but many developers do is.
 
#20
Actually Arno, I've been trying to make this model as a native FSX - P3D model using XtoMDL compiler and modeldef definitions for animations.
The difference that I have found between the FS2004 makeMDL and FSX XtoMDL part names and compiling is that FSX XtoMDL requires that every parent animated part must start with its XYZ axis at Zero. If the azis is not t zero, the animation explodes in the compiled .mdl model. The frustrating thing is, the animation looks and works normal in FSDS 3.5.1.
I'd really prefer to make my models using the FS2004 makeMDL compiler and then use MCX in some automated way to convert the animations to compile using XtoMDL.
Another thing with FS2004 makeMDL compiler and part names are the stock pre-animated definitions, which means you don't have to keyframe a wheel, for example.
Yes the XtoMDL has more animation part names than makeMDL, but its much easier to use for animation sequencing as the animation does not go astray on the XYZ axis.
I've seen many FS2004 AI modelers basically leave the hobby because of XtoMDL and those changes to how animations are handled by that compiler, and I'm now one of them that would rather make a static scenery model than go any where near doing animations via the XtoMDL compiler.
1.PNG
 
Top