EdyJ / blender-to-unity-fbx-exporter

FBX exporter addon for Blender compatible with Unity's coordinate and scaling system.
MIT License
947 stars 98 forks source link

Wheel location transform and full FBX rotated while rotation value is 0 #18

Closed 1NoobDev closed 3 years ago

1NoobDev commented 3 years ago

Trying to use the cars from the Transportation add-on for Blender in Unity with the Edy's Vehicle Physics. Though, when i use this Blender-to-Unity-FBX-exporter is get the following strange behaviour, on any car i try to export to Unity.

The versions of Blender and Unity I'm using:

See screenshots for an instant understanding of the problem.

Here you see the vehicle after importing it into Unity: merc1

Here is the vehicle from Transportation add-on in Blender, all fresh no edits made: merc2

I've tried to follow the instructions provided in the Readme of this git, though, i can't get it working. With the rotation I noticed the Wheelcolliders from the Vehicle Physics add-on are not working on the road..

EdyJ commented 3 years ago

Can you provide some .blend file that can be used to reproduce the issue?

1NoobDev commented 3 years ago

Thank you for the quick response.

Hopefully you're able to find the problem/solution, as I'm more than willing to use this in your vehicle physics pack for Unity :)

Edit: I uploaded the wrong Blend file.. This file exceeds the Github file size so i put it in my Google Drive. https://drive.google.com/file/d/1YU697bV1rlBWFEQr_AhGdbMjmEwpO4Fk/view?usp=sharing

Kind regards,

EdyJ commented 3 years ago

Unfortunately I couldn't do anything with that .blend file. It shows collections only, no hierarchy nor meshes. I can't even switch between Object and Edit mode! (the menu shows Object mode only). Am I missing something?

This is how the hierarchy looks when I open that file: image

How could I see or "expand" the actual Object hierarchy?

1NoobDev commented 3 years ago

That's strange.. Might be because of the way the Transportation add-on works? I have to click on 'Make editable for animation' before I can see the hierarchy. Do you have any experience on this?

This is how i see the file I shared.. bmw1

It could be that exactly this, is what's keeping your export plug-in from working accordingly.. What's your thought?

EdyJ commented 3 years ago

Probably. I can only see the objects by using the command "Make Instances Real", but then the hierarchy is flat and disconnected. Exporting the file now mostly works and all objects except one are in their correct pose. But no armature nor animation are exported, possibly because of the "Make Instances Real" command.

image

Still, the resulting objects are not suitable for realtime animation in Unity. There's no proper hierarchy, the origins of the moving parts (wheels, suspension) are not configured, and the objects include unnecessary rotations in the Blender file. The same happens when using the stock FBX exporter. Those rotations are properly exported to Unity, but they make no sense in vehicles.

It seems that the Transportation add-on is specifically designed to be used within Blender for animations, cut scenes, CG pictures, showcases, etc but not to export the vehicles for realtime simulation. Using these vehicles in Unity (or any other engine) would require these steps in Blender:

  1. Convert the vehicle to standard Blender objects (i.e. with "Make Instances Real").
  2. Remove unwanted rotations from the objects.
  3. Recreate the object hierachy.
  4. Apply correct origins to the wheels and any other moving parts.
  5. Remove animation, armature, etc (now they're disconnected from the objects).
  6. Export the file to Unity FBX.

Unfortunately there's nothing else I could do here, as that's the way the Transportation tool works.

1NoobDev commented 3 years ago

Thanks a lot for thinking along, muy appreciated! When I get some more time, I will try the method you described. For now I'll stick to exporting as *.obj . That is working fine in Unity. Your Vehicle Physics for Unity runs like a charm with these cars!

I think this 'issue' can be closed, as it's has little to do with your Blender-to-Unity-FBX-Exporter.

EdyJ commented 3 years ago

Cool, good to know!