Jump to content

Propeller not turning


Recommended Posts

Hi,

 

I'm modeling a tale dragger plane and got all the animations to work except for the propeller turning ("40" Draw angle of propeller rotation ) when the engine is started and the steering of the tail wheel ( "2" Steering angle nose gear ) when taxiing.

 

I have set a keyframe after every 90° rotation. The prop is linked to a dummy box which has the animation appllied to it.

 

Can anyone tell me what I am doing wrong?

 

Thx!

Link to comment
Share on other sites

  • 2 weeks later...

40 is the Prop Argument for SFM

 

The "list" is very old (From LockOn 1.1 Days), a New List would change depending on Aircraft, and go as high as 800+ Arguments.


Edited by SkateZilla

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2),

ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9)

3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs

Link to comment
Share on other sites

  • 5 years later...

I'm going nuts with my prop not turning on my mod aircraft!

The ModelViewer shows rotation with argument 407.

The AI system is able to animate the prop!

I verified the animation lua code is called and I can animate, for example, the rudder with set_aircraft_draw_argument_value(17, propState) -- propState values are reasonable.

I verified there is only one entity (lua or MyFlightModel.cpp) modifying argument 407.

SOS!

i7-7700K@4.8GHz, 16Gb-3200, GTX-1080Ti-Strix-11Gb, Maximus IX Hero, Oculus Rift, Thrustmaster Warthog+F/A-18C, Logitech G940 Pedals.

Link to comment
Share on other sites

18 hours ago, Jack McCoy said:

I'm going nuts with my prop not turning on my mod aircraft!

The ModelViewer shows rotation with argument 407.

The AI system is able to animate the prop!

I verified the animation lua code is called and I can animate, for example, the rudder with set_aircraft_draw_argument_value(17, propState) -- propState values are reasonable.

I verified there is only one entity (lua or MyFlightModel.cpp) modifying argument 407.

SOS!

 

Are you using the "new propeller technology"?

In this case the model needs arg 407 anf 475. 

However the animation is triggered by arg 370 (this means you have no arg 370 in the model, only triggered that number your code).

Note that you'll need to also provide the engine rpm in the efm_get_param() method. 

  • Like 1
Link to comment
Share on other sites

On 3/27/2023 at 9:09 AM, Copprhead said:

 

Are you using the "new propeller technology"?

In this case the model needs arg 407 anf 475. 

However the animation is triggered by arg 370 (this means you have no arg 370 in the model, only triggered that number your code).

Note that you'll need to also provide the engine rpm in the efm_get_param() method. 

I owe you one, buddy! That argument 370 !!! This is not documented anywhere on the entire internet, except for here! 😄

I guess I'm using "new propeller technology" now!

I will post my observations and working code in a future post.


Edited by Jack McCoy
Precision

i7-7700K@4.8GHz, 16Gb-3200, GTX-1080Ti-Strix-11Gb, Maximus IX Hero, Oculus Rift, Thrustmaster Warthog+F/A-18C, Logitech G940 Pedals.

Link to comment
Share on other sites

AM uses SFM, which is a different argument. which has already been mentioned above.

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2),

ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9)

3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs

Link to comment
Share on other sites

  • 1 year later...
On 3/30/2023 at 2:22 PM, SkateZilla said:

AM uses SFM, which is a different argument. which has already been mentioned above.

Well, after a year pondering your answer, I have no idea what I allegedly repeated or missed(?) that would be worth pointing out.


Edited by Jack McCoy

i7-7700K@4.8GHz, 16Gb-3200, GTX-1080Ti-Strix-11Gb, Maximus IX Hero, Oculus Rift, Thrustmaster Warthog+F/A-18C, Logitech G940 Pedals.

Link to comment
Share on other sites

What am I missing to leverage the latest "propeller technology"?

MyAircraft.lua
propellorShapeType  = '3ARG_PROC_BLUR',
propellorShapeName  = 'prop_blade.FBX',  -- this file is in Shapes\ with the *.EDM and no complaints in dcs.log

MyAircraft.EDM
- Animations work, as with all official modules, i.e.:
  - 407 spins the propeller
  - 413 changes the propeller blades' pitch
  - 475 value <= 0 : propeller blades are visible
  - 475 value >  0 : propeller blades are hidden
- Has connector PROP_LOCATOR_0 or PROP_LOCATOR_1, scale=1,1,1
- Propeller model scale=1,1,1
- No geometry for blur disk

