Commit 44d6fbcf authored by Harmonikater's avatar Harmonikater
Browse files

Update scripts/bf2/_settings/StaticObjects_Import.ms, scripts/bf2/alternate_Mesh_Import.ms files

parent d6c5d17d
Pipeline #5120 passed with stage
in 31 seconds
......@@ -30,7 +30,11 @@ global g_bf2Level_IncludeDummies = #( \
"e_sAmb_wreckfire",
"glow"
)
-- Meshes that are always to be loaded two-sided, e.g. underground bunkers without fake terrain
global g_bf2Level_ForceTwoSided = #( \
"command_underground"
)
-- Textures to be replaced during import for lightmapping, 1st value original, 2nd value replacement, 3rd value to force alpha on mesh
global g_bf2Level_ReplaceTextures = #( \
......
......@@ -1199,6 +1199,15 @@ fn alternate_meshImport fname lightmapInt s =
local combinedMats = Multimaterial numsubs:(allBF2Mats.count) name:"BF2Material"
local hasRealMat = false
local hasForcedAlpha = false
local forceTwoSided = false
if (lightmapInt == 1) and (g_bf2Level_ForceTwoSided != undefined) do
(
for testName in g_bf2Level_ForceTwoSided do
(
pattern = "*" + testName + ".*mesh"
if matchPattern fname pattern:pattern do forceTwoSided = True
)
)
for m=1 to allBF2Mats.count do
(
if allBF2Mats[m] != undefined do
......@@ -1268,7 +1277,7 @@ fn alternate_meshImport fname lightmapInt s =
(
mat.diffuse = (color 230 230 230)
mat.ambient = (color 230 230 230)
if hasForcedAlpha do mat.twoSided = on
if hasForcedAlpha or forceTwoSided do mat.twoSided = on
)
else
(
......@@ -1277,7 +1286,17 @@ fn alternate_meshImport fname lightmapInt s =
)
)
if hasRealMat do for obj in allMeshes do obj.material = combinedMats
if hasRealMat then
(
for obj in allMeshes do obj.material = combinedMats
)
else
(
if forceTwoSided then
(
for obj in allMeshes do obj.material = StandardMaterial diffuse:(color 230 230 230) ambient:(color 230 230 230) twoSided:on
)
)
return rootHelper
)
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