Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.
Zero Tolerance for Disrespect

Extract UFC Octagon 3D model?

Featured Replies

Hi, is anyone able to extract the UFC 3, 4, 5, Octagon or even the arenas 3D model? Been seeing many 3D models of the fighters extracted but no discussion of the octagon or arena.

Thanks.

Upload files or something, without clay you can't make bricks... otherwise they'll close this thread and you'll be left without the square or octagon or arena...

Thanks.

  • Author

Here's the UFC 3 (would like the higher games but I am not sure how to unpack those) Stage folder I tried to unpack, but to no success. I'm not sure if this is the folder with the Arena or octagon, but if this isn't it I have the other files.

stage.7z

  • Supporter

I think i got it. Now it should unpack compressed textures.

##############################
get BaseFileName basename
get FileExtension extension
get FileSize asize

endian big

get ResourceCount uint32
getdstring Dummy 0x8
get TOCOffset uint32

goto TOCOffset

for i = 0 < ResourceCount
	getdstring ResourceName 0x10
	getdstring ResourceType 0x4
	get ResourceSize uint32
	get ResourceOffset uint32
	getdstring Dummy 0x4
	savepos cPos
	string Name p "%s/%s.%s" BaseFileName ResourceName ResourceType
	
	goto ResourceOffset
	getdstring Sign 0x4
		
	if Sign == "YZLI"
		goto ResourceOffset
		getdstring Dummy 0x4
		endian little
		get DecompressedSize uint32
		getdstring Dummy 0x8
		savepos Offset
		endian big
		math ResourceSize - 16
		clog Name Offset ResourceSize DecompressedSize
	else
		log Name ResourceOffset ResourceSize
	endif
	goto cPos
next i

Got something.

image.png

So mesh format is something like this. I will try to write noesis script.

//------------------------------------------------
//--- 010 Editor v14.0 Binary Template
//
//      File: 
//   Authors: 
//   Version: 
//   Purpose: 
//  Category: 
// File Mask: 
//  ID Bytes: 
//   History: 
//------------------------------------------------
BigEndian();OutputPaneClear();

local uint32 i,j,k,l;

char Sign[4];
uint32 Unknown_0;
uint32 Unknown_1;
uint32 Unknown_2;
uint32 Unknown_3;
uint32 Unknown_4;
uint32 ShapeCount;
uint32 ShapeDefOffset;     // + 8
uint32 BoneCount;
uint32 TextureCount;
uint32 BoneDefOffset;      // + 8
uint32 TextureDefOffset;   // + 8
uint32 MeshDefOffset;      // + 8
uint32 MeshCount;
uint32 Reserved[4];
uint32 MaterialCount;
uint32 MaterialDefOffset;  // + 8


FSeek(BoneDefOffset + 8);
struct
{
    char BoneName[16];
    float Matrix4x4[16];
}BoneDefinition[BoneCount];

FSeek(TextureDefOffset + 8);
struct
{
    char TextureName[16];
}TextureDefinition[TextureCount];

FSeek(MeshDefOffset + 8);
struct
{
    char MeshName[16];
    uint32 Unknown_0;
    uint32 Unknown_1;
    uint32 ShapeIndex;
    uint32 Unknown_2;
}MeshDefinition[MeshCount]<optimize=false>;

FSeek(MaterialDefOffset + 8);
struct
{
    char MaterialName[16];
}MaterialNameDefinition[MaterialCount];


FSeek(ShapeDefOffset + 8);
struct
{
    uint32 ElementCount;
    uint32 IndexChunkCount;
    uint32 UsedBoneCount;
    uint32 BoneIndex[20];
    uint32 BoneLengthSetCount;
    uint32 MeshNameIndex;
    uint32 ElementSetCount;
    uint32 ElementSetBaseOffset;      // + 8  // Vertices / Normals / Colors // Stride 28
    uint32 BoneLengthSetBaseOffset;   // + 8  // Bone Legths                 // Stride 8
    uint32 UnitVectorBaseOffset;      // + 8  // Unit Vectors                // Stride 16 // 2 UV Sets  // Local / World
    uint32 BoneSkinIndiceBaseOffset;  // + 8  // Bone Skin Indices           // Stride 12
    uint32 MaterialNameIndex;
    uint16 Unknown_1;
    char SkinName[14];
    uint32 Unknown_2;
    uint32 Unknown_3;
    uint32 MaterialCount;
    uint32 MaterialDefOffset;         // + 8
    uint32 FaceIndiceBaseOffset;      // + 8
    uint32 ElementCount_t;
    uint32 UVSizeFlag;
    float BBoxX,BBoxY,BBoxZ,Radius;
    local uint32 cPos=FTell();
    
    // Mesh Name
    FSeek(startof(MeshDefinition[MeshNameIndex].MeshName));
    string MeshName;
    
    // Material Name
    FSeek(startof(MaterialNameDefinition[MaterialNameIndex].MaterialName));
    string MaterialName;
    
    // Materials
    FSeek(MaterialDefOffset + 8);
    struct
    {
        uint32 MaterialOffset[MaterialCount];
        for (i=0; i < MaterialCount; i++)
        {
            FSeek(MaterialOffset[i] + 8);
            struct
            {
                char MaterialDefName[16];
                uint16 Unknown_0;
                uint16 Unknown_1;
                if (Unknown_0 == 15)
                {
                    if (MaterialDefName == "g_mDiffusePrm" | MaterialDefName == "g_texDiffuse")
                    {
                        int32 TextureIndex;
                        FSeek(startof(TextureDefinition[TextureIndex].TextureName));
                        string TextureName;
                    }
                }
                else if (Unknown_0 == 5)
                {
                    int32 Value;
                }
                else
                {
                    float Value;
                }
            }Material;
        }
    }MaterialDefinition;
    
    // Elements
    FSeek(ElementSetBaseOffset + 8);
    struct
    {
        uint32 ElementSetBufferOffset[ElementSetCount]; // + 8
        for (i=0; i < ElementSetCount; i++)
        {
            FSeek(ElementSetBufferOffset[i] + 8);
            struct
            {
                float VPosX,VPosY,VPosZ,VNPosX,VNPosY,VNPosZ;
                ubyte VColR,VColG,VColB,VColA;
            }Elements[ElementCount]<optimize=false>;  
        }
    }ElementSetDefinition;
    
