[Tutorial] Using Blender for custom xModels

broken avatar :(
Created 1546 days ago
by Scobalula
0 Members and 1 Guest are viewing this topic.
5,748 views
broken avatar :(
×
broken avatar :(
OnionmanVere Bo21
Location: ieu dnt wnt 2 no
Date Registered: 27 September 2013
Last active: 9 days ago
Posts
1,863
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Mapper
My Groups
More
Personal Quote
ok
Signature
Aye mate you don't know me so y don't you shut tf up ok buddy :)

×
Scobalula's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Scobalula's Contact & Social Links
I am meant to make this tutorial ages ago, lol, but in light of the contest I am aware that many of you want to get involved and probably don't have Maya for custom models that you have possibly found online or maybe you want to make models yourself.

Well fear not! You can use the popular open source 3D Modelling software, Blender! :D Video version soon.

So before we get started, here's a few things you should have:

Basic knowledge of Blender.
Image Editor (Photoshop, GIMP, Paint.net, etc. NOT MICROSOFT PAINT)
Texture that is power of 2 (I'll go over making a texture that is Power of 2) and is TGA, JPG or DDS.
Model

So to start off we're going to get ourselves a texture, I am going to use this metal texture.

Note: if your texture is a power of 2, then you can skip the PS part.



So this texture isn't a power of 2, EEK! Wait, no problem, open it in an image editor, I will be using Adobe Photoshop.

Open the file in Photoshop, then go to Image>Image Size...



This will open the Image Size dialogue box, you may also notice a keyboard shortcut, you can use that also.

First thing, un-tick that chain, what this does is maintain's aspect ration, we do not want that in this case.

Like I said your image has to be a power of 2 or you'll get an error when converting it later. You can mix resolutions, i.e. you can go 256x1024 or 512x1024, in this case I'll make it 1024x512 to make it as close to the original as possible.

Note: I recommend not going above 2048x2048 and stay around 1024x1024 or lower so your map isn't full of textures 50mb in size.

So once you have your resolution set press Ok, you can see this how mine came out after I changed it.



Once you're done you can go to File>Save as (Export iirc for Gimp) and save it as TGA, JPG or DDS, if your texture has transparecy or holes such as a fence then use DDS DXT5.

If you're using Photoshop you can use the [You are not allowed to view external links. Register or Login to see them] , I can confirm the DDS Saving works in 2015 but can't get the normals part to work.

Save it to texture_assets in your CoD WaW root, make the folder if it doesn't exist. :)

Now we're done in Photoshop.


/////////////////////////////////////
Tutorial on Blender Starts here

If you don't have Blender download it by [You are not allowed to view external links. Register or Login to see them] . It's free, so grab it.

Next Download Blender-CoD by [You are not allowed to view external links. Register or Login to see them] . The latest one he seems to have doesn't seem to work for me, so the link is to the latest one that worked for me. His official page is here on Github: [You are not allowed to view external links. Register or Login to see them]

Open Blender, you should see a screen similar to this:



Just click anywhere in Blender to get rid of the Slash screen that you will probably get when starting Blender.

Go to File> User Preferences, then click the Addons tab then Install from File. Locate the ZIP of Blender-Cod you downloaded earlier and install it.

Then click "Testing" and it should show up, there will be a box to the right, tick it and then Save Settings.

You will notice 3 new entries in Import and Export, 1 for Importing Xmodel_exports, 1 for exporting Xmodel_exports and 1 for exporting Xanim_export. We will not be covering xanims.

Make sure to double tap a to selecting everything in-scene, then delete, the sun, camera, etc. will cause errors.

I also recommend importing the xmodel_export of the character from model_export/characters/american/roebuck, this is the size of the player, so you scale your models based off him. :)

So I have made a basic cube and UV Mapped it as shown below, once again I will not be covering Blender basics such as UV mapping, there are other tutorials for that.

Note: When UV Mapping you may get the error "Object has non-uniform scale, unwrap will operate a non-scaled version of the mesh" when you Unwrap and then it will look weird, as if you can see the inside faces, in editor and game. Thanks to JBird632 informing me what cause this, to fix it, select the offending mesh in Object Mode, press CTRL+A and select Scale, job done. :D I would avoid using Unwrap though for the most part if I were you. ;)



Looks good, huh? You will learn to worship this Iron Block as you worshiped Bwc's Purple Square.

Next we need to give the mesh a material name, this is the material name you will also be using in Asset Manager.

Go to the side bar and go to the materials tab, then make a new material with the mesh selected and give it a name, I usually like to use this format: mtl_*map I am working on*_*what it is*_*surface type* and possibly _*color* as well.

So I will call this mtl_tutorial_block_iron like so:



All the other settings do not matter as they are specific to blender. The texture's tab need not be touched also.

Note: You may have 2 seperate meshes in your scene that you want to use the same material, but you find when you enter the same name for both of them blender adds .001 to end of one of them, this is because 2 meshes cannot have the same Material name in Blender, what you can do is click the meshes that you want to use the same material name for, and press CTRL+J, this will make them all the 1 mesh, and allow you to give them a material name for all of them since they are now 1 mesh essentially.

Now we can select everything we want to export, then go to File>Export>CoD XModel. Save it under model_export as any name you want.

Now we are done with Blender.


///////////////////////////////
Assman Stuff Starts Here

Now to convert it so it works in-game.

Open Asset Manager via Launcher or via your Bin Folder, then create a new GDT in model_export and save it.

Go to material and create a new entry(ies) with the same name you gave to the mesh(es) in Blender.

I created mine like so, you can use different settings for surface type, etc.

You may notice Normal Maps, Spec Maps, etc, mentioned, you can create them for your model, refer to JohnDoe's tutorial here:

http://ugx-mods.com/forum/index.php?topic=6082.0



Then press F10 or go to PC Conver>Current Asset Only to convert the material(s).

Next for the xmodel is pretty simple and not worth screenies for, just create a new xmodel entry, name does not matter, name it what you want, and add your Model to the filename. Make it rigid unless it's animated.

You might be asking me what do the LOD's mean, they stand for Level of Detail and adding LOD models that get lower in quality will mean that the further the player is from the model, the model's quality will drop and it swaps out for a lower LOD model.

Now we can use the model in any fashion we want! You can use Asset viewer to view it or add it in Radiant, if you add it in Radiant then there is no need to call it in mod.csv, if you use it in a script then you will need us xmodel,*name of model* in mod.csv.

Also make sure to add the images to your mod's images folder and tick them in Mod Builder.

Any questions, don't hesitate to ask. :)

 

Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Twitch
Loading ...