--========================================================================--
--FB_UVconversion.ms   --version 1.0--
------------------------------------------
--Description:
	--enables control+subobj conversion for the UV modifier.  It could have some compatibility issues depending on how many scripts youre running, so be careful though
--------------------------------------------------------------------------------------------------
--How To Use:
	--select a subobject on the uv modifier
	-- then hold Control and change your subobject mode
	-- the script will then convert from one mode to the other
--========================================================================--
--Installation:
	--drop this .ms file into ProgramFiles/3dsMaxXXXX/scripts/Startup/
	--then start 3ds max
	--FB_UVconversion will automatically start whenever you start 3ds max
	-- to remove, delete FB_UVconversion.ms from the ...scripts/Startup/ folder and restart max
--------------------------------------------------------------------------------------------------
--Notes:
	--this script works with editable mesh and editable poly, editable mesh will show the hidden edges of your object, if you wish to keep those hidden, convert to editable poly
	--some scripts you're running may already add this feature, such as Chugnutt's UV tools.  I'm honestly not sure how the 2 would interract, but obviously if the feature is already enabled by another tool you should have no need for this :)
--========================================================================--
--email me with any questions or concerns at Chris@FunkyBunnies3d.com
--========================================================================--

FB_UVconversion = "
if keyboard.controlPressed do
(
try
(
	local currModifier = modPanel.getCurrentObject()
	local FB_subObjModes = callbacks.notificationParam()
	
	if (classof currModifier) == Unwrap_UVW then
	(
		--print FB_subObjModes
		case FB_subObjModes[2] of
		(
			1:	
			(	
				if FB_subObjModes[1] == 2 then
					currModifier.vertToEdgeSelect()
				else if FB_subObjModes[1] == 3 then
					currModifier.vertToFaceSelect()
			)
			2:	
			(	
				if FB_subObjModes[1] == 1 then
					currModifier.EdgeToVertSelect()
				else if FB_subObjModes[1] == 3 then
					currModifier.EdgeToFaceSelect()
			)
			3:
			(	
				if FB_subObjModes[1] == 2 then
					currModifier.FaceToEdgeSelect()
				else if FB_subObjModes[1] == 1 then
					currModifier.FaceToVertSelect()
			)
		)
	)
)catch()
)"

 
callbacks.removeScripts id:#FB_UVconversion
callbacks.addScript #ModPanelSubObjectLevelChanged FB_UVconversion id:#FB_UVconversion

