Tutorial - Create Custom Objects

ddmx
Posts: 5373
Joined: Sun Apr 20, 2008 3:36 pm
Location: Midland MI

Tutorial - Create Custom Objects

Post by ddmx »

(please sticky)
Ok, this is a tutorial to help better the tracks by making some new models. At the end of this tutorial we will have something that all tracks need, and you will have a template for creating custom objects in the future.
You will need:
Blender - 3d modeling, open source - http://www.blender.org
JLV's .jm python script - for exporting the appropriate model type - http://www.mxsimulator.com/models
Python - Programming language that, in conjunction with Blender and the export script, allow you to export your models - http://www.python.org

We are going to be making a simple track banner with which you can put all around your track. You can create many skins for it too, so the possibilities are endless. Throughout the tutorial I am assuming that you have some basic knowledge of Blender and it's functions, but I will try to explain every step as I go. A quick internet search will solve your many answers to your questions.

Alright, you have already downloaded and installed python, you downloaded and installed Blender, and you downloaded the .jm export script to anywhere on you hard drive (as long as you remember where it is).
Let's begin.
"A" - Select/Unselect all
"X" - Delete
On the numbpad
"1" - Front view
"3" - Side view
"7" - Top view
"5" - Switches between regular and orthographic view
Holding control and hitting any of these keys switches to the opposite side
"Tab" - switches between object mode and edit mode. (lots of other modes are available but beyond the scope of this tutorial)
"R" - Rotates an object - X, Y, or Z can be pressed to limit the axis of rotation
"G" - Grab key, allows you to move any point or object - X, Y, or Z can be pressed to limit the moving axis
Middle Mouse Wheel - Zooms in and out

1. Open up Blender, maybe for the first time, and begin by deleting everything on the screen. Press "A" twice to first unselect the default cube, and then reselect everything in the scene.
2. Press "X", and agree to delete the selected objects.
Image
3. While holding "Ctrl" hit "1" on the numbpad. This switches to the opposite (Ctrl) front view (1). This is actually the top view with respect to the coordinate plane set up in MXS.
4. Add a plane. Hit spacebar, then select add > mesh > plane. A small plane appears.
5. Rotate it along the x axis. Make sure the plane is selected (pink outline) and hit "R", to rotate it, then "X", to rotate it along the x axis, then manually type "-90" on the numbpad
6. Hit "tab" to switch from object mode to edit mode.
7. Deselect all vertices by hitting "A"
8. "Left click" the top right vertice, and then hold "Shift" and "left click" the bottom right vertice. The two right hand vertices should now be yellow. They are selected.
9. Hit "G", then "X", then type "1" on the numbpad, hit enter to confirm the move. Do not deselect the vertices.
10. Hit "G", then "X", the type "-1024" on the numbpad, hit enter to confirm the move. Deselect the vertices.
11. Select the two left hand vertices.
12. Hit "G", then "X", then type "-1" on the numbpad, hit enter to confirm the move. Do not deselect the vertices.
13. Hit "G", then "X", then type "1024" on the numbpad, hit enter to confirm the move. Deselect the vertices.
14. Zoom out until you can see the newly formed object. Zooming is controlled by the middle mouse wheel.
15. Select both of the top vertices.
16. Hit "G", then "Z", then type "-1" on the numbpad.
17. Hit "G", then "Z", then type "1024" on the numbpad. Deselect the vertices
18. Select the two lower vertices.
19. Hit "G", then "Z", then type "1" on the numbpad.
20. Hit "G", then "Z", then type "-1024" on then numbpad. Deselect the vertices.
21. On the header at the bottom of your 3d viewing area select "View Properties", the change "Clip End" from 500 to 10000. This allows the viewing area to display objects that stretch out to 10000 units. Ours is only 1024 but it is still nice to see an unclipped object.
Image

Good Job! What we have just done is created a plane with which to make all of our objects on. The plane is 2048 units by 2048 units. This, if I do believe is the same amount of units available to one in the MXS editor. Any object done on this plane will be the same size with respect to the plane in game. It may seem unnecessary but it is really helpful!

22. Go to File > Save As, and name it something useful like "Object Template" or something.

Now we will start to make our banner.
Let's assume our banner is going to be 15 feet long.

23. Switch to Top view (numbpad "7")
24. Make sure you are in object mode. (Tab)
25. Add a mesh plane.
26. Use "G" to move it so it sits on the corner of the y/x axis intersection.
27. Hit tab to enter edit mode with the plane.
28. Select the right two vertices and hit "G", then "X", then "13" on the numbpad. (it was already two feet wide so it is now 15 feet wide)
29. Now select the top two vertices and hit "G", then "Y", then hit "2" on the numbpad. (it is now 4 feet tall by 15 feet wide)
30. Change the center of the object by moving the 3d cursor and hitting "Center Cursor" in the editing panel.
Image

Lastly, make sure that you have the banner object selected in object mode and hit "Control" and "A". Select "Scale and Rotation to ObData"

Alright, we now have the object done! all we need to do is set it up for skinning.

31. Slit your 3d window in two by right clicking the dividing line and selecting "Split area", then just select where you want the split.
32. Continue by changing your window from the default 3d view to the UV/Image Editor.
Image
33. Move over to your 3d view window and press numbpad 7 to take you to a front of view of your banner. If you need to zoom in a little.
34. Hit tab to switch to edit mode for your banner, make sure all of the vertices are selected, and then press "U", choosing "project from view".
35. Your newly unwrapped object should be visible in the UV/Image Editor taking on the same shape as it does in the 3d view. Move it and resize it ("S" key) however you need to to get it to fill up the space and be centrally located.
Image
36. You have now unwrapped the object, which allows for skinning, and you have created a banner!
37. In the UV/Image Editor Window select UV's > Scripts > Save UV Face Layout
38. Click ok in the dialogue box if it says "size: 1024" and "wire: 2"
39. Find someplace useful to save it to, because this is the wireframe you will use to skin your banner.
40. Change the UV/Image editor window to the Text editor window the same way you changed it before.
41. In the text editor window click File > Open, and then browse for the .jm python script you downloaded earlier.
42. Go into the 3d view window and make sure your banner is selected in object mode. Scroll back into the text editor window and select File > Run Python Script.
43. Save the file somewhere where you can remember where it is.

