I search for solutions in this order: Past Code, Unreal Source, Wiki, BUF, groups.yahoo, google, screaming at monitor. – RegularX

Difference between revisions of "Legacy:T3D File"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
(Loading T3D brush geometry)
m (removed my signature - seems I put it accidentally there)
 
(14 intermediate revisions by 3 users not shown)
Line 14: Line 14:
  
 
===Exporting T3D ===
 
===Exporting T3D ===
* Export the whole map: File -> Export...  
+
* Export the whole map
* export one brush:
+
** File -> Export... (UnrealEd 1,2,3)
* export a part of a map: either save, delete discards and export as above, or select, copy, paste into a text editor and save as a T3D file
+
** File -> Export -> All.. (UnrealEd 4 - UT3)
 +
* Export selected actors: File-> Export-> Selected Only ... (UnrealEd 4 only - UT3)
 +
* Export one brush: Brush -> Export ...
 +
* Copy/Paste: can copy paste any actor from any UnrealEd version to another one (Except for UnrealEd 4) or to any text editor such as notepad (Windows)
  
 
===Importing T3D ===
 
===Importing T3D ===
Line 32: Line 35:
  
 
The T3D format is a text file which stores information about map actors. It's in fact identical to what can be copied from UnrealEd to a text editor. An exported map looks like this:
 
The T3D format is a text file which stores information about map actors. It's in fact identical to what can be copied from UnrealEd to a text editor. An exported map looks like this:
 +
  
 
<uscript>
 
<uscript>
Line 90: Line 94:
 
End Map</uscript>
 
End Map</uscript>
  
External link: http://unreal.jall.org/tutorials/t3d.html (new URL)
 
  
===Loading T3D brush geometry===
+
External link: http://web.archive.org/web/20060710080159/http://unreal.jall.org/tutorials/t3d.html (new URL)
  
You must parse those informations correctly: PrePivot, Location, Rotation, MainScale, PostScale, TempScale, Polygon / Vertexes
+
=== T3D File Structure ===
 +
== Ux,UT,UT200x Maps ==
 +
<uscript>
 +
Begin Map
 +
    Begin Actor Class=<ClassName>
 +
    ...
 +
    End Actor
 +
    Begin Actor Class=<ClassName>
 +
    ...
 +
    End Actor
 +
    ...
 +
End Map
 +
</uscript>
  
 +
== UT3 Maps ==
 
<uscript>
 
<uscript>
FOR each vertex of each polygon of parsed brush DO:
+
Begin Map
   do MainScale ... x *= MainScale[x], y *= MainScale[y], z *= MainScale[z]
+
   Begin Level NAME=PersistentLevel
  do translation (-PrePivot[x], -PrePivot[y], -PrePivot[z])
+
      Begin Actor Class=<ClassName>
  do rotation Yaw, Pitch, Roll
+
      ...
  do PostScale ... x *= PostScale[x], y *= PostScale[y], z *= PostScale[z]
+
      End Actor
  do TempScale ... x *= TempScale[x], y *= TempScale[y], z *= TempScale[z]
+
      Begin Actor Class=<ClassName>
   do translation (Location[x], Location[y], Location[z])
+
      ...
ENDFOR
+
      End Actor
 +
      ...
 +
   End Level
 +
Begin Surface
 +
End Surface
 +
End Map
 
</uscript>
 
</uscript>
  
Note:
+
Note: as UT3 T3D files have different header, any other not-UT3 t3d file can't be imported into UT3 editor (UnrealEd 4)
For Unreal Engine 3.x based maps (Unreal Tournament 2004 and 2003),PostScale,MainScale,TempScale and Rotation values are always null as the editor automatically updates vertices,origin and normal values when scaling up/down or rotating a brush.
+
 
+
 
+
Rotation matrix are the following:
+
 
+
<uscript>Roll Matrix-X Axis:
+
1, 0, 0, 0,
+
0, cos(roll),-sin(roll), 0,
+
0, sin(roll),cos(roll), 0,
+
0, 0, 0, 1</uscript>
+
 
