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

P3D v4 visibility conditions for scenery objects

tgibson

Resource contributor
Messages
11,338
Country
us-california
I probably missed it, but how is that done? I can't find instructions on that, sorry.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi,

Let's me show an example. I have loaded a simple windsock object:

1562005314499.png


Now in the hierarchy editor I select the top node. And in the right pane I right click on transformation and select the add animation:

1562005357174.png


Then right click on the animation that was added and press the edit animation option. In the form that appears In that form you can add the 5 keys that are needed. Each with a rotation around the Z-axis of 0, 90, 180, 270 and 0 degrees.

1562005681807.png


In the hierarchy editor don't forget to set the type of animation (I haven't added the wind animation to my modeldef, but that should be easy to do).

Now export to MDL and you should be fine. The entire object will rotate around its axis. If you tag it with the wind animation it will move with the wind.
 

tgibson

Resource contributor
Messages
11,338
Country
us-california
I don't get this using my converted FS2004 aircraft, because all of my non-animated parts already have a transformation matrix, but no Animation section. When I select one of these non-animated parts and right click the Transformation section I get Edit Transformation... and Delete Transformation...

The transformation matrix is:

1,0,0,0
0,1,0,0
0,0,1,0
0,0,0,1

I can choose Delete Transformation... and this will give me what you have above. Then when I right click I get Add Animation...

Is this OK to remove the Transformation first?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
If you click on the label with #transformations you should always get the add animation option. I think you clicked on one of the transformations itself, then you get the options to edit that one.
 

tgibson

Resource contributor
Messages
11,338
Country
us-california
Here is a pic of what I'm seeing.

mcx_animation_add.jpg


How do you code a 360 degree rotation in the Animation Key Editor?

I entered 5 "Times", 0, 25, 50, 75, and 100 (I assume that Time is the Keyframe Number).

I chose Quaternion since I couldn't see how to get rotation from the Vector choice.

In RotX I entered 0, 90, 180, 270, and 360. The numbers did not stay as I entered them, I ended up with 0, 90, -180, 90, and 0. I tried several times and they always changed to those numbers.

This resulted in the part rotating 180 degrees and then reversing course and rotating back to the start point. Not a complete rotation.

Help?

Thanks,
 

tgibson

Resource contributor
Messages
11,338
Country
us-california
Ah, I didn't realize that my parts have TWO transformation entries. The Add Animation choice is there, by right clicking the other one. It's the Transformation section above the one I right clicked in the above image.

Now I see you mention #Transformation and not just Transformation. I now see the difference.

Sorry,
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
I also had some issues entering the rotations. I used 0, 90, - 180, - 90, 0 in the end. But I'll check why it's hard to enter them sometimes.
 
Messages
5,214
In RotX I entered 0, 90, 180, 270, and 360. The numbers did not stay as I entered them, I ended up with 0, 90, -180, 90, and 0. I tried several times and they always changed to those numbers.
This resulted in the part rotating 180 degrees and then reversing course and rotating back to the start point. Not a complete rotation.
And I have the same problem.
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,944
Country
us-wisconsin
Hi Arno.
I also cannot get an added animation to save with the mdl.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi Dick.

Is your issue the key frame values like Tom and Roby say? Or saving an animation in general?
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,944
Country
us-wisconsin
I work around the keyframe issue by using a "-" where needed. My issue is in saving a MDL or .x file. The animation appears to be dropped.

Edited:

I imported a dae file. After I exported as a MDL file, I reimported it and was able to add an animation and assign an animation type ( Action01 ), so my problem is solved, by the extra step od saving MDL and re-importing that MDL.
 
Last edited:
Messages
5,214
(O:Weather.AmbientWindDirection, Degrees) 360.0 / 100 *
Could it be, Christian, that this is only for simobjects and not for scenery objects?

windsock_testing.jpg


Unless, which is probable, I have done something wrong? (I have no bones for the moment, my dog ran off with them:)).
Can someone figure it out?

PS: no animation, no minus symbol helps, nothing shows up. I made it a bgl but maybe I should use an mdl?

