ScriptSpot

Forum topic · Scripts Wanted

Bitmap Blur for Vray Mutlimaterial...

By roamn · 2012-05-22

Description

Hi, could someone help me, and post a script, that sets the bitmap blur in VrayMtl for diffuse to 0.1 and for bump slot to 1? And it must work also with multimaterial (subobject materials).

Currently i have 2 scripts (separate), one sets bitmap blur to 0,1 for diffuse slot, and one for bump slot to 1. but they work with suboject material.

Could someone please help me?

Comments (16)

Try This

barigazy · 2012-05-25

Let say your collections of script are placed in maxroot>scripts>MyScripts folder.
First put vraymtl_map_blur_value.ms in this folder,
then create new macro script like this:


macroScript SetBlur category:"MY" internalcategory:"MY" tooltip:"SetBlur" buttontext:"SetBlur" silentErrors:true
(
	local setblurscript = ((getDir #Scripts) + "\\MyScripts\\vraymtl_map_blur_value.ms")
	on execute do ( if not doesFileExist setblurscript then #abort else ( filein setblurscript ) )
)

and save it something like "setblur.mcr" inside
maxroot>UI>MacroScripts folder.
Restart max. Find script and place it on toolbar or quadmenu
If this does not work then the problem is your max installation, not the script.
Use this two files and try.

Attachments

interesting

roamn · 2012-05-26

it seems to work now, interesting, thanks :-)!

barigazy · 2012-05-26

Finaly :)

Little Problem

roamn · 2012-05-23

But how can i put it in the menus (or quads etc.)?

I try to add line

category:"MY" tooltip:"SetBlur" buttonText:"SetBlur" (which i use for all other small scripts i came acros which dont have their own category) but it doesnt help.
If i crate separate launcher ms for it, in which is:

macroScript SetBlur category:"MY" tooltip:"SetBlur" buttonText:"SetBlur"
(
fileIn "vraymtl_map_blur_value.ms"
)

It still doesnt work.

(with "doesnt work" i mean i get a dialogue box where i can only write the bump blur, not the diffuse blur. If i run your script from the run script option everything is ok, but it would help to have it also in max (menu or quad etc.).
What should i add to the begging of the max?

Im using max 2009 64 bit by the way.

Old vray

barigazy · 2012-05-23

Which version of vray you use.
Try this:
Open maxscript listener and activate macro recorder.
Then open material editor and change diffuse map blur value (material must be VrayMtl).
Look in the listene what is throw. Then send me to see whats goin on.
I use max2012x64 and vray2

i use

roamn · 2012-05-24

Hi, thanks for the updated version.

Well im using vray 1.5 SP4, max 2009 64 Bit, but the problem isnt here probably... Because when i run your script manuly (from maxscript run) it runs and does stuff good.

But when i try to get it to the menus using the "category:" etc. (what i have written before) it allows and show me only one option for the blur...

How can i properly get it to menus or quads please?

barigazy · 2012-05-24

post or attach your macroscript here and i'll try to fix it

ok

roamn · 2012-05-25

I created a new *.ms file, i use it to add your script to category in max Customize, the script is:

macroScript SetBlur category:"MY" tooltip:"SetBlur" buttonText:"SetBlur"
(
fileIn "vraymtl_map_blur_value.ms"
)

On the left you can the dialogue whioch appears when i run the script from maxscript run and right you can see the dialogue which appears when i load your script with my new short filein script (As listed sbove):

http://s16.postimage.org/v86iipodh/Untitled_1.jpg

Wheres the problem? all i want to do is to add your fully functional script to menu (or quad) what should i do please?

roamn · 2012-05-24

it didnt record anything... im having problems with macrorecorder in max 2009, it doesnt, most of the time, record anything.

barigazy · 2012-05-24

not your record in listener, but macroscript file (*.mcr)

roamn · 2012-05-23

Great thanks, it runs :-)! and the ui is also fine :-)!

roamn · 2012-05-23

Ok, but as i said or as it is clear from the title, i dont know maxscript, i wasnt even able to get these scripts working together in one script (i have to use them separatelly :-) ), if you could put them into 1 maxscript, and make them work correctly even on subojebct materials it would be great :-): Thanks, here they are:

(
for obj in selection do
(
try(
obj.material.bumpMap.coordinates.Blur = 1
) catch()
)
)

(
for obj in selection do
(
try(
obj.material.diffuseMap.coordinates.Blur = .1
) catch()
)
)

Hope this help

barigazy · 2012-05-23

I wrote a small script. Just run it, select some objects,
set the values and press the button.

Attachments

bitmap blur

andywigley · 2012-05-24

Hi Barigazy
I saw your script and think its great but is it possible to alter it
to include all the slots eg reflection opacity etc that would be so useful
many thanks
andy

Supports All

barigazy · 2012-05-24

Now script supports all vray maps slots

Attachments

barigazy · 2012-05-22

Post the code that you write for bump and blur and i finish the job for multimaterial. OK?