    // Bone Lengths
    FSeek(BoneLengthSetBaseOffset + 8);
    struct
    {
        struct
        {
            byte BoneId;
            FSkip(3);
            float BoneLength;
        }BoneLengths[ElementCount]<optimize=false>;  
    }BoneLengthSetDefinition[BoneLengthSetCount]<optimize=false>;
    
    // Unit Vectors
    FSeek(UnitVectorBaseOffset + 8);
    struct
    {
        struct
        {
            float LUVPosX,LUVPosY;
            if (UVSizeFlag == 2)
            {
                float WUVPosX0,WUVPosY0,WUVPosX1,WUVPosY1;
            }
            else if (UVSizeFlag == 1)
            {
                float WUVPosX,WUVPosY;
            }
        }UnitVectors[ElementCount]<optimize=false>;  
    }UnitVectorDefinition;
    
    // Bone Skin Indices
    if (BoneSkinIndiceBaseOffset != FaceIndiceBaseOffset)
    {
        FSeek(BoneSkinIndiceBaseOffset + 8);
        struct
        {
            struct
            {
                float BIPosX,BIPosY,BIPosZ;
            }BoneSkinIndices[ElementCount]<optimize=false>;  
        }BoneSkinIndiceDefinition;
    }
    // Face Indices
    FSeek(FaceIndiceBaseOffset + 8);
    struct
    {
        struct
        {
            uint32 Unknown;
            uint32 IndexCount;
            uint32 IndexCountOffset;
        }IndexChunkInfo[IndexChunkCount]<optimize=false>;  

        for (i=0; i < IndexChunkCount; i++)
        {
            struct
            {
                uint16 Index;
            }FaceIndices[IndexChunkInfo[i].IndexCount]<optimize=false>;  
        }
    }FaceIndiceDefinition;
    FSeek(cPos);
}ShapeDefinition[ShapeCount]<optimize=false>;

Some progress....

image.png

Edited by h3x3r

  • Author
17 hours ago, h3x3r said:

I think i got it. Now it should unpack compressed textures.

##############################
get BaseFileName basename
get FileExtension extension
get FileSize asize

endian big

get ResourceCount uint32
getdstring Dummy 0x8
get TOCOffset uint32

goto TOCOffset

for i = 0 < ResourceCount
	getdstring ResourceName 0x10
	getdstring ResourceType 0x4
	get ResourceSize uint32
	get ResourceOffset uint32
	getdstring Dummy 0x4
	savepos cPos
	
	if ResourceType == "tex"
		goto ResourceOffset
		savepos ResourceBaseOffset
		get TexResourceCount uint32
		getdstring Dummy 0x8
		get TexTOCOffset uint32
		
		for j = 0 < TexResourceCount
			getdstring ResourceName 0x10
			getdstring ResourceType 0x4
			get TexResourceSize uint32
			get TexResourceOffset uint32
			getdstring Dummy 0x4
			savepos EndOfInfo
			
			math TexResourceOffset + ResourceBaseOffset
			math TexResourceSize - 16
			
			goto TexResourceOffset
			getdstring Dummy 0x4
			endian little
			get DecompressedSize uint32
			getdstring Dummy 0x8
			savepos Offset
			endian big
			goto EndOfInfo

			string Name p "%s/%s.%s" BaseFileName ResourceName ResourceType
			clog Name Offset TexResourceSize DecompressedSize
		next j
		goto cPos	
	else
		string Name p "%s/%s.%s" BaseFileName ResourceName ResourceType
		log Name ResourceOffset ResourceSize
	endif	
next i

Got something.

image.png

So mesh format is something like this. I will try to write noesis script.

//------------------------------------------------
//--- 010 Editor v14.0 Binary Template
//
//      File: 
//   Authors: 
//   Version: 
//   Purpose: 
//  Category: 
// File Mask: 
//  ID Bytes: 
//   History: 
//------------------------------------------------
BigEndian();OutputPaneClear();

local uint32 i,j,k,l;

char Sign[4];
uint32 Unknown_0;
uint32 Unknown_1;
uint32 Unknown_2;
uint32 Unknown_3;
uint32 Unknown_4;
uint32 ShapeCount;
uint32 ShapeDefOffset;     // + 8
uint32 TransformCount;
uint32 UnknownDef0Count;
uint32 TransformDefOffset; // + 8
uint32 UnknownDef0Offset;  // + 8
uint32 UnknownDef1Offset;  // + 8
uint32 UnknownDef1Count;
uint32 Unknown_5;
uint32 Unknown_6;
uint32 Unknown_7;
uint32 Unknown_8;
uint32 TextureCount;
uint32 TextureDefOffset;   // + 8

FSeek(ShapeDefOffset + 8);
struct
{
    uint32 ElementCount;
    uint32 Unknown_0;
    uint32 Unknown_1;
    uint32 TransformIndex;
    byte FF[76];
    uint32 Unknown_2;
    uint32 Unknown_3;
    uint32 Unknown_4;
    uint32 ElementBufferOffset;    // + 8  // Vertices / Normals / Colors // Stride 28
    uint32 Unknown0BufferOffset;   // + 8
    uint32 UnitVectorBufferOffset; // + 8  // Unit Vectors // Stride 16 // 2 UV Sets  // Local / World
    uint32 Unknown1BufferOffset;   // + 8
    uint32 TextureIndex;
    char Type[16];
    uint32 Unknown_6;
    uint32 Unknown_7;
    uint32 MaterialDefCount;
    uint32 MaterialDefOffset;      // + 8
    uint32 IndexBufferOffset;      // + 8
    uint32 ElementCount_t;
    uint32 Unknown_8;
    float BBoxX,BBoxY,BBoxZ,Radius;
}ShapeDefinition[ShapeCount]<optimize=false>;