MyEFM.cpp
double ed_fm_get_param(unsigned index)
{
    if (index <= ED_FM_ENGINE_2_RPM)
    {
        switch (index)
        {
        case ED_FM_ENGINE_1_RPM:
            return engine_rpm;
        case ED_FM_ENGINE_1_RELATED_RPM:  // 0..1
            return engine_rpm_0_1;
        case ED_FM_ENGINE_1_CORE_RPM:  // 0..RPMmax Engine and prop sound
            return engine_rpm * engine_running;
        case ED_FM_ENGINE_1_CORE_RELATED_RPM:  // 0..1 displayed as RPM% in 2D F2 view
            return engine_rpm_0_1;
        }
    }
=====
void ed_fm_set_draw_args(EdDrawArgument * drawargs, size_t size)
{
    drawargs[40] = (float)propellerAngle;  // 0..1
    if (size > 407)
    {
        drawargs[370] = (float)propellerAngle;  // 0..1
        drawargs[407] = (float)propellerAngle;  // 0..1
=====

In the sim for both AI and player aircraft,
- neither the propeller blades nor the blur disk are visible when the engine is running
- the hub spins and comes at rest normally
- by fluke, I caught a glimpse of my (giant) propeller in the middle of the runway (I suspect the map's 0,0,0). See attached picture. My aircraft is at proper scale, parked way in the back, far from the prop.

1) Should the connector PROP_LOCATOR_N be referenced somewhere in lua or MyEFM.cpp?

2) What are the specs for the prop_blade.FBX?

3) What other question should I be asking?

4) Please?
 

 

Screen_240415_213731 - Copy.png


Edited by Jack McCoy
Added picture

i7-7700K@4.8GHz, 16Gb-3200, GTX-1080Ti-Strix-11Gb, Maximus IX Hero, Oculus Rift, Thrustmaster Warthog+F/A-18C, Logitech G940 Pedals.

Link to comment
Share on other sites

5 hours ago, Jack McCoy said:

2) What are the specs for the prop_blade.FBX?

 

I don't remember many of the details; but I seem to recall that when I've done it that it was a single blade of the propellor, scaled down to 1/100th of original size with origin point at the propellor's spin axis; textures embedded in the model and it feels like I also did something with keyed animation.

I also recall having to code prop details under SFM_Data, engine section (ie. type, prop_blades_count, prop_locations, prop_direction, etc.)

not sure if that helps, but maybe will point you in the right direction

 

  • Like 1
Link to comment
Share on other sites

On 4/18/2024 at 2:08 AM, prccowboy said:

I don't remember many of the details; but I seem to recall that when I've done it that it was a single blade of the propellor, scaled down to 1/100th of original size with origin point at the propellor's spin axis; textures embedded in the model and it feels like I also did something with keyed animation.

I also recall having to code prop details under SFM_Data, engine section (ie. type, prop_blades_count, prop_locations, prop_direction, etc.)

not sure if that helps, but maybe will point you in the right direction

 

Thanks, @prccowboy!

Somehow I no longer had engine.prop_* fields! This fixes a lot of things! <duh>

MyAircraft.lua
engine = {
            prop_locations    = {{2.11219, -0.702867, 0.00}, {0.0, 0.0, math.rad(-2.112)}}, -- forward..back, down..up, left..right, spin axis orientation: roll, yaw, pitch
            prop_blades_count = 2,
            prop_direction    = 1,  -- clockwise as viewed from cockpit

            -- prop_pitch_*: specify even for fixed-pitch propeller or else AI will show thicker (pitched) blades as viewed with the prop disk edge-on (i.e. from the side)
            prop_pitch_min        = 0.0,    -- prop pitch min, degrees 
            prop_pitch_max        = 10.0,    -- prop pitch max, degrees 
            prop_pitch_feather    = 80.0,    -- prop pitch feather position, degrees if feather < prop_pitch_max no feathering available
}

prop_blade.FBX
Exported a textured single blade at scale 0.01, same orientation as the aircraft model.

Textures\MyAircraft\description.lua and/or Liveries\MyAircraft\*\description.lua
    {"Material_propeller", DIFFUSE,                              "prop.dds", true};
    {"Material_propeller", ROUGHNESS_METALLIC,    "prop_roughMet.dds", true};  -- optional

With the above changes, the AI now works perfectly in all regimes.

Now the problem is with the player aircraft:

- The propeller hub spins and stops correctly, in direct relation with argument 407.

- The DCS-generated propeller blur disk changes the blurred blades' visual aspect but does not spin.

