moonpaladin Posted December 12 Share Posted December 12 Hello I was checking alot of information about this kind of filetype in xentax archive but the old script doesn't work also trying to get them with hex2obj with the help of shakotay but still cannot achieve to get the model, any kind of help gonna be awesome! current values of hex2obj : credits to shalotay :p 0x994 10440 Vb1 44 99 0x5B3C 2218 020000 0x0 255 3471051701C.7z Link to comment Share on other sites More sharing options...
Engineer h3x3r Posted December 13 Engineer Share Posted December 13 Quick test... 1 Link to comment Share on other sites More sharing options...
Engineer shak-otay Posted December 13 Engineer Share Posted December 13 The problem is to divide it up into sub meshes... Attempt from the end: 0x3E2C 3709 Vb1 44 99 0x1D874 970 020000 0x0 255 1 Link to comment Share on other sites More sharing options...
moonpaladin Posted December 13 Author Share Posted December 13 35 minutes ago, shak-otay said: The problem is to divide it up into sub meshes... Thanks! I could get it piece by piece but how about uvs :'( Link to comment Share on other sites More sharing options...
Engineer shak-otay Posted December 13 Engineer Share Posted December 13 (edited) I have no idea. There's a unkn float at offs 40 of the FVFblock. Maybe it's related? Edited December 13 by shak-otay Link to comment Share on other sites More sharing options...
moonpaladin Posted December 13 Author Share Posted December 13 1 hour ago, shak-otay said: I have no idea. There's a unkn float at offs 40 of the FVFblock. Maybe it's related? gonna be checking! thanks shakotay Link to comment Share on other sites More sharing options...
Engineer shak-otay Posted December 13 Engineer Share Posted December 13 Forget what I wrote - UVpos should be 36 as you can see from the point cloud. But there's much fiddling required to find the suiting face indices' address. Link to comment Share on other sites More sharing options...
moonpaladin Posted December 14 Author Share Posted December 14 2 hours ago, shak-otay said: Forget what I wrote - UVpos should be 36 as you can see from the point cloud. But there's much fiddling required to find the suiting face indices' address. really thanks for your time shakotay! im testing many values XD Link to comment Share on other sites More sharing options...
moonpaladin Posted December 14 Author Share Posted December 14 5 hours ago, h3x3r said: Quick test... Hii! thanks for try! if you can try again to get the complete mesh would be cool! Link to comment Share on other sites More sharing options...
Engineer shak-otay Posted December 14 Engineer Share Posted December 14 1 hour ago, moonpaladin said: if you can try again to get the complete mesh would be cool! Why is this necessary? You wrote Quote I could get it piece by piece Link to comment Share on other sites More sharing options...
moonpaladin Posted December 14 Author Share Posted December 14 57 minutes ago, shak-otay said: Why is this necessary? You wrote i'm still trying x.x Link to comment Share on other sites More sharing options...
Engineer h3x3r Posted December 14 Engineer Share Posted December 14 (edited) Send another sample for compare. Got it. But i still need another sample coz i am not sure with structs. Edited December 14 by h3x3r 2 Link to comment Share on other sites More sharing options...
moonpaladin Posted December 14 Author Share Posted December 14 Hii, here you goo 4 hours ago, h3x3r said: Send another sample for compare. Got it. But i still need another sample coz i am not sure with structs. samples.zip Link to comment Share on other sites More sharing options...
Engineer h3x3r Posted December 14 Engineer Share Posted December 14 010 Editor Template... I am sooo lazy to rewrite it to the noesis python script. //------------------------------------------------ //--- 010 Editor v14.0 Binary Template // // File: // Authors: // Version: // Purpose: // Category: // File Mask: // ID Bytes: // History: //------------------------------------------------ OutputPaneClear();LittleEndian(); local string FileName=GetFileName(),FilePath=FileNameGetPath(FileName,true),BaseName=FileNameGetBase(FileName,false); local uint32 i,j,k,l; local string ShapeNum; typedef struct Matrix4x4 { float Mat00,Mat01,Mat02,Mat03, Mat10,Mat11,Mat12,Mat13, Mat20,Mat21,Mat22,Mat23, PosX,PosY,PosZ,PosW; }; struct { char Sign[4]; uint32 Unk0,TypeInfoOffset,TypeNameIndex,Unk3,Unk4,Unk5,BoneNameIndex,ShapeNameIndex,Unk8,Unk9; float Value[7]; }Header; struct { FSeek(sizeof(Header)+Header.TypeInfoOffset); uint32 TypeNameOffset[Header.TypeNameIndex]; uint32 ShapeNameOffset[3]; }TypeIndexInfo; struct { float Unknown[12]; }UnknownInfo; if (Header.BoneNameIndex != 0) struct { struct { uint32 BoneNameOffset,SkinNameOffset,Dummy; Matrix4x4 matrix4x4; uint32 BoneIndex; uint32 Null[7]; }BoneIndex[Header.BoneNameIndex]<optimize=false>; }BoneIndexInfo; struct { struct { uint32 Unk0,ShapeNameOffset,Unk1; float Unk2,Unk3,Unk4,Unk5; uint32 ShapeIndexNum,IndexCount,IndexOffset,VtxCount,Unk6,Unk7,Unk8[14]; local string ShapeNameStr=ReadString(sizeof(Header)+ShapeNameOffset,-1); }ShapeIndex[Header.ShapeNameIndex]<optimize=false>; }ShapeInfo; struct { local uint32 IndexBaseOffset=FTell(); for (i=0; i < Header.ShapeNameIndex; i++) { FSeek(IndexBaseOffset+ShapeInfo.ShapeIndex[i].IndexOffset*6); struct { byte IndexData[ShapeInfo.ShapeIndex[i].IndexCount*6]; }IndexBuffer; } }IndexBuffers; struct { for (i=0; i < Header.ShapeNameIndex; i++) { struct { uint32 Unknown,VtxBufferSize; local uint32 Stride=VtxBufferSize/ShapeInfo.ShapeIndex[i].VtxCount; }StrideInfo; } for (i=0; i < Header.ShapeNameIndex; i++) { struct { byte VertexData[StrideInfo[i].VtxBufferSize]; }VertexBuffer; } }VertexBuffers; FSeek(startof(VertexBuffers)); struct SHAPE { for (i=0; i < Header.ShapeNameIndex; i++) { SPrintf(ShapeNum,"_%u",l++); FSeek(startof(VertexBuffers.VertexBuffer[i])); if (VertexBuffers.StrideInfo[i].Stride == 44) struct { float VPosX,VPosY,VPosZ,Unk0,Unk1,VNPosX,VNPosY,VNPosZ,Unk2,UVPosX,UVPosY; Printf("v %f %f %f\nvn %f %f %f\nvt %f %f\n",VPosX,VPosY,VPosZ,VNPosX,VNPosY,VNPosZ,UVPosX,-UVPosY); }VtxBuffer[ShapeInfo.ShapeIndex[i].VtxCount]<optimize=false>; else if (VertexBuffers.StrideInfo[i].Stride == 48) struct { float VPosX,VPosY,VPosZ,Unk0,Unk1,Unk2,VNPosX,VNPosY,VNPosZ,Unk3,UVPosX,UVPosY; Printf("v %f %f %f\nvn %f %f %f\nvt %f %f\n",VPosX,VPosY,VPosZ,VNPosX,VNPosY,VNPosZ,UVPosX,-UVPosY); }VtxBuffer[ShapeInfo.ShapeIndex[i].VtxCount]<optimize=false>; else if (VertexBuffers.StrideInfo[i].Stride == 52) struct { float VPosX,VPosY,VPosZ,Unk0,Unk1,Unk2,Unk3,VNPosX,VNPosY,VNPosZ,Unk4,UVPosX,UVPosY; Printf("v %f %f %f\nvn %f %f %f\nvt %f %f\n",VPosX,VPosY,VPosZ,VNPosX,VNPosY,VNPosZ,UVPosX,-UVPosY); }VtxBuffer[ShapeInfo.ShapeIndex[i].VtxCount]<optimize=false>; Printf("g shape_%s_%u\n",BaseName,ShapeInfo.ShapeIndex[i].ShapeIndexNum); FSeek(startof(IndexBuffers.IndexBuffer[i])); struct { uint16 F1,F2,F3; Printf("f %u/%u/%u %u/%u/%u %u/%u/%u\n",F1+1,F1+1,F1+1,F2+1,F2+1,F2+1,F3+1,F3+1,F3+1); }IdxBuffer[ShapeInfo.ShapeIndex[i].IndexCount]<optimize=false>; OutputPaneSave(FilePath+BaseName+ShapeNum+".obj"); OutputPaneClear(); } }; //local SHAPE Shape; If you want export them just remove two slashes on last line 2 Link to comment Share on other sites More sharing options...
Engineer shak-otay Posted December 14 Engineer Share Posted December 14 (edited) 20 minutes ago, h3x3r said: 010 Editor Template... I am sooo lazy to rewrite it to the noesis python script. Thanks! Since years I'm thinking about a "010 Editor Template" toC converter, but I'm too lazy, too. Plus, there's not so many examples to find. I'm asking myself whether I can (in 'C') simply replace struct {... } indexbuffers; and the like by void indexbuffers {...} ? I'm unsure how to dissolve struct { struct { Do I need to use two points? (I C I'm using one point with verts[index].addr and verts[index].count which are based on an unnested struct.) Edited December 14 by shak-otay Link to comment Share on other sites More sharing options...
Engineer h3x3r Posted December 14 Engineer Share Posted December 14 The function is there so i guess yes? Never tried before... 1 Link to comment Share on other sites More sharing options...
Engineer shak-otay Posted December 14 Engineer Share Posted December 14 (edited) Thanks. That could help to rewrite 010 templates, I guess. Seems I can get a 30 days trial version. On another note - this appears to me as a combination of code and a struct declaration. Correct? So I'll have to separate it in 'C' assumedly. 5 hours ago, h3x3r said: for (i=0; i < Header.ShapeNameIndex; i++) { struct { uint32 Unknown,VtxBufferSize; local uint32 Stride=VtxBufferSize/ShapeInfo.ShapeIndex[i].VtxCount; }StrideInfo; } edit: maybe someone solved my problem somehow already... Well, it's python. Maybe only a shift of the problem.:D Need pip for the setup. Ohh - no. Build/install manually ends up with import regex as re "ModuleNotFoundError: No module named 'regex'" Seems I need to get familiar with "pip on windows". Next year, maybe... ok, I dared the hassle... While pngtemplate.bt worked (with a small png) your gm2 bt script broke PFP (python format parser): error , line 104, in FileNameGetPath raise NotImplementedError() NotImplementedError Edited Saturday at 08:44 PM by shak-otay 1 Link to comment Share on other sites More sharing options...
Engineer h3x3r Posted Saturday at 10:28 PM Engineer Share Posted Saturday at 10:28 PM Try to disable > OutputPaneSave(FilePath+BaseName+ShapeNum+".obj"); Link to comment Share on other sites More sharing options...
Engineer shak-otay Posted Saturday at 11:39 PM Engineer Share Posted Saturday at 11:39 PM (edited) Seems, PFP is not as mighty as I thought. (I could try use the built-in debugger but it's awkward.) edit: using Int(3) invokes the debugger: 53 uint32 Unk0,ShapeNameOffset,Unk1; 54 float Unk2,Unk3,Unk4,Unk5; 55 uint32 ShapeIndexNum,IndexCount,IndexOffset,VtxCount,Unk6,Unk7,Unk8[14]; 56 Int3(); --> 57 local string ShapeNameStr=ReadString(sizeof(Header)+ShapeNameOffset,-1); 58 }ShapeIndex[Header.ShapeNameIndex]<optimize=false>; 59 }ShapeInfo; 60 61 LE pfp> peek 6f 01 00 00 53 01 00 00 01 08 00 00 00 00 00 b3 o...S........... LE pfp> n Traceback (most recent call last): File " \lib\site-packages\pfp\interp.py", line 1044, compat_io.py", line 428, in ReadString raise NotImplementedError() Current processed bone: Quote BoneIndex[13] = struct { BoneNameOffset = UInt(309 [00000135]) SkinNameOffset = UInt(322 [00000142]) Dummy = UInt(0 [00000000]) matrix4x4 = struct { Mat00 = Float(1.0) Mat01 = Float(4.5145075233676835e-08) Mat02 = Float(1.42923482826518e-07) Mat03 = Float(0.0) Mat10 = Float(-4.514505391739476e-08) Mat11 = Float(1.0) Mat12 = Float(-1.275043786108654e-07) Mat13 = Float(0.0) Mat20 = Float(-1.42923482826518e-07) Mat21 = Float(1.275043786108654e-07) Mat22 = Float(1.0) Mat23 = Float(0.0) PosX = Float(-0.3636668622493744) PosY = Float(0.13261717557907104) PosZ = Float(0.6157079339027405) PosW = Float(1.0) } BoneIndex = UInt(108 [0000006c]) Null = UInt[7] } } ShapeInfo = struct { } Nice going but "step into" doesn't work. So I'm lost here... Edited Sunday at 05:29 AM by shak-otay Link to comment Share on other sites More sharing options...
Engineer h3x3r Posted Sunday at 06:23 AM Engineer Share Posted Sunday at 06:23 AM (edited) Seems like python doesn't give a fck about local variables. You can also dissable that line > local string ShapeNameStr=ReadString(sizeof(Header)+ShapeNameOffset,-1); It's not used. I just put it here to check string name which can be obtained without it. But not sure how you deal with this one which calculates Stride > local uint32 Stride=VtxBufferSize/ShapeInfo.ShapeIndex.VtxCount; Edited Sunday at 06:26 AM by h3x3r 1 Link to comment Share on other sites More sharing options...
moonpaladin Posted Sunday at 07:04 AM Author Share Posted Sunday at 07:04 AM 15 hours ago, h3x3r said: If you want export them just remove two slashes on last line Amazing! really thanks! Link to comment Share on other sites More sharing options...
Engineer shak-otay Posted Sunday at 11:59 AM Engineer Share Posted Sunday at 11:59 AM (edited) 18 hours ago, h3x3r said: Seems like python doesn't give a fck about local variables. You can also dissable that line > local string ShapeNameStr=ReadString(sizeof(Header)+ShapeNameOffset,-1); It's not used. I just put it here to check string name which can be obtained without it. But not sure how you deal with this one which calculates Stride > local uint32 Stride=VtxBufferSize/ShapeInfo.ShapeIndex.VtxCount; Thanks! Local vars could be the problem on reading from the input stream. The author of Pfp, James "d0c_s4vage" Johnson, wrote: Quote Variables are also allowed that do not cause data to be read from the input stream. Prefixing a declaration with const or local will create a temporary variable that can be used in the script. Anyways. //local string.... did the trick. Furthermore I got Quote IndexBuffers = struct { _skipped_0 = Char[0] ('') IndexBuffer_0 = struct { IndexData = Char[13986] ('´\x00µ\x00¶\x00\x95\x00\x96\x00\x97\x00\x97\x00\x98\x00\x95\x00\x98\x00') } _skipped_1 = Char[0] ('') IndexBuffer_1 = struct { IndexData = Char[5886] ('C\x00\x89\x00\x8a\x00C\x00D\x00E\x00E\x00D\x00K\x00E\x00') } _skipped_2 = Char[0] ('') IndexBuffer_2 = struct { IndexData = Char[1008] ('7\x008\x009\x00\x82\x00\x83\x00\x84\x00\x84\x00\x85\x00\x82\x00T\x00') } } If Pfp didn't ignore FTell() and OutputPaneSave("D:\\test"+ShapeNum+".obj"); I'd be happy, but anyways, I would have taken any bet that Pfp would NOT parse this .bt to it's end. edit: this worked: local uint32 b = FTell(); Edited Monday at 12:56 AM by shak-otay Link to comment Share on other sites More sharing options...
Engineer shak-otay Posted Monday at 06:14 PM Engineer Share Posted Monday at 06:14 PM (edited) I converted the bt script up to struct IndexBuffers into 'C' (then got tired). It gave the required parameters but offered one wrong offset (0x8DD6). Should be 0x5734= 0x4036 + 981x6 (dec.) ShapeIndex, 0x850 (NameOffs, IndexNum, faceCount, offs, vCount) 0: 153 0 2331 0 2218 1: 153 1 981 91b 970 2: 153 2 168 cf0 160 IndexBaseOffset 0x994 0. Index Offset 0x994 1. Index Offset 0x4036 2. Index Offset 0x8dd6 ?? 0x5734 I didn't find my fault but 3 sub meshes (see H2O files) where I had to mulitply the face counts by 3 to get FIs counts: 0x994 6993 Vb1 44 36 0x5B3C 2218 020000 0x0 255 0x4036 2943 Vb1 44 36 0x1D874 970 020000 0x0 255 0x5734 504 Vb1 48 40 0x27F2C 160 020000 0x0 255 Can someone tell me the parameters for the missing mesh (see picture)? Edited Monday at 07:47 PM by shak-otay Link to comment Share on other sites More sharing options...
Engineer h3x3r Posted Tuesday at 07:40 AM Engineer Share Posted Tuesday at 07:40 AM That's fine. I also end up with this result. I think it's use another mesh 1 Link to comment Share on other sites More sharing options...
moonpaladin Posted Wednesday at 04:46 AM Author Share Posted Wednesday at 04:46 AM On 12/17/2024 at 1:14 AM, shak-otay said: Can someone tell me the parameters for the missing mesh (see picture)? Its complete Shakotay! seems that the saddle is used for around 3-4 mounts. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now