So I noticed this problem of constantly having to switch between view modes when modeling in 3dsMax. When I switch to front view (orthographic) and rotate (alt+mmb) I end up in user/orthographic view. I would much prefer perspective view.
Currently wondering if this is possible in MAXScript since I imagine you would have to catch some kind of camera rotated event in real time and execute the "enter perspective view" command to switch to perspective. I can't seem to find a way to execute a command when the camera is rotated. Also from what I've seen MAXScript doesn't appear to be intended for this kind of task but rather for creating toolkits with buttons that execute certain commands.
Please share your thoughts about whether this is possible or not and how you would go about it.
thanks
Replies
I would very much appreciate a fix for this.
So is this something that could be done?
Indeed, i imagine so, but I'm not trying to completely get rid of it. I'd implement it in a way that would let me toggle the auto perspective change so I don't have to worry about cases where I need normal orthographic camera.
thanks for the effort, appreciate it.
I ran the script and it seems to work ok in terms of switching the perspective but when it switches, it for some reason zooms in extremely far to the point that my camera ends up inside the mesh so I see right through. It also doesn't quite focus the selection very nicely - it's actually a fair bit off.
I prototyped the behavior I was looking for in a external application that remaps/ macros my keystrokes/ clicks in a way that does exactly what I want and it works wonderfully except for the fact that it sometimes has a tiny delay when rotating the camera that can be a little bit bothering. I should be able to fix that but I'd much rather not use a external solution and keep it in max.
Before I resorted to a external solution I was looking for a event in maxscript that would allow me to fire a script when the viewport is rotated. I wasn't able to find anything.
You however, apparently know how to do this and I would appreciate if you could point me to a source that offers some insight on this since I don't exactly get it yet just by looking at the code you provided.
thanks again
on a sidenote:
would it be possible to implement to implement the zoom from zbrush in max? (pressing alt -> holding LMB -> releasing alt => zoom by dragging mouse)
also wondering if blender style rotation translation and scaling in possible (eg. pressing g -> move mouse => move object/ press g -> press z => move object on z axis
a yes no type answer would suffice on these because I don't mean to take your time with my concerns
Yea what I think is happening there is the rotation is continuing on from the ortho to perspective view without resetting in between, as a result it's losing the point of focus and getting confused.
There's two way to deal with this: Either temporarily pause and resume user input during the frame it switches over from ortho to perspective view modes, or manually capture the focus point and re-set it. The 2nd method involves undocumented maxscript behavior so it would be quite a challenge to do. The first method though should be doable, so I'd look into manipulating user input if you want to try that.
In the above script what I'm using is a 'callback', which is a background function that runs a script whenever a specific event is triggered from a list of pre-existing events (its similar to a ScriptJob in MEL for Maya). You can read up on them here.
There's another function like it called a 'Change Handler' which is specific to changes made to objects in the scene that can be useful too.
The Blender style manipulation is definitely possible.
The ZBrush style navigation however I'm not so sure on, there would be quite a few obstacles to scripting that.
I will look into this. Also thanks for providing potential approaches on how to go about it.