Jump to content
Sign in to follow this  
gorlosky

prop_anim in modeldef - what does it do ?

Recommended Posts

I'm familiar with prop anim in the aircraft.cfg, but what exactly does this code, from the default modeldef.xml, actually do ? It is also referenced by the prop and rotor _still _slow _blurred codes.

	<PartInfo>		<Name>prop_anim</Name>		<AnimLength>100</AnimLength>		<Animation>			<Parameter>				<Sim>					<Variable>PROP ROTATION ANGLE:1</Variable>					<Units>percent</Units>					<Bias>0</Bias>					<Scale>0.1592</Scale>				</Sim>			</Parameter>		</Animation>

Share this post


Link to post
Share on other sites
Guest anthony31fs

It is used by the modeller to create the propellor animation. Modeldef is not used by FSX itself. The xtomdl program uses the modeldef file when compiling the model.The modellor creates the animation by rotating the prop in the modelling programs animation mode and using key frames at 0,25,50,75 and 100 frames while rotating the prop 90 deg every 25 frames.Usually the modellor will use the prop0_slow, blurred and still variations for the actual animation (or the prop1 or prop2 or prop3 for each prop the plane has). These prop0 animations refer to the prop_anim file but include visibility tags to determine whether you see a still prop model, slow spinning prop model or fast spinning model.

Share this post


Link to post
Share on other sites

More specifically, no one actually "uses" the animation tag: <Name>prop_anim</Name>...It is the "base script" used as a reference by the other animation tags, such as <Name>prop0_still</Name> et cetera.Notice in those animation tag's script the inclusion of <Name>prop_anim</Name> via the <Copy> function:

  <PartInfo>	<Name>prop0_still</Name>	<Copy>prop_anim</Copy>

In fact, the only portions of prop_anim that are actually used are these two, and even then they could be overridden by have them redefined in the calling animation tag! :)

		  <Units>radians</Units>		  <Scale>15.92</Scale>


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

Thanks anthony (understand all that) - but what I need to know is what prop_anim does. Let me give you an example.The following is default code from the modeldef, below that is my code. You can see that the line <Copy>prop_anim</Copy>, is only in the default code.BOTH codes animate just fine through all throttle settings. That is why I wonder what prop_anim is needed for ???

  <PartInfo>	<Name>prop0_still</Name>	<Copy>prop_anim</Copy>	<AnimLength>100</AnimLength>	<Visibility>	  <Parameter>		<Code>		  (A:PROP MAX RPM PERCENT:1, percent) 6.25 < if{ 1 } els{ 0 }		</Code>	  </Parameter>	</Visibility>	<Animation>	  <Parameter>		<Sim>		  <Variable>PROP ROTATION ANGLE:1</Variable>		</Sim>	  </Parameter>	</Animation>  </PartInfo>

<PartInfo>	<Name>Prop0_still_mine</Name>	<AnimLength>100</AnimLength>	<Visibility>		<Parameter>			<Code>			   (L:PropStill,number)			</Code>		</Parameter>	</Visibility>	<Animation>		<Parameter>			<Code>				 (L:PropPosition,number)			</Code>		</Parameter>	</Animation></PartInfo>

Share this post


Link to post
Share on other sites

I assume that you are providing the input values for your custom (L:PropStill,number) variable?


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

Hi Bill - yesIs it that there maybe is something to do with this part of the prop_anim code that gives the animation a little more variableness so it looks real ?

					<Variable>PROP ROTATION ANGLE:1</Variable>					<Units>radians</Units>					<Scale>15.92</Scale>

Share this post


Link to post
Share on other sites
Hi Bill - yesIs it that there maybe something to do with this part of the prop_anim code that gives the animation a little more variableness so it looks real ?
					<Variable>PROP ROTATION ANGLE:1</Variable>					<Units>radians</Units>					<Scale>15.92</Scale>

The <Scale>15.92</Scale> is used to scale one revolution to 100 keyframes...

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

:( Where in the world did they come up with one figure of 15.92 to cover all models ?oh well...I'll leave that part of the code out of my code, unless it doesn't look or react correctlyThanks

Share this post


Link to post
Share on other sites
:( Where in the world did they come up with one figure of 15.92 to cover all models ?oh well...I'll leave that part of the code out of my code, unless it doesn't look or react correctlyThanks
As far as I understand it

Share this post


Link to post
Share on other sites
I assume that you are providing the input values for your custom (L:PropStill,number) variable?
Hi Bill,Can you confirm that the Code line in:
<PartInfo>	<Name>Prop0_still_mine</Name>	<AnimLength>100</AnimLength>	<Visibility>		<Parameter>			<Code>			   (L:PropStill,number)			</Code>		</Parameter>	</Visibility>	<Animation>	etc......

does exactly the same as the Code line in

<PartInfo>	<Name>Prop0_still_mine</Name>	<AnimLength>100</AnimLength>	<Visibility>		<Parameter>			<Code>			   (L:PropStill,number) 0.5 > if{ 1 } els{ 0 }			</Code>		</Parameter>	</Visibility>	<Animation>	etc......

??With (L:PropStill,number) being a boolean, that is set in a gauge to the value "0" or "1" (thereby controlling the visibility of that animation part, depending on certain conditions)Thanks, Rob

Share this post


Link to post
Share on other sites
Guest anthony31fs

If L:PropStill is a boolean then why not use a boolean variable type ie, L:PropStill,Bool.Also the code you describe is not identical (at least not 100% although you are on the right track).From the SDK:"The only reliable numeric equivalent is that 0 is returned for False. Non-zero values, especially both 1 and -1, are used to indicate True."

(L:PropStill,number) 0 == if{ 0 } els{ 1 }

is identical to

(L:PropStill,number)

Share this post


Link to post
Share on other sites

Anthony is correct, Rob. Specifying a fractional part of a boolean is somewhat of a gamble. Actually it rather useless since it is always going to evaluate to "anything greater than zero..."Now, given that the return might actually be "less than zero" when true, is where the problems might occur...So the answer to your question is that usually the two expressions will be functionally equivalent, but not always! :(All of which begs the question of why anyone would use an enum variable as though it were a boolean to begin with? :(


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
All of which begs the question of why anyone would use an enum variable as though it were a boolean to begin with? :(
Hi Bill (andAnthony),Old habit, I think :( to use the generic Number instead of Bool unit.But of course you're right; using Bool would be more logical....Although, for L:vars, the implementation of Bool in FS is the same as Number, isn't it ?I mean, when I assign the value 1.5 to (L:Test,bool) and read it as (L:Test,bool), the read value is 1.5.Again, this is pretty useless either ... :( , but I'm doing some faultfinding in the "Visibility" tag specified before (because controlling the visibility of that part doesn't work), and I want to exclude the possibility that it has anything to do with the used XML syntax.But I will try it anyway, although I'm pretty sure the problem lies elsewhere.Thanks anyway ...Rob

Share this post


Link to post
Share on other sites

(Psst! ALL L:vars regardless of the "unit" are really FLOAT64 types in drag... ) :(


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...