Very tiny script

Hi All,

I was wondering if anyone may be able to help me make a Very tiny script. I tried, but know nothing of scripting.
All the script needs to do is change the 3ds max blur parameter of all bitmaps in the scene.

Thanks
Jamie

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jannyltd's picture

I was wondering how can we

I was wondering how can we change the blur in all texture maps that have coords as well. For example tiles as they are other class - bricks not bitmaptexture. So we can go through all the classes one by one but is there a way of getting them together? I read somewhere something about GetClassInstances (superclass.classes) but I don't get it to work?

br0t's picture

Well all texture maps have

Well all texture maps have the superClass "textureMap", but you cant get it using "getClassInstances". Also, not every textureMap has a .coords or .blur parameter.

Mhm...maybe you can loop through objects in the scene that have a material, than get the maps of that material and check for .coords / .blur parameter. Just an idea, dont ahve much time right now to test^^

for o in objects where o.material != undefined do
	for m in o.material.maps where m != undefined do
			if hasProperty m.coords "blur" do
				m.coords.blur = 20.0

Never get low & slow & out of ideas

jannyltd's picture

Thanks, it is kind of go

Thanks, it is kind of go round way but I think will do the work ;)

Christopher Grant's picture

No problem. You can either

No problem. You can either copy/paste the following code into the MAXScript Listener window or your can download the attached maxscript file and in Max click MAXScript / Open Script and change the blur value to what you want then either click Tools / Evaluate All or just press Ctrl+E. Voila. All bitmaps in the scene will have their blur changed.

Note this doesn't work on a selection, it change every bitmap whether in a displace modifier, a spotlight, material, etc...

maps = getClassInstances bitmaptexture 
 
for m in maps do (
	m.coords.blur = 1.00 --set this value to whatever you want
)
AttachmentSize
snippet_SetBitmapBlur.ms 87 bytes
jamiek's picture

Thanks ever so much

Thanks ever so much Christopher!!!

As previously mentioned I know nothing of maxscript other than to record in Max listner window and reuse the code without modification.

I really appreciate your time to help me out and I would like to be able to offer you some help back [Maybe in the area of texture creation as this is my forte]
Please let me know if I can help you in any way.

Thanks again
Jamie

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.