Daraan on 6/8/2017 at 15:33
By chance I found this old thread (
http://www.ttlg.com/forums/showthread.php?t=113847)
It seams that view.exe can load more than one object but haven't figured it out how.
I leave the view ReadMe here as well.
Code:
Takes a binary bsp file, or several binary bsp files, or a .cmp compound file and displays them.
-ppal.gif specifies the palette to use, or
If no palette is specified, the First Contact palette is used.
-upal.gif specifies the palette to use without remapping textures
-m means to generate and use mip maps in the model.
-dd3d starts it in d3d mode.
-cFILE loads in a command file line by line
by default looks for view.cfg
Set the RAW environment variable to point at your texture directory
Set the IDATA environment variable to point at your model
note that no 16 bit or 24 format of textures are supported. Only cel
gif,pcx, and bmp.
You switch between the multiple models using the h key.
Controls are:
l/j, arrows, for changing object heading
i/k, arrows, for changing pitch
u/o for changing bank
w/s for moving it backwards and forwards
a/d for moving it left and right
q/e for moving it up and down
z/Z, also +/- zooms in and out
b/v changes background color
1/2 changes lighting harshness
3/4 changes lighting heading
5/6 changes lighting pitch
7 toggles lighting or full ambient
p toggles lighting table displayer on and off
P makes a screen shot, viewxxxx.bmp
r changes resolution
m toggles texture/solid/wire modes
t cycles through textures, space toggles transparency
f toggles viewer motion versus object motion
y toggles information mode, showing vhots and vcalls, then lighting vecs
x toggles cycling the parameters to move subobjects
` toggles rendering order
h toggles through all the models n toggles silly scaling mode
[ toggles linear or perspective
] collapses all the models and shows them together
g toggles mip mapping on and off
\ updates all the textures
:vhot <id> moves the head to vhot number id
:display "full" or "debug" or "d3d [#]" or "zd3d [#]"
or "list" to get d3d list on mono screen
:res 800 600 sets the resolution
:load foo.bin loads a bsp model
:load brings up dialog box
:fov <deg> makes the field of view <deg> degrees
:rate <float> sets the rate of time for swinging parts
:range <deg> sets the swinging range of the parts
:time <float> sets the rate of time for all controls
:model <int> sets the current model number
:vcall <int vcall> <int model> sets a vcall to render a model.
That model must be loaded already.
:vcall clear Clears all the vcalls.
:vcall_spin <float rpm> spins a vcall model at rpm
:update <on|off> starts or stops auto tmap updating (default off)
:axle_list mprints a list of all the axles and their ranges
:back <r g b> makes the background be a specified rgb triplet
:alpha <val 0..1> makes the object transparent.
:sun_direct <val 0..1> makes that much light come directly from sun
:sun_brightness <float val> scales the total brightness.
:scale <x y z> scales the model in each axis.
:scale <val> scales the model by val.
------------------------
As for the script I promised it's done since a week but I'm still fine tuning the screenshot function.
For me I can dump ~1300 models in 35 seconds. For taking screenshots this process becomes a lot longer (3mins). The script runs rather independent from the screenshots so some delay must be forced. For me 150ms are working fine but I think there might be some machine dependence and if you save in BMP or PNG.
I try to release it with the new version of DScript (but independent .nut file)
But here is the pre-release version, it's not polished but for it's purpose it doesn't have to be:rolleyes:
For me it already is a good reference, and I found some models to throw away.
Code:
/*#########################################
DScript - DumpModels v0.9
Before you can use this script you have to do some additional work as a complete list of all filenames is needed.
*For WINDOWS
1.) Open the folder with models you want to use in your explorer.
From the top line copy the path. For example:
2.) Open the Comand prompt (CMD) - for example by Win+R -> CMD
enter cd and then paste your obj path (use rightclick)
3.) Now enter: DIR /B /O:E >models.txt
4.) Go back into your explorer and open the now present models.txt. Best you use notepadd++.
•At the top and bottom of the file you will find - if present - non .bin files. Delete these.
•With Ctrl+H you open the Search and replace dialog.
•Bottom left select: Advanced (\n, \r...)
•Now enter: Search for .bin\r\n
•Replace with "," (including the ")
•Now Replace all
You know have one very long line
Go to the very and and delete the last ,"
Go to the start and enter a " before the first model name.
5.) Copy everything and paste it below into the [ ] brackets.
6.) Save this file again and open your editor. Make sure squirrel.osm is loaded.
7.) Create a Marker and give it the DDumpModels script. if you don't want to create screenshots you can start the progress in the editor with script_test ObjIDOfTheMarker. This will be done in less than a minute.
IN CASE OF CRASH:
in case of wrong models: The script will dump the models it has/tried to create in the last entrys of monolog.txt you should find a clue which models make trouble. Delte/Move the file and also delete the model name from the long "modelname" line.
In case of memory problems -> Check the parameters below. Use First and MaxModels.
8.) Best to create your airbrushes now, when you see how small and big objects are distributed. I had no problems with ~400x200 air brushes.
TAKING SCREENSHOTS:
!--> BEFORE: In cam_ext.cfg use screenshot_format BMP. PNG will TAKE AGES and possibly skip models! <---!
A) First you should create all models without screenshots and place your airbrushes accordingly.
B) Create a button/leaver and CD link it to the marker.
C) Create a second Marker name it Camera.
•Give it the property Renderer->CameraOverlay. Set it to active.
•Set it to active and set Alpha to 0
D) It's better to delete all models again so none obscours the camera.
E) If you want to create screenshots, create a button/lever and CD link it to the marker. Make sure you set the parameter Screenshots = 1 in the DesignNote.
Press the Button in Game Mode.
If you machine is not so powerfull it could happen that some models are skipped, in that case you have to search for the line SetOneShotTimer("timer",0.15) and slightly increase the last number, e.g. to 0.2
Note: For the very first model there won't be a screenshot.
-----
In the DesignNote the following optional parameters can be used as (exactly) as written here:
First Can be a model name or number, will start the process at the given ModelName or at the #th Model in your list.
MaxModels There could be trouble because to many models are created. With MaxModels you can set a limit to create for example just 100 models.
To continue the process where you left set First to the next Model after that. First alphabetically then with one character more.
Default is 2000. I had no problems with 1300 - expect at first defect models who caused crashes.
Screenshots = 1 to create a screenshot for every model during the process. This will make it a LOT slower, especially if you enabled PNG format.
##########################################*/
class DDumpModels extends SqRootScript
##########################################
{
xmax=0
v=vector()
m=""
i=0
count=0
MaxModels=2000
cam = null
MyModels =
[
"staff","stalag","statua1","Steelcabinet","waterel4"
//COPY YOUR FILE NAMES INTO HERE. -- ONE LINE ONLY!
]
function FoundSth(test,dump,v)
{
Property.SetSimple(-5739,"ModelName",test)
local o = Object.Create(-5739)
Property.SetSimple(o,"ModelName",test)
Object.SetName(o,test)
local v2 = Property.Get(o,"PhysDims","Size")
local x = v2.x
local y = v2.y
local z = v2.z
if (x>xmax)
xmax=x
v.y += y/2
Object.Teleport(o,v,vector())
//Object.Teleport("player",v,vector())
//making the screenshot
if (dump)
{
local d = 0.62*y+0.5 //~cos(45)
Object.Teleport(cam,vector(v.x-d,v.y+d,v.z+v2.z/8+2),vector(0,32,-45))
if (i != 0)
Debug.Command("screen_dump",MyModels[i-1])
}
v.y += y/2+1
print(i+" "+m)
if (v.y > 400)
{
v.y = -380
v.x += xmax
xmax = xmax/4
if (v.x >900)
print("Maxiumum Area used ending the progress")
return v
}
return v
}
function OnTimer()
{
m= MyModels
FoundSth(m,true,v)
i++
count++
if (count < MaxModels)
SetOneShotTimer("timer",0.15) //TIME BETWEEN SCREENSHOTS. Do not use png format in cam_ext.cfg
}
function OnTurnOn()
{
local db = userparams()
//local chars = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0]
local first = DGetParam("First",0,db)
local dump = DGetParam("Screenshots",false,db)
if (dump)
{
local cam = Object.Create("Marker")
Camera.StaticAttach(4)
}
count = 0
MaxModels = DGetParam("MaxModels",2000,db)
Property.Add(-5739,"ModelName")
cam = Object.Named("Camera")
if (typeof first == "string")
{first = MyModels.find(first)}
i= first
v = vector(-380,-380,0)
if (dump)
SetOneShotTimer("timer",0.15)
else
{
for (local i = first;count < MaxModels;count++)
{
m= MyModels
v = FoundSth(MyModels,dump,v)
i++
}
}
xmax = 0
count = 0
//Object.Destroy(self)
//Camera.ForceCameraReturn()
}
function OnMessage()
{print(message().message)
if (message().message == "Test")
OnTurnOn()}
}