PDA

View Full Version : Bitmap Remover from Viweport..( possible to create? )


ozioz
05-08-2007, 11:02 AM
Hi Guys;

I need some advices and help for a script.. Here it is:


------------------------------------------------------------------

fn showMatInViewport mat =
(
if (mat != undefined) do
(
--this works for all materials
mat.showinviewport = true

--but there could also be the show in viewport of just the bitmaps..

--so if it was a standard material
if classof mat == Standardmaterial then
(
-- then we use the .diffusemap object of the material
if (mat.diffusemap != undefined) then showTextureMap mat mat.diffusemap on
)
--if it wasn't a standard material, check if its a vraymaterial
else if classof mat == Vraymtl then
(
--and then we try and shut off the .texmap_diffuse map
if (mat.texmap_diffuse != undefined) then showTextureMap mat mat.texmap_diffuse on
)
)
)--end function


-- teh script
sel = selection as array
for n = 1 to sel.count do
(
if classof sel[n].material == Multimaterial then
(
for i in 1 to sel[n].material.numsubs do
(
showMatInViewport sel[n].material.materiallist[i]
)
)
else
(
showMatInViewport sel[n].material
)
)


All I wanna do is just removing all the textures that are displayed in the viweport. Unfortunately there are many objects and many differenet bitmaps. So I do not want to try turning off "Show Bitmap on Viweport" option for every single metarial. It would be a nightmare I think. I have to remove the textures from the viewport.. ıt was a mistake to show them but I have done. I always run into memory problems while rendering. ( Textures are too big and have a resalution 2k - 2048/2048 ) Vray always goes crazy...

I have found that little script . But It did not work. It turns on the option. That is not What I wanna achive..

I hope I have been able to explain What I mean.. Could you please do something for me if it is possible?? I cannot use MAXScript. One of the guys in the forum offered me to fill you in about the situation I have..

Best Regards;

Ozioz.

MoonDoggie
05-08-2007, 02:18 PM
I'm confused, you want a script that turns off ShowInViewport for all the bitmaps seen in the viewport? I don't think that's what you are referring to. You want a script that actually turns off the actual textures (by material = undefined)? correct? Still not sure.

Try running a freeSceneBitmaps() in the listener every once in a while and scale some textures down too.

-Colin

ozioz
05-08-2007, 02:59 PM
I'm confused, you want a script that turns off ShowInViewport for all the bitmaps seen in the viewport?

Yes man. That is excatly What I am looking for. The textures that can be seen in the viweport should be turned off and they should keep on appearing on render results. I do not wanna reset my metarials diffuse map slots. ( ıt is just because memory issues )

If you still confused, let me know..

Buy the way, the script that I sent you guys did not belong to me. I just found it by doing a quick search in CGSociety forums. Unfortunately, It doesn't give me the appropriate result that I want..

Best Regards;

Ozioz

BakerCo
05-08-2007, 03:49 PM
not sure if this is what you mean


(

rollout MaterialsToggle "Show Materials" width:163 height:52
(
local onOff = false

button onOff_btn "" pos:[33,11] width:97 height:30
on onOff_btn pressed do
(
onOff = (not onOff)

if onOff == true then appOnOff = "On" else appOnOff = "Off"
onOff_btn.text = ("Materials " + appOnOff)

for i in meditMaterials do
(
if i.diffuseMap != undefined then
(
showTextureMap i i.diffuseMap onOff
)
)
)
)
createDialog MaterialsToggle

)


I am still very new to all this so I am sure there is a better way

-Baker

ozioz
05-08-2007, 04:46 PM
Thank You So Much Jonathan;

That script worked properly.. It is so usefull. But I think I do not need to use any script anymore..

One of the MAX user in CGSociety told me that there is a command that removes the viwepor displayed textures just by one click. Ir is ınder "display" main menu.. :)

Thank you so much again.. That was my falt..

See you soon..

Ozioz

CGTalk Moderation
05-08-2007, 04:46 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.