Jump to content

Main and Nose Landing Gear Rigging/Animating


Recommended Posts

Notice

This thread contains a discussion of a WIP. Not all of the information is correct, but as time went by the most recent posts contain a lot of useful information. If you read the whole thing and look through all the example files you should be able to create a landing gear complete with a deployment animation, suspension, bay doors, and torque arms.

Original Post

Here's the landing gear from my wip

g8ZDl6S.png

I need help with setting up the torque arms (the top highlighted parts) in blender and unity, if it's even possible.

Then I'm wondering if it's possible to set up the axle beam (bottom highlighted part) so that it free-rotates and conforms to the ground when landing/taking off (while also setting up and animating the pistons on top of it)

Edited by Cpt. Kipard
Link to comment
Share on other sites

It seems possible, when you set up the CONSTRAINLOOK/FXModuleConstrainPosition the specified parts rotate on their origin, to point at the other specified parts origin

So to get the lever effect you'll need to set up (invisible) objects for them to point at, which will be part of the top (fixed) or bottom (suspensionTraverse) assemblies

Terrible burn your eyes picture

T1za04a.jpg

Link to comment
Share on other sites

Yeah that makes perfect sense, thanks. I'm having difficulty finding decent documentation on CONSTRAINLOOK/FXModuleConstrainPosition. Is there any, or a tutorial?

<edit>

After some recent tests (Sept 2014) I have determined that this will not work perfectly. A better solution is presented by lo-fi later in the thread here.

</edit>

Also the axle beam question is still open for anyone who wants to tackle it.

Edited by Cpt. Kipard
Link to comment
Share on other sites

Glad that helped, I was trying to figure out how to explain it but decided to inflict my drawing upon you instead.

Not really, I had the same difficulty just recently (still visible about 7-8 questions below).

When you set up objects using CONSTRAINLOOK/FXModuleConstrainPosition, their 'default' position needs to be Z+ (with no baked in rotation, do not use X=90 for these parts), so in your 3d modelling program all the rotating bits end up pointing at the sky, but once the CONSTRAINLOOK/FXModuleConstrainPosition part of the wheel module kicks in (in game) they are all automatically rotated (at their origin) to look at the (config) specified origin

I'm not sure about making the axle beam rockable, maybe you can configure that joint as flexible inside Unity and then have two wheelCollider parts? Not sure how (or if) KSP would handle that

Edited by NoMrBond
Link to comment
Share on other sites

Yeah I saw that thread, but it's always useful to have something rephrased, so thanks for that.

What I should have said thought is that in those screenshots I don't see any reference to those things in either unity or blender. I have no idea how to implement that. Does Unity at least have decent API documentation somewhere which is not just specific to KSP but which will allow you to add things to any and all Unity games?

Or is there maybe a way to export constraints from Blender? I know I can already import objects from a blend file directly.

Edited by Cpt. Kipard
Link to comment
Share on other sites

Damnit, Valve's Source engine documentation really spoiled me I guess. This is way harder than it should be. Is anyone aware of maybe some source files of Squad parts for reverse engineering?

Everywhere I look it's thread after thread of failed landing gear attempts. It turns out I might not even be able to have two separate wheels colliders

Link to comment
Share on other sites

Damnit, Valve's Source engine documentation really spoiled me I guess. This is way harder than it should be. Is anyone aware of maybe some source files of Squad parts for reverse engineering?

Everywhere I look it's thread after thread of failed landing gear attempts. It turns out I might not even be able to have two separate wheels colliders

If you figure it out, please let me know! about a year ago I literally tore my hair out trying to get a dual roverwheel happening, and basically using two wheel colliders ended up in some pretty horrendous bugs and catastrophes, mainly because as you probably know by now making your wheel, that 0,0,0 position is pretty important :sticktongue:

As I said, not landing wheels more rover wheels, but same problem.. bah.. was such a pain

image.php?id=E92D_532810C2&jpg

Link to comment
Share on other sites

Yeah that makes perfect sense, thanks. I'm having difficulty finding decent documentation on CONSTRAINLOOK/FXModuleConstrainPosition. Is there any, or a tutorial?

Also the axle beam question is still open for anyone who wants to tackle it.

In whatever editing software you use, you need to create an emptyObject and place it at the position you wish to constrain and make it a child of the armature mesh. The same needs to be done for the look constrain and these are called in the part's config file and configured there under the module wheel. The CONSTRAINLOOK/FXModuleConstrainPosition are essentially empty objects that are children of the armature. You would configure them with targets in the actual part.cfg.

I am sorry I can't help you on the multi-axle problem. Though maybe the guys that are updating the tank tracks mod can help you with that one.

Edit: I forgot to add that that all depends on the objects global and or local position. You may or may not want to apply any global rotations. I have only ever made a single armature suspension with a single wheel and it wasn't even really a wheel. It was for a landing leg. YMMV.

Edited by Payload
Link to comment
Share on other sites

Multi-axle wheels might not be possible. Bac9 was asked about them once, and basically said that KSP can't handle that sort of landing gear. So you're doomed to either a single axle or a plugin.

Link to comment
Share on other sites

That's disappointing. I've put a bit of work into those wheels. I'll see if anyone wants to write a plugin for this, because I can't, but I imagine I'll need to gain some reputation before people decide to invest their time. To that end I've just released a little part set. See my signature.

EDIT:

Would anyone mind giving me their blend files and Unity project files to reverse engineer? Or is that too much to ask?

Edited by Cpt. Kipard
Link to comment
Share on other sites

Too bad it can be done "easily", Devo and Cpt. Kipard, I know it's looks pretty simple but why not cutting the twin wheels into 2 separate parts which can be merged later (with the welding part thing in config file), it might do the job, or not.

You may even have a fixed central part, and 2 moving sets around for the wheels.

Cpt. Kipard: your landing gear model is very nice, good job.

Link to comment
Share on other sites

Unfortunately the only one I have at the moment isn't really suitable as I've done some horrible things with/for/too it to make it do what I want (because it's not actually a wheel, just uses the wheel module).

As soon as I finish the next bit (which is actually a wheel) I'll mail over the .blend and Unity scene

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...

hi !

i'm looking the first picture, and yes I think you have to simplify the rear gear, the WheelCollider physics work

only on Yup axe it's a limitation, but they are no limitation to place the collider, so with ContrainFXposition and the fxlookAT

it's perhaps possible to fake the whole suspension's animation, with these two module !!

We have great module too, made by people like firespiter, and may use these module, for now I can play only with the stock

KSP module ModuleLandingGear.

And to start this big tuto :

this is a blender example on how the FXModuleLookAtConstraint must be configured in blender

You need the last BLENDER version 2.71

Starting with this example you have to export the model in UNITY, I recommend you to choose FBX export .

  1. Select the entire object key A
  2. Go to menu FILE->EXPORT->choose FBX
  3. in the left panel (KEY T) you have now the Export FBX panel
  4. Choose FBX 6.1 ASCII version and mark the selected Objects option
  5. Don't touch the orientation option stay -Z forward and Y Up
  6. if you have Modifiers mark the option
  7. Name the export fbx file and hit Export FBX button on the top right window !

Now you have an FBX file ready to UNITY


How the FXModuleLookAtConstraint work !

For UNITY you have nothing to do, the setup is in blender for the orientation of objects's axis !

- object oriented by this module work with two axis :

  • The X AXIS (red in blender) -> object's turning Axis
  • the Z AXIS -> the orientation axe of the object (look in blender example)

- And with the CFG file , we need a rotator and a target Name

  • rotatorsName -> it's the blender's object, defined by a mesh, this is the object driven by this module
  • targetName -> it's the blender's object, defined by a mesh or a DUMMY, the ZAXIS of rotatorsname is pointing on this object
  • targetName -> is the animated part or is parent in blender or UNITY.

  • MODULE
    {
    name = FXModuleLookAtConstraint
    CONSTRAINLOOKFX
    {
    targetName = Mesh or DUMMY, name
    rotatorsName = the moving and driven object name
    }
    }

You can define multiple object with this module (look in the cfg's stock part for good example)

for this module they are some [KSPFIELD] parameter :

  1. runInEditor not tested yet
  2. trackingModeString : tested this function control the state of module by this enum TrackMode

TrackMode have 3 string value:

  1. FixedUpdate
  2. Update
  3. LateUpdate

in cfg file the config is :

trackingModeString = fixedUpdate -> the object stay fixe on start but later was updated by module, may be useful to correct

some weird movement, I have noticed that object using this module (FxLookat...) don't like animation parent !

And that all for this module!


IN UNITY (they are enough tuto here to do that I think)

but If you have trouble to export this example in KSP, tell me the problem :wink:

here the result in KSP

HRuaMjW.gif

I'm waiting you're screenshot :cool:

steph

@+

Edit : I haven't use the FXModuleConstrainPosition yet I need to conduct some test before a tutorial !!!

Edited by stephm
Link to comment
Share on other sites

..damped track

Because it's similar to the module function and it's use the Zaxis, "Track to" add more control but

for this example it's simple.

For armature you can use especially in this example, it's interesting because the animation it's much more

easy to do with armature, you just have to drive one object and armature do the rest.

I use armature on my landing gear, but keep in mind that take lot of resource in animation when you

export in Unity.

I'm looking how the second module work (FXModuleConstrainPosition)!

if you are good in blender and I think you are, ignore my advice for blender :wink: use you're method !

use track to and armature if you like !

For the gear test mockup I try to use the same function you use.

-Would you like a blender file for the FXModuleConstrainPosition module ?

-next info will be an example on how work the Physic WheelCollider

I give you info on this orientation, and how it work and these parameter :wink:

- much detailed info about the picture's gear of smallgearBay !

- and final try to make you gear functional

A very important thing , all controller are not imported in UNITY,

they have only utility in blender to find correct animation, to match

the same effect give by controller (like track to in blender), this is done

by module and cfg file and of course a correct orientation of axis

and good naming object !

I hope I'm clear :blush: in my explanation, I'm just a beginner like you !

steph!

edit: Added some info about KSPFIELD for the FXModuleLookAtConstraint, see post up

Edited by stephm
Link to comment
Share on other sites

hello !

this is the template for the second module FXModuleConstrainPosition

7z7nxqX.gif

the download pack -> PUTFILE

-Contain-

1 the blender original file with animation by constraint

2 the FBX file

3 the UNITY scene of the imported FBX file

4 Gamedat is the compiled part with cfg file

The part is animed by the two module, the FXModuleConstrainPosition manage the Torus rotation!

Compared to blender animation notice how the torus is oriented in KSP, the two fonction

matchRotation and matchPosition, both of them align the axis for the targetName and the moversName

In this case :

  1. - targetName = Driver_for_Position (contain the unity rotation animation)
  2. - moversName = Torus the object mesh driven by module

In cfg file it's look like this :

MODULE

{

name = FXModuleConstrainPosition

matchRotation = true

matchPosition = false

CONSTRAINFX

{

targetName = Driver_for_Position

moversName = Torus

}

}

they are no particular Orientation, for the MODULE FXModuleConstrainPosition

the rule is to keep the same orientation axis

To use the UNITY scene in tuto_FXpos\Assets, place these files

-FXModuleConstrainPosition.unity and FXModuleConstrainPosition.unity.meta

-FXModule_unity

in you're Assets folder

You may need to redefine for the part tools (script) export folder, use the Assets\FXModule_unity\export_PART

for that or keep you're export folder.

The scene use a derived anim file from the fbx import, to have possibility to modifie

the animation file and save it (FXModuleConstrainPosition_Modified.anim)

in UNITY :

Compare the anim prefab and the modifed anim only few key stay in modified anim.

i hope this help you to start something on the gear .

steph

Link to comment
Share on other sites

ok :wink: I have already download the file on the others post .

it's look great !!! really .

look on the others post they are some details added on the smallgearbay picture it's a start.

In blender of course ALL reference stay in place, only moving part will be animated !

And nothing on the geometry except the axis orientation for some object are modified.

@+

Link to comment
Share on other sites

hello !

this is a first Animation Setup -> SkylonNoseGear.rar

All gear Door are animated, and you have to notice some modification around the wheel steer.

Because we have to manage the steering function, and all thing concerning Rigging ! around Wheelcollider

and wheel.

The entire Gear is parented on : LegOriginGuide , use it to place the complete gear.

- NoseGearLeg is the main animation

- NoseGear_STEER is a separated object from NoseGearSteering, (nothing modified in geometry, is just for rigging)

- All empty's objects (displayed Arrows), with _MOTOR tag at the end of name are controllers of gear doors.

- All animation are base setup on 0 degrees, so it's easy to retrieve the position origine.

- All object are correctly scaled for future export.

An important thing the way how you want the suspension work :

rdSqzau.gif

you have two choice A or B ?

the frame range is setup to 1 - 150

Tell me if you like, the next stage will be the export to Unity to test if the whole thing work with a cfg File :D.

If you don't like something on the animation, change it and give me the new modified file .

steph

@+

Edited by stephm
try to correct bad english (native french)
Link to comment
Share on other sites

hi !

in a real mechanism the top of this part contain motor or actuator, and don't move but move the lower part !

the first top part is a parent .

if you take look on ailiners page they are some good pictures of gear plane .

But if you want the part NoseGearSteering in one part it's ok :wink:

Ok for the A option .

And you like the animation ?, tell me what you want exactly, everything is possible changing the timing of the door

the animation time etc .

Edit :

I think you are troubled by how I manage, the parenting of object and constraint, but keep in mind

the constraint in blender are not used in UNITY, in blender I use constraint to visualize

how part move or for screenshot and to find the position and add a KEY.

Look the example for the constraint fxposition.

Edit 19.25 French time

Cpt.Kipard do you have some cfg template for the gear, I think the gear come as separate part ?

like other mod !

steph

Edited by stephm
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...