i3d plugin for Blender 3.6

Discuss your upcoming modding & editing projects here or shout out some ideas.
battlefeel1942
Private
Posts: 13
Joined: Thu Jun 29, 2023 1:52 am

Re: i3d plugin for Blender 3.6

Unread post by battlefeel1942 » Thu Feb 22, 2024 11:39 pm

No I didn't modify the file before importing. I modified the vertex array during the import process - a technique that would only work for this i3d file and maybe a few others.

I like looking through old game assets and seeing how they were made. It's a fun challenge. This might beat me though. Can I ask, does the importer for 3D Studio MAX you sent me load the asset and textures ok? I'm curious if in 3DS Max, the model has 24 vertices or 8

This is the output from Blender
Image

User avatar
NilsZ
Major
Posts: 431
Joined: Sun Dec 29, 2013 8:19 pm
Location: Germany

Re: i3d plugin for Blender 3.6

Unread post by NilsZ » Sat Feb 24, 2024 10:39 pm

looks like you tripled also the objects :)

I couldn't find such cool stats view in 3ds max 3. But here is something compareable:

Code: Select all

Summary Info for  (at Frame 0)

Objects:
  			Cast	Receive	Motion		
  Name (Type)	Verts	Faces	Shadows	Shadows	Blur	Hidden	Frozen	Material (Type)
  ------------------------	------------	------------	------------	------------	------------	------------	------------	------------------------
  ~03dvereh4 (Editable Mesh	8	12	Yes	Yes	No	No	No	Material #35 (Multi/Sub-Object)


Scene Totals:
  Objects: 1
  Shapes: 0
  Cameras: 0
  Lights: 0
  Helpers: 0
  Space Warps: 0
  Total: 1

Mesh Totals:

  Verts: 8
  Faces: 12
Materials:

  Material #35  ( Multi/Sub-Object )
      dverepredek  ( Standard )
      dverebok  ( Standard )


It has 8 verts. The 3ds max plugin fully supports i3d, as its the original source for that format.
In those days 3ds max 3 was hot stuff and hard to get. But nowadays I heard its free to download at archive.org. The intention of the blender plugin is to be freed of the .3ds "cage". Whenever we wanted to import other models 3ds cutted filenames and messed up positions.

the blender plugin has indeed a long todo list. But there is no need to do it yet, so we focus on more important things as engine improvements.

battlefeel1942
Private
Posts: 13
Joined: Thu Jun 29, 2023 1:52 am

Re: i3d plugin for Blender 3.6

Unread post by battlefeel1942 » Sun Feb 25, 2024 11:08 pm

The extra 2/3 objects were the light and camera I forgot to delete out.

I just cant quite work out how the 3D Studio Max importer is using the UV and face data within 0x4200, with the vertex data at 0x4110.

This is an output from a script I wrote to read the i3d file.

Object Name: ~03dvereh4

0x4110
Number of vertices: 8
Expected total length of POINT_ARRAY block: 98 bytes
Vertex: X=-0.5000002384185791, Y=-0.04999801144003868, Z=0.0
Vertex: X=0.51291823387146, Y=-0.049997761845588684, Z=0.0
Vertex: X=-0.49999991059303284, Y=0.05000046268105507, Z=0.0
Vertex: X=0.51291823387146, Y=0.050000712275505066, Z=0.0
Vertex: X=-0.5000002384185791, Y=-0.04990645870566368, Z=3.0032970905303955
Vertex: X=0.51291823387146, Y=-0.049906209111213684, Z=3.0032970905303955
Vertex: X=-0.49999991059303284, Y=0.050095830112695694, Z=3.0032970905303955
Vertex: X=0.51291823387146, Y=0.05009607970714569, Z=3.0032970905303955

0x4120:
Number of faces: 12
Face 0: Vertex Indices = 0, 1, 5, Flag = 3
Face 1: Vertex Indices = 5, 4, 0, Flag = 3
Face 2: Vertex Indices = 3, 2, 6, Flag = 3
Face 3: Vertex Indices = 6, 7, 3, Flag = 3
Face 4: Vertex Indices = 0, 2, 3, Flag = 3
Face 5: Vertex Indices = 3, 1, 0, Flag = 3
Face 6: Vertex Indices = 4, 5, 7, Flag = 3
Face 7: Vertex Indices = 7, 6, 4, Flag = 3
Face 8: Vertex Indices = 1, 3, 7, Flag = 3
Face 9: Vertex Indices = 7, 5, 1, Flag = 3
Face 10: Vertex Indices = 2, 0, 4, Flag = 3
Face 11: Vertex Indices = 4, 6, 2, Flag = 3

0x4130
Material name: dverepredek
Number of faces using this material: 4
Face index: 0
Face index: 1
Face index: 2
Face index: 3
Material name: dverebok
Number of faces using this material: 8
Face index: 4
Face index: 5
Face index: 6
Face index: 7
Face index: 8
Face index: 9
Face index: 10
Face index: 11

0x4150
Smoothing Groups: (1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4)

0x4200
Channel index: 1
Number of UV coordinates: 24
UV[0]: U=0.0004994571208953857, V=0.0004995763301849365
UV[1]: U=0.9994996786117554, V=0.0004995167255401611
UV[2]: U=0.0004994571208953857, V=0.0004995763301849365
UV[3]: U=0.9994996786117554, V=0.0004995167255401611
UV[4]: U=0.0005002915859222412, V=0.9995004534721375
UV[5]: U=0.9995005130767822, V=0.9995003938674927
UV[6]: U=0.0005002915859222412, V=0.9995004534721375
UV[7]: U=0.9995005130767822, V=0.9995003938674927
UV[8]: U=5.368080139160156, V=-41.38868713378906
UV[9]: U=6.383701324462891, V=-41.38869094848633
UV[10]: U=5.368080139160156, V=-40.23325729370117
UV[11]: U=6.383701324462891, V=-40.23326110839844
UV[12]: U=5.368080139160156, V=-41.38868713378906
UV[13]: U=6.383701324462891, V=-41.38869094848633
UV[14]: U=5.368080139160156, V=-40.23325729370117
UV[15]: U=6.383701324462891, V=-40.23326110839844
UV[16]: U=0.5446206331253052, V=-19.281972885131836
UV[17]: U=0.54462069272995, V=-19.281972885131836
UV[18]: U=0.54462069272995, V=-18.110013961791992
UV[19]: U=0.54462069272995, V=-18.110013961791992
UV[20]: U=-0.4513844847679138, V=-19.281959533691406
UV[21]: U=-0.4513844847679138, V=-19.281959533691406
UV[22]: U=-0.4513844847679138, V=-18.10999870300293
UV[23]: U=-0.45138442516326904, V=-18.10999870300293

Number of faces: 12
Face[0]: Vertex Indices = (0, 1, 5)
Face[1]: Vertex Indices = (5, 4, 0)
Face[2]: Vertex Indices = (3, 2, 6)
Face[3]: Vertex Indices = (6, 7, 3)
Face[4]: Vertex Indices = (8, 10, 11)
Face[5]: Vertex Indices = (11, 9, 8)
Face[6]: Vertex Indices = (12, 13, 15)
Face[7]: Vertex Indices = (15, 14, 12)
Face[8]: Vertex Indices = (17, 19, 23)
Face[9]: Vertex Indices = (23, 21, 17)
Face[10]: Vertex Indices = (18, 16, 20)
Face[11]: Vertex Indices = (20, 22, 18)

battlefeel1942
Private
Posts: 13
Joined: Thu Jun 29, 2023 1:52 am

Re: i3d plugin for Blender 3.6

Unread post by battlefeel1942 » Mon Feb 26, 2024 3:10 am

This might be it... I need to test it though - The face data in 4200 is not referencing the vertex data, but the uv coordinates array

So the first face in the model
Face 0: Vertex Indices = 0, 1, 5, Flag = 3

Uses vertices
[0] Vertex: X=-0.5000002384185791, Y=-0.04999801144003868, Z=0.0
[1] Vertex: X=0.51291823387146, Y=-0.049997761845588684, Z=0.0
[5] Vertex: X=0.51291823387146, Y=-0.049906209111213684, Z=3.0032970905303955

Then it references the face from 4200
Face[0]: Vertex Indices = (0, 1, 5)

With UV coordinates
UV[0]: U=0.0004994571208953857, V=0.0004995763301849365
UV[1]: U=0.9994996786117554, V=0.0004995167255401611
UV[5]: U=0.9995005130767822, V=0.9995003938674927

battlefeel1942
Private
Posts: 13
Joined: Thu Jun 29, 2023 1:52 am

Re: i3d plugin for Blender 3.6

Unread post by battlefeel1942 » Mon Feb 26, 2024 7:02 am

I was correct in my previous post. I just have a problem with face[1]

Illustrated here
Image

battlefeel1942
Private
Posts: 13
Joined: Thu Jun 29, 2023 1:52 am

Re: i3d plugin for Blender 3.6

Unread post by battlefeel1942 » Tue Feb 27, 2024 9:42 pm

I couldn't work out why on some faces the UVs were messed up. All I could see is that each UV position needed to be shifted, effectively rotating the coordinates. So for example, if the UV coordinates are A B C. They needed to be offset to B C A or C A B. I wrote a tool to do this instead of digging into the importer. Its an easy manual fix, and good enough for what I want.

Blender 4.0 has an updated 3DS importer so it might be worth diff checking your I3D importer to see if there are any changes worth implementing.

This asset from the first mission has one face with bad UVs which I fixed with UV shift tool.

Image

So that's that, thank you for your help NilsZ thup01

Post Reply

Who is online

Users browsing this forum: No registered users and 342 guests