TRR exporter for gmax

Creating new content for Trespasser!

Moderators: TresCom Support Team, TresCom Board Managers, TresCom Developers

Post Reply
User avatar
hppav
-=TresCom Forum Admin=-
-=TresCom Forum Admin=-
Posts: 6618
Joined: Sun Nov 10, 2002 9:40 pm
Antispam: No
Location: Peru, Indiana

TRR exporter for gmax

Post by hppav »

Made this on my own time, in the "no internet" phase, editing the one machf made for 3ds Max. It works just like the TPM exporter so you'll need to use GmaxSLGrab to save the output just like you would the TPM file (Of course using .trr instead of .tpm in the filename). File is in a zip folder in the attachments. Just put in the scripts folder like you do with the TPM import/export scripts.


Here's the maxscript itself for those who don't want to download or have difficulty downloading. Just copy and past and save as an .ms file.

Code: Select all

-- TRR Exporter
--  Version 0.0.1
--  by machf
--  Copyright © TresCom, 2011

-- Version History:
-- 0.0.1
--  * converted from TPM Exporter 1.2.4y
-- 0.0.1 gmax
--  * modified 3ds Max script to run in gmax and be used like tpm exporter

-- clean up
clearlistener()

-- options
global opt_scalefix = false

-- material redundancy list
global matlist = #()
global matlistnum = 0

-- warnings
global warn_notobj = false
global warn_mirror = false
global warn_twoside = false

-- write mesh
fn WriteMesh obj =
(
 local op = obj.objectoffsetpos
 local os = obj.scale
 
 local isskin = false
 local boneVerts = #()
 local i
 local k
 
 -- write vertices
 local v
 for i=1 to obj.numverts do
 (
  in coordsys world v = (getvert obj i)
  
--    if v.z > 0 then
--    (
      format "% % %\n" v.x v.y v.z
--    ) else (
--      format "% % %\n" v.x v.y 0.0
--    )
 )
 
 
 -- clean up
 fnlist = #()
 
)

utility TrrExp "TRR Exporter"
(
 group "About"
 (
  label lab1 "TRR Exporter"
  label lab2 "Version 0.0.1"
  label lab3 "Modified by M.A.Ch.F."
  label lab4 "Modified for gmax by hppav"
  label lab5 "Copyright © TresCom, 2011"
 )
 group "Export"
 (
  checkbox chkSelected "Selection Only" checked: true
  button cmdExport "Export Terrain..." width: 140
 )
 on cmdExport pressed do
 (
  local j
  local b
  
  -- reset material redundancy list
  matlist = #()
  matlistnum = 0
  
  -- reset warning flags
  warn_notobj = false
  warn_mirror = false
  warn_twoside = false
  
   
  -- write objects
  local obj
  for j=1 to $objects.count do
  (
   obj = $objects[j]
  
   -- skip unselected
   if chkSelected.checked == true do
   (
    if not obj.isSelected do continue
   )
   
   -- write data block
     WriteMesh obj
    )
  

  -- clean up material redundancy list
  matlist = #()
  matlistnum = 0
  
  -- warnings
  local errstr = ""
  if warn_notobj do  errstr = errstr + "* not all scene objects could be exported\n"
  if warn_mirror do  errstr = errstr + "* some objects are mirrored, this may lead to object orientation problems\n"
  if warn_twoside do errstr = errstr + "* some materials are two sided, these are not preserved\n"
  if errstr.count > 0 do messagebox ("Warning:\n" + errstr)
   
  -- success confirmation
  messagebox "Terrain exported successfully."
  
 )
)



-- END OF FILE
Attachments
trr_export_gmax.zip
TRR Exporter for GMax
(1.1 KiB) Downloaded 432 times
Album 1 http://m.imgur.com/a/cRA26
Album 2 http://imgur.com/a/6tvKV
Jurassic World: Fallen Kingdom leaked and (few) official photos
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: TRR exporter for gmax

Post by machf »

Interesting. Now wondering why I never made it...
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
TheIdiot
T-Rex
T-Rex
Posts: 4345
Joined: Thu Feb 20, 2014 9:13 pm
Location: Canada, eh?

Re: TRR exporter for gmax

Post by TheIdiot »

Gotta ask, where can I get the 3DS Max version? I've looked everywhere (yes, I did a forum search) and haven't found a download. Might be good to upload both versions to the main site's Tools section.
User avatar
tatu
-=TresCom Website Manager=-
-=TresCom Website Manager=-
Posts: 5088
Joined: Fri Jun 24, 2005 9:40 pm
Antispam: No
Location: Sweden
Contact:

Re: TRR exporter for gmax

Post by tatu »

TheIdiot wrote:Gotta ask, where can I get the 3DS Max version? I've looked everywhere (yes, I did a forum search) and haven't found a download. Might be good to upload both versions to the main site's Tools section.
http://www.trescom.org/download/downloa ... 124_v2.zip

They are and have always been in the download section, in the "Editing" category.
Active project: Trespasser: Isla Sorna
Status:
BE-PH1: Released
PH2-IT: Pre-released
PL-SUM: In production

"...there used to be more benches, but InGen's workers removed them during the evacuation in the name of framerate."
User avatar
TheIdiot
T-Rex
T-Rex
Posts: 4345
Joined: Thu Feb 20, 2014 9:13 pm
Location: Canada, eh?

Re: TRR exporter for gmax

Post by TheIdiot »

tatu wrote:They are and have always been in the download section, in the "Editing" category.
Hmm. Those don't seem to be the right scripts, I have those already. Unless the TPM exporters can export to TRR as well and I'm just missing it..?
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: TRR exporter for gmax

Post by machf »

I think I didn't quite get to upload them... they were just some "quick'n'dirty" scripts I made by modifying the .tpm ones. I think I attached them to some post I made back then. Fortunately I have them at hand.

So, here they are now.
Attachments
trr_export.zip
(1.19 KiB) Downloaded 464 times
tri_import.zip
(1.18 KiB) Downloaded 448 times
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
TheIdiot
T-Rex
T-Rex
Posts: 4345
Joined: Thu Feb 20, 2014 9:13 pm
Location: Canada, eh?

Re: TRR exporter for gmax

Post by TheIdiot »

machf wrote:I think I didn't quite get to upload them... they were just some "quick'n'dirty" scripts I made by modifying the .tpm ones. I think I attached them to some post I made back then. Fortunately I have them at hand.

So, here they are now.
Thanks a ton, machf. :) Might want to add these to the Tools section like I said.
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: TRR exporter for gmax

Post by machf »

Beware, if you load them at the same time as the .tpm import/export scripts, they may have conflicts, since they use the same variables (as I said, I modified those to make these quickly). You nned to reload the script when you want to use it again (if you use the .tpm exporter, then load the .trr exporter, then if you want to use the .tpm exporter again you must relaod it first, for example; the same applies to both importers).
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
TheIdiot
T-Rex
T-Rex
Posts: 4345
Joined: Thu Feb 20, 2014 9:13 pm
Location: Canada, eh?

Re: TRR exporter for gmax

Post by TheIdiot »

No worries, machf - I didn't open the .tpm exporter and managed to get my terrain exported right. Now just need to patch up some holes in TresEd and it'll be done. 8)
Post Reply