Commit 73cb21ad authored by Harmonikater's avatar Harmonikater
Browse files

Add exception output and change default point light behavior

parent 3b90a7bf
......@@ -76,8 +76,10 @@ fn auto_lm_load_scene mapFolder =
True
)
fn auto_lightmap_setup mapFolder sizefile:undefined areaShadows:False =
fn auto_lightmap_setup mapFolder sizefile:undefined areaShadows:False pointLights:False sharpness:1.0 =
(
try
(
auto_lm_prelim mapFolder
LM_log ("Auto-Lightmapping " + mapFolder)
......@@ -142,6 +144,16 @@ fn auto_lightmap_setup mapFolder sizefile:undefined areaShadows:False =
LM_log " Importing statics."
local statics_name = pathconfig.appendpath mapFolder "StaticObjects.con"
bf2ReadStaticObjectsCon statics_name offset:[0,0,0] forLm:True copyTex:true
for l in lights do
(
if not pointLights and superclassof l == light and l.rgb == (color 255 0 0) then
(
l.enabled = off
)
)
try ( g_bf2_lightMappingWaterLight.enabled = off ) catch ()
g_bf2Level_levelDir = getFileNamePath statics_name
local objSet = BF2getSceneRootNodes()
if sizefile != undefined then
......@@ -166,10 +178,19 @@ fn auto_lightmap_setup mapFolder sizefile:undefined areaShadows:False =
)
LM_log " Saving scene."
LM_log "Scene setup complete."
)
catch
(
exc = getCurrentException()
LM_log "*** MAXSCRIPT EXCEPTION ***"
LM_log (exc as string)
LM_log (stack asString:True)
)
)
fn auto_lightmap_render_obj mapFolder part:1 parts:1 =
(
try
(
if maxFileName != "LightmapScene.max" then
(
auto_lm_prelim mapFolder
......@@ -235,11 +256,20 @@ fn auto_lightmap_render_obj mapFolder part:1 parts:1 =
fullConvertStr = convertStr + "\n"
runDosCommand fullConvertStr doPause:false
LM_log "Done."
)
catch
(
exc = getCurrentException()
LM_log "*** MAXSCRIPT EXCEPTION ***"
LM_log (exc as string)
LM_log (stack asString:True)
)
)
fn auto_lightmap_render_terrain mapFolder =
(
try
(
if maxFileName != "LightmapScene.max" then
(
auto_lm_prelim mapFolder
......@@ -347,6 +377,14 @@ fn auto_lightmap_render_terrain mapFolder =
)
)
LM_log "Done."
)
catch
(
exc = getCurrentException()
LM_log "*** MAXSCRIPT EXCEPTION ***"
LM_log (exc as string)
LM_log (stack asString:True)
)
)
fn auto_lightmap mapFolder =
......
......@@ -215,7 +215,17 @@ function Bf2RenderTerrain outPath size:undefined s:10.0 =
bf2LightmapsPrepForRender()
g_bf2_lightMappingTerrain.pos.z = 0
unhide g_bf2_lightMappingTerrain
for l in lights do l.enabled = on
for l in lights do
(
if l.rgb != (color 255 0 0) then
(
l.enabled = on
)
else
(
l.enabled = off
)
)
try ( g_bf2_lightMappingWaterLight.enabled = off ) catch ()
local terrainToRender = g_bf2_lightMappingTerrain
if g_bf2_lightMappingWaterLight != undefined and g_bf2_lightMappingTerrain.min[3] < (g_bf2_lightMappingSeaLevel * s) then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment