Blender to Unity preview rotation - rotation

When I import a model made in Blender to Unity the preview image rotates, when I drag it into the editor it's rotation is fine. It only happens though when the model consists more objects and I join them with CTRL+J in Blender. Let me show an example. I made this house in a few clicks, for the "seperated" one I left the roof as an individual object and for the "joined" one I hit CTRL+J so that they became one object. Here is the image. The "seperated" shows up fine while the "joined" rotates in the preview. I tried to import it straight to Unity as a blend file and also exported it as an fbx from Blender but the result is the same. For more complex models which consists of a lot of objects I like to join them so they appear as one mesh. I haven't find any fix for this, I hope someone can help. I use Unity 5.3.2 and Blender 2.76b.

Maybe you haven't noticed that the up axis for Unity and Blender is different.
In Unity it is 'Y' and in Blender it is 'Z'.
So when you import any model from Blender Unity sets Rotation x = 90.
It's not a big deal, just group it to fix it.

Related

How to fix image texture not transfering to Unity from Blender

I textured an object in Blender because it wouldn't texture properly in Unity, and then imported the object and texture to Unity.
I don't know how to fix this, I'll put both pictures here.
Blender Texture Before Import
Object In Unity
Okay, so based on your screenshots..
You're going to select everything then add a modifier called "Solidify", then set this to something very small like .03. (Unity doesn't like objects that are just planes).
double check all your normals are facing out. Let me know if you don't know how to do this...
Go into edit mode select all edges, then right click, select "mark as seam".
Open UV editor window (should be split screen with Edit mode on one side, UV view on the other). In the Edit side select all, then go to UV dropdown menu and click "unwrap". You should then see your object unfolded into flat planes over on the UV window side. There's different unwrap options, like smart UV unwrap, etc. I think just "unwrap" has worked for me, but play around and there may be something that shows your object shapes in a less distorted way..
At this point, since your pattern is basically repeating. If you export the OBJ file and take it into unity, and you add the image file (make sure it's dimensions are perfectly square) it should receive the image file as an Albedo texture much better than in your screenshots. You can play with the 'tiling' and "X/Y offset" till it looks right (you might face issues with rotation though.
BUT
If you want to line it up very specifically, you can export the UV layout as a png from the UV window in blender. Then use photoshop or another photo editor to change/rotate and arrange your texture so the sides line up properly. In blender in the Edit window (assuming you still have both UV + editor open) when you select a side it will highlight in the UV window the corresponding flat plane, based on this you should be able to figure out what should be rotated up/down, etc. Then when you change that 2d image and drag it into Unity, it will adjust and wrap around the object.
I'm pretty new to both, but the advice I've been given is to not do the texturing in blender, but instead to do it in Unity.
This is a 10-month-old post but incase anyone is curious or struggling the same, Blender exports models with a scale of 100 so you need to scale up the tile of the material (in material settings) to see it.
This is a bad solution however because then you are not working with objects on a scale of 1 so you actually want to check "Apply transformations" when exporting the FBX model in blender

Exported Blender Model "faces" the wrong way When Importing to SceneKit

I've bought a 3D model form TurboSquid, and I need to scale it down to an exact size. I'm a complete newbie when it comes to 3D modelling and Blender but I've managed to find enough tutorials to do this and export the file.
The problem is that I can only get it to export a view from the corner of the object, which I problematic as I want to line-up several of the objects together as part of my ARKit app.
I'm exporting as a Collada .dae file, selecting "Selection Only" as I only need the model, no lights or camera (is this right?).
Is there any specific way it needs to point in Blender? Would aligning it with the camera help (even though I'm exporting the object only)? Can I select a side to be the "front"?
I can angle it somewhat correctly in the SceneKit Editor but I'd prefer to do it in Blender.
I can't remember where I got this or I would happily give credit, but it's how I got my Turbo Squid models to work. I needed to flip mine around and fix the Y-Up axis, but you might be able to fix your rotation with this.
Make sure everything is selected and press R (for rotate). Just like with scaling, you’ll find that mouse movement rotates the selected objects. But we want to do a particular rotation: 180 degrees around Blender’s Z-axis. To do that quickly, assuming you already pressed R, press Z, then type 180, and press Enter. From my experience, doing this rotation will correct the orientation of your model.
Just as with scale, to apply rotation permanently, press Ctrl+A. In the menu that pops up, click “Rotation”.
Set Y-Up for Scenekit if you need it.
/Applications/Xcode.app/Contents/Developer/usr/bin/scntool --convert fighter0.dae --format c3d --output out.dae --force-y-up --force-interleaved --look-for-pvrtc-image

Why do two faces appear invisible in ThreeJs?

I've an object in Blender. Because I want to do some UV-unwrapping using ThreeJS (see here) I determined that I need merge two of the sides to correctly unwrap.
So before exporting the .blend as a .obj object I selected the Tris to Quads face option to create a square face for the two sides as opposed to it being made up of two triangles. Here's what it looked like in Blender:
But when I import the .obj and .mtl file into ThreeJs I get this:
Is this a problem to do with me not updating the material being added to the new object?
The handles appearing white makes me think this is the case. If so how can I go about fixing it?
When I see something like this, the first thing I usually do is to set the material to side: THREE.DoubleSide. If that helps, the problem has to do with the normal-directions (so the face is actually there but isn't rendered because it is facing away from you).
To fix this, you should try the following:
In blender you can enable displaying of normal-directions in the right-hand menu (select "Face normals in section "Mesh Display").
You should now see if any of the normals are pointing inwards/in the wrong direction.
There is an automatic fix that works well for properly constructed meshes:
select object and switch into edit-mode (<Tab>)
select all vertices (shortcut &ltA>)
via menu "Mesh" > "Normals" > "Recalculate Outside" (shortcut <Ctrl>+<N>).

Unity animation translation error

I am having an issue in unity. I have an animated model made in blender imported into unity. When the scene starts the model is the correct size and is at 0,0,0. When trying to use a java script to play an animation the model moves about a meter and scales by about half, the animation does play on the small model. The model was made in blender and is not anything out of the ordinary, the animations play in blender with out any issues. It was imported as a blender file not an fbx. Trying to import it as an fbx produced too many issues. The import did not cause any issues but two things of note: the rig was imported with -90x rotation and the animations can only be used as lagacy. The java script is not complicated it is only using "animation.CrossFade( "english_hook" );" or any of the other animations. I have tried to see if anyone else on the internet has seen this issue but either they ave not or I am not searching for the right problem. I am fairly new to unity and have moderate exprience in blender. Has anyone seen this kind of issue, know how to fix it or have any ideas?
Are you using Unity4? You might have to mark your animation as legacy, open your imported model in unity inspector, select "Rig" tab and set your animation to legacy.

Maya Mel Scripted Animation Not Animating as FBX

I've acquired a great quad model. I skinned and animated it to a rig build by a
Mel script. It works great as far as editing the animation using sliders and parameters
in Maya. When I export the file as an FBX file to Unity3D, it does not animate. Is something
being lost in the translation from Mel to the rig? Unity needs a boned rig, is this procedural rig not the equivalent of a rig built and animated with the skeleton tools in Maya? I've check that I have a 'Reference' folder, I've set keys, changed root name to "Hips".
Thanks for any insight on this question.
dDuane
If you are transferring the file with no errors and there is no animation then there are three issues to look at.
First, you may have accidentally not exported the keyframes. Make sure the box is checked to export animation on the FBX export UI.
Second, it's possible that the object that contains the actual keyframes is not being exported. When you animate using the MEL scripted GUI, find out where the actual keyframes are on the rig and make sure that object is exporting with the rest of the character.
Third, the object might be transferring fine but depending on the rig setup the connections/constraints/whatever might not be working or supported in Unity. You might consider baking the animation to the skeleton before transferring to the engine. To do this, select the skeleton, click [Edit -> Keys -> Bake Simulation].
I don't know what Maya you are using, but I've always used 2010. This is the workflow that we used for a small unity 3D game project:
Export all of the
animations in one scene as a .fbx. Be sure you just select the geometry (it
usually helps to have it all grouped, but if you can't for some reason that's
okay) and hit export selected.
These FBX export options should be checked:
Geometry:
Edge smoothing,
Tangents and Bi-normals
Animation:
Animation,
Bake Animations,
Bake Animations,
(range of animation),
step = 1
Deformed Models:
Deformed Models,
Skins,
Blend Shapes (if using these),
Curve Filters,
Resample as Euler Interpolation,
Input Connections,
Instances to Objects,
Referenced Containers Content (if using any references),
FBX File Format
Binary
FBX200900
When you bring this into Unity, set animation generation
to "store in root." If all of your
animation is in this one file (which it should be). The "split
animations" box should be checked and define the names and range of these in the
chart below. When you eventually create an animation blending script, drag
and drop it on the animation object within the player prefab, not the prefab
itself.

Resources