Jump to content

Question on part model orientation


Recommended Posts

Edit: Sorry if I started the thread in the wrong part of the forum. Wasn't quite sure where exactly was appropriate.

Greetings,

I've been making some models for parts to KSP recently, but have noticed a rather odd thing.

The type of part I'm working on is a surface attachable part. The main question I have is the proper orientation/facing inside unity.

Basically, I've noticed that to have the part face 'away' from the part attached to it needs to be facing the '-Y' axis? (See images)

If facing +Y it faces 'inside' the object instead.

[blender 2.71]

Blender_02.jpg

[unity 4.3.4]

Unity_01.jpg

[KSP 0.9]

KSP_01.jpg

Is this correct? And if so, will this orientation create issues with other parts like lander legs?

Just want to make sure I'm not doing something incorrectly or that could create a future bug.

Thanks for your time :).

Edited by Udsahn
Link to comment
Share on other sites

In blender rotate your part x = 90, apply rotation (rotation x/y/z: should all become zero), then rotate part x = -90, part should then appear with the same orientation in game as it does in blender

Basically you always want rotation x = -90 for the root part of your hierarchy for going into .blend > Unity > Export to KSP

Edited by NoMrBond
Link to comment
Share on other sites

Is what correct? You decide how you want it oriented. If that's how you want it then it's correct, if not then it should be simple to work out how to rotate it.

Basically I wanted to make sure that it's correct to have that orientation. Every other tutorial or example I've seen has had it completely different unless that changed recently.

The other reason is because things like landing gears or engines wouldn't be facing a specific direction (down -Y for instance).

In blender rotate your part x = 90, apply rotation (rotation x/y/z: should all become zero), then rotate part x = -90, part should then appear with the same orientation in game as it does in blender

Basically you always want rotation x = -90 for the root part of your hierarchy for going into .blend > Unity > Export to KSP

Interesting, although in text one would find it odd because that rotation seems a bit counter productive since it ends up in the same rotation in the end (Not in blender atm). Guess it has to do with how Unity or KSP sees it though. I'll give it a try later in any case :).

Thanks.

Edited by Udsahn
Link to comment
Share on other sites

Long story short, Unity (and KSP) uses a different coordinate system from Blender:

Blender_to_KSP_Co-Ordinates.png

If you're using the Blender prefabs for Unity, Unity will automatically orient the part correctly for you.

Link to comment
Share on other sites

If you're using the Blender prefabs for Unity, Unity will automatically orient the part correctly for you.

I'm exporting to .FBX and importing to unity that way. That was how it was recommended from what I read.

Regular parts that are a part of a stack seem to easily work with no real need for adjustment. I'm just a little unsure why anything that's surface attached needs to be oriented differently (Towards '-Y' to jut out away from the part it's attached to, else it goes inside it). The other thing I've noticed is that it seems using part symmetry will mirror along one of the axes in the VAB or SAB. Not sure if it's something that can be avoided, but that's a different thread entirely :).

Link to comment
Share on other sites

I'm exporting to .FBX and importing to unity that way. That was how it was recommended from what I read.

I never needed to export to .FBX - the essence of Blender prefabs for Unity Editor 4.2+ is that you can drag the BLEND file directly into Unity, and it will handle the importing for you, as well as correcting the orientation as needed.

Link to comment
Share on other sites

I never needed to export to .FBX - the essence of Blender prefabs for Unity Editor 4.2+ is that you can drag the BLEND file directly into Unity, and it will handle the importing for you, as well as correcting the orientation as needed.

Doesn't work for me. When trying to save/move a .blend file to unity assets it gives me this:

Blender could not convert the .blend file to FBX file.

You need to use Blender 2.45-2.49 or 2.58 and later versions for direct Blender import to work.

I'm using Blender 2.71. Maybe I'm missing something?

Link to comment
Share on other sites

Doesn't work for me. When trying to save/move a .blend file to unity assets it gives me this:
Blender could not convert the .blend file to FBX file.

You need to use Blender 2.45-2.49 or 2.58 and later versions for direct Blender import to work.

I'm using Blender 2.71. Maybe I'm missing something?

I have Blender 2.70a and Unity 4.6.0f3, although the no-FBX prefab system had always worked for me as far back as Blender 2.6x.

I saved my Blender models in a subfolder under the Assets directory, and in Unity, used the Project window browser to find the .blend files. Not only am I able to directly import them without the intermediary FBX conversion, but I can also tweak import settings (tangents, normals, materials). Furthermore, if I make changes to my original Blender model, the prefab system automatically updates its counterpart in Unity.

Link to comment
Share on other sites

Am I maybe mistaking what you mean by 'prefab'? Is it a separate plugin for Unity? I just downloaded version 4.6.0f3 like you and it still won't import with the same message. :)

So you know, I placed the .blend file in my unity project (Under assets\models in my case (See image)), right-clicked on it and hit 'reimport'.

Unity_02.jpg

Edited by Udsahn
Link to comment
Share on other sites

Very strange. I guess I'll just have to stick with using .FBX since I'm stumped at what it's missing. Thanks for your time and effort anyhow :).

Trying to drag the .blend file into the 3D view for me comes up with a restriction symbol (circle with a line through it).

Edited by Udsahn
Link to comment
Share on other sites

Discovered what it was! It actually was that particular version of Blender. I decided to download and try the slightly older 2.70a version you used and it worked flawlessly. Guess that means that if this ever happens in the future to look at the version of Blender before anything else. :)

Suppose it also means if anyone else has this issue best let them know to check their Blender version.

For future reference, 2.71 doesn't auto import into Unity, but 2.74 (the current latest version) does.

Edited by Udsahn
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...