Jump to content
Oovee® Games
DrGoNzO1489

Blender 3d and spintires

Recommended Posts

I picked up a .x file importer for blender at some point. Unfortunately I cannot remember where I got it from (and I am posting from work so I can't just check) but it should be easy enough to find :) I do not think it imports everything (skin weights for bones for example) but works fine for the raw geometry  B)

Share this post


Link to post
Share on other sites
i have more fun doing and changing the game with mods than playing the game

 

Happy to help and I can relate to this statement.

 

You can find an x importer here:

 

http://blenderartists.org/forum/showthread.php?236401-a-directX-importer&highlight=directx+import

 

It has it's shortcomings. For example it only imports text x files, not binary/compressed.

It does not preserve the mesh names giving them a sequence of numbers. Strange, why would you do that?

Bones almost always get imported as Plain Axes Empties positioned at 0,0,0

 

You will probably have more success using the Online 3D Converter link you can find in Tattoo's thread:

Useful links for new users Edited by GJU

Share this post


Link to post
Share on other sites

about wheels and the left and right side option on the blender export window, my wheels have the tire brand on the walls.

so i did like it was on this page and exported them with the right side option, the result was ok, but the ones on the left side the add the texture mirrored

18521136_Lqari.jpeg

 

when i used the same model and exported with the left side option the right side the faces and normals where inverted and the left side wheels still add the texture mirrored.

 

18521159_KpGZO.jpeg

 

after i mirrored the model on the global X axis, the texture becomes mirrored on the blender, applied the mirror and export using the left side option on the game the left side wheels have the texture ok, and the right side ones have the normals and faces ok but the texture is mirror.

 

18521187_BofSM.jpeg

 

so i used the first model for the right side wheels and the last on for the right ones, the xml is something like this:

<WheelsSet Title="Large Wheels">
	<WheelType Type="Gaz-66_Wheels/Gaz-66_Large-Tire_L" Wheels="0,2" />
	<WheelType Type="Gaz-66_Wheels/Gaz-66_Large-Tire_R" Wheels="1,3" />
</WheelsSet>

and the final result:

18521209_vkLJ2.jpeg

 

this works for the addon wheels, does any one know the xml code for doing the same on the default wheels using a different model for left and right side wheels?

Share this post


Link to post
Share on other sites

it work freeman, thanks, just had to change the code a little from what you posted

<Wheels>
	<Wheel _template="FrontWheel" DiffGroup="axle0">
		<Suspension Hardpoint="(1.682; 0.3; 0.95)" />
	</Wheel>
	<Wheel _template="FrontWheel" DiffGroup="axle0" DefaultWheelType="Gaz-66_Wheels/Gaz-66_Stock-Tire_R">
		<Suspension Hardpoint="(1.682; 0.3; -0.95)" />
	</Wheel>
	<Wheel _template="RearWheel" DiffGroup="axle1">
		<Suspension Hardpoint="(-1.513; 0.36; 0.94)" />
	</Wheel>
	<Wheel _template="RearWheel" DiffGroup="axle1" DefaultWheelType="Gaz-66_Wheels/Gaz-66_Stock-Tire_R">
		<Suspension Hardpoint="(-1.513; 0.36; -0.94)" />
	</Wheel>
</Wheels>

Share this post


Link to post
Share on other sites

Im learning Blender as well and just getting to the part where i need to set up suspension.GJU your tutorial on suspension rigging is great but could you provide example blender scene with correctly set up leaf spring suspension. I find things easier to understand when i see them :P

 

Share this post


Link to post
Share on other sites

is this how it should look before I export it

from top view

attachicon.gifmoo 014.JPG

attachicon.gifmoo 013.JPG

it looks ok the blender for the wheel i posted before: https://drive.google.com/file/d/0Bwedj2FpOUEyMm12OXRYdWxQUlU/view?usp=sharing

 

this one is the one i used for the right side, exported with the option right hand, y as up axis and removed the option to export only the selected parts

Share this post


Link to post
Share on other sites

Now why didn't I think of that? If a picture is worth a thousand words an example .blend is worth?

 

Here is another.

A simple, low poly, basic textured wheel I recently imported from Sketchup. I used it to teach myself AO baking in Blender Render. Didn't want to mess with my other wheel files until I understood what I was doing.

 

https://drive.google.com/open?id=0B7LRtMutMCJkeGdFTWNSenJ1bGM&authuser=0

Share this post


Link to post
Share on other sites

So glad I started this thread seems to be a help to some people, Thank you GJU for the .blend's, very nice!

 

While I'm thinking of it what its the deal with the baking? To reduce poly count or something I've been curious to what the function was, and how to set up and carry out the baking process. I'm new to modeling skinning but very interested in making my own vehicle. All info is greatly appreciated.

 

Carry on fellas good info here!

 

Cheers

GoNzO

Edited by DrGoNzO1489

Share this post


Link to post
Share on other sites

So glad I started this thread seems to be a help to some people,

 

Yes, very good thread. I just added a link to this into the Useful Links sticky.

 

I also just added a link to freeman's code for wheels with lettering named, Wheels with Lettering - code

Edited by Tattoo

Share this post


Link to post
Share on other sites

You can use the (Blender Render) rendering engine to create the image files you use in your xml files. It's called baking.

 

The first screenshot is a simple cube modified with a slight cavity. I created 3 materials and textured the faces as you see them.

On the right is the UV/Image Editor window. The cube is UV unwrapped with the smart option.

A new, blank image was created using the Image menu in the UV/Image window.

 

The second is a simple Texture bake. Once it's baked you can save the image with the same Image menu and use it in your truck xml.

Blender will save it as a .png graphic which (I think) ST can use but I convert it into a .dds in paint.net or gimp.

You could of course just create an image in paint.net with three solid color blocks and just dump the UV mapping into the respective color block and get the same effect.

If this were a truck cab textured with 99 different materials that might take a while. Blender will make it for you in minutes if not seconds.

Note, however, that the cavity is just...plain...red.

 

The third is an Ambient Occlusion (AO) bake. AO is all about the shadows created by light in the real world. ST has a built in AO engine (so I have heard) but you can enhance it with an AO bake of you image files.

Note how the red is now nicely shadowed. Try making that in paint.net by hand with a complex mesh.

 

Here is a youtube video on how to bake in blender. It's somewhat dated but pretty clear on what to do.

He uses the AO bake to speed up his rendering. Once he saves the image you would be done for ST purposes.

 

Note this is for the Blender Render engine not the Cycles engine. Baking in Cycles is different and more involved. Hopefully I will figure it out as the Cycles engine is newer and most claim it's better than Blender Render which is getting somewhat long in the tooth.

 

 

 

post-115997-0-42186900-1434251330_thumb.png

post-115997-0-05109500-1434251342_thumb.png

post-115997-0-16296000-1434251354_thumb.png

Share this post


Link to post
Share on other sites

Here is another decent video. Baking a high poly mesh normal map onto a low poly copy.

This is how you would reduce the poly count without sacrificing too much detail.

 

 

This one is more about how to create the low poly copy.

 

Share this post


Link to post
Share on other sites

Good stuff man so question,I can't seem to get the wheels I'm working on exported correctly, looking at the front of my wheels from top view I export both objectsrim and tire right handed and the normals and faces are flipped on the right side. If objects are mirrored on global z so from top view I see backside of wheel, normals faces are ok but rim is wrong direction, on right side rim faces the same direction as the left side.

Edited by DrGoNzO1489

Share this post


Link to post
Share on other sites

Hi guys - i need help ;)

im again working with Blender ( trying to make some stuff ...) it is more then 2 years i had worked with it - what i need to be choosen on direct.x export here? To be correct in game?

1z3c4cg.jpg

 

And this:

"

If your going to use blender you need to disable the Root Frame generated by the default x exporter.

In the file ...\scripts\addons\io_scene_x\export_x.py:  (for blender 2.73, most recent versions use the same xporter)

Comment out the 2 lines "self.__OpenRootFrame()" and "self.__CloseRootFrame()". Use an ascii text editor. # is the comment char. IE:

 

# self.__OpenRootFrame()

# self.__CloseRootFrame()

"

i need for all exports?

Can someone upload this tuned python for me pls? Thanks :)

Share this post


Link to post
Share on other sites

Good stuff man so question,I can't seem to get the wheels I'm working on exported correctly

The usual cause of this seems to be not having applied pending transforms. Control-a once each for Transpose, Rotate and Scale.

Share this post


Link to post
Share on other sites

The usual cause of this seems to be not having applied pending transforms. Control-a once each for Transpose, Rotate and Scale.

Thanks man will try when I get home as longas the tire isn't directional you should only need one mesh right? Or if it had lettering...?

Share this post


Link to post
Share on other sites

Can someone upload this tuned python for me

Here is the file. Being open source it should be ok to do this.

 

https://drive.google.com/open?id=0B7LRtMutMCJkMmNTUkVibDhEYms&authuser=0

 

What you have checked for export is fine except I don't Export Materials unless I plan on importing into another scene.

If you rig/skin you will also need

 

Export Skin Weights

Apply Modifiers

Export Armature Bones

 

Wheels should be Righthanded.

Share this post


Link to post
Share on other sites

I have never had a problem with directional tread.

3d lettering I have never worked with but HP tried everything I would have tried.

Share this post


Link to post
Share on other sites

Ok now let me ask you this as far as texturing goes, could I use the ao map as a texture and edit it with paint.net or gimp? Or do you make a pallet of colors then bring that into blender and put the UV map over it then save that as a new image? I'm new but eager to learn, sorry if I'm asking alot.

Edited by DrGoNzO1489

Share this post


Link to post
Share on other sites

Or can I use materials from blender to create a texture from an ao map rendered on the mesh with a material applied?

 

Sorry if that confused anyone....

 

To clarify:

 

If I applied a material to my wheel black for the tire and silver/grey for the rim, and then baked an AO map on a new image, could I use that as a texture?

Edited by DrGoNzO1489

Share this post


Link to post
Share on other sites

Or can I use materials from blender to create a texture from an ao map rendered on the mesh with a material applied?

 

Sorry if that confused anyone....

 

To clarify:

 

If I applied a material to my wheel black for the tire and silver/grey for the rim, and then baked an AO map on a new image, could I use that as a texture?

 

You can use any image file (provided it is in a format that SpinTires can read: png, tga, dds etc) as a texture in SpinTires.

Share this post


Link to post
Share on other sites

If I applied a material to my wheel black for the tire and silver/grey for the rim, and then baked an AO map on a new image, could I use that as a texture?

 

Yes, that is the whole idea.

 

Why try to make a graphics file in paint then attempt to move the uv's where you want them (in relation to that image file) in the uv editor?

Just texture the mesh using blender materials, unwrap it, and the AO bake will apply those materials in addition to the shadows.

 

Look at that cube I did earlier in this thread. It's just textured in blender.

 

This is for the Blender Render. Cycles is different.

Either I'm doing it wrong or the AO bake is just black and white and ignores the materials used to texture the mesh.

I've managed to bake both a Texture and AO image file in Cycles and put them together in Gimp but it's probably that I just don't yet know how to use the Node editor which is required.

;

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...