FSeek(TransformDefOffset + 8);
struct
{
    char MeshName[16];
    float Matrix4x4[16];
}TransformDefinition[TransformCount];

FSeek(UnknownDef0Offset + 8);
struct
{
    char Name[16];
}Unknown0Definition[UnknownDef0Count];

FSeek(UnknownDef1Offset + 8);
struct
{
    char Name[16];
    uint32 Unknown_0;
    uint32 Unknown_1;
    uint32 Unknown_2;
    uint32 Unknown_3;
}Unknown1Definition[UnknownDef1Count];

FSeek(TextureDefOffset + 8);
struct
{
    char TextureName[16];
}TextureDefinition[TextureCount];

Some progress....

image.png

Noesis script. If anything went wrong just let me know. Some textures are missing from scene, maybe in another file.

# Script by h3x3r

from inc_noesis import *
import noesis
import rapi
import os

def registerNoesisTypes():
   handle = noesis.register("UFC 3 - Mesh", ".ymx")
   noesis.setHandlerTypeCheck(handle, noepyCheckType)
   noesis.setHandlerLoadModel(handle, noepyLoadModel)
   noesis.logPopup()
   return 1
        
def noepyCheckType(data):
	bs = NoeBitStream(data, NOE_BIGENDIAN)
	if len(data) < 20:
	    return 0
	if bs.readUInt() != 0x4A424F59:
	    return 0
	return 1
        
def noepyLoadModel(data, mdlList):
	bs = NoeBitStream(data, NOE_BIGENDIAN)
	baseName = rapi.getExtensionlessName(rapi.getLocalFileName(rapi.getInputName()))
	ctx = rapi.rpgCreateContext()
	rapi.rpgSetOption(noesis.RPGOPT_BIGENDIAN, 1)
	Underline = "_"
    
	TextureNameList = []
	MeshNameList = []
	TransformList = []

	# Base Info
	bs.read(24)
	ShapeCount = bs.readUInt()
	ShapeDefOffset = bs.readUInt() + 8
	TransformCount = bs.readUInt()
	bs.read(4)
	TransformDefOffset = bs.readUInt() + 8
	bs.read(28)
	TextureCount = bs.readUInt()
	TextureDefOffset = bs.readUInt() + 8
    
	# Texture Definition
	bs.seek(TextureDefOffset, NOESEEK_ABS)
	for i in range(0, TextureCount):
		CurPos = bs.tell()
		TextureNameList.append(bs.readString())
		bs.seek(CurPos)
		bs.read(16)
        
	# Transform Definition
	bs.seek(TransformDefOffset, NOESEEK_ABS)
	for i in range(0, TransformCount):
		CurPos = bs.tell()
		MeshNameList.append(bs.readString())
		bs.seek(CurPos)
		bs.read(16)
		TransformBytes = bs.read(64)
		TransformList.append(TransformBytes)
        
	# Shape Definition
	bs.seek(ShapeDefOffset, NOESEEK_ABS)
	for j in range(0, ShapeCount):
		ShapeNum = "{:04d}".format(j)
		ElementCount = bs.readUInt()
		bs.read(8)
		TransformIndex = bs.readUInt() - 1
		bs.read(88)
		ElementBufferOffset = bs.readUInt() + 8
		bs.read(4)
		UnitVectorBufferOffset = bs.readUInt() + 8
		bs.read(4)
		TextureIndex = bs.readUInt()
		bs.read(32)
		IndexBufferOffset = bs.readUInt() + 8
		bs.read(24)
		EndOfInfo = bs.tell()
        
		bs.seek(ElementBufferOffset, NOESEEK_ABS)
		bs.read(4)
		ElementBuffer = bs.read(ElementCount * 28)
        
		bs.seek(UnitVectorBufferOffset, NOESEEK_ABS)
		UnitVectorBuffer = bs.read(ElementCount * 16)
        
		bs.seek(IndexBufferOffset, NOESEEK_ABS)
		bs.read(8)
		IndexCountOffset = bs.readUInt()
        
		bs.seek(IndexCountOffset, NOESEEK_ABS)
		IndexCount = bs.readUInt()
		bs.read(4)
		IndexBuffer = bs.read(IndexCount * 2)
        
		rapi.rpgBindPositionBufferOfs(ElementBuffer, noesis.RPGEODATA_FLOAT, 28, 0)
		rapi.rpgBindNormalBufferOfs(ElementBuffer, noesis.RPGEODATA_FLOAT, 28, 12)
		rapi.rpgBindUV1BufferOfs(UnitVectorBuffer, noesis.RPGEODATA_FLOAT, 16, 0)
		rapi.rpgBindUV2BufferOfs(UnitVectorBuffer, noesis.RPGEODATA_FLOAT, 16, 8)
        
		rapi.rpgSetName(baseName + Underline + MeshNameList[TransformIndex] + Underline + ShapeNum)
		rapi.rpgSetMaterial(TextureNameList[TextureIndex])
		rapi.rpgCommitTriangles(IndexBuffer, noesis.RPGEODATA_USHORT, IndexCount, noesis.RPGEO_TRIANGLE_STRIP)
		bs.seek(EndOfInfo, NOESEEK_ABS)

	mdl = rapi.rpgConstructModel()
	mdlList.append(mdl)
	return 1

Tried to use the noesis script, and most of the files worked, but some did not giving this error. Most of these "error files" are the "oct" files. Seeing if re-extracting the game will help.

Thanks for your help so far.

error ufc.png

Edited by Zanthrman9
Changed how I typed the sentence, but get the same point across.

  • Author

Sorry, should have clarified. It gives this error to all ymx files with oct in the name. As mentioned before, other ymx files are able to be viewed just fine, but for some reason, some cannot be opened.

  • Supporter

Post them...

EDiT: Yeah i see they are in octagon_00.pac etc... I will look at them.

Found the problem. It reads invalid character at TextureName.

Also these doesn't use 2 uv sets so i must create exception.

EDiT: Updated script, you can try now.

Edited by h3x3r

  • Author
On 7/18/2026 at 3:55 AM, h3x3r said:
##############################
get BaseFileName basename
get FileExtension extension
get FileSize asize

