MoI discussion forum
MoI discussion forum

Full Version: Rotate objects 90º relative to view

Show messages: All  1-7  8-16

From: Marc (TELLIER)
10 Jan   [#8] In reply to [#7]
Hi Michael,

Works like a charm, you are a magician !

Thanks for taking the time to look at this.

Here's a project I'm working on, a Morris chair design with assorted table and leg rests in cherry wood .
The command will help in the laying out of individual parts.

Marc




Image Attachments:
Screenshot 2026-01-10 at 6.02.14 PM.png 


From: Matadem
10 Jan   [#9]
The spacebar script to switch view is fast also...especially on a laptop.
cannot live without it.
From: Marc (TELLIER)
11 Jan   [#10] In reply to [#9]
Indeed !

Is it the script that toggles the active viewport to fullscreen, and goes back to split view if pressed again ?

Marc
From: Matadem
11 Jan   [#11]
Yes..thats the one. ctrl+spacebar will flip left to right, front to back etc.
From: Marc (TELLIER)
12 Jan   [#12]
Hi Matadem,

I didn't know about flipping the view 180º, quite interesting.

Thanks !

Marc
From: Matadem
12 Jan   [#13] In reply to [#12]
Ctrl+space script:moi.ui.mainWindow.viewpanel.reverseView( moi.ui.getActiveViewport().name );

This is the way I have it setup.
From: Marc (TELLIER)
12 Jan   [#14] In reply to [#13]
Thanks !

Marc
From: Mik (MIKULAS)
15 Jan   [#15] In reply to [#7]
Hello Michael,

I've noticed that if I set arrow key Up with command Rotate90RelativeToView Up, so the model turn Down and vice versa, if I set arrow key Down with command Rotate90RelativeToView Down, so the model turn Up,

therefore I changed the order of code from:

case 'left': view_dir = frame.yaxis; view_dir.scale( -1.0 ); break;
case 'right': view_dir = frame.yaxis; break;
case 'up': view_dir = frame.xaxis; break;
case 'down': view_dir = frame.xaxis; view_dir.scale( -1.0 ); break;

to

case 'left': view_dir = frame.yaxis; view_dir.scale( -1.0 ); break;
case 'right': view_dir = frame.yaxis; break;
case 'up': view_dir = frame.xaxis; view_dir.scale( -1.0 ); break;
case 'down': view_dir = frame.xaxis; break;

now the model rotation correspond to arrow key dirrection.

Is that right?

Thanks

Mik
From: Michael Gibson
15 Jan   [#16] In reply to [#15]
Hi Mik, yes you're correct, thanks for the bug fix. I have updated the script above.

- Michael

Show messages: All  1-7  8-16