- When engine is off, the propeller's rest position is alternating at every simulation frame between the EDM's rest position and whatever constant value I supply for argument 407. In other words, it flickers...

- I still have no idea what I should do, if anything, with argument 370. I tried engine_rpm, engine_rpm_0_1, 0, 1...


Edited by Jack McCoy
description.lua

i7-7700K@4.8GHz, 16Gb-3200, GTX-1080Ti-Strix-11Gb, Maximus IX Hero, Oculus Rift, Thrustmaster Warthog+F/A-18C, Logitech G940 Pedals.

Link to comment
Share on other sites

6 hours ago, Jack McCoy said:

Thanks, @prccowboy!

Somehow I no longer had engine.prop_* fields! This fixes a lot of things! <duh>

MyAircraft.lua
engine = {
            prop_locations    = {{2.11219, -0.702867, 0.00}, {0.0, 0.0, math.rad(-2.112)}}, -- forward..back, down..up, left..right, spin axis orientation: roll, yaw, pitch
            prop_blades_count = 2,
            prop_direction    = 1,  -- clockwise as viewed from cockpit

            -- prop_pitch_*: specify even for fixed-pitch propeller or else AI will show thicker (pitched) blades as viewed with the prop disk edge-on (i.e. from the side)
            prop_pitch_min        = 0.0,    -- prop pitch min, degrees 
            prop_pitch_max        = 10.0,    -- prop pitch max, degrees 
            prop_pitch_feather    = 80.0,    -- prop pitch feather position, degrees if feather < prop_pitch_max no feathering available
}

prop_blade.FBX
Exported a textured single blade at scale 0.01, same orientation as the aircraft model.

With the above changes, the AI now works perfectly in all regimes.

Now the problem is with the player aircraft:

- The propeller hub spins and stops correctly, in direct relation with argument 407.

- The DCS-generated propeller blur disk changes the blurred blades' visual aspect but does not spin.

- When engine is off, the propeller's rest position is alternating at every simulation frame between the EDM's rest position and whatever constant value I supply for argument 407. In other words, it flickers...

- I still have no idea what I should do, if anything, with argument 370. I tried engine_rpm, engine_rpm_0_1, 0, 1...

Since 2.9 you need to use arg 407 and also set

ED_FM_ENGINE_1_FAN_PHASE [0 to 2*pi]

to rotate the blurry blades

 

  • Like 1
Link to comment
Share on other sites

On 4/20/2024 at 1:37 AM, Copprhead said:

Since 2.9 you need to use arg 407 and also set

ED_FM_ENGINE_1_FAN_PHASE [0 to 2*pi]

to rotate the blurry blades

 

Thanks, @Copprhead! I had a regression about that with the 2.9 update but I couldn't figure it out. It's not easy having to write the API and Breaking Changes document ourselves! I now learned to keep my eye on the evolution of wHumanCustomPhysicsAPI.h.

Just to be clear, the propeller in the EDM must respond to argument 407 but it should not be set in the EFM.

MyEFM.cpp
void ed_fm_simulate(double dt)
{
    propellerAngle += engine_rpm * rpm2radps * dt;
    propellerAngle = fmod(propellerAngle, twoPI);
=====

void ed_fm_set_draw_args(EdDrawArgument * drawargs, size_t size)
{

    // drawargs[407] = (float)0;  // don't do this

    drawargs[413] = (float)0;  // [0..1] propeller pitch
=====

double ed_fm_get_param(unsigned index)
{
    if (index <= ED_FM_ENGINE_2_RPM)
    {
        switch (index)
        {
        case ED_FM_ENGINE_1_RPM:
            return engine_rpm;
        case ED_FM_ENGINE_1_RELATED_RPM:  // 0..1
            return engine_rpm_0_1;
        case ED_FM_ENGINE_1_CORE_RPM:  // 0..RPMmax Engine and prop sound
            return engine_rpm * engine_running;
        case ED_FM_ENGINE_1_CORE_RELATED_RPM:  // 0..1 displayed as RPM% in 2D F2 view
            return engine_rpm_0_1;
        case 
ED_FM_ENGINE_1_FAN_PHASE:  // 0..2*pi
            return propellerAngle;
        }
    }
=====

 


Edited by Jack McCoy

i7-7700K@4.8GHz, 16Gb-3200, GTX-1080Ti-Strix-11Gb, Maximus IX Hero, Oculus Rift, Thrustmaster Warthog+F/A-18C, Logitech G940 Pedals.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...