Add Slice Modifier to the selected objects

what is the best way to add one Slice Modifier to the all selected objects with the Slice Plane set to Z=-100 and then Collapse them to EditableMesh

Comments

Comment viewing options

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

Thank you!

Yeah, this works like a charm!
Could it add both Slice and UVW Mapping Clear Modifiers?

Thank you)

miauu's picture

.

Try this:

(
	if selection.count != 0 do
	(
		sliceMod = sliceModifier()
		sliceMod.slice_plane.transform = matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,-100]
 
		uvwMappingClearmod = UVW_Mapping_Clear()
 
		for o in selection where validModifier o sliceMod do
		(
			addModifier o sliceMod
			addModifier o uvwMappingClearmod
			convertToMesh o
		)
	)
)
miauu's picture

.

I am not sure that this is what you need:

(
	if selection.count != 0 do
	(
		sliceMod = sliceModifier()
		sliceMod.slice_plane.transform = matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,-100]
 
		for o in selection where validModifier o sliceMod do
		(
			addModifier o sliceMod
			convertToMesh o
		)
	)
)

Comment viewing options

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