The Forum is up for sale: XeNTaX Forum looking for new owner
Tian Xia 3 models
- Durik256
- ultra-veteran

- Posts: 425
- Joined: Wed Nov 21, 2018 7:26 pm
- Has thanked: 45 times
- Been thanked: 411 times
Re: Tian Xia 3 models
i made lugin for Noesis
link plugin
You do not have the required permissions to view the files attached to this post.
Last edited by Durik256 on Tue Jun 20, 2023 5:54 pm, edited 2 times in total.
-
moonpaladin
- ultra-veteran

- Posts: 398
- Joined: Tue Mar 05, 2019 6:24 am
- Has thanked: 286 times
- Been thanked: 18 times
Re: Tian Xia 3 models
Code: Select all
def noepyCheckType(data):
bs = NoeBitStream(data)
file = bs.readUInt()
if file == 0x42A14E65:
return 1
else:
return 0
- shakotay2
- MEGAVETERAN

- Posts: 4231
- Joined: Fri Apr 20, 2012 9:24 am
- Location: Nexus, searching for Jim Kirk
- Has thanked: 1139 times
- Been thanked: 2222 times
Re: Tian Xia 3 models
Little endian data definition: a value of 0x1234ABCD for example is CDAB3412 in the file(s). Don't ask me why, accept it.
(In big endian formats the value would be stored as 1234ABCD, surprise. High word (1234), then low word (ABCD) so humans can read it without headaches
.) If they know hex.
(In big endian formats the value would be stored as 1234ABCD, surprise. High word (1234), then low word (ABCD) so humans can read it without headaches
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
-
moonpaladin
- ultra-veteran

- Posts: 398
- Joined: Tue Mar 05, 2019 6:24 am
- Has thanked: 286 times
- Been thanked: 18 times
Re: Tian Xia 3 models
Code: Select all
def noepyLoadModel(data, mdlList):
ctx = rapi.rpgCreateContext()
bs = NoeBitStream(data)
#rapi.rpgClearBufferBinds()
bs.seek(0x20DC, NOESEEK_ABS)
vertsCount = bs.readUInt()
faceCount = bs.readUInt()
bs.seek(0x44, NOESEEK_ABS)
uvAddr = bs.readUInt()
uvAddr += 12
bs.seek(0xB4, NOESEEK_ABS)
FIaddr = bs.readUInt()
bs.seek(0x12C, NOESEEK_ABS)
VertBuf = bs.readBytes(vertsCount * 12)
bs.seek(uvAddr, NOESEEK_ABS)
uv1Buf = bs.readBytes(vertsCount * 8)
bs.seek(FIaddr, NOESEEK_ABS)
idxBuf = bs.readBytes(faceCount * 12)
rapi.rpgBindPositionBufferOfs(VertBuf, noesis.RPGEODATA_FLOAT, 12, 0)
rapi.rpgBindUV1Buffer(uv1Buf, noesis.RPGEODATA_FLOAT, 12)
rapi.rpgCommitTriangles(idxBuf, noesis.RPGEODATA_UINT, faceCount*3, noesis.RPGEO_TRIANGLE, 1)
mdl = rapi.rpgConstructModel()
mdlList.append(mdl)
return 1
- shakotay2
- MEGAVETERAN

- Posts: 4231
- Joined: Fri Apr 20, 2012 9:24 am
- Location: Nexus, searching for Jim Kirk
- Has thanked: 1139 times
- Been thanked: 2222 times
Re: Tian Xia 3 models
Long way to go - google for python seek()
Noesis functions to be found in pluginshare.h (see pluginsource.zip)
void (*rpgCommitTriangles)(void *idxData, rpgeoDataType_e dataType, int numIdx, rpgeoPrimType_e primType, bool usePlotMap);
It's to understand the parameters only - keep in mind that .h is a C header file.
(Dunno whether there's a commented Noesis python functions parameter list, but the above should do.)
Noesis functions to be found in pluginshare.h (see pluginsource.zip)
void (*rpgCommitTriangles)(void *idxData, rpgeoDataType_e dataType, int numIdx, rpgeoPrimType_e primType, bool usePlotMap);
It's to understand the parameters only - keep in mind that .h is a C header file.
(Dunno whether there's a commented Noesis python functions parameter list, but the above should do.)
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
- Durik256
- ultra-veteran

- Posts: 425
- Joined: Wed Nov 21, 2018 7:26 pm
- Has thanked: 45 times
- Been thanked: 411 times
Re: Tian Xia 3 models
"bs" - NoeBitStream()moonpaladin wrote: ↑Sun Feb 20, 2022 10:16 pm Still trying to understand what is bs.seek and the rpgCommitTriangles![]()
"seek" - sets the position within the current stream.
(NOESEEK_REL-from current position and NOESEEK_ABS- from the beginning of the file)
"rpgCommitTriangles" collects faces from bytes (args=bytes for index buffer, dataType, numIdx, primType)
in files (00000726.dat) and (000000000000c4fe.dat) have swapped vertices with faces.
using the (iSize and vSize) it can be easily solved.
Last edited by Durik256 on Tue Jun 20, 2023 5:55 pm, edited 2 times in total.
-
moonpaladin
- ultra-veteran

- Posts: 398
- Joined: Tue Mar 05, 2019 6:24 am
- Has thanked: 286 times
- Been thanked: 18 times
Re: Tian Xia 3 models
Yep! but is the position I have been using in the hex2obj is slighty different so need to know why I need to use different values there, gonna review your script.
Yep I was worried for it too, but seems that for someone skilled doing scripts is a very easy xD, thanks for it, gonna learn the basis with this script, I know these models are basic because it have a very easy pattern. Again thanks and sorry for so many requests.
-
moonpaladin
- ultra-veteran

- Posts: 398
- Joined: Tue Mar 05, 2019 6:24 am
- Has thanked: 286 times
- Been thanked: 18 times
Re: Tian Xia 3 models
Well there is much to learn
Code: Select all
def noepyCheckType(data):
bs = NoeBitStream(data)
if bs.readInt64() != 8391166444416618085:
return 0
return 1eN¡Blist : 7473696C42A14E65 = 8391166444416618085
The other value that I'm not sure is :
Code: Select all
bs.seek(16, NOESEEK_REL)
and how about the
Code: Select all
bs.seek(64, NOESEEK_REL)Code: Select all
bs.seek(4)-
moonpaladin
- ultra-veteran

- Posts: 398
- Joined: Tue Mar 05, 2019 6:24 am
- Has thanked: 286 times
- Been thanked: 18 times
-
moonpaladin
- ultra-veteran

- Posts: 398
- Joined: Tue Mar 05, 2019 6:24 am
- Has thanked: 286 times
- Been thanked: 18 times
Re: Tian Xia 3 models
Well is really weird I'm getting around four different types of errors xD, and this meshes have same pattern, I tried to tweak the script a bit to it not thrown error but still getting errors, or is my noesis? I had this kind of "C error" time ago :salty:
https://www.mediafire.com/file/ofnw5r2b ... 2.zip/file
https://www.mediafire.com/file/ofnw5r2b ... 2.zip/file
- Durik256
- ultra-veteran

- Posts: 425
- Joined: Wed Nov 21, 2018 7:26 pm
- Has thanked: 45 times
- Been thanked: 411 times
Re: Tian Xia 3 models
position is the same.moonpaladin wrote: ↑Mon Feb 21, 2022 3:18 am the position I have been using in the hex2obj is slighty different
not so simple.
"def noepyCheckType(data):" and "def noepyLoadModel(data, mdlList):"moonpaladin wrote: ↑Mon Feb 21, 2022 4:21 am At least are some values that I'm understanding like these one
eN¡Blist : 7473696C42A14E65 = 8391166444416618085
two different methods that noesis calls in turn.
the first one is to check the file the second one is to load the model.
in each of them a new thread is assigned "bs = NoeBitStream(data)".
so the position starts from the beginning of in every new stream.
in general, the header in the file is:(eNЎB)
but since there are inverted files i check the first 8 bytes(eNЎBlist) by reading the integer64 value.
use debug. eg: print(bs.getOffset()). will print the current position.
- Durik256
- ultra-veteran

- Posts: 425
- Joined: Wed Nov 21, 2018 7:26 pm
- Has thanked: 45 times
- Been thanked: 411 times
Re: Tian Xia 3 models
what did yout ried to tweak there?moonpaladin wrote: ↑Mon Feb 21, 2022 5:26 am i tried to tweak the script a bit to it not thrown error
I'm already annoyed by these "broken" files
(there may be extra null bytes in the same places. Because of this, checks have to be made.)
one of the problems solved:
At the end of the file, information is not only about faces and vertices, there may also be materials.
(indentation is now used using (iSize и vSize)

(you need to immediately do a normal unpacker so that you don’t suffer with models later)
Last edited by Durik256 on Mon Feb 21, 2022 3:11 pm, edited 1 time in total.
-
moonpaladin
- ultra-veteran

- Posts: 398
- Joined: Tue Mar 05, 2019 6:24 am
- Has thanked: 286 times
- Been thanked: 18 times
Re: Tian Xia 3 models
This one is really helpfull! xD
I get it, I don't want to see these .dat files again for a while
Thank you Durik!
- Durik256
- ultra-veteran

- Posts: 425
- Joined: Wed Nov 21, 2018 7:26 pm
- Has thanked: 45 times
- Been thanked: 411 times
Re: Tian Xia 3 models
finalmoonpaladin wrote: ↑Mon Feb 21, 2022 3:18 am in files (00000726.dat) and (000000000000c4fe.dat) have swapped vertices with faces.
(I did not bother, I just duplicated the reading of faces and vertices and swapped them.) Old plugin : fmt_TianXia3.py
Update plugin (open all model), (click up arrow)
You do not have the required permissions to view the files attached to this post.
Last edited by Durik256 on Tue Jun 20, 2023 6:03 pm, edited 3 times in total.
