Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

A beginner needing help with Unity AND Blender (simple mesh and texture import)

Discussion in 'Getting Started' started by Tset_Tsyung, Jan 21, 2016.

  1. Tset_Tsyung

    Tset_Tsyung

    Joined:
    Jan 12, 2016
    Posts:
    406
    Good evening forum members,

    So I'm a beginner in this whole wonderful world of Game Development. I'm learning Unity AND Blender concurrently (yes I know it's best to perhaps master 1 first... but I find that muddling through seems to work best for me).

    However I'm trying to make a simple(?) mesh which is a stretched box with holes in it (for balls to fall through) with a nice wood texture. However I can't seem to 'unwrap' it in blender properly.

    1. I get a message saying "Object has un-uniform size etc." And then can't apply a simple texture to it in Blender. It only shows up as a bland colour in the render (Previously could get this to work on simple primitive shapes - worried it's the high-poly needed for the holes... - used boolean)

    2. When I've imported it to Unity as an .fbx, I apply the texture and it will only show it in each individual face, not as a nice overall image over the mesh.

    Now I'm aware that I'm so new that it hurts, and that I've probably fubar'd this up quite well... If no one has any idea how to rectify this, do you know of any tutorials/documentation that would help a self-taught programmer/game developer wannabe? Have gone through the basic theory lesson videos on textures and materials in this learn section, but because I'm using 2 different programs I'm not sure where the problem lies...

    Will gladly supply more infor/screenshots/files if you would like to see them.
     
  2. jhocking

    jhocking

    Joined:
    Nov 21, 2009
    Posts:
    813
    If you're getting an error message and the texture looks wrong in Blender, then obviously the problem is what you're doing in Blender.
     
  3. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,510
    I want to start off by saying Welcome, and that almost everything about this paragraph turns me on.

    I had a hell of a time figuring out Blender initially, but with perseverance, it can be done. I think I was looking at a lot of videos on Blender Cookie, but they've since switched to having more of their content behind the paywall, and I think the UV mapping tutorial is a victim of this. Nonetheless, there are lots of good tutorials out there, so just keep going through one after another until it clicks.

    I don't recognize the error you're describing, though if it's just a holey box, it shouldn't be that high-poly. Can you post a few screenshots showing what you have going on?
     
  4. Teravisor

    Teravisor

    Joined:
    Dec 29, 2014
    Posts:
    654
    Non-uniform, actually. I'm sure it's http://blender.stackexchange.com/questions/14524/non-uniform-scaling-during-uv-unwrap-what-is-this. Oh, and having non-uniform scale in blender gets exported to unity, so not fixing it might break something if you're playing with Transform.localScale in Unity or with something that depends on GameObject scaling. I've had really big problems when I created a character mesh with blender object scale not set to (1,1,1).
    This means each of your meshes' faces have UV coordinates same as a default face-to-texture unwrap (usually, for quads, that means your UVs are (0,0), (1,0), (1,1) and (0,1)). Usually this happens when you didn't make UV unwrap or it failed (see above link - that might be the reason).
     
  5. Farelle

    Farelle

    Joined:
    Feb 20, 2015
    Posts:
    504
    little hint: never resize an object in object mode, always resize a whole object in edit mode!
    It's something that I was hearing alot in blender tutorial videos and apparently that can cause alot of issues. and as stated in Teravisors link, you have to apply the size to the mesh to make it uniform again by ctrl+A >scale, it's applying the new mesh scale (same as freezing in maya and 3dsmax)

    Also did you make sure to apply the boolean modifier to the mesh before trying to make the UVs? (with apply I mean that its kinda baked into the mesh and not visible as a modifier anymore)
    cause the way you describe it, it sounds as if you got automated UVs for the case that a model has none when importing it into unity
     
  6. Tset_Tsyung

    Tset_Tsyung

    Joined:
    Jan 12, 2016
    Posts:
    406
    Wow, thanks for the answers all, I really appreciate it.

    @jhocking - That's what I thought, however as it seemed it was more of an 'FYI' than an actual error, I thought I'd check with you guys - glad I did now. Thanks for the input, it's good to know I was on the right track ;)

    @Schneider21 - LMAO, I totally didn't realise I said all that and I'm usually the first to make innuendo puns... obviously Blender and Unity have sapped me of my power, lol. I realised when I read your comment that I was a little trigger happy with the subdivide - think I'll try again from scratch and reduce as many verts as I can.

    @Teravisor and @Farelle - That all makes perfect sense. As stated I'm going to start the mesh again, but I'll check out some more tutorials on UV unwrapping to make sure I followed the correct procedure. Between the wrapping, scaling and the faces I think it'd be best to start all over - it how I learn best anyway, ;)

    I'm out for a bit this morning but I'll post the result of these recommendations later so that anyone else having the same problem can see what it was.

    Again, Thanks all, it's REALLY appreciated!
     
    Schneider21 likes this.
  7. Tset_Tsyung

    Tset_Tsyung

    Joined:
    Jan 12, 2016
    Posts:
    406
    Well I think I've sorted.

    First off, I've realised that I need to be using triangles and not squares when I'm importing as this kinda throws off the UV coords... I think.

    Basically I started again using a plane and circles. Left the board as a plane, attached cylinders to the hole BUT LEFT THEM AS SEPARATE OBJECTS, and also did the same for a border to add visual depth to the plane. As these were seperate objects I could seam, unwrap and assign textures within Unity more easily.

    Still not sure I'm doing things right as it only seems to send across a bump map texture and not the normal Textures - but this is easily rectified withing Unity itself.

    I still have much to learn.

    Thank you for all your help everyone! Really appreciated it.

    Mike
     
  8. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,510
    I'm far from an expert, but I believe this is incorrect. Everything I've seen says to keep things as quads. Unity does a fine job converting them to triangles itself, and if anything you'll have much better luck with UVs keeping quads.

    Try starting very simple.
    1. Create a 64x64 texture with 4 solid colors. Save that as a PNG.
    2. In Blender, create a cube. Just a plain old cube. Go into Edit Mode, select all, and hit U to unwrap. Select Smart Unwrap and use the default options.
    3. Switch your editor to UV Editing mode, and try positioning the UVs so that each face of the cube is a different solid color (with 2 dupes, obviously).
    4. Exit edit mode. Export your model as an FBX.
    5. Import the model and texture into Unity, and assign the texture to a new material, and apply the material to the cube object. If everything worked, you know how to UV unwrap!
     
    Tset_Tsyung likes this.
  9. Tset_Tsyung

    Tset_Tsyung

    Joined:
    Jan 12, 2016
    Posts:
    406
    Thank you very much Schneider21, I'll give that more of a bash in a bit, just to get it nailed home. Thanks again ;)