Notifications
Clear all

[Closed] Weird problem with change handler

This problem was reported by one of users on max3d.pl forum.
Following code limits box movement.

when transform $Box01 changes do
 (
 if $Box01.pos.x>10 then $Box01.pos.x=10
 )

If you replace x with y or z it doesn’t work anymore for different axis. Any ideas why?
It’s propably something simple but I just don’t see it.

regards

2 Replies
1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

This might not be exactly an error, but it is a limitation. I assume it is caused by the way interactive manipulations are applied to the controller hierarchy and the notifications sent to the system and MAXScript.

A workaround I found is to assign a Bezier Position controller to the Position track – when there are no sub-controllers, all 3 axes are being processed correctly.

Another workaround is to use the handerAt:#redrawViews option. The object does not stop when the Y reaches the limit, but as soon as the view is redrawn, the object jumps back to the limit.

And of course the Limit controller in Max 8 would be the clean solution to the problem.

Thanks Bobo.