Move random UV

Hi,

I would like to move randomly selected faces in unwrap modifier.

I can move ALL selected faces randomly :
$.modifiers[#unwrap_uvw].unwrap2.MoveSelected [ (random -10 10 )as integer, (random -10 10 )as integer ,0]

But I can't manage to make a loop, so each face would have a different value.

Can somebody help ?

Thanks

Comments

Comment viewing options

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

As usual it works like a

As usual it works like a charm... :-)

miauu's picture

.

Modify this to fit your needs:

(
	uv = modpanel.getcurrentobject()
	if classof (uv) == Unwrap_UVW do
	(
		--	"get selected faces"
		selFacesBA  = uv.getSelectedFaces() 
		for f in selFacesBA do
		(
			uv.selectFaces #{f}
			uv.MoveSelected [ (random -10 10 )as integer, (random -10 10 )as integer ,0]			
		)
		uv.selectFaces selFacesBA
	)
 
)

Comment viewing options

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