Notifications
Clear all

[Closed] Mouse tools stops working?

 PEN

I have had this on going problem for years and not really tried to look into it until now. I have a tool that allows me to set the fall off of a soft selection by scrubbing up and down in the viewport. It just stops working at some point, dont’ know what causes it. I have always thought it was something in the macro as I wrote it years ago. Well it just happened again and it isn’t the macro as I can write a simple tool like

tool foo
(
	on mousePoint click no do
	(
		print no
	)
)
startTool foo

and all it returns is #abort. Doesn’t matter what mouse button I click and I know that this isn’t based on mouse drivers as it has happened on many machines with different mice. Has any one seen this before? I need to restart to get it working again but once in a while deselecting and selection the mesh again will do it.

5 Replies

Shouldn’t the code be:

tool foo
(
	on mousePoint clickno do
	(
		print clickno
	)
)
startTool foo

I’m not having a problem with that code.

 PEN

Sorry yes it should, just typed it to fast. It still fails as it just happened again. Once again I have to restart. I’m doing piles of facial targets as well and adjusting the fallOff is something that I’m doing constrantly. What a pain, I hate using the UI spinner.

 PEN

Here is the actualy code


		tool fallOffTool
		(
			local pMod=(modPanel.getCurrentObject())
			fn calldrawText=drawText()
			local stPos=[0,0]
			local curPos=[0,0]
			local oldyVal=0
			on mousePoint clickNo do
			(
				case clickNo of
				(
					1:
					(
						stPos=viewPoint 
-- 						registerRedrawViewsCallback calldrawText
					)
					2: 
					(
-- 						unRegisterRedrawViewsCallback calldrawText
						#stop
					)
				)
			)
			on mouseMove clickNo do
			(
				case clickNo of
				(
					2:
					(
						curPos=viewPoint 
						yval=((stPos.y-curPos.y)*.05)
						pMod.fallOff+=(yval-oldyVal)
						oldyVal=yval
					)
					3: #stop
				)
			)
-- 			on mouseAbort clickNo do 
-- 			(
--				  #stop
-- 				unRegisterRedrawViewsCallback calldrawText
-- 			)
		)
		startTool fallOffTool

I just tried commenting out the mouseAbort handler and it killed it on second try this time.

Just to be sure how this is supposed to work:

I ‘startTool’, then click and drag in the viewport, and it changes the falloff of my currently selected poly object, yah? When I let go of the button, the tool finishes. Tried with both Editable Poly and Edit Poly, it seems to work perfectly.

Is it possible there is a name/variable/scope conflict somewhere in your code or scene that is interfering with this?

 PEN

Might be but not sure where. Also it doesn’t happen right away, you need to just keep using it. For instance I have now been working for quite a while without issue. But some times it just does. Not sure where the scope problems would come in as it is all local.