# runbatchscript for MarbleClay PlayStation export.
# RSD Export/Obj batch script version 2 (May 2023)
# No warranty or liablity, very hacky stuff! Use at own risk.

# No defaulting of values below, all parameter values must appear!

# !assetpath C:\Documents and Settings\NetYaroze\Desktop
# This should be the first line executed!
# Spaces are fine in path, but dont put in quotes or a last back slash.
# Path can be change anytime, and the following commands will process in that folder.

# !rsdexport RootObjectName 1234567.rsd 1.0 0/1/2
# Names are Alphanumeric, no path included, no spaces, filename must be 7.3 formatted or less, 1.0 is the scale value, 0/1/2 can either be: 1:launch No$PSX,  0:Create TMD but skip No$PSX, or 2:ask
# See RSDExporter.txt for more information.
# !objexport is the same, except there is no launchpsx - note: no normals are exported.

#  !echo off / on
# Default is on, each DOS command's output will be displayed in a message popup, if off, it wont. 

# Everything else will be DOS commands and each passed to DOS, run in the current (!assetpath) location.
# Your commands can be log your output by >>file.log,  >NUL  2>NUL to null or everything will be displayed with !echo on.

#Recommendations :
# Using folders and files with no spaces, ASCII char's and DOS (or 7.3) filenames.
# Use echo on to see command and output when editing this script.
# You can not save this script while MarbleClay is running this script! Wait for it to end first.
# CD (chdir) will have no effect after that line has exectuted, you must use the !assetpath command.
# WARNING - strongly advise not deleting anything via this script, instead use move, if you have to run delete, always fully qualify individual files to avoid removing wrong files.
# Sometimes the message boxes from MarbleClay will be behind the application and it will look like it's locked up or crashed, it hasn't just hit Alt + Tab to find it, Also you'll see two MarbleClay windows in the toolbar, click the 2nd one.
# If you run a command and it's halted or pause (ie awaiting input), it will need to be killed via process explorer, for the script to finish.

#turn logging off
!echo off

#lazy, working on the desktop is a bad idea!
!assetpath C:\Documents and Settings\NetYaroze\Desktop

#auto create a del folder and move all test files to it
mkdir del
move test* del


#export rsd only
!rsdexport newobject test.rsd 1.0 0

#do a multiple object scene and view it
rsdform -v  -t 855 555 555 -o 1  test
rsdform -v  -t -855 555 555 -o 2  test
rsdform -v  -t  0  555 555 -o 3  test

#rsdn.bat must be in system envirnoment path
rsdcat -v -o testall 1 2 3  test

#rsdn.bat must be in system envirnoment path
rsdn testall 


#export obj then test it 
!objexport newobject test.obj 10.0 
assimp_viewer.exe test.obj

# assimp build from: https://archive.org/details/assimp-master-build-21-jan-2023-winxp
assimp export test.obj test.dae
assimp_viewer.exe test.dae