+
<uscript>Pitch Matrix-Y Axis:
+
cos(pitch), 0, sin(pitch), 0,
+
0, 1, 0, 0,
+
-sin(pitch), 0,cos(pitch), 0,
+
0, 0, 0, 1)</uscript>
+
 
+
<uscript>Yaw Matrix-Z Axis:
+
cos(yaw), sin(yaw), 0, 0,
+
-sin(yaw), cos(yaw), 0, 0,
+
0, 0, 1, 0,
+
0, 0, 0, 1</uscript>
+
 
+
<uscript>Global Rotation Matrix=(Roll Matrix)*(Pitch Matrix)*(Yaw Matrix)</uscript>
+
 
+
Yaw, Roll and Pitch values are in radians. Original values from t3d files are in "Unreal format" where 2 rad = 65536.
+
For more information about Yaw, Pitch, Roll rotation matrix see http://mathworld.wolfram.com/EulerAngles.html.
+
 
+
Unknown (correct) effect: SheerAxis
+
  
TextureU, TextureV, PanU, PanV, Origin are information about how to apply texture for the polygon.
+
===T3D brush geometry===
 +
Information geometry is contained in the following actors:
 +
*Brush
 +
*Mover (only UT and U1 game)
  
Python T3D loader (doesn't care about texture informations): http://carolina.mff.cuni.cz/~gib/ut_utils/unreal_t3d_loader.zip see readme.txt in zip file
+
For more information about T3D brushes, see [[Legacy:T3D_Brush|T3D Brush]].
  
 
==T3D Utilities ==
 
==T3D Utilities ==
 
* [[Legacy:MapScale|MapScale]] scales an entire .t3d file
 
* [[Legacy:MapScale|MapScale]] scales an entire .t3d file
 
* [[Legacy:MeshMaker|MeshMaker]] converts a prefab in .t3d format to a [[Legacy:Decoration|decoration]]
 
* [[Legacy:MeshMaker|MeshMaker]] converts a prefab in .t3d format to a [[Legacy:Decoration|decoration]]
* [http://www.unrealroc.com/Converter.html UnrealROC] converters: from 3DMF, to VRML/X3D/OBJ (including textures et al).
+
* [http://darendash.home.comcast.net/~darendash/Converter.html UnrealROC] converters: from 3DMF, to VRML/X3D/OBJ (including textures et al).
  
 
==Related Topics ==
 
==Related Topics ==
Line 151: Line 146:
 
* [[Legacy:Brush Exporting And Importing|Brush Exporting And Importing]]
 
* [[Legacy:Brush Exporting And Importing|Brush Exporting And Importing]]
 
* [[Legacy:Brush Hacking|Brush Hacking]]
 
* [[Legacy:Brush Hacking|Brush Hacking]]
 +
* [[Legacy:T3D Brush|T3D Brush]]
  
 
'''Kefik:''' There can be also a tag 'CsgOper' which have one of two values ... 'CSG_Subtract' -> subtract the brush from space or 'CSG_Add' -> add this brush to shape.
 
'''Kefik:''' There can be also a tag 'CsgOper' which have one of two values ... 'CSG_Subtract' -> subtract the brush from space or 'CSG_Add' -> add this brush to shape.
  
'''Sobiwan:''' New to WIKI editing, but not using it.  I was searching for the actual format of T3D and found [http://users.skynet.be/fa550206/Slug-Production/Data/OpenGL-Documents/T3D-File-Format/T3D-File-Format.htm Mongo's description] of [http://www.planetunreal.com Planetunreal] to be extremely helpful.  I'll ask him (mongo@planetunreal.com) if we can use and/or edit his description here.  The format is much more involved than described here.  We can even supply examples of how to do particular hacks.
+
'''Sobiwan:''' New to WIKI editing, but not using it.  I was searching for the actual format of T3D and found <!-- invalid URL "http://users.skynet.be/fa550206/Slug-Production/Data/OpenGL-Documents/T3D-File-Format/T3D-File-Format.htm" replaced, --SeriousBarbie (talk) 21:11, 11 August 2016 (EDT) -->
 +
[http://web.archive.org/web/20050913035722/http://users.skynet.be/fa550206/Slug-Production/Data/OpenGL-Documents/T3D-File-Format/T3D-File-Format.htm Mongo's description] of [http://www.planetunreal.com Planetunreal] to be extremely helpful.  I'll ask him (mongo@planetunreal.com) if we can use and/or edit his description here.  The format is much more involved than described here.  We can even supply examples of how to do particular hacks.
  
 
'''MadNad:''' Interestingly, I was able to convert a [http://madnad.com/ut2k3/Screenshots/q3dm7.jpg?link Quake3_Level] into a unreal map.  Quite interesting.  First i converted a *.bsp to a *.map in quake, then I made a level that was just a huge cube and converted it to *.t3d.  With an external app (i'll have to find the name of it ) I was able to merge these two together.  After some scaling and switching additive brushes in quake to subtractive brushes in ued and subtractive to additive, I compiled and had q3dm7 geometry. I don't necessarily recommend doing this, as it will take more time to fix than create it from scratch, but I thought I would share a little experience I had with this.
 
'''MadNad:''' Interestingly, I was able to convert a [http://madnad.com/ut2k3/Screenshots/q3dm7.jpg?link Quake3_Level] into a unreal map.  Quite interesting.  First i converted a *.bsp to a *.map in quake, then I made a level that was just a huge cube and converted it to *.t3d.  With an external app (i'll have to find the name of it ) I was able to merge these two together.  After some scaling and switching additive brushes in quake to subtractive brushes in ued and subtractive to additive, I compiled and had q3dm7 geometry. I don't necessarily recommend doing this, as it will take more time to fix than create it from scratch, but I thought I would share a little experience I had with this.

Latest revision as of 21:42, 26 January 2017

The T3D file format or Unreal Text File holds a text list of Unreal map objects. An entire map can be saved as this file format, or just a single actor or brush.

Note that while brushes, their applied textures and light actors are saved, the Unreal Geometry itself is not saved: upon importing a T3D file the map must be built.

Copying objects from UnrealEd and pasting into a text editor produces the same format.

Unreal Text format

Exported brushes and (other) actors. See T3D file.

  • Created by:
    • UnrealEd's File -> Import command
    • UnrealEd's Brush -> Import command (see Data Import and Export for more on both these commands).
    • is this created by external stuff too?

Exporting T3D[edit]

  • Export the whole map
    • File -> Export... (UnrealEd 1,2,3)
    • File -> Export -> All.. (UnrealEd 4 - UT3)
  • Export selected actors: File-> Export-> Selected Only ... (UnrealEd 4 only - UT3)
  • Export one brush: Brush -> Export ...
  • Copy/Paste: can copy paste any actor from any UnrealEd version to another one (Except for UnrealEd 4) or to any text editor such as notepad (Windows)

Importing T3D[edit]

File -> Import...

(note importing may take a LONG time)

Overheard on #utjb... :-)

<tarquin> t3d stores brushes & actors but not texturing, right?
<Mychaeel> Texturing as well.
(melds into the opening speech from Reservoir Dogs...)
<DaveA>Stores links to textures, and texture transforms, but not the pixels themselves

The T3D format is a text file which stores information about map actors. It's in fact identical to what can be copied from UnrealEd to a text editor. An exported map looks like this:


Begin Map
Begin Actor Class=LevelInfo Name=LevelInfo0
    TimeSeconds=17.008888
    Summary=LevelSummary'Entry.LevelSummary'
    DefaultGameType=Class'Botpack.UTIntro'
    AIProfile(0)=23784352
    AIProfile(1)=52
    AIProfile(2)=41
    AIProfile(3)=42
    AIProfile(4)=40
    AIProfile(5)=44
    AIProfile(6)=45
    AIProfile(7)=21846171
    AvgAITime=0.000000
    Level=LevelInfo'Entry.LevelInfo0'
    Tag=LevelInfo
    Region=(Zone=LevelInfo'Entry.LevelInfo0',iLeaf=-1)
    Name=LevelInfo0
End Actor
Begin Actor Class=Brush Name=Brush0
    MainScale=(SheerAxis=SHEER_ZX)
    PostScale=(Scale=(X=0.250000,Y=8.000000,Z=3.000000),SheerAxis=SHEER_ZX)
    TempScale=(Scale=(X=0.250000,Y=8.000000,Z=3.000000),SheerAxis=SHEER_ZX)
    Level=LevelInfo'Entry.LevelInfo0'
    Tag=Brush
    Region=(Zone=ZoneInfo'Entry.ZoneInfo0',iLeaf=1,ZoneNumber=1)
    Location=(X=464.000000,Y=-16.000000,Z=64.000000)
    Begin Brush Name=Brush
       Begin PolyList
          Begin Polygon Item=OUTSIDE Texture=black1 Flags=4194304 Link=0
             Origin   -00160.000000,+00000.000000,+00128.000000
             Normal   +00000.000000,+00000.000000,+00001.000000
             TextureU +00004.000000,+00000.000000,+00000.000000
             TextureV +00000.000000,+00004.000000,+00000.000000
             Vertex   -00128.000000,-00128.000000,+00128.000000
             Vertex   +00128.000000,-00128.000000,+00128.000000
             Vertex   +00128.000000,+00128.000000,+00128.000000
             Vertex   -00128.000000,+00128.000000,+00128.000000
          End Polygon
          ...
       End PolyList
    End Brush
    Brush=Model'Entry.Brush'
    Name=Brush0
End Actor
Begin Actor Class=PlayerStart Name=PlayerStart0
    Level=LevelInfo'Entry.LevelInfo0'
    Tag=PlayerStart
    Region=(Zone=ZoneInfo'Entry.ZoneInfo0',iLeaf=1,ZoneNumber=1)
    Location=(X=183.134430,Y=-987.334167,Z=33.978027)
    OldLocation=(X=-217.561523,Y=-44.538128,Z=-87.899948)
    Name=PlayerStart0
End Actor
...
End Map


External link: http://web.archive.org/web/20060710080159/http://unreal.jall.org/tutorials/t3d.html (new URL)

T3D File Structure[edit]

Ux,UT,UT200x Maps[edit]

Begin Map
    Begin Actor Class=<ClassName>
    ...
    End Actor
    Begin Actor Class=<ClassName>
    ...
    End Actor
    ...
End Map

UT3 Maps[edit]

Begin Map
   Begin Level NAME=PersistentLevel
      Begin Actor Class=<ClassName>
      ...
      End Actor
      Begin Actor Class=<ClassName>
      ...
      End Actor
      ...
   End Level
Begin Surface
End Surface
End Map

Note: as UT3 T3D files have different header, any other not-UT3 t3d file can't be imported into UT3 editor (UnrealEd 4)

T3D brush geometry[edit]

Information geometry is contained in the following actors:

  • Brush
  • Mover (only UT and U1 game)

For more information about T3D brushes, see T3D Brush.

T3D Utilities[edit]

Related Topics[edit]

Kefik: There can be also a tag 'CsgOper' which have one of two values ... 'CSG_Subtract' -> subtract the brush from space or 'CSG_Add' -> add this brush to shape.

Sobiwan: New to WIKI editing, but not using it. I was searching for the actual format of T3D and found Mongo's description of Planetunreal to be extremely helpful. I'll ask him (mongo@planetunreal.com) if we can use and/or edit his description here. The format is much more involved than described here. We can even supply examples of how to do particular hacks.

MadNad: Interestingly, I was able to convert a Quake3_Level into a unreal map. Quite interesting. First i converted a *.bsp to a *.map in quake, then I made a level that was just a huge cube and converted it to *.t3d. With an external app (i'll have to find the name of it ) I was able to merge these two together. After some scaling and switching additive brushes in quake to subtractive brushes in ued and subtractive to additive, I compiled and had q3dm7 geometry. I don't necessarily recommend doing this, as it will take more time to fix than create it from scratch, but I thought I would share a little experience I had with this.