Sign in to follow this  
Woopert

Just a few questions regarding Blender and Unity

Recommended Posts

EDIT: NEW QUESTION

**NOTE: this has been resolved. I am leaving the question here so others can understand the context of the replies to the question** Is there a way around this perspective illusion I'm experiencing in Blender? The part here is 4.2 meters wide and 4.2 meters tall but it doesn't look like it in Blender. Obviously, if you're going to be 3D modelling it helps to have an accurate visual perspective of what you're actually making. Cheers

259mGCV_wxU6.png

Hi all, I know there are already plenty of answers and tutorials available on these forums and the vast place we call the Internet, but some of my questions are a bit specific so it may be more appropriate to ask them explicitly here... :)

  • Intersecting meshes - is it okay if two objects intersect with each other? Such as an engine bell cutting into the bottom of a a piece? Picture below
  • Collision mesh - better to do so in Blender or one in Unity?
  • Scale - should parts be modelled at 80% scale? It seems all the parts when compared to the numeric units (0.5/0.625, 1/1.25, 2/2.5, etc) have a ratio of 0.8, so should modelling something at 80% scale work at the proper scale? Alternatively, would modelling full scale, but using a rescale factor of 1.25 also do the trick?
  • Texturing - I've watched plenty of tutorials about the UV maps and still can't find how to arrange them. Is it always necessary to mark seams, or only when Blender can't do it automatically? I also was able to get one map somehow, but when I tried making another it deleted the other one and made a new one. Is there an export button once the UV map is finished?
  • Normal maps - are they necessary?
  • Is it possible to put an untextured part in Unity to test if it actually loads in game?
  • Does whether or not the smooth or flat shading is used in Blender affect the actual part in-game/Unity? Or this just how it appears on the display in Blender?

Those are the questions that I've been wanting to know the most, any help is appreciated! Thanks! :)

Edited by Woopert

Share this post


Link to post
Share on other sites

  • Intersecting meshes - is it okay if two objects intersect with each other? Such as an engine bell cutting into the bottom of a a piece? Picture below
    Yes
  • Collision mesh - better to do so in Blender or one in Unity?
    Blender. One of the more annoying things is that most people make cylinders so that the edges are facing N/E/S/W. It should be the quads that face in these directions, because it makes radial attachments easier. Have you ever noticed some radial parts wobbling around when you try to place them?
    Unity collision meshes are ok a lot of the time, but sometimes it generates more faces than is needed, especially if you have a lot of small 3D details. These shouldn't have collisions at all.
  • Scale - should parts be modelled at 80% scale?
    I always model 100%, It makes rescaling in the config a LOT simpler.
  • Texturing - I've watched plenty of tutorials about the UV maps and still can't find how to arrange them. Is it always necessary to mark seams, or only when Blender can't do it automatically? I also was able to get one map somehow, but when I tried making another it deleted the other one and made a new one. Is there an export button once the UV map is finished?
    Yes, you should make seams, and yes you can export the UV in raster and vector format. I recommend SVG. If you use GIMP, you can import it as paths. Raster UVs are a little bit trickier to use because there's a 1px offset.
  • Normal maps - are they necessary?
    No, they just look good.
  • Is it possible to put an untextured part in Unity to test if it actually loads in game?
    I don't know.
  • Does whether or not the smooth or flat shading is used in Blender affect the actual part in-game/Unity? Or this just how it appears on the display in Blender?
    I think so. You should smooth it anyway and use the edge split modifier for sharp edges. Uncheck "angles"

Share this post


Link to post
Share on other sites

Thanks for the prompt response! :)

Do you leave the rescale factor at 1, since you model at 100%? I'm also curious because I'm still wondering if there actually is an 125% increase from the model to KSP.

Another thing, will the models still load if you don't join the components together?

Edited by Woopert

Share this post


Link to post
Share on other sites

You can let your model untextured, it will appear full white in game.

IMHO, forget about the rescale thing (125%), set the unit to 1m, do your model as it should be, you don't have to worry about its size later.

Share this post


Link to post
Share on other sites
Do you leave the rescale factor at 1, since you model at 100%? I'm also curious because I'm still wondering if there actually is an 125% increase from the model to KSP.

If you make models to be 100%, e.g. 1.25 radius, then rescale factor and scale is 1.

Things are a little bit more involved if you want to scale the parts in the cfg and if you use the MODEL module.

scale = 1
MODEL
{
model = KipEng/parts/LPNodes/6hubmodel
scale = 2.0, 2.0, 2.0
}
rescaleFactor = 0.5

This is from my hub mod. It's a halved version of the default hub.

scale has to be 1, unless you want your stack nodes to scale disproportionally.

rescaleFactor is what you actually want the scale to be.

scale inside MODEL has to be 1/rescaleFactor because of reasons.

Share this post


Link to post
Share on other sites

Thanks again :)