You now have the necessary files to put a custom object onto your track.
You should have a .jm file for the banner, and a file for your wireframe. All you need to do is follow DJ's skinning tutorial to skin it.
The quality of your models is only limited by your creativity. Follow some Blender specific tutorials to learn more about Creative Graphics.

This is where the original plane comes into play. With the proper scaling of a displace modifier on your plane, it is possible to recreate your track within blender. Why do I do this? It is way easier to create one giant banner object in blender, with one skin, and then place it into the game as an object than to hand place each banner and rotate it. it also helps you to visualize the size of your objects compared to your jumps and whatnot. this will come in a later tutorial also.
Image
Last edited by ddmx on Fri Jun 20, 2008 2:48 am, edited 4 times in total.
DJ99X
Posts: 15523
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: How to: Create Custom Objects

Post by DJ99X »

Even I learnt a few things from that! I don't see the point of the plane though....
ddmx
Posts: 5373
Joined: Sun Apr 20, 2008 3:36 pm
Location: Midland MI

Re: How to: Create Custom Objects

Post by ddmx »

it helps to better visualize what size you are working with, and with a correctly implemented displace modifier and displacement map, you can see exactly what the objects look like on your track before you export them. i'll go that in a later tutorial
motox161
Posts: 520
Joined: Fri Jan 25, 2008 3:06 am
Location: Arizona

Re: Tutorial - Create Custom Objects

Post by motox161 »

ok so i got to number 8. how do you select the vertice?
Gourley #13
dearnhardtfan7
Posts: 1095
Joined: Sat Mar 22, 2008 2:05 am
Team: Privateer
Location: Trafford Alabama

Re: Tutorial - Create Custom Objects

Post by dearnhardtfan7 »

you actually right click to select the vertice
R.I.P. Jacob Nash #241
PSN-chrismri463
Image
xfire--cmarona463
ddmx
Posts: 5373
Joined: Sun Apr 20, 2008 3:36 pm
Location: Midland MI

Re: Tutorial - Create Custom Objects

Post by ddmx »

yeah, blender is ass backwards of other modeling programs. left click places the 3d cursor. this is where newly added objects are placed, and it can be used to place the objects center. right click selects.
ddmx
Posts: 5373
Joined: Sun Apr 20, 2008 3:36 pm
Location: Midland MI

Re: Tutorial - Create Custom Objects

Post by ddmx »

BIG bump
yzmxer608
Posts: 15352
Joined: Mon Dec 29, 2008 4:30 am
Team: SYS
Location: Wisconsin, U.S.A

Re: Tutorial - Create Custom Objects

Post by yzmxer608 »

I just found this now, a very helpfull tutorial. I don't use Blender but I found out how to use the jm export :). I also never thought of placing the objects in the 3d program first, then export it as one giant object. The uvw map would take a longer time, but I think it would be worth it, just select which individual banners you want to have "A" texture and group those together on the uvw map, then do the same for "B" banners ect. Thanks!
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.
Mikey
Posts: 7018
Joined: Sat Nov 08, 2008 1:27 am
Location: Melbourne
Contact:

Re: Tutorial - Create Custom Objects

Post by Mikey »

Yeh DJ i dont get it, i mahe to make a plain and then put my terrain.png onto it as a skin? but then how dose it show hight?
My photography work
www.mikeowenphotographer.com
Mikey
Posts: 7018
Joined: Sat Nov 08, 2008 1:27 am
Location: Melbourne
Contact:

Re: Tutorial - Create Custom Objects

Post by Mikey »

i *need* to make
My photography work
www.mikeowenphotographer.com
mxallan15
Posts: 104
Joined: Mon May 11, 2009 7:35 pm

Re: Tutorial - Create Custom Objects

Post by mxallan15 »

I have probleme at number 41.
I save jm_export.py ( save target as )
but when I open the text editor, and I open my file , it says that .

Image

what is the problem ?
Image
mxallan15
Posts: 104
Joined: Mon May 11, 2009 7:35 pm

Re: Tutorial - Create Custom Objects

Post by mxallan15 »

Sorry I repeat, and it is ok now
Image
Shadow
Posts: 2772
Joined: Sun Dec 02, 2007 5:10 pm
Team: FSK
Location: Finland

Re: Tutorial - Create Custom Objects

Post by Shadow »

How do you get that displacement modifier applied to the plane so I could get my track in blender?
Another thing, is there something particular needed to be done for changing the model's scale? Changing the object's scale in blender and then exporting via the script produced exactly same sized model than before :/
Image
Those who possess strength have also known adversity.
Mona
Posts: 1645
Joined: Thu Jul 31, 2008 6:46 pm
Team: MotoOption

Re: Tutorial - Create Custom Objects

Post by Mona »

Shadow wrote:How do you get that displacement modifier applied to the plane so I could get my track in blender?
http://en.wikibooks.org/wiki/Blender_3D ... heightmaps
I think that's the tutorial i used, so it should work fine.
BRYAN17
Posts: 414
Joined: Tue Feb 02, 2010 2:54 pm

Re: Tutorial - Create Custom Objects

Post by BRYAN17 »

How do i save it as a .jm file
Image
Post Reply