Edit: sent wrong screenshot. Now it is the right one.
Edited again: now for one reason or another, after adding several times the quaternion values, MCX now shows a 360 rotation (But nothing shows up in the Sim yet:(.
 

Attachments

  • windsock_testing.jpg
    windsock_testing.jpg
    406.9 KB · Views: 150
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
I didn't test in sim yesterday, but I did save the animation to mdl and loaded the mdl again with the animation still there.
 
Messages
5,214
Sure, in MCX the animation is still there and shows up. But the model does not in the Sim!
Could you spare a moment and test it in the sim so that I can rule out some mistakes of mine?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hopefully tonight, typing this from my phone, P3D doesn't run that well on there :D
 

Christian Bahr

Resource contributor
Messages
951
Country
germany
Could it be, Christian, that this is only for simobjects and not for scenery objects?

For SimObjects, I have never tested the code. The code refers to BGL files or objects that can be stored in a BGL-Lib. The code certainly works with BGL files.

Unless, which is probable, I have done something wrong? (I have no bones for the moment, my dog ran off with them:)).
Can someone figure it out?

Your code is incomplete, it should be structured as follows:

Animation name="muelheim_windsack" guid="45610dae-e726-4d3e-b4db-6d704a6f2332" length="100" type="Sim" typeParam2="muelheim_windsack" typeParam="AutoPlay" />
<PartInfo>
<Name>muelheim_windsack</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(O:Weather.AmbientWindDirection, Degrees) 360.0 / 100 *
</Code>
<Lag>10</Lag>
</Parameter>
</Animation>
</PartInfo>

The red marked text should be changed! Then all the code is copied to the current modeldef.xml. In the MCX, the code can then be tagged with the animation of the windsock.


I also had some issues entering the rotations. I used 0, 90, - 180, - 90, 0 in the end.

The animation should be as follows:

keys_quaternion_rotation_animation.jpg


Degrees: 0, -90, -180, -270, -360
Keys : 0, 25, 50, 75, 100
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi,

I just tested it again here and apart form the issue that entering the angles in MCX is a bit tricky (like Dick said putting a minus key at the right position helps), the object works fine.

I used the animation code Christian posted and my windsock moves fine with the wind. I have attached the BGL, it is located at N40 W40.
 

Attachments

  • windsock.zip
    6.6 KB · Views: 201

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,944
Country
us-wisconsin
Finally, I figured out how to do a wind rotation.

XML:
<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo>
    <Animation name="wind_rotate" guid="11ea2877-6bee-41ef-8216-4a3306815e5c" length="100" type="Sim" typeParam2="wind_rotate" typeParam="AutoPlay" />

  <PartInfo>
    <Name>wind_rotate</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (O:Weather.AmbientWindDirection, Degrees) 360.0 / 100 *
        </Code>
        <Lag>10</Lag>
      </Parameter>
    </Animation>
  </PartInfo>

</ModelInfo>

The guid can be any valid generated guid. It just identifies the animation in the sim. I chose wind_rotate for the name. Hundreds of objects could share this animation.

Make sure ModelConverterX uses the right model definition file containing the animation code. I used the above, and named it "object_conditions.xml". Add it to MCX, exit MCX, re-open MCX and it points to the right definitions file.

In MCX' hierarchy editor, click the model part you wish to edit. Right-click on # Transformation, and select Add animation.
With the animation for the part added, Right-click on Animation, and select Edit animation...

In the popup Animation key editor, click on Add. To the right, select Type Quaternion.
To the left, click Add again. To the right, set time as 25, set Rot Z as 90, go above to W and place "-" before the 0.70711 (-0.70711) and press Normalize button.

Click Add again, time set as 50, Rot Z set as 180, press normalize button.

Click Add again, time set as 75, Rot Z set as 90, press Normalize button

Click Add again, time set as 100, Rot Z as 0, press Normalize button. Click OK and popup disappears.

In the hierarchy editor, right-click on the animation name (unknown), and select wind_rotate. Close hierarchy window.

Hierarchy_editor.png


You can now save as P3Dv4.4 MDl or .x or library bgl or placed bgl.
The object rotates with the wind to point the direction the wind is moving to (not from).

An example placed bgl is included in the zip file.
 

Attachments

  • directional.zip
    21.9 KB · Views: 212

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi,

No need to press normalize after entering the angles. That's only needed when you edited the quaternion values directly and the quaternion length is not one anymore. So adding a minus doesn't change the length.
 
Messages
5,214
Animating my windsock day 3!:eek:

Sorry to bother you folks again:(.
I have a new problem:rolleyes:!
I cannot get the modeldef.xml entry to stick to the model.
Each time I save and compile, the modeldef.xml shows only the first line if 'show used only':

<?xml version="1.0" encoding="utf-8"?>
<ModelInfo>
<Animation name="vindstrut" guid="9477a4d9-9347-479a-9eb1-e63e6d0ff2ad" length="100" type="Sim" typeParam2="vindstrut" typeParam="AutoPlay" />
But only on unchecking this 'show used only' I get to see the rest:
<PartInfo>
<Name>"vindstrut"</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(O:Weather.AmbientWindDirection, Degrees) 360.0 / 100 *
</Code>
<Lag>10</Lag>
</Parameter>
</Animation>
</PartInfo>
</ModelInfo>

What do you have to do in MCX to make it stick?

hierarchy editor.jpg


I thought it was because I had saved my so called "modeldef_wind.xml" in the program files folder, but I also tried to put it in "documents" and other places but all to no avail (and yes, I pointed to the right path in the MCX options).
My windsock shows up alright but still does not move with the wind and obviously because the Modeldef Editor does not want to save my complete entries.
Apparently and in spite of all the information we have been given by the three of you, I am once more the dumdumb for being the only one that does not get it done (sigh).
It is happy hour so I am allowing myself a drink now.

Cheers
 
Top