Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1075919 Posts in 44152 Topics- by 36120 Members - Latest Member: Royalhandstudios

December 29, 2014, 03:21:42 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Blender hates my guts and the feeling is mutual.
Pages: [1]
Print
Author Topic: Blender hates my guts and the feeling is mutual.  (Read 917 times)
Rat Casket
Level 10
*****


i can do what i want

TheRabbitInferno
View Profile WWW Email
« on: October 19, 2012, 10:41:57 AM »

When exporting an object from Blender, and importing it into Unity, I get some very strange results. I have since figured out why some deformities were happening, but now this is even more obnoxious.

When importing, my objects have strange shadows and material properties and I don't know why.



Object on the left is a cube made directly in Unity. The right, in Blender and imported. No matter what I do I can't get this to change. If I had to guess I would assume its bringing over the grey texture from Blender and it has goofy properties. I really only need the wireframe and can add my materials in Unity, but I don't know if I can do that or HOW to do it.

These imported objects just aren't wanting to cooperate with my lighting and its making me very sad.
Logged

zacaj
Level 3
***


void main()


View Profile WWW Email
« Reply #1 on: October 19, 2012, 10:44:25 AM »

I'd guess Blender isn't assigning separate vertices (and therefore normals) to each face of the box
Logged

My twitter: @zacaj_

Quote from: mcc
Well let's just take a look at this "getting started" page and see--
Quote
Download and install cmake
Noooooooo
Rat Casket
Level 10
*****


i can do what i want

TheRabbitInferno
View Profile WWW Email
« Reply #2 on: October 19, 2012, 10:46:27 AM »

How would I go about doing that? To create that particular cube, I just created a cube and exported it. Nothing else was changed.
Logged

zacaj
Level 3
***


void main()


View Profile WWW Email
« Reply #3 on: October 19, 2012, 10:51:09 AM »

No idea for Blender, never even figured out how to place a cube :/  Could you upload the exported file (preferably obj format)
Logged

My twitter: @zacaj_

Quote from: mcc
Well let's just take a look at this "getting started" page and see--
Quote
Download and install cmake
Noooooooo
Rat Casket
Level 10
*****


i can do what i want

TheRabbitInferno
View Profile WWW Email
« Reply #4 on: October 19, 2012, 10:55:11 AM »

http://www.mediafire.com/?j6k06daq532od99

here you go

edit: exporting it as obj actually solves the problem. can obj files store animation and such?
Logged

Klaim
Level 10
*****



View Profile WWW
« Reply #5 on: October 19, 2012, 10:57:43 AM »

Yeah it's neither a Blender or a Unity problem, it's obviously an exporter problem.
Logged

http://www.klaimsden.net | Game : NetRush | Digital Story-Telling Technologies : Art Of Sequence
zacaj
Level 3
***


void main()


View Profile WWW Email
« Reply #6 on: October 19, 2012, 10:59:54 AM »

Looking at your obj it's not even exporting the normals.  Definitely something wrong with your export settings
Logged

My twitter: @zacaj_

Quote from: mcc
Well let's just take a look at this "getting started" page and see--
Quote
Download and install cmake
Noooooooo
Rat Casket
Level 10
*****


i can do what i want

TheRabbitInferno
View Profile WWW Email
« Reply #7 on: October 19, 2012, 11:03:28 AM »

Okay cool, I will see what I can find out. Thanks so much guys.
Logged

Wilson Saunders
Level 5
*****


Nobody suspects the hamster


View Profile WWW
« Reply #8 on: October 19, 2012, 11:06:06 AM »

Have you tried fiddling with the material settings on the object once it is in Unity? I have had blender to Unity imports go wonkey in a different way before. It sorted itself out after I applied a new material over the default one generated by the blender import.
Logged

Play my games at http://monkeydev.com/
Rat Casket
Level 10
*****


i can do what i want

TheRabbitInferno
View Profile WWW Email
« Reply #9 on: October 19, 2012, 11:15:02 AM »

