Notifications
Clear all

[Closed] execute and variable scope

I’m not sure if this is what you want, but since you’re assigning the same bitmap to all slots, you could create instances of the bitmapTexture instead of individual copies:

local chkTypesArray = #(chk_ambientMap,chk_diffuseMap,chk_specularMap,chk_specularLevelMap,chk_glossinessMap,chk_selfillumMap,chk_opacityMap,chk_filterMap,chk_bumpMap,chk_reflectionMap,chk_refractionMap,chk_displacementMap)
local MapTypesArray = #(#ambientMap,#diffuseMap,#specularMap,#specularLevelMap,#glossinessMap,#selfillumMap,#opacityMap,#filterMap,#bumpMap,#reflectionMap,#refractionMap,#displacementMap)
  
local b = bitmaptexture filename:mapFileList[iter]
  
for j = 1 to mapTypesArray.count do
(
    if chkTypesArray[j].state then (setproperty activeMaterial.materialList[i] MapTypesArray[j] b)
)

Cheers,
Martijn

Page 2 / 2