Talk:Mod Tool/OniTools addon: Difference between revisions

m
fixed links by pointing to archive that now contains them
mNo edit summary
m (fixed links by pointing to archive that now contains them)
 
(47 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==Notes on usage==
===master xml file===
How a healthy master file should look like:
<?xml version="1.0" encoding="utf-8"?>
<Oni>
  <Level SharedPath="../shared">
    <Environment>
      <Model>
        <Import Path="levelN_Final/alpha_helix_env.dae" />
        <Import Path="levelN_Final/alpha_helix_env_markers.dae" />
      </Model>
      <Rooms>
        <Import Path="levelN_Final/alpha_helix_bnv.dae" />
      </Rooms>
      <Textures Format="BGR" AlphaFormat="RGBA" MaxSize="512"></Textures>
    </Environment>
    <Sky>sunset</Sky>
    <Objects lsi="torch">
      <Import>levelN_Final/BINACJBOCharacter.xml</Import>
      <Import>levelN_Final/BINACJBOPowerup.xml</Import>
      <Import>levelN_Final/BINACJBOTurret.xml</Import>
      <Import>levelN_Final/BINACJBOConsole.xml</Import>
    </Objects>
    <Films></Films>
    <Cameras></Cameras>
  </Level>
</Oni>
GUI generated master files come with a "level specific item" ([[XML:IPge#Related_files|LSI]]) attribute in the <Objects> tag.
The tag is used by the GUI to copy the correct LSI files into the output folder where OniSplit generates all other level files for the "Final" archive or plugin.
Note that you can use only one type of LSI per level.
==Dev notes for the remake==
==Dev notes for the remake==
alpha helix
[[Image:Mod_Tool_Oni_level_rebuilder_logo.jpg|200px|right]]
[[Image:Mod_Tool_Oni_level_rebuilder_logo.jpg|200px|right]]
The original plan was to do all relevant stuff with Mod Tool scripts.
The original plan was to do all relevant stuff with Mod Tool scripts.


But having another program in between ease some shortcomings of MT such as its capability of creating terrible GUIs/controls.
But having another program in between ease some shortcomings of MT such as its capability of creating GUIs/controls.
 
Currently working on: [[#Detailed_checklist|update #3]]
 
===Update management===
====GUI====
Starting with 14.01.2017 the GUI is distributed via AEI.
 
====Shared vanilla classes====
These zipped resources are about 2 MB and for now they will ship embedded inside the GUI. After being written to separate files the oni files get converted to dae and xml.
 
====Shared additional classes====
These zipped resources aren't yet available. They are going to be downloaded by the GUI.


Currently working on: welcome screen to confirm basic data such as AE path, XSI path, XSI addon path, and author name
There are supposed to be many files in that zip. Due to copyright concerns the files are encrypted and will be made available only if Oni retail resources are found on client computer.


====XSI addon====
Normally you have to install a *.xsiaddon file by hand but it seems that is just gets unzipped to another folder. So that can be automated.


===Addon updater===
Also, the scripts don't need much space so they will ship embedded inside the GUI.
Normally you have to install a *.xsiaddon file but it seems that is gets unzipped to another folder so we could just download new scripts and resources via GUI, making this thing more modular.


Location of used *.xsiaddon files<br>
Location of used *.xsiaddon files<br>
Line 18: Line 68:
C:\Users\UserName\Autodesk\Softimage_Mod_Tool_7.5\Addons
C:\Users\UserName\Autodesk\Softimage_Mod_Tool_7.5\Addons


  Addon name folder
  ''Addon name folder''
   |
   |
   +-- Application
   +-- Application
Line 26: Line 76:
             +-- *.vbs
             +-- *.vbs


We only need the GUI to figure out where the folders are. Either automatic search or some sort of user input.
We only need the GUI to figure out where the folders are.


The welcome screen triggers an automatic search. The user either confirms or changes the information.


===Combined checklist of addon and GUI===
===Known issues===
* level projects cannot migrate from original release to update #1
:: Folder naming rule was changed from numbered levels to "levelN_Final".
:: This avoids the need to update all links in master file if the level number changes.
:: You would have to rename your local level and update the master file by hand.
* <s>self-closing PPG leaves a blank page</s> Fixed in #2. ''DeleteObj "..."'' and ''PPG.'''Close''''' need to be embedded within ''oPPGLayout'''.Logic'''''
* GUI pops up when you save the console from XSI. (Cause is unexpected hard to track down.)
* <s>XSI cannot brought to front by GUI when it is minimized.</s> Fixed in #2
* <s>unstable updating of shared classes</s> Fixed in #2 by renaming old folder. That way custom made changes don't get lost however still need to be moved by hand.
* <s>quick test function in xsi produces level archives of name "levelN_Final"</s> Fixed in #2. N is now an actual number.
 
===Detailed checklist===
{{divhide|env markers - feature update #3 (upcoming)}}
 
Since this update deals mainly with textures I better shouldn't stop at env markers.
 
These things deal also more or less with textures: '''pathfinding''' (ghosts), '''furniture''' (collision boxes), handling of '''regular textures''' (adding an easy way to switch textures), '''gunk flagged''' ("special") textures, '''static objects''' (just so that I complete the model section all together), and for sake of completeness '''animated objects''' and '''cameras'''.
 
Version increment:
sharedVanillaClassesVersionInApp = 4
xsiGeneralScriptsVersion = 3
 
;env markers
* html page [x]
* detect xml DnD from html page [x]
** create new grid if DnD happened on an empty location [x]
** change material if DnD happened on an object [x]
* make / switch to layer [..]
* auto-create texture clips and materials [x]
* move object if a point was selected [x]
* make PPG (property page) [..]
** button: toggle twosidedness of object's main material [x] (lose of twosidedness also removes transparency)
** button: toggle transparency of object's main material []
** button: toggle twosidedness of selected polygons []
** button: toggle transparency of selected polygons []
** button: invert selected polygons [x]
** button: toggle visibility of polygon normals [x]
** button: toggle visibility of collision boxes [x]
* add layer export [x]
* load complete layer after clicking button in GUI [x]
* enhancements
** add instance checker: AKEV textures []
** don't show tasks PPG on startup if there are no imports [x]
* embed new files and make package []
* test package update on different machine before uploading it []
 
; powerups
* html page [x]
* detect xml DnD from html page [x]
* make / switch to layer [x]
* move object if a point was selected [x]
* make PPG (property page) [x]
* add layer export [x]
* load complete layer after clicking button in GUI [x]
* get specific (local) LSI files when building a level [x]
* embed new files and make package []
* test package update on different machine before uploading it []
 
 
; furniture
:attached OFGA particle can't be shown within xsi until there I write 3RAP support which won't happen
* html page []
* detect xml DnD from html page []
* make / switch to layer []
* move object if a point was selected []
* make PPG (property page) ? []
* add layer export []
* load complete layer after clicking button in GUI []
* embed new files and make package []
* test package update on different machine before uploading it []
 
{{divhide|end}}
 
{{divhide|Turrets (TURR) - feature update #2}}
* dae and xml gets extracted from shared vanilla classes [x]
* html page [x]
* detect xml DnD from html page [x]
* make / switch to layer [x]
* load all dae parts and group them [x]
* move objects if a point was selected [x]
* make PPG (property page) [x]
* add layer export [x]
* load complete layer after clicking button in GUI [x]
* enhancements
** fix: close and reopen CONS PPG after editing events [x]
** fix: show XSI to trigger OnActivate function for loading a layer [x]
** fix: various (basically #1 was unusable for other machines) [x]
* embed new files and make package [x]
* test package update on different machine before uploading it [x]
 
 
Version increment:
sharedVanillaClassesVersionInApp = 3
xsiGeneralScriptsVersion = 2
{{divhide|end}}
 
{{divhide|Consoles (CONS) - feature update #1}}
* dae and xml gets extracted from shared vanilla classes [*]
* CONS html page (<nowiki>https://www.dropbox.com/s/1rur57ea9i34652/consoles_wip.jpg?dl=0</nowiki>, dead link) [*]
* detect xml DnD from html page [*]
* make / switch to CONS layer [*]
* load all dae parts and group them [*]
* move console if a point was selected [*]
* make collision box semi-transparent [*]
* make PPG (property page) [*]
* get textures of used screens from vanilla CONS collections [] (#?)
* make screen section in CONS html [] (#?)
* detect active project via exchange file [*]
* add CONS layer export [*]
* re-create PPG whenever an CJBO event changes [*]
* add quick level test function [*]
* load complete CONS layer after clicking button in GUI [*]
* bugs fixes [*]
* remove Sledgehammer's old self-updater, other cleanups [*]
* embed new files and make package [*]
* test package update on different machine before uploading it [*]
 
Version increment:
sharedVanillaClassesVersionInApp = 2
{{divhide|end}}
 
===General checklist of addon and GUI===
: estimated time
: estimated time
:: XSI addon features (1y)
:: XSI addon features (1y)
:: small GUI features and editors (1y)
:: small GUI features and editors (1y)
:: BSL and XML editor (1y)
:: BSL and XML editor (1y)
:: fine-tuning, bug-fixes, refactoring (1y)
:: fine-tuning (v2), bug-fixes, refactoring (11mos.)
:: demo-level with prone-mode (1y)
:: demo-level with prone-mode (1mo.)
:: wth ...
:: wth ...


Line 122: Line 294:
'''addon'''
'''addon'''
# read, write, edit CHAR [][][]
# read, write, edit CHAR [][][]
# read, write, edit CONS [][][]
# read, write, edit CONS [x][x][x]
# read, write, edit DOOR [][][]
# read, write, edit DOOR [][][]
# easy option to [http://paradox.oni2.net/tmpWikiPics/create_3d_door_frame.png create door frames] [] (2d walls require a bit more work)
# easy option to [http://paradox.oni2.net/tmpWikiPics/create_3d_door_frame.png create door frames] [] (2d walls require a bit more work)
Line 135: Line 307:
# read, write, edit TRIG [][][]
# read, write, edit TRIG [][][]
# read, write, edit TRGV [][][]
# read, write, edit TRGV [][][]
# read, write, edit TURR [][][]
# read, write, edit TURR [x][x][x]
# read, write, edit WEAP [][][]
# read, write, edit WEAP [][][]
# read, write, edit CONS class [][][] ?
# read, write, edit DOOR class [][][] ?
# read, write, edit decal class [][][] ?
# read, write, edit TURR class [][][] ?
# read, write, edit TRIG class [][][] ?
# read, write, edit WEAP class [][][] ?
# xsi vertex shading editor (with easy controls for light sources) []
# xsi vertex shading editor (with easy controls for light sources) []
# add new corpses []
# add new corpses []
# material-depending polygon deletion []
# material-depending polygon deletion []
# create cameras from dae []
# create cameras from dae []
: count: 49




Line 163: Line 340:
----
----
----
----


===New code snippets===
===New code snippets===
Line 225: Line 401:
| -
| -
| html
| html
| [https://dl.dropboxusercontent.com/u/139715/OniGalore/ModToolScript/LevelBuilder/HelpFunctions.vbs x]
| x <nowiki>https://www.dropbox.com/s/srcvil992v3jkxs/HelpFunctions.vbs?dl=0</nowiki> (dead link)
| [https://dl.dropboxusercontent.com/u/139715/OniGalore/ModToolScript/LevelBuilder/HelpFunctions.vbs x]
| x <nowiki>https://www.dropbox.com/s/srcvil992v3jkxs/HelpFunctions.vbs?dl=0</nowiki> (dead link)
| html
| html
<!--
<!--
Line 245: Line 421:
|-
|-
| preview imgs
| preview imgs
| [https://dl.dropboxusercontent.com/u/139715/OniGalore/ModToolScript/LevelBuilder/characters.zip x]
| x <nowiki>https://dl.dropboxusercontent.com/u/139715/OniGalore/ModToolScript/LevelBuilder/characters.zip</nowiki> (dead link)
|
|
|
|
Line 254: Line 430:
|
|
<!-- | -->
<!-- | -->
| [https://dl.dropboxusercontent.com/u/139715/OniGalore/VanillaTURRs.jpg x]
| x <nowiki>https://dl.dropboxusercontent.com/u/139715/OniGalore/VanillaTURRs.jpg</nowiki> (dead link)
| x
| x
|-
|-
Line 328: Line 504:
Patrol paths are the trickiest. There's no easy way to show the connection from flag to another. It might be possible with multiple chains used for rigging but that's not very comfortable to deal with.
Patrol paths are the trickiest. There's no easy way to show the connection from flag to another. It might be possible with multiple chains used for rigging but that's not very comfortable to deal with.


Idea: add ID property to each used flag. When a flag is clicked, a PPG opens with a button to show flag connections (one lose chain with many bones, old one is deleted). MT also opens/updates an application (have to look into [https://bytes.com/topic/visual-basic-net/answers/630751-how-do-i-pass-command-line-another-instance-my-application-already-running writing command line apps] first). I guess that's necessary to preview (and edit) the complete xml code as this would be to awkward to code directly in MT. The xml file is saved on change events. MT reads that xml when a patrol path flag is selected.
Idea: add ID property to each used flag. When a flag is clicked, a PPG opens with a button to show flag connections (one lose chain with many bones, old one is deleted). MT also opens/updates an application (have to look into [http://web.archive.org/web/20150926205808/http://bytes.com/topic/visual-basic-net/answers/630751-how-do-i-pass-command-line-another-instance-my-application-already-running writing command line apps] first). I guess that's necessary to preview (and edit) the complete xml code as this would be to awkward to code directly in MT. The xml file is saved on change events. MT reads that xml when a patrol path flag is selected.
 
21.06.2016 Yay. Ugly PATR xml editor underway. "[https://1drv.ms/u/s!AjLkf0bK7POzgpI-McvVNAPeU5Cz2w Full manual edits]" tab ''already'' ready... took long enough. Figured out command line part. Next stop MT interaction.
 


21.06.2016 Yay. Ugly PATR xml editor underway. "Full manual edits (<nowiki>https://1drv.ms/u/s!AjLkf0bK7POzgpI-McvVNAPeU5Cz2w</nowiki>, dead link)" tab ''already'' ready... took long enough. Figured out command line part. Next stop MT interaction.


===Editing simultaneously multiple ghost quads heights===
===Editing simultaneously multiple ghost quads heights===
Line 338: Line 512:


===Display keywords===
===Display keywords===
[[Image:XSI_ModTool_display_keywords.png|thumb|200px|right]]
  SetUserKeyword selection(0), "type=akev, id=1"  
  SetUserKeyword selection(0), "type=akev, id=1"  
   
   
Line 347: Line 523:
  SetValue "Camera.camvis.attrseluserkeywords", True
  SetValue "Camera.camvis.attrseluserkeywords", True


https://dl.dropboxusercontent.com/u/139715/OniGalore/xsi_char_save_settings.png




Line 354: Line 529:
Using a "Simulate Rigid Bodies" ICETree node for this is ''overkill''. But it works and I fail to come up with alternatives, so...
Using a "Simulate Rigid Bodies" ICETree node for this is ''overkill''. But it works and I fail to come up with alternatives, so...


https://dl.dropboxusercontent.com/u/139715/OniGalore/abusing_ICE_for_displaying_a_flag.png
<nowiki>https://dl.dropboxusercontent.com/u/139715/OniGalore/abusing_ICE_for_displaying_a_flag.png</nowiki> (dead link)
  '### setup flag display by abusing ICE
  '### setup flag display by abusing ICE
  CreatePrim "Cube", "MeshSurface"
  CreatePrim "Cube", "MeshSurface"
Line 378: Line 553:
  end if
  end if


==Dev notes for remake v2==
Labor-intense improvements (aka ''skipped cuz of lazyness'') will be probably tackled only after v1 (alpha helix) was completed.
beta helix
'''GUI'''
* Add a "current tasks" screen.
** use background worker threads
** use a progress bar
* Use separated form for txmp creation (avoid impression that GUI is only for that one file type)
* Explore and fix issue that causes GUI to remain in front when called via command-line in XSI
* Add html section for turret screens
* Add html section for door decals
* Migrate custom classes to new "shared" folder after an update
* Unify use of internal update variables
** v1 uses shared classes version right inside the source code
** v1 uses xsi scripts version in the app's settings (a section provided by Visual Studio)
'''XSI'''
* remove the deprecated exchange file tag <activeLevelNumber>


==More wild ideas==
==More wild ideas==
===FILM creation within MT===
[[XML:FILM|FILM]]s could be created with certain approximation.
Maybe we can use curves and add null objects to specific point that hold FILM properties like key presses.
Cameras would indicate the current perspective.


Exact values might require information about ONCC and starting TRAM.


===Animated reference===
===Animated reference===
Line 424: Line 627:


===New camera animations===
===New camera animations===
{| border=0 cellpadding=0 style="float: right;"
| last frame of OBANOutroCam02<br>[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/Mod_Tool/camera_OBAN_examination_zpsaf16d39e.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/Mod_Tool/camera_OBAN_examination_tn_zpsc8295474.png]
|}
There's already an excel macro available but now I want to build cam anims without excel.
There's already an excel macro available but now I want to build cam anims without excel.


Line 441: Line 640:


Positions and rotations keyframes can be applied to the camera root object.
Positions and rotations keyframes can be applied to the camera root object.


===Adding multiple textures to level geometry [out-dated]===
===Adding multiple textures to level geometry [out-dated]===
Line 459: Line 657:


[...]
[...]


===TRBS-fitting TRMA creation===
===TRBS-fitting TRMA creation===
Line 473: Line 670:


Current status:
Current status:
* http://youtu.be/RqSsXTzHTA8
* drag and drop [http://mods.oni2.net/system/files/Oni_Character_Helper_with_onisplit_dnd_updater_wip.zip add-on file] into Mod Tool to install it
* drag and drop [http://mods.oni2.net/system/files/Oni_Character_Helper_with_onisplit_dnd_updater_wip.zip add-on file] into Mod Tool to install it
* no LOD, no envmap support
* no LOD, no envmap support
|style="float:right"|
hexhound hierarchy
[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/3D_modding/hexhound_hierarchy_zpsf32e971c.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/3D_modding/hexhound_hierarchy_tn_zpsd82230ce.png]
|}
|}


Line 603: Line 794:
  ' INFO  : counted body parts: 19
  ' INFO  : counted body parts: 19
{{divhide|end}}
{{divhide|end}}


==Old dev notes==
==Old dev notes==
===New door animations===
===New door animations===
Final door animation depends on:
Final door animation depends on:
Line 640: Line 829:


There could be a loop scanning all objects for those numbers.
There could be a loop scanning all objects for those numbers.


===Hierarchy builder for characters===
===Hierarchy builder for characters===
Based on old knowledge. See [[Mod_Tool#exchange_of_meshes_in_hierarchies|HERE]] for an easy manual way to change the meshes in hierarchies.
Based on old knowledge. See [[Mod_Tool#Exchange_meshes_in_hierarchies|HERE]] for an easy manual way to change the meshes in hierarchies.




Line 649: Line 837:
'''(old notes in the following)'''
'''(old notes in the following)'''


{| border=0 cellpadding=0 style="float: right;"
(Automatic rigging.) Maybe null objects could stand for the centers of body parts. Then one click and the real centers gets positioned. The rotations are known and the names would lead to the correct hierarchy.
| hierarchy breaker beta<br>[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/3D_modding/hierarchy_breaker_beta.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/3D_modding/hierarchy_breaker_beta_tn.png]
|}
 
(Automatic rigging.) Maybe null objects could stand for the centers of body parts. Then one click and the real centers gets positioned. The [[User:Paradox-01/for_WIP_pages#Mod_Tool:_putting_a_character_together_while_preserving_body_part_positions|rotations are known]] and the names would lead to the correct hierarchy.


In order to make edits there is also a need of destroying the hierarchy again while preserving the rotation and position of the meshes.
In order to make edits there is also a need of destroying the hierarchy again while preserving the rotation and position of the meshes.




code pieces
'''[http://mods.oni2.net/node/383 code pieces]'''
 
 
hierarchy breaker
* [https://dl.dropbox.com/u/139715/OniGalore/ModToolScript/hierarchy_breaker_beta.txt hierarchy_breaker_beta.txt] (works only with strict correct names)


* hierarchy_breaker_beta.txt
: works only with strict correct names


hierarchy builder
* hierarchy builder
* [https://dl.dropbox.com/u/139715/OniGalore/ModToolScript/delete_keyframes.txt delete_keyframes.txt] (deletes keys, saves and reloads character)
** delete_keyframes.txt
* [...]
:: deletes keys, saves and reloads character
** [...]




Line 737: Line 920:
'''Data table'''
'''Data table'''


[[Mod_Tool/Scripting#as_binary|Reading the AKEV's name table]] was more or less easy. This time we need to look up the data table.
[[Mod_Tool/Scripting#Read_binary_file|Reading the AKEV's name table]] was more or less easy. This time we need to look up the data table.


Three things to take care about: '''reading hex numbers backwards''' (as usual in Oni), '''adding relative offsets''' to data table's offset (took a pretty while to find that one out*), '''subtracting 8 bytes''' for no other reason to get the correct offset.
Three things to take care about: '''reading hex numbers backwards''' (as usual in Oni), '''adding relative offsets''' to data table's offset (took a pretty while to find that one out*), '''subtracting 8 bytes''' for no other reason to get the correct offset.
Line 762: Line 945:
'''AGQG reader'''
'''AGQG reader'''


https://dl.dropboxusercontent.com/u/139715/OniGalore/temp/AKEV_AGQG_reader.txt
see [[Mod_Tool/Scripting#AKEV_AGQG]]


output sample:
output sample:
Line 817: Line 1,000:


AKEV data and extracted console mesh have different polygon IDs and point IDs. Identifying each point by position (taking tolerances into account) and then identifing the quads and triangles would take too long. So, it's still possible but at the moment it's a black hole consuming too much dev time... Darn.
AKEV data and extracted console mesh have different polygon IDs and point IDs. Identifying each point by position (taking tolerances into account) and then identifing the quads and triangles would take too long. So, it's still possible but at the moment it's a black hole consuming too much dev time... Darn.
== Improving deletion algorithm ==
'''[Expand [http://konoko.oni2.net/%5bOni%20Developing%5d/%5bProgramming%5d/SRC%20texts.7Z this archive] to see the files being referenced. -Iritscen]''' I've tested an improved version ("kill_NONEs_improved.TXT") of this section ("kill_NONEs_orig.TXT"). My improvements are very simple:
# Deleting cluster itself after polygon deletion
# Freezing object and modelling
That improvements are really useful for me... Maybe, it could be useful for you (or for others)... You can test it...
<br>
--[[User:Mai X|Mai X]] ([[User talk:Mai X|talk]]) 00:17, 10 April 2023 (CEST)
[[Category:Completed modding tools]][[Category:Windows-only modding tools]]