endian big

get ResourceCount uint32
getdstring Dummy 0x8
get TOCOffset uint32

goto TOCOffset

for i = 0 < ResourceCount
	getdstring ResourceName 0x10
	getdstring ResourceType 0x4
	get ResourceSize uint32
	get ResourceOffset uint32
	getdstring Dummy 0x4
	savepos cPos
	
	if ResourceType == "tex"
		goto ResourceOffset
		savepos ResourceBaseOffset
		get TexResourceCount uint32
		getdstring Dummy 0x8
		get TexTOCOffset uint32
		
		for j = 0 < TexResourceCount
			getdstring ResourceName 0x10
			getdstring ResourceType 0x4
			get TexResourceSize uint32
			get TexResourceOffset uint32
			getdstring Dummy 0x4
			savepos EndOfInfo
			
			math TexResourceOffset + ResourceBaseOffset
			math TexResourceSize - 16
			
			goto TexResourceOffset
			getdstring Dummy 0x4
			endian little
			get DecompressedSize uint32
			getdstring Dummy 0x8
			savepos Offset
			endian big
			goto EndOfInfo

			string Name p "%s/%s.%s" BaseFileName ResourceName ResourceType
			clog Name Offset TexResourceSize DecompressedSize
		next j
		goto cPos	
	else
		string Name p "%s/%s.%s" BaseFileName ResourceName ResourceType
		log Name ResourceOffset ResourceSize
	endif	
next i

I got the meshes from the octagon exported with no issues, but it seems that the .dds files the .tex quickbms script unpacks are unable to opened in GIMP, or PaintNET. Attached is a .dds file, not sure if it would be different compared to the ones you extracted.

c_pad_c_n.dds

  • Author
3 hours ago, h3x3r said:

Hmmm strange... it's compressed. Tell me name of the file. I'll take a look.

Had to zip up this one file to send it here. It should be this one. (it should also be in the stage folder named oct.tex if you still have it)

oct.zip

  • Supporter

That's wierd. When there is dds extension it should by uncompressed. But this one isn't. I will rewrite bms.

EDiT: Updated bms script... Now it should unpack it.

Edited by h3x3r

  • Author
19 hours ago, h3x3r said:

That's wierd. When there is dds extension it should by uncompressed. But this one isn't. I will rewrite bms.

EDiT: Updated bms script... Now it should unpack it.

I’ll test it when I am able.

  • Author
21 hours ago, h3x3r said:

That's wierd. When there is dds extension it should by uncompressed. But this one isn't. I will rewrite bms.

EDiT: Updated bms script... Now it should unpack it.

Unfortunately, it still does not open even after running the script with the new code. Really not sure what magic EA used to keep these files from being seen outside of the consoles. Still giving the same errors as before, saying its an invalid .dds.

Here's the first part of the Paint.NET error if that helps.

Exception:

System.FormatException: The DDS file is invalid.

at DdsFileTypePlus.DdsNative.Load(Stream stream, DDSLoadInfo& info) in D:\Dev_projects\DDSFileTypePlus\src\DdsNative.cs:line 57

at DdsFileTypePlus.DdsReader.Load(Stream input, IServiceProvider services) in D:\Dev_projects\DDSFileTypePlus\src\DdsReader.cs:line 30

at PaintDotNet.FileType.Load(Stream input) in D:\src\pdn\src_vPrev\Data\FileType.cs:line 513

at PaintDotNet.FileType.Load(Stream input) in D:\src\pdn\src_vPrev\Data\FileType.cs:line 513

