sparhawk@Posted: Tue Nov 16, 2004 10:57 am :
I'm trying to use Blender to create simple objects. Nothing fancey just a bowel of similar easy stuff. The problem I have is that my object never shows up in D3 because of some error messages.

So I was wondering if there is a step by step tutorial somewhere that explains how to create such a simple object, texture it and put it in-game.

I was looking through the tutorial section but it seems that all these tutorials are aiming at users already proficient with Blender.

I know how to creat the objects in Blender, but what I haven't found is how to triangulate them (Do I even need to do this in order to get it into D3?) and I can't come to terms with the UV mapping.

So any help would be appreciated.



kat@Posted: Tue Nov 16, 2004 12:29 pm :
I was working on a tutorial but as you can imagine it takes more time than expected.

The basic steps
- make your model however you need
- UVWmap it
- Triangulate (Ctrl+T : Alt+J return selected triangles back to a quad)
- Export - if you use the ASE USMscript (the UnrealT export script) make sure you 'Apply size/Rot' to the mesh before export, do this with Ctrl+A (or look in the 'MESH' menu for more options). You need to do this to 'fix' the rotation of the model otherwise the exporter will flip the model back to the 'base' orientation. It's also a good idea to center the mesh center of the grid so that the export process places the origin point of the model in the center of the mesh. What this means is that when you place the model ingame you won't run the risk of buring the origin point and causing errors

I'll double check the above once I've switched on my main box but the above should get you started.



sparhawk@Posted: Tue Nov 16, 2004 6:46 pm :
kat wrote:
Triangulate (Ctrl+T : Alt+J return selected triangles back to a quad)


That removed two of the errors. Now I still have a warning that teh material can not be found. But how can I assign a material to a blender file?



kat@Posted: Tue Nov 16, 2004 7:51 pm :
when you look at the mesh in the veiwport is it grey? or does it have a colour?

If it's grey then yes you need to assign a material and texture.

Select the mesh and click on the shading button in the *buttons* viewport (usually at the bottom of the default screen layout) that looks like a little globe - if you can't see it hit keyboard F5 and you should see the buttons window change to the 'shading' buttons.

When you do this by default it *should* be showing a grey square on the left (probably grey in colour by default) and in a tool panel next to that with a series of sliders. These are the material tool panels (you might notice a little red globe button is active above the general tool panels) from which you can control the underlying colour of the material. If you want, change the colour by adjusting the RGB sliders to something appropriate to the object.

When you've done this you need to assign a texture to the mesh.

To do this we need to be in the texture buttons window, press F6. You'll see an image panel on the left and a couple of other tool panels... the one you want is called image (it says 'image' in the header of the toolbar), there's a file browse input field in this tool bar which you use to find and then link a texture to the material. Browse to where ever your texture is.

Once that's loaded you should see the material window change and show you texture 'combined' with the underlying material colour.

