General animation of switches in cockpit

Dirk Steffen

Porsche Factory Jackass™
Premium
AC does ship a few cars with animated switches (ie the Kunos Porsche 908 LH or 718 RS60 has a linear animated light switch).

I tried without success to animate a light switch and cannot find any hints what I am missing.

The Kunos light switch animations do not seem to have anything but a single lights.ksanim animation file in the animations folder (no additional entry in any of the relevant files I can see).


I have animated a simple toggle switch in Blender, have exported the animation as I have done with wiper animations before, dropped the file into teh animations folder ... aaand ... nothing :-(


What am I missing ?

Is there anywhere an entry needed to hint to the animation?
I remember in the past I have seen Custom Shader Patch entries related to pop up headlight animation speed definition but that was strictly CSP related as I recall.

Perhaps something similar is needed for the Light switch?

I have animated the light switch one way (two keyframes - one in the OFF position and one in the ON position) - is this correct? Does it need a "loop animation with three keyframes OFF-ON-OFF instead perhaps?


Now here is the bonus question - can we animate EVERYTHING ?
Think netKar Pro fully functional cockpits (or ACC for that matter) !
I do not recall having seen anything more than a lights.ksanim (beyond doors, wings, wipers and steering).
 
I used animation for a light switch on my Tiga Lotus, just three keyframes. Think I had to name it lights.ksanim and it did work immediately, no special name for the Empty.

Back in 2015 some guys tried animating throttle and brake pedal via aero animation (iirc eboo used it on the Calibra DTM), but it came with the drawback of worse performance I think.
 
There is an option to code in the name of the animation but it's optional, I'm pretty sure.

In lights.ini,
Code:
[HEADER]
VERSION=2

[LIGHT_ANIMATION_0]
NAME=lights.ksanim
TIME=1
All it adds is the ability to set the time the animation plays. I think if you use CSP doing this also helps to autodetect on cars that do have popup headlights.
 
@AccAkut Did you have to do the three three keyframes:

OFF ->ON->OFF

,,, to make it work?

Thanks @Stereo
That bit of code looks like what I vaguely recall having seen to adjust pop up headlight frames with CSP.

I am trying to play with the code in the lights.ini (strange is I did not see any such code being used in either the Kunos Porsche cars I was looking which had an animated light switch nor the Lamborghini Countach (pop up headlights).
 
Is it possible that this is perhaps an animation which does not like the Blender -> ksanim plugin and only Blender->ksEditor->ksanim works on this one?

I tried with and without coding the lights.ini and the switch wont budge.

Do the light switch objects need a certain standard naming scheme perhaps?

Does the rotary axis placement of the empty vs object origin orientation play any roll?
I placed the empty z-axis as the rotational axis - the animation in Blender works nice but won't budge in CM showroom and in game :-(
 
The CSP route is just a easy, and allows for any input available to be animated.

Code:
[ANIMATION_...]
INPUT = CSP input           ; refer to input list in the github page
FILE = animation.ksanim     ; file name of new animation in “animations” folder
TIME = 0.5                  ; animation time

Say you want to create a blinker arm animation...

Make 2 key frame animations for the arm going up for left, or down for right blinker...

Put them in the animations folder, names dont matter...

and the code:

Code:
[ANIMATION_...]
INPUT = TURNSIGNAL_LEFT
FILE = up_blinker_arm.ksanim
TIME = 0.5

Code:
[ANIMATION_...]
INPUT = TURNSIGNAL_RIGHT
FILE = down_blinker_arm.ksanim
TIME = 0.5
 
Last edited:
Guys, your help is awesome !!!

I finally found out the cause of the failing animation .... yes, complete beginners mistake ...

I edited the animation in Blender and must have had exported it a dozen times, have also done the route via Blender to FBX to KSeditor to create the animation file ...

I did everything right ... well ... I just forgot about one crucial detail ;-)

I completely forgot to export a fresh KN5 file as I had renamed the animated objects in Blender ... doh !!!

@Johnr777
That CSP config tip is brilliant, exactly what I was looking for to try out animation galore ;-)
I cannot seem to find a list of commands to be used in the code on the CSP github.
You don't have a link handy, do you - if not no problem, I'll ask on the CSP discord once I dive deeper



One little issue I still have but I guess it is a limitation of the AC engine:
The animation does start with a significant delay - I'd say about a second late.
Is this something I am going to have to live with or are there workarounds (I did a simple 2 keyframe animation on frame 0 and frame 1, animation speed looks great for a flip switch it is just delayed).
 
Guys, your help is awesome !!!

I finally found out the cause of the failing animation .... yes, complete beginners mistake ...

I edited the animation in Blender and must have had exported it a dozen times, have also done the route via Blender to FBX to KSeditor to create the animation file ...

I did everything right ... well ... I just forgot about one crucial detail ;-)

