Commit a169058e authored by Harmonikater's avatar Harmonikater
Browse files

bugfixes in texture copying during auto lm

parent cabe10b3
......@@ -135,9 +135,13 @@ fn auto_lightmap_setup mapFolder sizefile:undefined areaShadows:False =
local sun_name = pathconfig.appendpath mapFolder "Sky.con"
bf2ImportSunglight fname:sun_name areaShadows:areaShadows
local savePath = pathconfig.appendpath mapFolder "Lightmaps/MaxLight/LightmapScene.max"
makeDir (pathconfig.appendpath mapFolder "Lightmaps/MaxLight") all:True
saveMaxFile savePath
LM_log " Importing statics."
local statics_name = pathconfig.appendpath mapFolder "StaticObjects.con" copyTex:true
bf2ReadStaticObjectsCon statics_name offset:[0,0,0] forLm:True
local statics_name = pathconfig.appendpath mapFolder "StaticObjects.con"
bf2ReadStaticObjectsCon statics_name offset:[0,0,0] forLm:True copyTex:true
g_bf2Level_levelDir = getFileNamePath statics_name
local objSet = BF2getSceneRootNodes()
if sizefile != undefined then
......
......@@ -481,30 +481,34 @@ fn bf2StaticsCopyTextures obj =
(
if classof obj.material == Multimaterial then
(
print "multimat"
for submat in obj.material do
(
local maps
if classof submat == Standard then
if classof submat == Standardmaterial then
(
maps = submat.maps
)m
) else (
if classof submat == bf2_StaticMesh2 then
(
maps = submat.delegate.maps
)
else
(
continue
))
for map in maps do
(
if map != undefined then
(
filename = pathConfig.appendPath (pathConfig.appendPath (pathConfig.removePathLeaf g_bf2OutModPath) "bf2") map.filename
newname = pathConfig.appendPath maxfilepath "textures"
newname = pathConfig.appendPath maxfilepath "textures"
makeDir newname
newname = pathConfig.appendPath newname (pathConfig.stripPathToLeaf filename)
copyFile filename newname
map.filename = pathConfig.appendPath "textures" (pathConfig.stripPathToLeaf filename)
copyFile filename newname
filename = pathConfig.appendPath g_bf2OutModPath map.filename
copyFile filename newname
map.filename = pathConfig.appendPath "textures" (pathConfig.stripPathToLeaf filename)
)
)
)
......
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