Outerra forum

Anteworld - Outerra Game => Modding: Importer, Tools & Utilities => Topic started by: TopNotch on March 09, 2013, 07:56:30 am

Title: Blender Vehicle Rigging [SOLVED]
Post by: TopNotch on March 09, 2013, 07:56:30 am
Hi. I'm trying to get my BMW E36 Working. I haven't understood how this works yet. From what I know, I have to set bones, so I guess I have to rig the model in Blender (Armature?). Each bone for each wheel? Should they be rotated? I have to parent the bones to the wheel mesh or no? How does it define a collision mesh?

Any help?
Title: Re: Land Vehicle creation
Post by: ZeosPantera on March 09, 2013, 12:41:30 pm
If you don't want to go through the import on your own I have the complete file uploaded here.. http://www.reddit.com/r/OuterraAddons/comments/19jf12/vehicle_bmw_m3_modded_physics/ (http://www.reddit.com/r/OuterraAddons/comments/19jf12/vehicle_bmw_m3_modded_physics/)
Title: Re: Land Vehicle creation
Post by: TopNotch on March 09, 2013, 01:21:21 pm
Euh? I'm not talking about the M3, but the model I made (E36). I'm trying to get it ingame, the model is correctly imported ingame as a static object (correctly, apart materials I have to setup yet). When I import the model, in the configuration tab I see no node in the list (maybe since I haven't rigged it in blender)

I have no clue on how the physical setup of the vehicle has to be done. It's different from what I've done in Rigs of Rods.
I've read around, correct me if I'm wrong:

-I have to rig the model with Bones? (ex. 1 bone for each wheel)
-How the vehicle collision mesh is setup? (ex. vehicle interaction, etc.)
Title: Re: Land Vehicle creation
Post by: ZeosPantera on March 10, 2013, 12:34:11 am
Oh my bad. You will have to wait for someone more learned to get on this.
Title: Re: Land Vehicle creation
Post by: cameni on March 10, 2013, 04:30:40 am
-I have to rig the model with Bones? (ex. 1 bone for each wheel)
-How the vehicle collision mesh is setup? (ex. vehicle interaction, etc.)
Yes, one bone for each wheel, it will appear in the importer where you mark it for import.
Collisions are currently done automatically with the bounding box of the vehicle only, and that box doesn't even collide with terrain yet. Only wheels are interacting with ground at the moment.
Title: Re: Land Vehicle creation
Post by: TopNotch on March 10, 2013, 07:47:54 am
I created the bones following some infos about rotation on another thread.
I parented the wheel to the bones (moving the bone moves the wheel too) and then I parented the bones to the chassis.
See picture

(http://puu.sh/2fdNt)

Selecting all and exporting gives me an error with the Blender plugin. Selecting only the chassis without the wheels export, but in the importer I see them as different packages (4 Bones packages and 1 for Chassis) instead of 1. Any help?

How I'm supposed to parent them?
Title: Re: Land Vehicle creation
Post by: cameni on March 10, 2013, 09:04:49 am
You need to make a single group with all the components. Not sure how's that done exactly in Blender, but other people mentioned it in some of the importer threads already.
Title: Re: Land Vehicle creation
Post by: TopNotch on March 10, 2013, 12:43:01 pm
Is there any chances somebody could post the original .dae files of some vehicle (The M3 for example) so that I can import it in Blender and see how grouping was done in it? It would be much faster than going with tries.
Title: Re: Land Vehicle creation
Post by: TopNotch on March 10, 2013, 01:35:41 pm
HALT!

I had serious dubts on Blender 2.49b plugin, so I tried 2.56a one, it worked fine. I correctly exported the bones and the model. Imported it and set a .js script for it. It moves, but something is wrong on the bone position. Isn't there a kind of debug tool to see where the bones are placed in game? I've set them right in Blender. I post a screen, I placed them right? Or they have to be at the bottom of the wheel (between the tire and the ground)?

(http://puu.sh/2fmno)

(https://dl.dropbox.com/u/42990436/Screens/Outerra/screen_1362936265.jpg)
(https://dl.dropbox.com/u/42990436/Screens/Outerra/screen_1362936558.jpg)
(https://dl.dropbox.com/u/42990436/Screens/Outerra/screen_1362936602.jpg)

This could start to be useful for other blender users ;)
Title: Re: Land Vehicle creation
Post by: TopNotch on March 11, 2013, 12:01:04 pm
I've been messing more. The main problem is understanding which should be the correct origin point of wheel mesh and bones.
I tried the following:

-Both Wheel Mesh and Bones origins to chassis origin
Result: Wheel mesh are placed correctly, bones are all in 1 place (monocycle like)

-Wheel mesh in their own origin, bones to chassis origin
Result: Same as above

-Wheel mesh in their own origin, Bone is the wheels origin
Result: Wheels mesh are in chassis origin, bones are correctly placed

I copy here the wheel section of the last one .dae file

Code: [Select]
        <node id="WHEEL1" name="WHEEL1" type="NODE">
          <translate sid="location">-0.538788 0.917304 0.02643038</translate>
          <rotate sid="rotationZ">0 0 1 0</rotate>
          <rotate sid="rotationY">0 1 0 0</rotate>
          <rotate sid="rotationX">1 0 0 0</rotate>
          <scale sid="scale">1 1 1</scale>
          <node id="Bone" name="Bone" sid="Bone" type="JOINT">
            <matrix sid="transform">7.54979e-8 -1 0 0.1672285 1 7.54979e-8 2.41038e-7 -2.39313e-4 -2.41038e-7 -1.81978e-14 1 -0.001710726 0 0 0 1</matrix>
          </node>
        </node>
        <node id="wheel_1" name="wheel_1" type="NODE">
          <matrix sid="parentinverse">1 0 0 0.538788 0 1 0 -0.917304 0 0 1 -0.02643038 0 0 0 1</matrix>
          <translate sid="location">-0.538788 0.917304 0.02643038</translate>
          <rotate sid="rotationZ">0 0 1 0</rotate>
          <rotate sid="rotationY">0 1 0 0</rotate>
          <rotate sid="rotationX">1 0 0 0</rotate>
          <scale sid="scale">1 1 1</scale>
          <instance_geometry url="#wheel_1-mesh">

Note- When importing, I have different nodes to choose. I have only 4 bones, but I get 12.
(http://puu.sh/2fTz2)
Bone_1-4 are the bones name (Group) (When I choose this one, animation doesn't work)
Bone is just the bone, no wheel mesh
Wheel_1-4 are the wheel mesh name (When choosing this one, the animation works, but their rotation is wrong, since the I can't get the wheels and the bones to be correctly placed)

This is the current group hierarchy
(http://puu.sh/2fTEm)

Intervehicle collision are working correctly (chassis)

Any help? Is the .dae file section correct or I have to fix it manually? Does somebody have a .dae file of some rigged vehicle I can take as example? Or tell me how the bones&Wheels origins are supposed to be.

The Collada exporter blender used is 1.4.1
Title: Re: Car Riggin Problems (Blender)
Post by: TopNotch on March 11, 2013, 12:30:50 pm
SOLVED!

It's finally working. I will soon make a tutorial for Blender users :)
Wheels are animated correctly and bones are placed correctly too. I'm so happy!

(http://puu.sh/2fUjY)

Here's how I set the bones in Blender 2.65a

Chassis has it's own origin point (in the middle)
Wheels are placed in their place and have their own origin point
Bones origin is set to the chassis origin

Export all

When importing, in the configurator select the one highlighted!
(http://puu.sh/2fUnK)
It's the name of the wheel mesh/model. Not the group, not the bone.

VoilĂ !
Title: Re: Blender Vehicle Rigging [SOLVED]
Post by: angrypig on March 11, 2013, 01:15:23 pm
You don't have to use bones in Blender. Bone column in the importer means which nodes you want to convert into engine bones. We added this system because it is faster and easier than standard skinning/rigging stuff.

According to your Blender's hierarchy all you need is to check bone checkboxes for wheel_1 - wheel_4 and you can remove all your armatures...

Here is simple Blender example:
http://outerra.com/download/hover_tank.blend.zip (http://outerra.com/download/hover_tank.blend.zip)
Title: Re: Blender Vehicle Rigging [SOLVED]
Post by: TopNotch on March 11, 2013, 01:35:20 pm
I tried removing the armature before, but the wheels came as different package, the only way to keep them together was to add bones that I wasn't going to use anyway.
Title: Re: Blender Vehicle Rigging [SOLVED]
Post by: angrypig on March 11, 2013, 01:40:42 pm
You have to move wheels under chassis or create a dummy parent node for all vehicle parts.
Root nodes are considered as separate objects...
Title: Re: Blender Vehicle Rigging [SOLVED]
Post by: PytonPago on July 29, 2013, 07:32:49 am
You have to move wheels under chassis or create a dummy parent node for all vehicle parts.
Root nodes are considered as separate objects...

When the dummy parent is made, all parts are then selectable as i understand ... how is it whyte multi-step parenting ? Lets say there are 6 rods connected one after another (any of them going a different way) and i want the flowing ones to rotate in their vectors, each in the speed of the previous one ...

    ... can i multi-step parent them ? Or should i rather leave all on the same level in the dummy node, thinking about scripting the speeds for each according to their primes ? (and whats the way the importer handles the parent nodes, if the first way isnt right to do ?)

 
Title: Re: Blender Vehicle Rigging [SOLVED]
Post by: cameni on July 29, 2013, 09:47:28 am
You can have a hierarchy, mark the nodes for script access in the importer and then rotate/translate them in the script, and child nodes will be affected by it as you'd expect.