XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Sat Nov 17, 2018 10:20 pm

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: [request] kao the kangaroo .bin .msh files
PostPosted: Thu Jul 05, 2018 6:20 pm 
Offline
advanced

Joined: Sat Oct 30, 2010 11:57 am
Posts: 75
Has thanked: 1 time
Have thanks: 5 times

Good job, thank you shakotay2, at least this gives me a hint.

You can make the ads go away by registering



Top
 Profile  
 
 Post subject: Re: [request] kao the kangaroo .bin .msh files
PostPosted: Thu Jul 05, 2018 9:52 pm 
Offline
ultra-n00b
User avatar

Joined: Mon Sep 08, 2014 7:34 pm
Posts: 6
Location: Polska
Has thanked: 0 time
Have thanks: 9 times
Here is a quick documentation for Kao1 animmesh files:
https://drive.google.com/file/d/1g0gnnVEoytfd3wPh1dZGZ6geV5HMrOqI/view?usp=sharing


Top
 Profile  
 
 Post subject: Re: [request] kao the kangaroo .bin .msh files
PostPosted: Sun Aug 12, 2018 7:25 pm 
Offline
advanced

Joined: Sat Oct 30, 2010 11:57 am
Posts: 75
Has thanked: 1 time
Have thanks: 5 times
Small progress, vertices can be read, but problem is with faces, with 1 object and 1 vertex group works but with more than 1 vertex group is error and i not know, how to implement dummy object.
Only vertices works.
Code:
---------------------------
Noesis Python Error
---------------------------
Traceback (most recent call last):
  File "D:\bogus pliki\noesis\plugins\python\fmt_Kao_the_Kangaroo.py", line 54, in noepyLoadModel
    rapi.rpgCommitTriangles(FaceBuff, noesis.RPGEODATA_USHORT, numfaces, noesis.RPGEO_TRIANGLE, 1)
RuntimeError: Number of indices must be evenly divisible by 3 with RPGEO_TRIANGLE

---------------------------
OK   
---------------------------

Here is current noesis script
Code:
from inc_noesis import *
import noesis
import rapi

def registerNoesisTypes():
    handle = noesis.register("Kao the Kangaroo", ".bin")
    noesis.setHandlerTypeCheck(handle, noepyCheckType)
    noesis.setHandlerLoadModel(handle, noepyLoadModel)
    return 1

def noepyCheckType(data):
    bs = NoeBitStream(data)
    Header = bs.readBytes(4)
    if Header != b'T83d':
        return 0
    return 1

def noepyLoadModel(data, mdlList):
    noesis.logPopup()
    ctx = rapi.rpgCreateContext()
    bs = NoeBitStream(data)
    bs.seek(0x0C, NOESEEK_ABS)
    nummeshes = bs.readInt()
    print("number of meshes", nummeshes)
    numfaces = bs.readInt()
    print("number of faces", numfaces)
    numanims = bs.readInt()
    print("number of animations", numanims)
    bs.seek(0x4C, NOESEEK_ABS)

    for i in range(nummeshes):
        numverts = bs.readInt()
        print("number of vertices", numverts)
        numvertgroups = bs.readInt()
        print("number of vertex groups", numvertgroups)
        meshname= (bs.readBytes(32).decode("ASCII").rstrip("\0"))
        print(meshname)
        unknown = bs.readInt()

    for i in range(nummeshes):
        faces = []
        size = bs.readBytes(16*numfaces)
        for j in range(numfaces):
            idx = size[j*16] + size[j*16 + 1]*256
            faces.append(idx)
            idx = size[j*16 + 4] + size[j*16 + 5]*256
            faces.append(idx)
            idx = size[j*16+ 8] + size[j*16 + 9]*256
            faces.append(idx)
        print(faces)
        FaceBuff = struct.pack('H' * len(faces), *faces)
        for j in range(numvertgroups):
            VertBuff = bs.readBytes(numverts * 16)
            rapi.rpgBindPositionBufferOfs(VertBuff, noesis.RPGEODATA_FLOAT, 16, 0)
            rapi.rpgCommitTriangles(None, noesis.RPGEODATA_USHORT, numverts, noesis.RPGEO_POINTS, 1)

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

    rapi.rpgClearBufferBinds()
    return 1




Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: Google [Bot], Sadtin and 2 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