Switch lenght, height and width in uvmap

Hello everyone,
i have a question, is it possible to switch the lenght parameters with the width and height parameters in the uvmap.
F.e. the lenght is 100 and the width is 50, so the script needs to switch the parameters to length:50 and width:100

AttachmentSize
swich.jpg111.72 KB

Comments

Comment viewing options

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

WOW, thank you very much. You

WOW, thank you very much.
You are the best

miauu's picture

.

Switch length and height:

(
	global rol_miauu
	try(destroyDialog rol_miauu)catch()
	rollout rol_miauu "Switch UVWMap L/W/H"
	(
		button btn_switchLW "Switch Length and Width" width:150 align:#center
		button btn_switchLH "Switch Length and Height" width:150 align:#center
		button btn_switchWH "Switch Width and Height" width:150 align:#center
 
		on btn_switchLW pressed do
		(
			selObjsArr = selection as array
			if selObjsArr.count != 0 do
			(
				for o in selObjsArr where o.modifiers.count != 0 do
				(
					if classOf o.modifiers[1] == UVWMap do
					(
						swap o.modifiers[1].length o.modifiers[1].width
					)
				)
			)
		)
 
		on btn_switchLH pressed do
		(
			selObjsArr = selection as array
			if selObjsArr.count != 0 do
			(
				for o in selObjsArr where o.modifiers.count != 0 do
				(
					if classOf o.modifiers[1] == UVWMap do
					(
						swap o.modifiers[1].length o.modifiers[1].height
					)
				)
			)
		)
 
		on btn_switchWH pressed do
		(
			selObjsArr = selection as array
			if selObjsArr.count != 0 do
			(
				for o in selObjsArr where o.modifiers.count != 0 do
				(
					if classOf o.modifiers[1] == UVWMap do
					(
						swap o.modifiers[1].width o.modifiers[1].height
					)
				)
			)
		)
	)
	createdialog rol_miauu
 
)

Comment viewing options

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