at PaintDotNet.Functional.Func.Eval[T1,TRet](Func`2 f, T1 arg1) in D:\src\pdn\src_vPrev\Fundamentals\Functional\Func.cs:line 58

EDIT: Added the affected file along with the file sent previously, but with this new script.

g_a_00_blue.dds c_pad_c_n.dds

Edited by Zanthrman9

  • Supporter

Well it looks like i must download whole game then. These files are compresed too. Anyway thanks for feedback.

Are those files loose or did you unpack them?

Well the variation of compressed/uncompressed assets is insane. Characters are compressed but levels not. Same for textures.

Tested on characters but there are some fuckups.

image.png

Edited by h3x3r

  • Author
6 hours ago, h3x3r said:

Well it looks like i must download whole game then. These files are compresed too. Anyway thanks for feedback.

Are those files loose or did you unpack them?

Well the variation of compressed/uncompressed assets is insane. Characters are compressed but levels not. Same for textures.

Tested on characters but there are some fuckups.

image.png

I unpacked them with the script. This really is a pain to work with for no reason.

Thank you for your help so far, gotten so much further than any other attempt before.

  • Author
On 7/21/2026 at 1:39 PM, h3x3r said:

would you mind have extra scripts for .pac, .tex? because put it into one is pain.

I might, I will have to look for some incase I don't.

  • Supporter

O.K last time I updated bms script. Now it doesn't unpack textures directly from pac. Now you must unpack them individually. Same for pac inside pac.

  • Supporter

Well i revisited ymx format a bit and found new clues. Texture assign is completely wrong. It's assigned by a material. But somehow it works in some cases.

Once i figure everything out i will update the script.

EDiT: Updated 010 Template. I almost uncover everything. But what's wierd that it use more than one element buffer for same face buffer. Same for bone lengths.

Well i inspected those element buffers and they are different. Some kind of pre-deformation.

image.png

Edited by h3x3r

  • Author
On 7/28/2026 at 5:49 AM, h3x3r said:

Well i revisited ymx format a bit and found new clues. Texture assign is completely wrong. It's assigned by a material. But somehow it works in some cases.

Once i figure everything out i will update the script.

EDiT: Updated 010 Template. I almost uncover everything. But what's wierd that it use more than one element buffer for same face buffer. Same for bone lengths.

Well i inspected those element buffers and they are different. Some kind of pre-deformation.

image.png

Thank you for the work you have done so far. Also, I found the .tex script I remembered having, but it does not work for the EA .tex files. I don't know why each company has to have different ways to store the same file type.

  • Author
On 7/28/2026 at 5:49 AM, h3x3r said:

Well i revisited ymx format a bit and found new clues. Texture assign is completely wrong. It's assigned by a material. But somehow it works in some cases.

Once i figure everything out i will update the script.

EDiT: Updated 010 Template. I almost uncover everything. But what's wierd that it use more than one element buffer for same face buffer. Same for bone lengths.

Well i inspected those element buffers and they are different. Some kind of pre-deformation.

image.png

1 hour ago, Zanthrman9 said:

Thank you for the work you have done so far. Also, I found the .tex script I remembered having, but it does not work for the EA .tex files. I don't know why each company has to have different ways to store the same file type.

I tried to see if I could use any of the tools found in this thread for UFC 5 (https://reshax.com/topic/19175-ufc-5-ps5-frostbite-engine-cas/) but it seems I cannot use these tools, unless I have set up something wrong. Also, if it helps lighten the load for now, I'm just trying to get the octagon textures for now.

  • Supporter

I am close to finish this. But no skeleton, skin. I have parsed them. But not assembled.

So here is it. Most of characters will look like that.... Not big deal, just reassign mesh to the right material.

image.png

Also there are still some degenerated face indices. Mostly in maps/arenas. Just remove them. Mesh should be complete.

# Script by h3x3r

from inc_noesis import *
import noesis
import rapi
import os

def registerNoesisTypes():
   handle = noesis.register("UFC 3 - Mesh PS3", ".ymx")
   noesis.setHandlerTypeCheck(handle, noepyCheckType)
   noesis.setHandlerLoadModel(handle, noepyLoadModel)
   noesis.logPopup()
   return 1
        
def noepyCheckType(data):
	bs = NoeBitStream(data, NOE_BIGENDIAN)
	if len(data) < 20:
	    return 0
	if bs.readUInt() != 0x4A424F59:
	    return 0
	return 1
        
def noepyLoadModel(data, mdlList):
	bs = NoeBitStream(data, NOE_BIGENDIAN)
	baseName = rapi.getExtensionlessName(rapi.getLocalFileName(rapi.getInputName()))
	ctx = rapi.rpgCreateContext()
	rapi.rpgSetOption(noesis.RPGOPT_BIGENDIAN, 1)
	Underline = "_"
	Dummy = "dummy"
    
	BoneNameList = []
	BoneTransformList = []
	MeshNameList = []
	MaterialNameList = []
	TextureNameList = []

	# Base Definition
	JBOYSign = bs.read(4).decode('utf-8')
	Unknown_0 = bs.readUInt()
	Unknown_1 = bs.readUInt()
	Unknown_2 = bs.readUInt()
	Unknown_3 = bs.readUInt()
	Unknown_4 = bs.readUInt()
	ShapeCount = bs.readUInt()
	ShapeDefOffset = bs.readUInt() + 8
	BoneCount = bs.readUInt()
	TextureCount = bs.readUInt()
	BoneDefOffset = bs.readUInt() + 8
	TextureDefOffset = bs.readUInt() + 8
	MeshDefOffset = bs.readUInt() + 8
	MeshCount = bs.readUInt()
	Reserved = bs.read(16)
	MaterialCount = bs.readUInt()
	MaterialDefOffset = bs.readUInt() + 8
    
	# Bone Definition
	bs.seek(BoneDefOffset, NOESEEK_ABS)
	for bone in range(0, BoneCount):
		StrOffset = bs.tell()
		MaxCharCheck = bs.readUByte()
		if MaxCharCheck < 128:
		    bs.seek(StrOffset, NOESEEK_ABS)
		    BoneNameTmp = bs.readString()
            
		BoneNameList.append(BoneNameTmp)
		bs.seek(StrOffset, NOESEEK_ABS)
		bs.read(16)
		BoneTransformBytes = bs.read(64)
		BoneTransformList.append(BoneTransformBytes)

	# Texture Name Definition
	bs.seek(TextureDefOffset, NOESEEK_ABS)
	for texture in range(0, TextureCount):
		StrOffset = bs.tell()
		MaxCharCheck = bs.readUByte()
		if MaxCharCheck < 128:
		    bs.seek(StrOffset, NOESEEK_ABS)
		    TextureNameTmp = bs.readString()
		else:
		    TextureNameTmp = Dummy
            
		TextureNameList.append(TextureNameTmp)
		bs.seek(StrOffset, NOESEEK_ABS)
		bs.read(16)
    
	# Mesh Name Definition
	bs.seek(MeshDefOffset, NOESEEK_ABS)
	for mesh in range(0, MeshCount):
		StrOffset = bs.tell()
		MaxCharCheck = bs.readUByte()
		if MaxCharCheck < 128:
		    bs.seek(StrOffset, NOESEEK_ABS)
		    MeshNameTmp = bs.readString()
		else:
		    MeshNameTmp = Dummy
            
		MeshNameList.append(MeshNameTmp)
		bs.seek(StrOffset, NOESEEK_ABS)
		bs.read(16)
		Unknown_0 = bs.readUInt()
		Unknown_1 = bs.readUInt()
		ShapeIndex = bs.readUInt()
		Unknown_2 = bs.readUInt()

	# Material Name Definition
	bs.seek(MaterialDefOffset, NOESEEK_ABS)
	for material in range(0, MaterialCount):
		StrOffset = bs.tell()
		MaxCharCheck = bs.readUByte()
		if MaxCharCheck < 128:
		    bs.seek(StrOffset, NOESEEK_ABS)
		    MaterialNameTmp = bs.readString()
		else:
		    MaterialNameTmp = Dummy
            
		MaterialNameList.append(MaterialNameTmp)
		bs.seek(StrOffset, NOESEEK_ABS)
		bs.read(16)
   
	# Shape Definition
	bs.seek(ShapeDefOffset, NOESEEK_ABS)
	for shape in range(0, ShapeCount):
		ShapeNum = "{:04d}".format(shape)
		ElementCount = bs.readUInt()
		IndexChunkCount = bs.readUInt()
		UsedBoneCount = bs.readUInt()
		for boneindex in range(0, 20):
		    BoneIndex = bs.readInt()

		BoneLengthSetCount = bs.readUInt()
		MeshNameIndex = bs.readUInt()
		ElementSetCount = bs.readUInt()
		ElementSetBaseOffset = bs.readUInt() + 8
		BoneLengthSetBaseOffset = bs.readUInt() + 8
		UnitVectorBaseOffset = bs.readUInt() + 8
		BoneSkinIndiceBaseOffset = bs.readUInt() + 8
		MaterialNameIndex = bs.readUInt()
		Unknown_1 = bs.read(2)
		SkinStrOffset = bs.tell()
		SkinName = bs.readString()
		bs.seek(SkinStrOffset, NOESEEK_ABS)
		bs.read(14)
		Unknown_2 = bs.readUInt()
		Unknown_3 = bs.readUInt()
		MaterialCount = bs.readUInt()
		MaterialDefOffset = bs.readUInt() + 8
		FaceIndiceBaseOffset = bs.readUInt() + 8
		ElementCount_t = bs.readUInt()
		UVSizeFlag = bs.readUInt()
		BBox = bs.read(16)
		EndOfShapeInfo = bs.tell()
		
        # Materials
        #bs.seek(MaterialDefOffset, NOESEEK_ABS)
        #for material in range(0, MaterialCount):
		#    MaterialOffset = bs.readUInt() + 8
		#    EndOfInfo = bs.tell()
        #    
		#    bs.seek(MaterialOffset, NOESEEK_ABS)
		#    MatStrOffset = bs.tell()
		#    MaterialDefName = bs.readString()
		#    bs.seek(MatStrOffset, NOESEEK_ABS)
		#    bs.read(16)
		#    Unknown_0 = bs.readUShort()
		#    Unknown_1 = bs.readUShort()
		#    if Unknown_0 == 15:
		#        TextureIndex = bs.readUInt()
        #
		#    bs.seek(EndOfInfo, NOESEEK_ABS)
        
		# This is material hack
		bs.seek(MaterialDefOffset, NOESEEK_ABS)
		bs.read(MaterialCount * 4) 
		MaterialOffset = bs.tell()
		bs.read(MaterialCount * 24)
		MaterialEndOffset = bs.tell()
		g_mDiffusePrmOffset = data.find(b'\x67\x5F\x6D\x44\x69\x66\x66\x75\x73\x65\x50\x72\x6D', MaterialOffset, MaterialEndOffset)
		g_texDiffuseOffset = data.find(b'\x67\x5F\x74\x65\x78\x44\x69\x66\x66\x75\x73\x65', MaterialOffset, MaterialEndOffset)
		if g_mDiffusePrmOffset != -1:
		    bs.seek(g_mDiffusePrmOffset, NOESEEK_ABS)
		    bs.read(20)
		    TextureIndex = bs.readUInt()
		    rapi.rpgSetMaterial(TextureNameList[TextureIndex])
		elif g_texDiffuseOffset != -1:
		    bs.seek(g_texDiffuseOffset, NOESEEK_ABS)
		    bs.read(20)
		    TextureIndex = bs.readUInt()
		    rapi.rpgSetMaterial(TextureNameList[TextureIndex])
		else:
		    rapi.rpgSetMaterial(Dummy)
            
		# Elements
		bs.seek(ElementSetBaseOffset, NOESEEK_ABS)
		bs.read(ElementSetCount * 4)
		ElementBuffer = bs.read(ElementCount * 28)
		rapi.rpgBindPositionBufferOfs(ElementBuffer, noesis.RPGEODATA_FLOAT, 28, 0)
		rapi.rpgBindNormalBufferOfs(ElementBuffer, noesis.RPGEODATA_FLOAT, 28, 12)
		#rapi.rpgBindColorBufferOfs(ElementBuffer, noesis.RPGEODATA_UBYTE, 28, 24, 4)
        
		# Bone Lengths
		bs.seek(BoneLengthSetBaseOffset, NOESEEK_ABS)
		BoneLengthBuffer = bs.read(ElementCount * 8)
		#rapi.rpgBindBoneIndexBufferOfs(BoneLengthBuffer, noesis.RPGEODATA_BYTE, 8, 0, 1)
        
		# Unit Vectors
		bs.seek(UnitVectorBaseOffset, NOESEEK_ABS)
		if UVSizeFlag == 2:
		    UnitVectorBuffer = bs.read(ElementCount * 24)
		    rapi.rpgBindUV1BufferOfs(UnitVectorBuffer, noesis.RPGEODATA_FLOAT, 24, 0)
		elif UVSizeFlag == 1:
		    UnitVectorBuffer = bs.read(ElementCount * 16)
		    rapi.rpgBindUV1BufferOfs(UnitVectorBuffer, noesis.RPGEODATA_FLOAT, 16, 0)
		else:
		    UnitVectorBuffer = bs.read(ElementCount * 8)
		    rapi.rpgBindUV1BufferOfs(UnitVectorBuffer, noesis.RPGEODATA_FLOAT, 8, 0)

        # Bone Skin Indices
		if BoneSkinIndiceBaseOffset != FaceIndiceBaseOffset:
		    bs.seek(BoneSkinIndiceBaseOffset, NOESEEK_ABS)
		    BoneSkinBuffer = bs.read(ElementCount * 12)
		    #rapi.rpgBindBoneWeightBufferOfs(BoneSkinBuffer, noesis.RPGEODATA_FLOAT, 12, 0, 3)
		
		# Face Indices
		bs.seek(FaceIndiceBaseOffset, NOESEEK_ABS)
		IndexCount = int()
		rapi.rpgSetOption(noesis.RPGOPT_TRIWINDBACKWARD, 1)
		for chunk in range(0, IndexChunkCount):
		    Unknown = bs.readUInt()
		    IndexCount += bs.readUInt()
		    IndexCountOffset = bs.readUInt()
            
		IndexBuffer = bs.read(IndexCount * 2)
		rapi.rpgSetName(baseName + Underline + MeshNameList[MeshNameIndex] + Underline + ShapeNum)
		rapi.rpgCommitTriangles(IndexBuffer, noesis.RPGEODATA_USHORT, IndexCount, noesis.RPGEO_TRIANGLE_STRIP)
        
		bs.seek(EndOfShapeInfo, NOESEEK_ABS)
	mdl = rapi.rpgConstructModel()
	mdlList.append(mdl)
	return 1

Edited by h3x3r

  • Author
7 hours ago, h3x3r said:

I am close to finish this. But no skeleton, skin. I have parsed them. But not assembled.

So here is it. Most of characters will look like that.... Not big deal, just reassign mesh to the right material.

image.png

Also there are still some degenerated face indices. Mostly in maps/arenas. Just remove them. Mesh should be complete.

# Script by h3x3r

from inc_noesis import *
import noesis
import rapi
import os

def registerNoesisTypes():
   handle = noesis.register("UFC 3 - Mesh PS3", ".ymx")
   noesis.setHandlerTypeCheck(handle, noepyCheckType)
   noesis.setHandlerLoadModel(handle, noepyLoadModel)
   noesis.logPopup()
   return 1
        
def noepyCheckType(data):
	bs = NoeBitStream(data, NOE_BIGENDIAN)
	if len(data) < 20:
	    return 0
	if bs.readUInt() != 0x4A424F59:
	    return 0
	return 1
        
def noepyLoadModel(data, mdlList):
	bs = NoeBitStream(data, NOE_BIGENDIAN)
	baseName = rapi.getExtensionlessName(rapi.getLocalFileName(rapi.getInputName()))
	ctx = rapi.rpgCreateContext()
	rapi.rpgSetOption(noesis.RPGOPT_BIGENDIAN, 1)
	Underline = "_"
	Dummy = "dummy"
    
	BoneNameList = []
	BoneTransformList = []
	MeshNameList = []
	MaterialNameList = []
	TextureNameList = []

	# Base Definition
	JBOYSign = bs.read(4).decode('utf-8')
	Unknown_0 = bs.readUInt()
	Unknown_1 = bs.readUInt()
	Unknown_2 = bs.readUInt()
	Unknown_3 = bs.readUInt()
	Unknown_4 = bs.readUInt()
	ShapeCount = bs.readUInt()
	ShapeDefOffset = bs.readUInt() + 8
	BoneCount = bs.readUInt()
	TextureCount = bs.readUInt()
	BoneDefOffset = bs.readUInt() + 8
	TextureDefOffset = bs.readUInt() + 8
	MeshDefOffset = bs.readUInt() + 8
	MeshCount = bs.readUInt()
	Reserved = bs.read(16)
	MaterialCount = bs.readUInt()
	MaterialDefOffset = bs.readUInt() + 8
    
	# Bone Definition
	bs.seek(BoneDefOffset, NOESEEK_ABS)
	for bone in range(0, BoneCount):
		StrOffset = bs.tell()
		MaxCharCheck = bs.readUByte()
		if MaxCharCheck < 128:
		    bs.seek(StrOffset, NOESEEK_ABS)
		    BoneNameTmp = bs.readString()
            
		BoneNameList.append(BoneNameTmp)
		bs.seek(StrOffset, NOESEEK_ABS)
		bs.read(16)
		BoneTransformBytes = bs.read(64)
		BoneTransformList.append(BoneTransformBytes)

	# Texture Name Definition
	bs.seek(TextureDefOffset, NOESEEK_ABS)
	for texture in range(0, TextureCount):
		StrOffset = bs.tell()
		MaxCharCheck = bs.readUByte()
		if MaxCharCheck < 128:
		    bs.seek(StrOffset, NOESEEK_ABS)
		    TextureNameTmp = bs.readString()
		else:
		    TextureNameTmp = Dummy
            
		TextureNameList.append(TextureNameTmp)
		bs.seek(StrOffset, NOESEEK_ABS)
		bs.read(16)
    
	# Mesh Name Definition
	bs.seek(MeshDefOffset, NOESEEK_ABS)
	for mesh in range(0, MeshCount):
		StrOffset = bs.tell()
		MaxCharCheck = bs.readUByte()
		if MaxCharCheck < 128:
		    bs.seek(StrOffset, NOESEEK_ABS)
		    MeshNameTmp = bs.readString()
		else:
		    MeshNameTmp = Dummy
            
		MeshNameList.append(MeshNameTmp)
		bs.seek(StrOffset, NOESEEK_ABS)
		bs.read(16)
		Unknown_0 = bs.readUInt()
		Unknown_1 = bs.readUInt()
		ShapeIndex = bs.readUInt()
		Unknown_2 = bs.readUInt()

	# Material Name Definition
	bs.seek(MaterialDefOffset, NOESEEK_ABS)
	for material in range(0, MaterialCount):
		StrOffset = bs.tell()
		MaxCharCheck = bs.readUByte()
		if MaxCharCheck < 128:
		    bs.seek(StrOffset, NOESEEK_ABS)
		    MaterialNameTmp = bs.readString()
		else:
		    MaterialNameTmp = Dummy
            
		MaterialNameList.append(MaterialNameTmp)
		bs.seek(StrOffset, NOESEEK_ABS)
		bs.read(16)
   
	# Shape Definition
	bs.seek(ShapeDefOffset, NOESEEK_ABS)
	for shape in range(0, ShapeCount):
		ShapeNum = "{:04d}".format(shape)
		ElementCount = bs.readUInt()
		IndexChunkCount = bs.readUInt()
		UsedBoneCount = bs.readUInt()
		for boneindex in range(0, 20):
		    BoneIndex = bs.readInt()

		BoneLengthSetCount = bs.readUInt()
		MeshNameIndex = bs.readUInt()
		ElementSetCount = bs.readUInt()
		ElementSetBaseOffset = bs.readUInt() + 8
		BoneLengthSetBaseOffset = bs.readUInt() + 8
		UnitVectorBaseOffset = bs.readUInt() + 8
		BoneSkinIndiceBaseOffset = bs.readUInt() + 8
		MaterialNameIndex = bs.readUInt()
		Unknown_1 = bs.read(2)
		SkinStrOffset = bs.tell()
		SkinName = bs.readString()
		bs.seek(SkinStrOffset, NOESEEK_ABS)
		bs.read(14)
		Unknown_2 = bs.readUInt()
		Unknown_3 = bs.readUInt()
		MaterialCount = bs.readUInt()
		MaterialDefOffset = bs.readUInt() + 8
		FaceIndiceBaseOffset = bs.readUInt() + 8
		ElementCount_t = bs.readUInt()
		UVSizeFlag = bs.readUInt()
		BBox = bs.read(16)
		EndOfShapeInfo = bs.tell()
		
        # Materials
        #bs.seek(MaterialDefOffset, NOESEEK_ABS)
        #for material in range(0, MaterialCount):
		#    MaterialOffset = bs.readUInt() + 8
		#    EndOfInfo = bs.tell()
        #    
		#    bs.seek(MaterialOffset, NOESEEK_ABS)
		#    MatStrOffset = bs.tell()
		#    MaterialDefName = bs.readString()
		#    bs.seek(MatStrOffset, NOESEEK_ABS)
		#    bs.read(16)
		#    Unknown_0 = bs.readUShort()
		#    Unknown_1 = bs.readUShort()
		#    if Unknown_0 == 15:
		#        TextureIndex = bs.readUInt()
        #
		#    bs.seek(EndOfInfo, NOESEEK_ABS)
        
		# This is material hack
		bs.seek(MaterialDefOffset, NOESEEK_ABS)
		bs.read(MaterialCount * 4) 
		MaterialOffset = bs.tell()
		bs.read(MaterialCount * 24)
		MaterialEndOffset = bs.tell()
		g_mDiffusePrmOffset = data.find(b'\x67\x5F\x6D\x44\x69\x66\x66\x75\x73\x65\x50\x72\x6D', MaterialOffset, MaterialEndOffset)
		g_texDiffuseOffset = data.find(b'\x67\x5F\x74\x65\x78\x44\x69\x66\x66\x75\x73\x65', MaterialOffset, MaterialEndOffset)
		if g_mDiffusePrmOffset != -1:
		    bs.seek(g_mDiffusePrmOffset, NOESEEK_ABS)
		    bs.read(20)
		    TextureIndex = bs.readUInt()
		    rapi.rpgSetMaterial(TextureNameList[TextureIndex])
		elif g_texDiffuseOffset != -1:
		    bs.seek(g_texDiffuseOffset, NOESEEK_ABS)
		    bs.read(20)
		    TextureIndex = bs.readUInt()
		    rapi.rpgSetMaterial(TextureNameList[TextureIndex])
		else:
		    rapi.rpgSetMaterial(Dummy)
            
		# Elements
		bs.seek(ElementSetBaseOffset, NOESEEK_ABS)
		bs.read(ElementSetCount * 4)
		ElementBuffer = bs.read(ElementCount * 28)
		rapi.rpgBindPositionBufferOfs(ElementBuffer, noesis.RPGEODATA_FLOAT, 28, 0)
		rapi.rpgBindNormalBufferOfs(ElementBuffer, noesis.RPGEODATA_FLOAT, 28, 12)
		#rapi.rpgBindColorBufferOfs(ElementBuffer, noesis.RPGEODATA_UBYTE, 28, 24, 4)
        
		# Bone Lengths
		bs.seek(BoneLengthSetBaseOffset, NOESEEK_ABS)
		BoneLengthBuffer = bs.read(ElementCount * 8)
		#rapi.rpgBindBoneIndexBufferOfs(BoneLengthBuffer, noesis.RPGEODATA_BYTE, 8, 0, 1)
        
		# Unit Vectors
		bs.seek(UnitVectorBaseOffset, NOESEEK_ABS)
		if UVSizeFlag == 2:
		    UnitVectorBuffer = bs.read(ElementCount * 24)
		    rapi.rpgBindUV1BufferOfs(UnitVectorBuffer, noesis.RPGEODATA_FLOAT, 24, 0)
		elif UVSizeFlag == 1:
		    UnitVectorBuffer = bs.read(ElementCount * 16)
		    rapi.rpgBindUV1BufferOfs(UnitVectorBuffer, noesis.RPGEODATA_FLOAT, 16, 0)
		else:
		    UnitVectorBuffer = bs.read(ElementCount * 8)
		    rapi.rpgBindUV1BufferOfs(UnitVectorBuffer, noesis.RPGEODATA_FLOAT, 8, 0)

        # Bone Skin Indices
		if BoneSkinIndiceBaseOffset != FaceIndiceBaseOffset:
		    bs.seek(BoneSkinIndiceBaseOffset, NOESEEK_ABS)
		    BoneSkinBuffer = bs.read(ElementCount * 12)
		    #rapi.rpgBindBoneWeightBufferOfs(BoneSkinBuffer, noesis.RPGEODATA_FLOAT, 12, 0, 3)
		
		# Face Indices
		bs.seek(FaceIndiceBaseOffset, NOESEEK_ABS)
		IndexCount = int()
		rapi.rpgSetOption(noesis.RPGOPT_TRIWINDBACKWARD, 1)
		for chunk in range(0, IndexChunkCount):
		    Unknown = bs.readUInt()
		    IndexCount += bs.readUInt()
		    IndexCountOffset = bs.readUInt()
            
		IndexBuffer = bs.read(IndexCount * 2)
		rapi.rpgSetName(baseName + Underline + MeshNameList[MeshNameIndex] + Underline + ShapeNum)
		rapi.rpgCommitTriangles(IndexBuffer, noesis.RPGEODATA_USHORT, IndexCount, noesis.RPGEO_TRIANGLE_STRIP)
        
		bs.seek(EndOfShapeInfo, NOESEEK_ABS)
	mdl = rapi.rpgConstructModel()
	mdlList.append(mdl)
	return 1

It works with fighters, but it does not seem to work with oct.ymx, or any of the stage files for some reason. Super close though since the fighters textures are starting to show up.

image.png

  • Supporter

Looks fine to me...

image.png

Unpack the tex file with bms script. It works for *.pac and *.tex

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.