Advertisement Jump to content
Sign in to follow this  

Question on this maxscript

This topic is 1660 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

try(destroydialog orderPoints) catch()
rollout orderPoints "Order Points" width:200
	fn sortByPosComponent v1 v2 order:#(1,2,3) dir:1 = 
		act = if v1.pos[order[1]] < v2.pos[order[1]] then -1 else if v1.pos[order[1]] > v2.pos[order[1]] then 1 else 
			if order[2] != undefined then sortByPosComponent v1 v2 order:(deleteitem order 1) else 0
	label lb "Order:" align:#right offset:[-20,4] across:3
	dropdownlist order_dd items:#("xyz", "xzy", "yzx", "yxz", "zxy", "zyx") width:44 align:#left offset:[-16,0] tooltip:"Sorting Order"
	checkbox reverse_ch "Reverse" width:90 align:#left offset:[-14,3] tooltip:"Use Reverse Order"
	edittext base_ed text:"Pallete" width:194 align:#left offset:[-12,2] tooltip:"Point Base Name"
	button rename_bt "Rename Points" width:190 align:#left offset:[-8,2] tooltip:"Rename Selected Points\n + Control\t- All Points"
	fn makeOrder = for k=1 to 3 collect (bit.charasint order_dd.selected[k] - 119)

	on rename_bt pressed do undo "Rename Points" on 
		nodes = if keyboard.controlpressed then selection else helpers
		pp = for p in nodes where iskindof p Point collect p
		if pp.count > 0 do
			dir = if reverse_ch.state then -1 else 1
			qsort pp sortByPosComponent order:(makeOrder()) dir:dir
			id = 0
			d = orange/pp.count
			for p in pp do 
				c = orange - id*d = base_ed.text + (formattedprint (id += 1) format:"05d")
				p.wirecolor = c
createdialog orderPoints

Pallet01 Pallet02 Pallet03 Pallet077...

The output is incorrect. There are 3 three objects in the first row that are named correctly.

The next several items are named incorrectly.

Any help?

Thanks Jack

Edited by lucky6969b

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!