The next step is to assign the texture to the mesh (Blender doesn't do this by default), we need to be in 'FACE' select mode for this.

Select the mesh and hit F (this toggles you into/out off face select mode), the mesh will change visually to indicate you're now in FACE SELECT mode. What you basically need to do next is select *all* the faces on the mesh by hitting keyboard A (toggles select all/deselect all) and go into the UVWmap viewport/window (Shift+F10). You probably won't see anything other than a dark grey background but somewhere there should have appeared a text menu (view, select, image, etc..) and next to this is a drop down list (it will probably look like to arrows pointing up and down on top of each other at this point) if you select that dropdown it should now list the texture we assigned to the material. If you've previously UVWmapped the mesh selecting the texture will then place it on the mesh and in the viewport you'll see the UVWmap overlayed ontop of the image. The texture and material has now been assigned to the mesh.

But....

We need to make sure that every face on the mesh has copied the properties of the 'controlface' (the control face is the one that's highlighted by a triangular gizmo - a red, green and default coloured outline around the polygon). If we don't do this next step you have untextured or mis-aligned UVWmap showing when you finailly export the mesh.

Toggle back to the 3D viewport (Shift+F5) and make sure the mesh is still selected and that every face is selected as well (just hit 'A' to deselect and then reselect everything) and then go right back to your EDIT BUTTONS window F9. You need to find the texture face tool panel (far right by default). On here are a couple of buttons, make sure 'TEX' is selected and then hit 'Copy VertCol' and 'Copy DrawMod'. This basically sets the properties from the control face onto all the other faces of the model. Once you've done that exit FACE SELECT mode (keyboard F) and you should now find your model is textured.

YOu should be able to export the mesh now.!

It seems complicated when you 1st get into it but once you get used to what's going on it's actually pretty breezy (easy) to do, much like the whole of using Blender.

I'm writing this off the top of my head so there *may* be one or two errors, just post back if there are. You can now see why writing a tutorail for this stuff take a while..!



sparhawk@Posted: Tue Nov 16, 2004 9:54 pm :
kat wrote:
when you look at the mesh in the veiwport is it grey? or does it have a colour?


I have the textured object in the viewport and the UV map seem also to be applied. When I look at the texture screen then I can see the twisted thing overlayed on the texture, which is probably the UV coordinated mesh.

The ony thing that is strange, though is, that when I look at the object it is textured on the outside (it is a bowel). But when I look at it from above to the inside, then I can see straight through and I can only see the lines for the mesh.

And when I try to load it into D3 there is nothing there and I get a warning message:
WARNING: couldn't load image: material



jay pettitt@Posted: Wed Nov 17, 2004 12:37 am :
sparhawk wrote:
The ony thing that is strange, though is, that when I look at the object it is textured on the outside (it is a bowel). But when I look at it from above to the inside, then I can see straight through and I can only see the lines for the mesh.l


That sounds like normals. Normally (geddit) polygons are one sided. The side that appears solid is the normal side. It isn't uncommon for the direction of normals to get all muddled, so some face outwards and some face inwards. If that happens you need to normalise your normals.

If your bowl (it's spelled bowl by the way ;) ) is just one wall of polygons thick, or if some of the normals are pointing the wrong way then you can expect the bowl to be a bit wrong. If the bowl has an inside wall of polygons and an outside wall, and all the normals are facing the proper way then you can expect to see a solid bowl.



kat@Posted: Wed Nov 17, 2004 1:36 am :
As Mssers Petitt mentioned you've got a mesh there that's only a single layer of polygons thick. If this was something just for use in Blender you could add 'twosided' to the material and it'd render both inside and out. But as we're using this in D3....

...you'll need to do is one of two things.
1 - create an 'inside' layer for the bowl (as petitt mentioned above)
2 - create a material in D3 that uses the twosided parameter to force surface draw of the 'inner' faces.

Depending on what the polycount is like for the mesh as it is at the moment I'd go for method '1' as the shader parameter 'twosided' switches of shadow volumns so the object won't cast dynamic shadows when I light is shone at it.

As for the missing material... you'll need to make a material file (a *.mtl text file) that contains information about the textures for the model, it's this material that you reference in the *BITMAP part of the ASE file (you'll clearly see this when you look at the file in notepad) and NOT the actual texture you used in Blender.

The following material can be used if you want a basic 'material' applied to the model ingame.
Code:
purgatory/purgator/doom/base/models/sparhawks_models/bowl
{
  qer_editorimage models/sparhawks_models/bowl_of_porridge.tga
  diffusemap    models/sparhawks_models/bowl_of_porridge.tga
  bumpmap      addnormals( models/sparhawks_models/bowl_of_porridge_local.tga, heightmap( models/sparhawks_models/bowl_of_porridge_h.tga, 8 ) )
  specularmap  models/sparhawks_models/bowl_of_porridge_s.tga
}


If you haven't yet got the bumpmaps just comment those out by placing a '//' (without quotes) infront of the reference above.

Also it's worth noting that other people have got the material path above working *without* the purgatory/purgatory bit, I haven't.... but if you do a seach for 'ASE models' you'll find a number of posts which outline what works and what doesn't, all of which will mean manually editing the ASE file in Notepad and correcting the *BITMAP reference.



sparhawk@Posted: Wed Nov 17, 2004 8:48 am :
jay pettitt wrote:
That sounds like normals. Normally (geddit) polygons are one sided. The side that appears solid is the normal side. It isn't uncommon for the direction of normals to get all muddled, so some face outwards and some face inwards. If that happens you need to normalise your normals.


That could be.
I created the object like this. I created a UVB sphere and then cut off the top half. Then I selected all the vertices and extruded them to create the outer hull of the bowl. If the properties are copied when I extrude then of course they would all face in the same direction. I check this.

EDIT: I just flipped the normals and now the texturing looks ok. I will see if it is better when I'm at home because I have no Doomn 3 here. Thanks! :)

Quote:
If your bowl (it's spelled bowl by the way ;) )


ok. :)



sparhawk@Posted: Wed Nov 17, 2004 9:07 am :
kat wrote:
1 - create an 'inside' layer for the bowl (as petitt mentioned above)


I did this when I created the object. See my posting to Jay on this.

Quote:
Depending on what the polycount is like for the mesh as it is at the moment I'd go for method '1' as the shader parameter 'twosided' switches of shadow volumns so the object won't cast dynamic shadows when I light is shone at it.


The polycount is rather high I guess because 1) I don't know how to check the polycount and b) I don't know how to reduce the polys while maintaining the geometry.


Quote:
As for the missing material... you'll need to make a material file (a *.mtl text file) that contains information about the textures for the model, it's this material that you reference in the *BITMAP part of the ASE file (you'll clearly see this when you look at the file in notepad) and NOT the actual texture you used in Blender.


I have to take a look at this (I guess you meant *.mtr right?). That is the part that I haven't understood so far (yet another one :)). Because I know that I have to create a material but in the *.def file I found no reference to the material, only the mesh and I couldn't see how the mesh references to a material. When I export the object as LWO it is a binary file and so far I haven't found out how to combine the material with the object. I will look for these ASE files in the evening when I have access to my D3 again.

The thread was already helpfull for an absolute beginner like me. :) I'm more coder than modeler so this is completley new territory for me. :)



SLI_Fallen@Posted: Sun Dec 19, 2004 1:06 pm :
This tutorial still in development Kat?



kat@Posted: Sun Dec 19, 2004 2:56 pm :
SLI_Fallen wrote:
This tutorial still in development Kat?
Yes it is. I'm just putting the final passage together about final export.. nearly there.!



jizaboz@Posted: Fri Dec 31, 2004 3:17 pm :
^bump^

Still anticipating this one...



kat@Posted: Fri Dec 31, 2004 3:36 pm :
jizaboz wrote:
^bump^

Still anticipating this one...
oops sorry, forgot to post in here, tiz' done...

[EDIT] url woz 'ere [see below]



SLI_Fallen@Posted: Fri Dec 31, 2004 4:59 pm :
Woohoo!

Thanks so VERY much Kat! :P



jizaboz@Posted: Sat Jan 01, 2005 11:14 pm :
Thanks Kat!



sparhawk@Posted: Sun Jan 02, 2005 1:02 pm :
kat wrote:
http://www.quake3bits.com/htm/tutorials/doom3_models.htm


Thanks! Especially that sizing problem is a pain in the ass, and it is great to know that Blender can adjust this. :) Makes life much more easier that way. :)



kat@Posted: Mon Mar 28, 2005 5:04 am :
new url to the tute.. I had a site shuffle so some pages got renamed.

http://www.quake3bits.com/htm/tutorials ... models.htm