ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
selected object material bitmap gamma override adjust
Submitted by dussla on Thu, 2013-12-12 18:57
i have a problem also
i have old version max scene
i would like to change diffuse map gamma ?
if i select ojbects , i would like to change diffuse gamma override 1 -> 2,2
how can i do that ?
fn GetBitmapTextures theObjects =
(
-- Because some submaps can also contain submaps we have to collect materials first, and then still append subMapContainers in the loop bitmapTextureMaps loop
subMapContainers = #()
for obj in theObjects do
(
if obj.material != undefined then
(
submatcount = getNumSubMtls obj.material
for i in 1 to submatcount do
(
append subMapContainers (getSubMtl obj.material i)
)
append subMapContainers (obj.material)
)
)
bitmapTextureMaps = #()
for subMapContainer in subMapContainers do
(
subtexcount = getNumSubTexmaps subMapContainer
for i in 1 to subtexcount do
(
theSubTexMap = (getSubTexMap subMapContainer i)
if theSubTexMap != undefined then
(
if (getNumSubTexmaps theSubTexMap) > 0 then
(
append subMapContainers theSubTexMap
)
else if classof theSubTexMap == bitmapTexture then
(
if theSubTexMap.gamma==1 then
(
newgamma=1/2.2
)
else
(
newgamma=1/theSubTexMap.gamma
)
Comments
...
This can be done only manually, because this option is not exposed via mxs
bga
i refered some script and maked
i made this
but that is not work
fn GetBitmapTextures theObjects =
(
-- Because some submaps can also contain submaps we have to collect materials first, and then still append subMapContainers in the loop bitmapTextureMaps loop
subMapContainers = #()
for obj in theObjects do
(
if obj.material != undefined then
(
submatcount = getNumSubMtls obj.material
for i in 1 to submatcount do
(
append subMapContainers (getSubMtl obj.material i)
)
append subMapContainers (obj.material)
)
)
bitmapTextureMaps = #()
for subMapContainer in subMapContainers do
(
subtexcount = getNumSubTexmaps subMapContainer
for i in 1 to subtexcount do
(
theSubTexMap = (getSubTexMap subMapContainer i)
if theSubTexMap != undefined then
(
if (getNumSubTexmaps theSubTexMap) > 0 then
(
append subMapContainers theSubTexMap
)
else if classof theSubTexMap == bitmapTexture then
(
if theSubTexMap.gamma==1 then
(
newgamma=1/2.2
)
else
(
newgamma=1/theSubTexMap.gamma
)
theSubTexMap=bitmap theSubTexMap.width theSubTexMap.height filename:theSubTexMap.filename gamma:newgamma
append bitmapTextureMaps theSubTexMap
)
)
)
)
makeUniqueArray bitmapTextureMaps
)