XML:DOOR: Difference between revisions
Paradox-01 (talk | contribs) m (ZAxisUp is ignored during file conversion) |
m (oops) |
||
(12 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{XML_File_Header | type=DOOR | {{XML_File_Header | prev=CONS | type=DOOR | next=DPge | name=Door}} | ||
__TOC__ | __TOC__ | ||
==General information== | |||
* The | * The XML code on this page was extracted with OniSplit '''v0.9.96.0''' | ||
* DOOR files are stored globally (AE/GameDataFolder/level0_Final) | * DOOR files are stored globally (AE/GameDataFolder/level0_Final) | ||
* DOOR files are | * DOOR files are named in the <Class> tag of [[XML:BINA/OBJC/DOOR|BINACJBODOOR]] files | ||
==File structure== | |||
{{Tree list}} | |||
*DOOR | |||
**OFGA | |||
***M3GM (holds <Texture> TXMP link to external file) | |||
****PNTA <Points> | |||
****VCRA <VertexNormals> | |||
****VCRA <FaceNormals> | |||
****TXCA <TextureCoordinates> | |||
****IDXA <TriangleStrips> | |||
****IDXA <FaceNormalIndices> | |||
{{Tree list/end}} | |||
==XML tags== | ==XML tags== | ||
===DOOR=== | ===DOOR=== | ||
{|class="wikitable" width="100%" | {|class="wikitable" width="100%" | ||
!width=200px| tag | !width=200px| tag | ||
Line 38: | Line 30: | ||
| width=200px| <Geometries> | | width=200px| <Geometries> | ||
| width=40px| - | | width=40px| - | ||
| contains 2 <Link> tags but only one is used (is this | | contains 2 <Link> tags but only one is used (is this true for all DOOR files?) | ||
|- | |- | ||
|valign=top |<Link> | |valign=top |<Link> | ||
Line 50: | Line 42: | ||
| <AISoundAttenuation> | | <AISoundAttenuation> | ||
| float | | float | ||
| | | passable sound "attenuation", exact formula unknown | ||
|- | |- | ||
|valign=top| <AISoundAllow> | |valign=top| <AISoundAllow> | ||
Line 72: | Line 64: | ||
| <AISoundDistance> | | <AISoundDistance> | ||
| float | | float | ||
| AI sound volume ? | | AI sound volume? | ||
|- | |- | ||
| <OpenSound> | | <OpenSound> | ||
Line 82: | Line 74: | ||
| <font color="#777777">OSBD</font>file<font color="#777777">.imp.oni (file prefix and suffix not used)</font>, 32 letters allowed | | <font color="#777777">OSBD</font>file<font color="#777777">.imp.oni (file prefix and suffix not used)</font>, 32 letters allowed | ||
|} | |} | ||
===OFGA=== | ===OFGA=== | ||
Read | Read about these '''[[XML:OFGA|HERE]]'''. | ||
===Sample XML=== | |||
=== | |||
'''DOORAIRglass01.xml''' | '''DOORAIRglass01.xml''' | ||
<?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||
Line 124: | Line 114: | ||
</Oni> | </Oni> | ||
==Exporting geometry== | |||
==geometry | |||
onisplit -extract:xml output_path path_to/DOOR*.oni | onisplit -extract:xml output_path path_to/DOOR*.oni | ||
This will extract some | This will extract some metadata in an XML file alongside the 3D content stored in a DAE file. | ||
==Importing geometry== | |||
[[Image:Quadrangulated_vs_triangulated_M3GM.jpg|thumb|200px|right|Use triangulated meshes to avoid holes in M3GM instances.]] | |||
==geometry | |||
onisplit -create output_path path_to/DOOR*.xml | onisplit -create output_path path_to/DOOR*.xml | ||
The 3D content can probably also be referenced with absolute file paths but to keep things simple the | The 3D content can probably also be referenced with absolute file paths, but to keep things simple the DAE file should be in the same folder. Sample references (as relative paths) can be seen in the [[#Sample_XML|Sample XML]] section under the <Geometry> tags. Of course TXMPs are required as part of the new 3D content. | ||
==Exporting animation== | |||
Normally it would be... | |||
==animation | |||
onisplit -extract:dae output_path path_to/OBAN''file''.oni -geom:M3GM''file''.oni | onisplit -extract:dae output_path path_to/OBAN''file''.oni -geom:M3GM''file''.oni | ||
... but since we don't use standalone | ...but since we don't use standalone M3GMs for doors anymore, use this instead: | ||
onisplit -create output_path path_to/DOOR*.xml | onisplit -create output_path path_to/DOOR*.xml | ||
onisplit -extract:dae output_path path_to/OBAN*.oni | onisplit -extract:dae output_path path_to/OBAN*.oni | ||
Then in a 3D editor, | Then, in a 3D editor, group the geometries under the animated NULL object. | ||
Next, you might want to do the following: | |||
* Set the geometries' local rotation to X = 0 | |||
* Translate the geometries' center to their lowest point | |||
* Translate the geometries in object mode onto the NULL | |||
; Question: Does OniSplit respect ZAxisUp while converting OBAN*.oni to *.dae? | |||
; Answer: No. The output values are the same no matter if ZAxisUp is present or not. | |||
==animation | ==Importing animation== | ||
ZAxisUp must be set in OBAN. | Note: ZAxisUp must be set in the OBAN. | ||
; Question: Do InitialTransform and BaseTransform affect the door? | |||
; Answer: Yes. To keep the animation unchanged, use these: | |||
<InitialTransform>1 0 0 0 0 -1 0 1 0 0 0 0</InitialTransform> | |||
<BaseTransform>1 0 0 0 1 0 0 0 1 0 0 0</BaseTransform> | |||
; Question: How is ZAxisUp handled best in a 3D editor when OniSplit doesn't respect its value? | |||
; Answer: For now, keep NULL's global X rotation to -90. | |||
'''Note: At the moment, OBAN import works only with cameras. ''' | |||
: | |||
==Making a new door class== | |||
== | Before importing doors via the "[[Creating a level#The master XML file|master file]]", you must place the door class and its TXMP(s) inside the "shared" folder. | ||
Before importing doors via "[[XML | |||
After level creation, the new door class and its animation must be placed in level 0. | After level creation, the new door class and its animation must be placed in level 0. | ||
''' | '''In shared folder''' | ||
* DOOR file | * DOOR file | ||
* TXMP file(s) ( | * TXMP file(s) (only one for each embedded M3GM instance) | ||
''' | '''In level 0''' | ||
* DOOR file | * DOOR file | ||
* OBAN file | * OBAN file | ||
; Open question | |||
: Does re-converting an original DOOR change it in any way so that e.g. its OBAN is also required in the shared folder? | |||
; | |||
: Does | |||
; Notes about original doors | ; Notes about original doors | ||
: In original game levels there are files | : In the original game levels, there are files such as "M3GMdoor_1_0.oni". That's an animated door part. (Doors consist of an animated and a static part.) But OniSplit will store animated door parts inside ONLV, so we don't need separate M3GMs. | ||
{{XML}} | {{XML}} |
Latest revision as of 15:41, 13 May 2024
DOOR : Door | ||
---|---|---|
XML
CONS << Other file types >> DPge |
General information
- The XML code on this page was extracted with OniSplit v0.9.96.0
- DOOR files are stored globally (AE/GameDataFolder/level0_Final)
- DOOR files are named in the <Class> tag of BINACJBODOOR files
File structure
- DOOR
- OFGA
- M3GM (holds <Texture> TXMP link to external file)
- PNTA <Points>
- VCRA <VertexNormals>
- VCRA <FaceNormals>
- TXCA <TextureCoordinates>
- IDXA <TriangleStrips>
- IDXA <FaceNormalIndices>
- M3GM (holds <Texture> TXMP link to external file)
- OFGA
XML tags
DOOR
tag | type | description |
---|---|---|
<Geometries> | - | contains 2 <Link> tags but only one is used (is this true for all DOOR files?) |
<Link> | link | OFGA instance number (#N) |
<Animation> | link | OBANfile.oni (file suffix not used) |
<AISoundAttenuation> | float | passable sound "attenuation", exact formula unknown |
<AISoundAllow> | flag | AI sound types which are allowed to pass:
|
<AISoundType> | flag | AI sound types:
|
<AISoundDistance> | float | AI sound volume? |
<OpenSound> | char[32] | OSBDfile.imp.oni (file prefix and suffix not used), 32 letters allowed |
<CloseSound> | char[32] | OSBDfile.imp.oni (file prefix and suffix not used), 32 letters allowed |
OFGA
Read about these HERE.
Sample XML
DOORAIRglass01.xml
<?xml version="1.0" encoding="utf-8"?> <Oni> <DOOR id="0"> <Geometries> <Link>#1</Link> <Link></Link> </Geometries> <Animation>OBANAIRglass01_anim</Animation> <AISoundAttenuation>0.5</AISoundAttenuation> <AISoundAllow>Gunfire</AISoundAllow> <AISoundType>None</AISoundType> <AISoundDistance>100</AISoundDistance> <OpenSound>door2_shrt</OpenSound> <CloseSound>door2_shrt</CloseSound> </DOOR> <OFGA id="1"> <EnvParticle></EnvParticle> <Elements> <OFGAElement> <GunkFlags></GunkFlags> <Geometry>AIRglass01_3.dae</Geometry> </OFGAElement> <OFGAElement> <GunkFlags></GunkFlags> <Geometry>AIRglass01_4.dae</Geometry> </OFGAElement> <OFGAElement> <GunkFlags></GunkFlags> <Geometry>AIRglass01_5.dae</Geometry> </OFGAElement> </Elements> </OFGA> </Oni>
Exporting geometry
onisplit -extract:xml output_path path_to/DOOR*.oni
This will extract some metadata in an XML file alongside the 3D content stored in a DAE file.
Importing geometry
onisplit -create output_path path_to/DOOR*.xml
The 3D content can probably also be referenced with absolute file paths, but to keep things simple the DAE file should be in the same folder. Sample references (as relative paths) can be seen in the Sample XML section under the <Geometry> tags. Of course TXMPs are required as part of the new 3D content.
Exporting animation
Normally it would be...
onisplit -extract:dae output_path path_to/OBANfile.oni -geom:M3GMfile.oni
...but since we don't use standalone M3GMs for doors anymore, use this instead:
onisplit -create output_path path_to/DOOR*.xml onisplit -extract:dae output_path path_to/OBAN*.oni
Then, in a 3D editor, group the geometries under the animated NULL object.
Next, you might want to do the following:
- Set the geometries' local rotation to X = 0
- Translate the geometries' center to their lowest point
- Translate the geometries in object mode onto the NULL
- Question
- Does OniSplit respect ZAxisUp while converting OBAN*.oni to *.dae?
- Answer
- No. The output values are the same no matter if ZAxisUp is present or not.
Importing animation
Note: ZAxisUp must be set in the OBAN.
- Question
- Do InitialTransform and BaseTransform affect the door?
- Answer
- Yes. To keep the animation unchanged, use these:
<InitialTransform>1 0 0 0 0 -1 0 1 0 0 0 0</InitialTransform> <BaseTransform>1 0 0 0 1 0 0 0 1 0 0 0</BaseTransform>
- Question
- How is ZAxisUp handled best in a 3D editor when OniSplit doesn't respect its value?
- Answer
- For now, keep NULL's global X rotation to -90.
Note: At the moment, OBAN import works only with cameras.
Making a new door class
Before importing doors via the "master file", you must place the door class and its TXMP(s) inside the "shared" folder.
After level creation, the new door class and its animation must be placed in level 0.
In shared folder * DOOR file * TXMP file(s) (only one for each embedded M3GM instance) In level 0 * DOOR file * OBAN file
- Open question
- Does re-converting an original DOOR change it in any way so that e.g. its OBAN is also required in the shared folder?
- Notes about original doors
- In the original game levels, there are files such as "M3GMdoor_1_0.oni". That's an animated door part. (Doors consist of an animated and a static part.) But OniSplit will store animated door parts inside ONLV, so we don't need separate M3GMs.