I completely forgot to export a fresh KN5 file as I had renamed the animated objects in Blender ... doh !!!

@Johnr777
That CSP config tip is brilliant, exactly what I was looking for to try out animation galore ;-)
I cannot seem to find a list of commands to be used in the code on the CSP github.
You don't have a link handy, do you - if not no problem, I'll ask on the CSP discord once I dive deeper



One little issue I still have but I guess it is a limitation of the AC engine:
The animation does start with a significant delay - I'd say about a second late.
Is this something I am going to have to live with or are there workarounds (I did a simple 2 keyframe animation on frame 0 and frame 1, animation speed looks great for a flip switch it is just delayed).
I never did animations the "vanilla" way, but dont see a lag in the CSP ones, you can even tweak their speeds.

Here are all the inputs: https://github.com/ac-custom-shaders-patch/acc-extension-config/wiki/Cars-–-Instruments-inputs
 
Guys, your help is awesome !!!

I finally found out the cause of the failing animation .... yes, complete beginners mistake ...

I edited the animation in Blender and must have had exported it a dozen times, have also done the route via Blender to FBX to KSeditor to create the animation file ...

I did everything right ... well ... I just forgot about one crucial detail ;-)

I completely forgot to export a fresh KN5 file as I had renamed the animated objects in Blender ... doh !!!
been there done that ..a lot :D
 
I never did animations the "vanilla" way, but dont see a lag in the CSP ones, you can even tweak their speeds.

Here are all the inputs: https://github.com/ac-custom-shaders-patch/acc-extension-config/wiki/Cars-–-Instruments-inputs
Thanks a lot for the link - this indeed is reading stuff for DAYS ! ;-)
I only now found out that you can search the repository supereasy for keywords and get actual good search results, making it kind of like a quick dictionary for all CSP command related stuff - this is awesome !!!
 
Thanks a lot for the link - this indeed is reading stuff for DAYS ! ;-)
I only now found out that you can search the repository supereasy for keywords and get actual good search results, making it kind of like a quick dictionary for all CSP command related stuff - this is awesome !!!
That place is still a major work in progress, but documentation is making its way there and I think it was LeBluem who organized it a bit better and added useful examples
 
The CSP route is just a easy, and allows for any input available to be animated.

Code:
[ANIMATION_...]
INPUT = CSP input           ; refer to input list in the github page
FILE = animation.ksanim     ; file name of new animation in “animations” folder
TIME = 0.5                  ; animation time

Say you want to create a blinker arm animation...

Make 2 key frame animations for the arm going up for left, or down for right blinker...

Put them in the animations folder, names dont matter...

and the code:

Code:
[ANIMATION_...]
INPUT = TURNSIGNAL_LEFT
FILE = up_blinker_arm.ksanim
TIME = 0.5

Code:
[ANIMATION_...]
INPUT = TURNSIGNAL_RIGHT
FILE = down_blinker_arm.ksanim
TIME = 0.5

I've got this to work. However, I'm not clear on how to go about creating the key frame animations properly. I'm using Blender 2.80

I get the lever moving up for left, and down for right, but I also have a static lever staying put in the middle.
 
It depends on what type of lever you want to animate how.

Example - indicator light switch:

Possible positions are: neutral, up and down

You export your FBX file for KSeditor with the lever in neutral.

You need then two separate animations for the two indicator positions - one moves the lever up from neutral, the second moves it down from neutral.

I found it best fir lever and switch animations to use just two keyframes in Blender (one in neutral and the second one in the respective end position).

After you saved those two animations, you simply use the CSP animation command in your car config (I vaguely remember there is even a variable to adjust animation time).
 
I remember there was an issue in the CSP build I was using back then where clashing animations on the same object would “break” the animation when say moving straight from left indicator to right indicator.
I had to deactivate left indicator first and then switch to right indicator.

A proper hardware mod to simulate the switches would take care of that though (switching one item off on the moving the lever to the other item).
 
If you do need two animations to be in play at once (eg. up/down for turn signals, in/out for headlights, twist for wipers, all on one stalk) they just need separate objects animated. Nest in whatever order is convenient, like STALK_RX/STALK_RZ/STALK_RY/Stalk_model
 
Last edited:

Latest News

How long have you been simracing

  • < 1 year

    Votes: 352 15.6%
  • < 2 years

    Votes: 247 10.9%
  • < 3 years

    Votes: 243 10.7%
  • < 4 years

    Votes: 177 7.8%
  • < 5 years

    Votes: 301 13.3%
  • < 10 years

    Votes: 259 11.5%
  • < 15 years

    Votes: 166 7.3%
  • < 20 years

    Votes: 126 5.6%
  • < 25 years

    Votes: 99 4.4%
  • Ok, I am a dinosaur

    Votes: 291 12.9%
Back
Top