multiple modifiers on multiple objects

Hi Guys,

I'm Looking to figure out a way to add a set of modifiers (in this case a UVW Box Map with 1mx1mx1m followed by a material modifier to several selected objects).

It would be super cool to have it applied to a quad menu, but I suppose that should work if you make it a macroscript and then costumize the quads to include the written macroscript.

Tried something like this:

macroScript Macro1
category:"DragAndDrop"
toolTip:""
(
modPanel.addModToSelection (Uvwmap ()) ui:on
$.modifiers[#UVW_Map].maptype = 4
$.modifiers[#UVW_Map].length = 100
$.modifiers[#UVW_Map].width = 100
$.modifiers[#UVW_Map].height = 100
modPanel.addModToSelection (Materialmodifier ()) ui:on
)

But it only works for individual objects, unfortunately

Thanks for your help, this is my 1st attempt at scripting.

Comments

Comment viewing options

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

or you just can add this line

or you just can add this line ..

macroScript AddUVW
category:"YourCatagoryName"
tooltip:"Add UVW to Selection"
buttontext:"Add UVW to Selection"
 
(
local uvwMod = Uvwmap maptype:4 length:100 width:100 height:100
suspendEditing()
modPanel.addModToSelection (uvwMod) ui:on
resumeEditing()
)
barigazy's picture

...

This is what you want. If you press SHIFT then all modifier are copy or with single click you have all modifiers as instance

macroScript UvwPlusMtlMod category:"bgaTools" toolTip:"uvw100"
(
	if selection.count > 0 do
	(
		local uvwMod = Uvwmap maptype:4 length:100 width:100 height:100
		local mtlMod = Materialmodifier ()
		for o in selection where canconvertto o editable_poly do
		(
			addModifier o (if keyboard.shiftPressed then copy uvwMod else uvwMod)
			addModifier o (if keyboard.shiftPressed then copy mtlMod else mtlMod)
		)
	)
)

barigazy

barigazy's picture

...

Don't try to copy from Listener or drag-drop chank of code to your toolbar. It's always better to find right solution in MXS Help documentation.

barigazy

Comment viewing options

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