Switching between views using key shortcuts?

Next
 From:  Jacob
4818.1 
What is the proper inline script for changing the view between 3D/Top/Front/Right for v2 and v3 beta?

I found this little bit
code:
script:moi.ui.mainWindow.viewpanel.mode = 'front';
but it does not appear to be doing anything, at least in v3Beta.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
4818.2 In reply to 4818.1 
Hi Jacob, actually that script looks correct, and when I try that exact script that you posted over here in the v3 beta it seems to be working ok.

Maybe double check to make sure you've got that entire line pasted in? Also what do you have for the "key" part to activate it?

Also see this previous post for the various scripts for switching views:
http://moi3d.com/forum/index.php?webtag=MOI&msg=3808.2

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Jacob
4818.3 
Actually... it turns out that these *do* work. They just didn't work in the session that I added them in, for reasons unknown, since I added other shortcuts along these and they worked fine right away.

I'm using Alt+Shift+1..5 for those views.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Jacob
4818.4 
Since this may be useful to some, here is a single key shortcut for switching over views:

javascript code:
var views = ["split", "3d", "top", "front", "right"];
var vp = moi.ui.mainWindow.viewpanel;
var current = vp.mode;
for (var i = 0, len = views.length; i < len; i++) {
	if (current == views[i])
	{
		vp.mode = views[(i+1)%len];
	}
}


Here's the one liner version for copy-pasting:
javascript code:
script:var views = ["split", "3d", "top", "front", "right"]; var vp = moi.ui.mainWindow.viewpanel; var current = vp.mode; for (var i = 0, len = views.length; i < len; i++) {if (current == views[i]){ vp.mode = views[(i+1)%len]; }}
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All