Exporting/Importing meshes from Unreal and UT

From Oldunreal-Wiki
Jump to navigation Jump to search

Your desired Mesh

For starters, you need to find the mesh you want to export. Load up UnrealED and load the package that contains your desired mesh.

Preparing the mesh for export

Once you have loaded the package with the mesh, go to the mesh browser. Find the mesh that you wish to export and remember it's name. Then, go to the Actor Class Browser and create new class below actor. Give it the package name "MyLevel" (Without the quotes of course) and any class name you desire. DO NOT SAVE MYLEVEL. Never save the MyLevel package. Everything created within MyLevel is saved into the map. Once the class is created, the script box will pop up. Paste the following into the box:

var Mesh M;

function MyMesh()
{
  M = Mesh'MeshNameHere';
}

Compile this code, obviously replacing MeshNameHere with the name of the mesh you want to export. Next, create a blank cube map. Just a simple click on the cube tool and subtract. Don't add any lights or playerstarts, but instead add the actor that you created to the map. Now save the map (Any name) and close the Editor.

Saving the package

Reopen the editor and open your saved map. Open the log window (View-->Log) and type the following:

OBJ SAVEPACKAGE PACKAGE="NameOfPackageWithMesh" FILE="DesiredMeshName.u"

Replace NameOfPackageWithMesh with the name of the package that originally contained the mesh, ie. the package that you loaded at the start. Replace the DesiredMeshName with the name you wish to give to the generated .u file. Make sure that the quote marks are used in the command, otherwise it will not work.

Did it work?

If all went well, then you should be able to go into your system folder and find a .u file called DesiredMeshName.u (Or whatever name you entered) You can now load this file into UnrealED and make your mods with the new meshes. Note that once you DO load the .u, it will not appear in the package list in the Actor Class Browser. This is because there are no classes. Just create a class with the package name of the saved mesh wherever you want (Under weapon if it's a weapon)

This method works with both Unreal and Unreal Tournament, so you export the mesh from UT, and load it in Unreal 1's Editor and vise versa.

UModel

Alternative method is to use UModel:
UModel.exe -export <path here>\UnrealTournament\System\SkeletalChars.u
And you should get recompile able PSK/PSA files.