----------------------------------------------------
fn clearUndefinedBitMaps mm = (
numSTM = getNumSubTexmaps mm
if numSTM != undefined and numSTM != 0 do (
for i = 1 to numSTM do (
BMAP = getSubTexmap mm i
if BMAP != undefined do(
bm = getclassinstances Bitmaptexture target:BMAP
getUnd = false
if bm.count != 0 do for t in bm do if t.filename == "" or t.filename == undefined do getUnd = true
if getUnd do(
format "%, % - clear\n" mm.name BMAP.name
setSubTexmap mm i undefined
)
)
)
)
)
fn theAllMat = (
local allMat = #()
join allMat (getclassinstances CoronaMtl)
join allMat (getclassinstances VRayMtl)
join allMat (getclassinstances Standardmaterial)
allMat
)
for m in theAllMat() do clearUndefinedBitMaps m
for m in sceneMaterials do clearUndefinedBitMaps m
for i = 1 to meditmaterials.count do if classOf meditmaterials[i] == BitmapTexture do if meditmaterials[i].filename == "" or meditmaterials[i].filename == undefined do (mn = meditmaterials[i].name; format "% - replase Standardmaterial in meditmaterials\n" mn; meditmaterials[i] = Standardmaterial name:mn;)
----------------------------------------------------
fn clearUndefinedBitMaps mm = (
numSTM = getNumSubTexmaps mm
if numSTM != undefined and numSTM != 0 do (
for i = 1 to numSTM do (
BMAP = getSubTexmap mm i
if BMAP != undefined do(
bm = getclassinstances Bitmaptexture target:BMAP
getUnd = false
if bm.count != 0 do for t in bm do if t.filename == "" or t.filename == undefined do getUnd = true
if getUnd do(
format "%, % - clear\n" mm.name BMAP.name
setSubTexmap mm i undefined
)
)
)
)
)
fn theAllMat = (
local allMat = #()
join allMat (getclassinstances CoronaMtl)
join allMat (getclassinstances VRayMtl)
join allMat (getclassinstances Standardmaterial)
allMat
)
for m in theAllMat() do clearUndefinedBitMaps m
for m in sceneMaterials do clearUndefinedBitMaps m
for i = 1 to meditmaterials.count do if classOf meditmaterials[i] == BitmapTexture do if meditmaterials[i].filename == "" or meditmaterials[i].filename == undefined do (mn = meditmaterials[i].name; format "% - replase Standardmaterial in meditmaterials\n" mn; meditmaterials[i] = Standardmaterial name:mn;)
----------------------------------------------------
Комментариев нет:
Отправить комментарий