XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Wed Aug 15, 2018 9:17 pm

All times are UTC + 1 hour

Forum rules

Please click here to view the forum rules

Post new topic Reply to topic  [ 63 posts ]  Go to page Previous  1, 2, 3, 4, 5
Author Message
 Post subject: Re: 3D model reversing compilation
PostPosted: Sun Mar 05, 2017 12:53 am 
M-M-M-Monster veteran
M-M-M-Monster veteran
User avatar

Joined: Fri Apr 20, 2012 9:24 am
Posts: 2351
Location: Nexus, searching for Jim Kirk
Has thanked: 543 times
Have thanks: 1223 times

blackracer wrote:
I decided to explore the noesis but I did not get to do one-stop solution for all model files ((
Seems you didn't even get the solution for loading one img file.
in def noepyCheckType(data):
if bs.readBytes(4).decode,
so (4) not (8)

why do you try to get VCount from address 0x0004?
bs.seek(0x4, NOESEEK_ABS)
VBytes = 36
VCount = bs.readUInt() // VBytes

Your reading the VBuf then IBuf, though IBuf comes first in wheel_rays_te37.img,
your reading short instead of float, you're reading triangles, though you used Strip with hex2obj,
guess you don't know what you're doing with that script, do you?

There's a basic tutorial from chrrox here: viewtopic.php?f=29&t=7760
Here's your modified script that does import the wheel only, counts set manually:
from inc_noesis import *
import noesis
import rapi

def registerNoesisTypes():
    handle = noesis.register("TestScriptGame", ".img")
    noesis.setHandlerTypeCheck(handle, noepyCheckType)
    noesis.setHandlerLoadModel(handle, noepyLoadModel)
    return 1

def noepyCheckType(data):
   bs = NoeBitStream(data)
   if len(data) < 8:
      return 0
   if bs.readBytes(4).decode("ASCII").rstrip("\0") != NOEPY_HEADER:
      return 0
   return 1 

def noepyLoadModel(data, mdlList):
    ctx = rapi.rpgCreateContext()
    bs = NoeBitStream(data)
    fileName = rapi.getLocalFileName(rapi.getInputName()).rstrip(".img")
    bs.seek(0xFE3, NOESEEK_ABS)

    #FCount = bs.readUInt() // 2
    FCount = 513
    IBuf = bs.readBytes(FCount * 2)

    bs.seek(0x20C0, NOESEEK_ABS)
    VBytes = 36           
    #VCount = bs.readUInt() // VBytes
    VCount = 200
    VBuf = bs.readBytes(VCount * VBytes)
    #skip = bs.readBytes(8)

    rapi.rpgBindPositionBufferOfs(VBuf, noesis.RPGEODATA_FLOAT, VBytes, 0)   
    rapi.rpgBindUV1BufferOfs(VBuf, noesis.RPGEODATA_SHORT, VBytes, 28)   
    rapi.rpgCommitTriangles(IBuf, noesis.RPGEODATA_USHORT, FCount, noesis.RPGEO_TRIANGLE_STRIP, 1) #SHORT for word indices
    mdl = rapi.rpgConstructModel()                                                         
    return 1

Here I made a template, you can help me fix it to read model with names of the textures.

Getting textures is the next step. Try to get the models first.

You can make the ads go away by registering

Bigchillghost, Reverse Engineering a Game Model: http://forum.xentax.com/viewtopic.php?f=29&t=17889
extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894

 Post subject: Re: 3D model reversing compilation
PostPosted: Sun Mar 05, 2017 1:11 am 
User avatar

Joined: Sat Jun 27, 2015 1:20 pm
Posts: 51
Has thanked: 30 times
Have thanks: 47 times
Yes, I really do not quite understand, thank you very much for the modification of the script in the first place I need to understand the structure of hex.
Next step I will try to read all meshes in this format.
I have been studying this tutorial :)

 Post subject: Re: 3D model reversing compilation
PostPosted: Thu Aug 10, 2017 10:04 am 

Joined: Thu Aug 10, 2017 9:59 am
Posts: 2
Has thanked: 0 time
Have thanks: 0 time
It is quite difficult to understand, but I can see the model structures.

Hey all

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 63 posts ]  Go to page Previous  1, 2, 3, 4, 5

All times are UTC + 1 hour

Who is online

Users browsing this forum: Darko and 13 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group