I think I finally did the UV map right, I'm trying to make an SRB segment and I got the UV, but don't know how to *properly* export it. I have a PNG but I'm not sure if I did it right, it's kind of a weird color (it's actually gray but looks different on the forums). How would I go about exporting the SVG version of it?

And to texture it, would I just paint over it in Photoshop? I have pretty good experience with Photoshop so I think I could do it. If anything crosses over into the transparency will that mess up the texture?

0SOnoqu.pngxFTT35q.png

Share this post


Link to post
Share on other sites

Texturing. As to UV maps, while the recommendation above to mark seams is always a good habit (especially when doing character models for other games, for example), for the simplest single object shapes, one may use one of the default UV unwrap methods with acceptable results. For me, Smart unwrap usually works. I sometimes select certain regions separately and arrange and scale the islands to my liking until all the faces have been accounted for on the unwrap; prior to saving and exporting from Blender.

Share this post


Link to post
Share on other sites

I usually find it is also a good idea to average island scale [CTRL+A] in the UV pane before positioning your islands

It's annoying to find a texture feature is suddenly larger/smaller somewhere else on the model because their islands aren't the same scale

Share this post


Link to post
Share on other sites

When you click UVs-> Export UV Layout you'll see options on the left. Just pick SVG, instead of PNG.

Working with textures is best done with lots and lots of layers, mostly because it'll be easier to fix things later if you mess something up.

Keep the UV layout as a separate layer, and paint on layers below it. I haven't used PS in a long time, but I think you might be able to lock the UV layer so it's ignored by the tools you use.

I don't know how SVGs are handled by PS but in GIMP you can import them into a separate stack of layers specially dedicated to paths. You can then make them visible, which helps a lot. You'll need to google this, or maybe someone else knows something about this.

  • Like 1

Share this post


Link to post
Share on other sites
When you click UVs-> Export UV Layout you'll see options on the left. Just pick SVG, instead of PNG.

Working with textures is best done with lots and lots of layers, mostly because it'll be easier to fix things later if you mess something up.

Keep the UV layout as a separate layer, and paint on layers below it. I haven't used PS in a long time, but I think you might be able to lock the UV layer so it's ignored by the tools you use.

I don't know how SVGs are handled by PS but in GIMP you can import them into a separate stack of layers specially dedicated to paths. You can then make them visible, which helps a lot. You'll need to google this, or maybe someone else knows something about this.

Got it. Hopefully this is the last question -- how again does the Edge Split work? I've tried looking at tutorials but when I do it nothing actually is smoothed, it looks like it doesn't change anything.

Oh, and one more. Is there an easy way to hollow an object in Blender? E.g., hollowing a cone to represent an engine bell?

Edited by Woopert

Share this post


Link to post
Share on other sites
Got it. Hopefully this is the last question -- how again does the Edge Split work? I've tried looking at tutorials but when I do it nothing actually is smoothed, it looks like it doesn't change anything.

Oh, and one more. Is there an easy way to hollow an object in Blender? E.g., hollowing a cone to represent an engine bell?

The modifiers can only be applied in Object Mode, otherwise Edge Split cuts your mesh along any edges which have angles over a certain threshold into separate faces (they're still adjoining, just no longer connected, i.e. dont share vertices at that edge). Useful if you want to have smooth shadows on certain shapes without it also trying to make a sharp edge also look like a round/smooth transition.

If you have something like an engine bell, you can select the vertices at the edge of the cone, extrude for zero, merge at center and then drag the newly created central vertex up into the bell, but the best way to manage hollow objects is going to vary by part

Example blender workflow

TAB (edit mode)

Z (toggle wireframe)

B (bounding box select)

drag box over vertices

E (extrude)

0 (zero length)

alt+m (merge)

G (move)

Z (along Z axis)

drag vertex up to desired position

Edited by NoMrBond

Share this post


Link to post
Share on other sites

Thanks everyone!

Did I do this UV map right? Or is there a way to warp the curved components to be nice and level to make texturing easier?

And, there are some excess islands on the map, that are part of the model clipped inside with each other (e.g. the engine bells). Are those necessary, and can they be removed safely?

HVKQUCm.png
Edited by Woopert

Share this post


Link to post
Share on other sites

If there are any faces inside a model you can safely remove them.

Conical sections are tricky because how you unwrap them really depends on what kind of texture you intend for it, or what the resolution of the texture is going to be.

-I would leave the UVs as they are right now. This kind of unwrapping means you will not have trouble with texture distortion, and allows you to work with lower resolution textures, for the reasons below.

-If you want straight horizontal or vertical lines you'll have problems, since the only way to make them look good is to either increase the resolution of your texture (while using current UVs), or unwrap the cone section cylindrically, and apply a subsurf modifier using the Simple algorithm and with 2 subdivisions (to remove the distortions). Neither of these solutions is ideal.

If you go for the second way you can dissolve the edge loops (and the corresponding vertices; don't forget) which are created after you apply the modifier, but the vertical edges will need to stay.

Edited by Cpt. Kipard

Share this post


Link to post
Share on other sites

Another question: is it okay if meshes are colliding into each other for the collision mesh? Is there a way to adjust the vertices on the mesh after they're already in place, specifically for the collision mesh? Is there also a way to merge meshes but so they're one, but look like one solid piece rather than multiple meshes joined together?

Share this post


Link to post
Share on other sites

You can make a completely separate (simple) mesh to be the collision mesh in Blender, once you get your part into Unity delete the 'mesh renderer' component of your simple collider (so it doesn't show up as a white shape in-game) and apply the physics component to the collider mesh you have included. Collision meshes need to be convex, but you can include multiple colliders to get something that conforms to your part.

You can join meshes in Blender (select multiple meshes an join them with CTRL+J), but I'm not really sure if this is what you're asking?

Share this post


Link to post
Share on other sites

If you want to join two meshes into a single manifold, then have a look at some Boolean Modifier tutorials.

Multiple colliders in a part can intersect apparently. I've not had any problems with it so far.

Is there a way to adjust the vertices on the mesh after they're already in place, specifically for the collision mesh?

This is a very very basic question. It makes me wonder if you wouldn't be better off spending a few days just watching video tutorials.

Share this post


Link to post
Share on other sites

BlenderGuru has some great video tutorials on different aspects of modeling in blender. There is one I found somewhat helpful with figuring out UV's, it was a video in which he modeled/textures a jet plane. I'll have to look for the option to export as svg as I don't remember seeing it.

Something I'm doing on the current part I'm working on is while in edit mode, I add more shapes. For example with your engine bell you could be in edit mode for the engine it's self, then add the shape. Although another option would be to create the profile of your booster, then use the spin modifier. It's been a while since I've done that so I'm not 100% certain on the exact steps needed to make it work. I did this for a part though and everything was fine except the size/orientation. Once in KSP the part was rotated 90 degrees, so that left/right was actually up/down (top of the part pointing sideways). Eventually I gave in and rotated the part in Blender, and it ended up the right way around in KSP lol. The part I'm working on now though I started as a cylinder, so we'll see how it ends up once in KSP.

I'm still trying to figure out how to smooth things my self. Ahh...edge split works with smooth shading on. ;)

Also trying to figure out how to animate textures (I've been able to animate intensity/emission color), in this case a "progress" bar of sorts. I was originally planning on doing it on the model it's self but I might have to add a plane to the area I want the progress bar and use a sprite sheet thing I saw a tutorial about earlier today.

I've also had problems with size. I modeled my first part to be the size of the small probe cores (0.625m in blender 0.5m) but when it was in KSP it was somewhere between 0.625m and 1m. Eventually I got it to an acceptable size, though still not quite what I was going for but close enough. Will be interesting to see how it goes with this new part (3.75m) I'm working on.

Edited by Sma

Share this post


Link to post
Share on other sites

Gonna piggyback on this thread with some questions.

when you have a scene with multiple meshes, what is the workflow so that they can all share the same UV map? some of the meshes are duplicates of one another, so I would like to align the meshes to overlap one another since they will be sharing the same texturing (viewports, radial attachment endcaps).

Y2dV8xt.jpg

Share this post


Link to post
Share on other sites
when you have a scene with multiple meshes, what is the workflow so that they can all share the same UV map? some of the meshes are duplicates of one another, so I would like to align the meshes to overlap one another since they will be sharing the same texturing (viewports, radial attachment endcaps).

Share this post


Link to post
Share on other sites

Thanks.

After meshes are joined, is there still some way to hide segments to make it easier to select mesh elements? similar to how the individual layers could be hidden by clicking the visibility in the outliner.

Share this post


Link to post
Share on other sites

This kind of question would be quicker answered by google, but ok.

Select Faces

Press H to hide

Press Alt+H to unhide everything.

Share this post


Link to post
Share on other sites

Well, the question was more about asking if there was some "1-click" method. So if a model had 5 cylinder components and then joined, and you want a quick way to isolate and only show cylinders 2 and 4 within the joined group. I'm guessing at that point it may be better just to keep everything as separate entities.

But going back to the UV mapping. If having separate meshes, would this be the method to setup the texture image file?

-create UV mappings for each mesh

-export the uv mappings

-create an image file where each UV mapping is brought in as separate layers, and move things around so they fit in the boundaries.

-Save this new image, and then load it into blender fir each mesh

-Shift around the UV mapping as needed.

geu54Th.jpg

Share this post


Link to post
Share on other sites

I would never do that. It's best to keep all the mesh together, and unwrap together so that you don't waste texture space. If you want to select a separate mesh inside a single object you can hover your mouse over it and press L

Share this post


Link to post
Share on other sites

I have no idea what you're asking about. Judging by the axis arrows in the bottom left corner, your view is aligned more or less.... But you're saying that trapezoid is actually a square? This makes no sense.

Press 5 on your numpad, maybe you just want an orthographic view.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this