Yeah dropping a new material doesnt seem to change anything. Most of the time it wont even carry over a texture, it will just change the color.
Logged

Fallsburg
Level 10
*****


Fear the CircleCat


View Profile
« Reply #10 on: October 19, 2012, 11:54:41 AM »

I think Unity has an importer setting to recalculate tangents and normals, try that.
Logged
zacaj
Level 3
***


void main()


View Profile WWW Email
« Reply #11 on: October 19, 2012, 11:57:05 AM »

Are you using obj to transfer the files to blender or a different format?
Logged

My twitter: @zacaj_

Quote from: mcc
Well let's just take a look at this "getting started" page and see--
Quote
Download and install cmake
Noooooooo
ChevyRay
Level 2
**



View Profile WWW Email
« Reply #12 on: October 19, 2012, 11:59:27 AM »

Hey Rabbit!

I had the same issue with importing, but eventually figured it out. There are a few solutions:

1) Fallsburg's solution: in the model settings, tell Unity to recalculate tangents & normals, and it will rid you of the problem. But you have to do this with every model.

2) Add an Edge Split Modifier to the object in Blender (this is the method I use):


3) As you've figured out above, using OBJ also fixes it, and is probably the best solution (I hear it's freakydeaky bad business to use blender files within unity)
« Last Edit: October 19, 2012, 12:08:30 PM by ChevyRay » Logged

Unity Patterns - Tools & Resources for Unity Developers
FlashPunk - 2D Flash Game Engine
BorisTheBrave
Level 10
*****


View Profile WWW
« Reply #13 on: October 19, 2012, 02:23:46 PM »

From what I can tell, edge-split modifier is the way to go.  If you set the shading mode to smooth, then you'll see the same (ish) shading in Blender and Unity.

.obj's do not support animation, so that is not preferable. And using unity calculated normals doesn't let you control what is sharp or not (which you can do inside Blender with Mark Sharp).

Btw, for many models, you are unlikely to want sharp edges in your model. You'll discover if you add a light to your scene as is, then both the unity cube and the "weird" blender cube look fine. If anything, the smoothed cube looks more realistic. Here's both under a point light:

Logged
Rat Casket
Level 10
*****


i can do what i want

TheRabbitInferno
View Profile WWW Email
« Reply #14 on: October 21, 2012, 12:06:43 PM »

I think Unity has an importer setting to recalculate tangents and normals, try that.

Can you give me a link to some documentation on that?
Logged

Fallsburg
Level 10
*****


Fear the CircleCat


View Profile
« Reply #15 on: October 22, 2012, 08:29:27 PM »

Well, here's the documentation I was able to find.
Logged
bateleur
Level 10
*****



View Profile
« Reply #16 on: October 23, 2012, 02:29:17 AM »

Can you give me a link to some documentation on that?

Unity's docs don't have a walkthrough of these settings, but it's really easy. Goes like this:

* Place your .blend file into your project hierarchy somewhere.
* from within Unity, select it.
* In the Inspector, look down the various headings until you find "Normals & Tangents".
* Normals will probably say "Import". Change it to "Calculate".
* I think Tangents starts on "Calculate" anyway, but if not then change that too.

Incidentally, it's worth making sure you understand how normals, lighting and UV mapping interact before concluding that any of Blender, Unity or exporting are not working correctly. ChevyRay's "edge split" solution isn't fixing a bug so much as it is requesting that Unity add vertices to ensure that different faces don't have to share normals. "Real" cubes don't share normals, which is why this sometimes looks better, but as Boris points out that's not always the case so you should see this as a design decision rather than a bugfix.

(I hope that doesn't come across as condescending. I put it that way because this stuff horribly confused me six months or so ago when I ran into it. Indeed, I still hate pretty much everything about how UV mapping works.)
Logged

gnat
Level 1
*



View Profile WWW Email
« Reply #17 on: October 23, 2012, 06:50:57 AM »

Your cube's polys are set to smooth shading. You need to change it to flat shading.
Logged

LAN Party List - The definitive LAN party list. Also Game Jams, etc.
GitHub
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic