SOLVED BY HSCHUIT (MCX): Possible to change aircraft animation?
SOLVED BY HSCHUIT (MCX): Possible to change aircraft animation?
Just wonder if it is possible to change a part of the Wilco Harrier.
In real, the GR3 has its front gear bay open when the aircraft is standing, but closed while taxiing.
The Wilco Harrier has the gear always open which looks a little odd, not real at least.
It would be nice to get it closed like in reality, but which parameters do I have to change - if any possible?
In real, the GR3 has its front gear bay open when the aircraft is standing, but closed while taxiing.
The Wilco Harrier has the gear always open which looks a little odd, not real at least.
It would be nice to get it closed like in reality, but which parameters do I have to change - if any possible?
Last edited by Manschy on 12 Nov 2023, 12:49, edited 1 time in total.
Regards, Manfred.
Re: (MCX): Possible to change aircraft animation?
Manfred,
You would need to write a custom xml animation that would sense whether the aircraft was taxi-ing (I'm not sure how you would detect this, perhaps via "Sim on ground" variable in conjunction with the "Ground Velocity" variable.
Then you can assign this animation to the front gear bay door in MCX
This is some code for reverse thrusters that you might be able to use as inspiration.
Of course doing this the door would open every time you stop taxi-ing even if it is just because you are waiting for take off clearance (is this realistic behaviour - I don't know.)
The simpler thing might be just to tie the animation to something like the parking brake or the Electrical Master Battery variable (power on the door is closed, power off the door is open).
Gavin
You would need to write a custom xml animation that would sense whether the aircraft was taxi-ing (I'm not sure how you would detect this, perhaps via "Sim on ground" variable in conjunction with the "Ground Velocity" variable.
Then you can assign this animation to the front gear bay door in MCX
This is some code for reverse thrusters that you might be able to use as inspiration.
Code: Select all
<Parameter>
<Code>
(A:SIM ON GROUND, bool) 1 == if{ 65 190 (A:GROUND VELOCITY, knots) rng if{ (A:SPOILERS HANDLE POSITION, percent) } }
</Code>
<Lag>100</Lag>
</Parameter>
The simpler thing might be just to tie the animation to something like the parking brake or the Electrical Master Battery variable (power on the door is closed, power off the door is open).
Gavin
Re: (MCX): Possible to change aircraft animation?
Thanks a lot, Gavin.
Okay, the solution using the Electrical Master Battery sounds like a jackpot.....
But how do I realize this?
The word "simpler" give me hope to be able to do this...
Where can I find the apropriate part to change something? That's exciting...
Okay, the solution using the Electrical Master Battery sounds like a jackpot.....
But how do I realize this?
The word "simpler" give me hope to be able to do this...
Where can I find the apropriate part to change something? That's exciting...
Regards, Manfred.
Re: (MCX): Possible to change aircraft animation?
Here is code I used to trigger animated landing lights on an AI
Code: Select all
<Animation name="ai_Underwing_Light" guid="c9490e08-c20a-4642-c666-5234efd1aa01" length="100" type="Sim" typeParam2="ai_Underwing_Light" typeParam="AutoPlay" />
<PartInfo>
<Name>ai_Underwing_Light</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(A:LIGHT LANDING,bool) ! if{ 100 } els{ 0 }
</Code>
<Lag>20</Lag>
</Parameter>
</Animation>
</PartInfo>
Once you have the code in your makemdl.xml file you need to pull the model up in MCX.
Now you have 2 choices, in Animation Editor you can find the animation that controls your door and change it to your custom animation. Or in Object Hierarchy you can find the door part and change the animation there. They both work equally well.
Gavin
Re: (MCX): Possible to change aircraft animation?
Oh fine, thank you very much, will check this out tomorrow .
Regards, Manfred.
Re: (MCX): Possible to change aircraft animation?
Hmm, I seem to be too stupid.
I need a little tutoring how to create the xml file and where to put it afterwards. Sorry for effort, but I am better in designing sceneries than aircraft...
I need a little tutoring how to create the xml file and where to put it afterwards. Sorry for effort, but I am better in designing sceneries than aircraft...
Regards, Manfred.
Re: (MCX): Possible to change aircraft animation?
Hi Manfred
the default modeldef.xml is part of the SDK, for P3D it is under Modeling/3ds Max/bin. I suggest you copy it and keep the original clean.
In MCX under Options/FS related settings you set the path to your copy of modeldef.xml, it can be anywhere you like.
As for editing the xml file, it is just a text file so you can use any editor. I like Notepad++ as it "knows" xml and makes editing a bit easier.
Hope this makes sense.
Gavin
Re: (MCX): Possible to change aircraft animation?
Okay, Gavin, thank you.
I did as suggested, added your line
<Animation name="ai_Underwing_Light" guid="c9490e08-c20a-4642-c666-5234efd1aa01" length="100" type="Sim" typeParam2="ai_Underwing_Light" typeParam="AutoPlay" />
on top of the makemdl.xml <animation name...> lines...
Than I added the following lines
<PartInfo>
<Name>ELECTRICAL MASTER BATTERY</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(A:ELECTRICAL MASTER BATTERY,bool) ! if{ 100 } els{ 0 }
</Code>
<Lag>20</Lag>
</Parameter>
</Animation>
</PartInfo>
Currently and unfortunately there don't appear any new entries inside MCX, nor inside "Animation Editor" neither "Object Hierachy".
There are some steps to go and I hope you can help me further on...
I did as suggested, added your line
<Animation name="ai_Underwing_Light" guid="c9490e08-c20a-4642-c666-5234efd1aa01" length="100" type="Sim" typeParam2="ai_Underwing_Light" typeParam="AutoPlay" />
on top of the makemdl.xml <animation name...> lines...
Than I added the following lines
<PartInfo>
<Name>ELECTRICAL MASTER BATTERY</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(A:ELECTRICAL MASTER BATTERY,bool) ! if{ 100 } els{ 0 }
</Code>
<Lag>20</Lag>
</Parameter>
</Animation>
</PartInfo>
Currently and unfortunately there don't appear any new entries inside MCX, nor inside "Animation Editor" neither "Object Hierachy".
There are some steps to go and I hope you can help me further on...
Regards, Manfred.
Re: (MCX): Possible to change aircraft animation?
The animation name has to be consistent thru-out the code. You are naming it ai_underwing_light in the first line (it appears there twice) and calling it ELECTRICAL MASTER BATTERY in the Partinfo sectionManschy wrote: ↑05 Nov 2023, 21:04 Okay, Gavin, thank you.
I did as suggested, added your line
<Animation name="ai_Underwing_Light" guid="c9490e08-c20a-4642-c666-5234efd1aa01" length="100" type="Sim" typeParam2="ai_Underwing_Light" typeParam="AutoPlay" />
on top of the makemdl.xml <animation name...> lines...
Than I added the following lines
<PartInfo>
<Name>ELECTRICAL MASTER BATTERY</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(A:ELECTRICAL MASTER BATTERY,bool) ! if{ 100 } els{ 0 }
</Code>
<Lag>20</Lag>
</Parameter>
</Animation>
</PartInfo>
Currently and unfortunately there don't appear any new entries inside MCX, nor inside "Animation Editor" neither "Object Hierachy".
There are some steps to go and I hope you can help me further on...
The name in the <Name> section has to match the names in Animation name= and typeParam2=
I suggest you pick an animation name that makes sense to your like Harrier_Gear_Door or some such name.
Then make sure it is identical in all 3 places.
Then you should see the code and be able to use it.
I was thinking about this the other night and there might be a bigger issue. Not sure because I'm not aware of how the Harrier gear works. The revised animation will only trigger the gear door when electrical power is on or off. Does the door not need to open again when the gear retracts? and then close once it is retracted? If so we will need to write some more sophisticated code.
Gavin
Re: (MCX): Possible to change aircraft animation?
Hi Gavin,
thank you very much for this effort.
I am the king of careless mistakes. Certainly I used "ELECTRICAL MASTER BATTERY" also in my modeldef.xml but forgot it to also change it here in my added example, sorry for confusion.
A good suggestion: The revised animation will only trigger the gear door when electrical power is on or off.
In this case, the gear door will be open from the electrical start until the electrical shut down - so the same like the current situation. I did disregard this.
I think it is not worth the effort - with some minor changes maybe a nice improvement, but the aircraft work without it anyhow
thank you very much for this effort.
I am the king of careless mistakes. Certainly I used "ELECTRICAL MASTER BATTERY" also in my modeldef.xml but forgot it to also change it here in my added example, sorry for confusion.
A good suggestion: The revised animation will only trigger the gear door when electrical power is on or off.
In this case, the gear door will be open from the electrical start until the electrical shut down - so the same like the current situation. I did disregard this.
I think it is not worth the effort - with some minor changes maybe a nice improvement, but the aircraft work without it anyhow
Regards, Manfred.
Re: (MCX): Possible to change aircraft animation?
Hi Manfred,
Just for the same of completeness and for future reference. I think the reason you couldn't see your animation in MCX is that animation names need to be a single word.
IE My_anim will work but My Anim won't
Gavin
Just for the same of completeness and for future reference. I think the reason you couldn't see your animation in MCX is that animation names need to be a single word.
IE My_anim will work but My Anim won't
Gavin
Re: (MCX): Possible to change aircraft animation?
Thank you, Gavin.
As soon as I run into trouble again with my RAF Gütersloh development, I will come back to this
As soon as I run into trouble again with my RAF Gütersloh development, I will come back to this
Regards, Manfred.
Re: (MCX): Possible to change aircraft animation?
Manfred, there is another way to accomplish what you need. First, you need to change the animation keyframe sequence in MCX.
What you want is the gear doors to be open when the gear travels up/down and closed when gear is fully down.
On top of that you need a custom gear animation code which makes the doors behave as the standard c_gear animation when the engine is running and makes the doors droop when hydraulics pressure drops below 1000 psi.
Use MCX Hierarchy Editor > Animation Key Editor to update the gear doors keyframe sequence and replace the c_gear animation tag with the custom tag below.
The updated keyframe sequence in MCX is 0 for closed when gear is up, 20-80 for open and 100 for closed when gear is down
left door:
k 0 rotation values x 0, y 0, z 0 same as old k 0
k 20 rotation values x -1.182, y -87.476, z 1.158 (old k100 values)
k 80 rotation values x -1.182, y -87.476, z 1.158 (old k100 values)
k100 rotation values x 0, y 0, z 0 (old k 0 values)
right door:
k 0 rotation values x 0, y 0, z 0
k 20 rotation values x -1.491, y 87.669, z -1.949
k 80 rotation values x -1.491, y 87.669, z -1.949
k100 rotation values x 0, y 0, z 0
The custom animation tag:
<Animation name="custom_ani_c_geardoor_droop" guid="DEFD6264-11C9-4463-8592-2B763639BFAB" typeparam2="custom_ani_c_geardoor_droop" typeparam="AutoPlay" length="100" type="Sim" typeParam="AutoPlay" />
<PartInfo>
<Name>custom_ani_c_geardoor_droop</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>(A:ENG HYDRAULIC PRESSURE:1, Psi) 1000 > if{ (A:GEAR ANIMATION POSITION:0, keyframe) } els{ 50 }</Code>
<Lag>10</Lag>
</Parameter>
</Animation>
</PartInfo>
What you want is the gear doors to be open when the gear travels up/down and closed when gear is fully down.
On top of that you need a custom gear animation code which makes the doors behave as the standard c_gear animation when the engine is running and makes the doors droop when hydraulics pressure drops below 1000 psi.
Use MCX Hierarchy Editor > Animation Key Editor to update the gear doors keyframe sequence and replace the c_gear animation tag with the custom tag below.
The updated keyframe sequence in MCX is 0 for closed when gear is up, 20-80 for open and 100 for closed when gear is down
left door:
k 0 rotation values x 0, y 0, z 0 same as old k 0
k 20 rotation values x -1.182, y -87.476, z 1.158 (old k100 values)
k 80 rotation values x -1.182, y -87.476, z 1.158 (old k100 values)
k100 rotation values x 0, y 0, z 0 (old k 0 values)
right door:
k 0 rotation values x 0, y 0, z 0
k 20 rotation values x -1.491, y 87.669, z -1.949
k 80 rotation values x -1.491, y 87.669, z -1.949
k100 rotation values x 0, y 0, z 0
The custom animation tag:
<Animation name="custom_ani_c_geardoor_droop" guid="DEFD6264-11C9-4463-8592-2B763639BFAB" typeparam2="custom_ani_c_geardoor_droop" typeparam="AutoPlay" length="100" type="Sim" typeParam="AutoPlay" />
<PartInfo>
<Name>custom_ani_c_geardoor_droop</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>(A:ENG HYDRAULIC PRESSURE:1, Psi) 1000 > if{ (A:GEAR ANIMATION POSITION:0, keyframe) } els{ 50 }</Code>
<Lag>10</Lag>
</Parameter>
</Animation>
</PartInfo>
Re: (MCX): Possible to change aircraft animation?
Wow Henk - that looks very promising. I will give it a try next days, thank you very much!
Regards, Manfred.
Re: (MCX): Possible to change aircraft animation?
Henk, Gavin, thanks for all the input.
It seems I am on the right way. Modeldef.xml entries are done and the custom animation appears well inside MCX.
After chosing both front gear doors, I did exchange the c_gear animations inside the Hierachy Editor.
Just for watching if any changes, I tried to export the model, but did get an issue as follows:
The exporter windows shows a message that your used guid code is already taken, namely within the NH-90 animations.
So is it possible to simply change the end number of your guid into another number or is it needed for the oil pressure procedure?
Sorry, I am not very familiar with this and am a part time worker at aircraft modifying. But it seems as if I am close to a solution with your help...
It seems I am on the right way. Modeldef.xml entries are done and the custom animation appears well inside MCX.
After chosing both front gear doors, I did exchange the c_gear animations inside the Hierachy Editor.
Just for watching if any changes, I tried to export the model, but did get an issue as follows:
The exporter windows shows a message that your used guid code is already taken, namely within the NH-90 animations.
So is it possible to simply change the end number of your guid into another number or is it needed for the oil pressure procedure?
Sorry, I am not very familiar with this and am a part time worker at aircraft modifying. But it seems as if I am close to a solution with your help...
Regards, Manfred.
Re: (MCX): Possible to change aircraft animation?
You need to generate a new GUID, afaik it is not OK to change part of an existing one.
There are several ways to do it, I always import a random part or model in MCX, then go to "Object Information".
There I click the "Set New GUID" button and copy the new GUID to the animation tag in the ModelDef.xml file.
EDIT: If this is too cumbersome for you I generated a couple, take your pick:
173949aa-196f-438e-9235-a1297032b5ac
84b6234e-a3c7-42b2-a98d-a0f68807d8b2
c19f57a5-d36a-4dc7-a933-f46087c49e8c
There are several ways to do it, I always import a random part or model in MCX, then go to "Object Information".
There I click the "Set New GUID" button and copy the new GUID to the animation tag in the ModelDef.xml file.
EDIT: If this is too cumbersome for you I generated a couple, take your pick:
173949aa-196f-438e-9235-a1297032b5ac
84b6234e-a3c7-42b2-a98d-a0f68807d8b2
c19f57a5-d36a-4dc7-a933-f46087c49e8c
Last edited by hschuit on 09 Nov 2023, 22:46, edited 2 times in total.
Re: (MCX): Possible to change aircraft animation?
Ah okay. Will try it, thank you.
Regards, Manfred.
Re: (MCX): Possible to change aircraft animation?
Henk probably has the right way to generate new GUIDs, but I always just randomly change a few characters (remembering of course that they are hexadecimal characters) on the GUID of the source animation that I use as the template for my new animations.
It hasn't come back to bite me yet (but probably will one day soon)
Gavin
It hasn't come back to bite me yet (but probably will one day soon)
Gavin
Re: (MCX): Possible to change aircraft animation?
Just wonder if it is a good idea to have a look at the back gear doors - there the animation may have the same procedure, innit?
Because there, the doors are closed after gear extending...
Because there, the doors are closed after gear extending...
Regards, Manfred.
Re: (MCX): Possible to change aircraft animation?
Based on several images of parked GR3's I do not think the back gear doors came down when parked. Aeroplane Heaven did the back doors animation correctly, doors only open when gear is travelling down/up.
BTW, based on photos it looks like the airbrake should be partially down when gear is down, can you confirm this?
Henk.
BTW, based on photos it looks like the airbrake should be partially down when gear is down, can you confirm this?
Henk.