View Rotation Style
 1-20  21-27

Next
 From:  Mike K4ICY (MAJIKMIKE)
4736.1 
Hi Michael,

MoI offers three styles of view manipulation that all have their own advantages:
1) Rotate Around World Z-Axis, allows you to "keep your balance" and the Z-axis of the view is fixed, as it would if you were manipulating the model on your own work bench.
2) Free Rotation, This one allows you look at your objects from the strangest angles, which helps when getting into those details.
3) First Person, allows you to "look around". This is great if you have a large spread of objects, or you're building architecture.

Many apps work in Free Rotation mode. SketchUp works in Locked-Z by default and is my preferred mode since I don't like feeling disoriented when I'm working. Like an awful virtual vertigo.

Is there a script, or can one be made to allow me to switch these modes by a keyboard shortcut?
A view-control change like this is most likely not used often enough by anyone to warrant a control key + mouse option.

I'm not too familiar with MoI's scripts, but it has something to do with "moi.view.rotationStyle" and "Free", "World" and "FirstPerson",
Can this be made into a shortcut script?



Normally, you have to go into two dialogs to select the style from the list.
I'd take advantage of an occasional view style shift if there was some way to do this on the fly. Otherwise, it's too nestled in dialogs to freely use this while working.
  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
4736.2 In reply to 4736.1 
Hi Mike,

> I'm not too familiar with MoI's scripts, but it has something to do with
> "moi.view.rotationStyle" and "Free", "World" and "FirstPerson",
> Can this be made into a shortcut script?

Yep, it would go like this:


script: /* Set world axis rotation style */ moi.view.rotationStyle = 'World';

script: /* Set free rotation style */ moi.view.rotationStyle = 'Free';

script: /* Set first person rotation style */ moi.view.rotationStyle = 'FirstPerson';


Put each of those on to a shortcut key and you should then be able to switch the rotation style with that shortcut.

Please let me know if those don't seem to work.

- 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:  Mike K4ICY (MAJIKMIKE)
4736.3 In reply to 4736.2 
Thank you! Thank you! Michael!

This is an option I wanted since the beginning. There was some 3D app like Blender I tried that allowed you to rotate the view one way and with the Alt or some key you could change the way it worked. And SketchUp has the Eyes tool that let you look around...

But this is great to be able to add a little manipulation freedom on-the-fly in MoI. (And good that it doesn't have to clutter up the UI).

Nice. :-)
  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
4736.4 In reply to 4736.1 
Hi Mike - actually all the stuff in the Options UI actually talks to MoI through the script interface to apply the properties, so any controls that you see in the Options UI can also be set through a keyboard shortcut like that as well.

- 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:  Mike K4ICY (MAJIKMIKE)
4736.5 
Cool, I might be able to have a little more fun with this...


script: /* Set mesh angle to fine */ moi.view.meshAngle = '5';

script: /* Set mesh angle to course */ moi.view.meshAngle = '25';

Ha! - Instant Mesh Angle Resolution Changer.

Now at the touch of a button, I can now go back and forth between high and low mesh resolution! :-)

This is a process I go through EVERY model because I need to occasional go from a more speedy modeling feel to a close-up detailed edge view when I turn the edge lines off.
  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:  Frenchy Pilou (PILOU)
4736.6 In reply to 4736.5 
Tricky ;)
---
Pilou
Is beautiful that please without concept!
My Gallery
  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:  BurrMan
4736.7 In reply to 4736.6 
ANd a single line that toggles it!!!

script: /* Set mesh angle to fine */moi.view.meshAngle = (moi.view.meshAngle == '5' ? '25' : '5');
  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:  coi (MARCO)
4736.8 In reply to 4736.7 
i was meaning to ask, if it's possible to toggle such things..yes it is. Is there a way to have some kind of toggle script for the circle options?




cheers,
marco
Attachments:

  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
4736.9 In reply to 4736.8 
Hi marco - the different commands in a "command set" like that are a bit different kind of thing than options in the Options dialog.

Right now there isn't really a way to toggle between those, but I do plan on adding a mechanism in so that scripts could determine the current running command, and that would then allow for a toggle script to be created for that.

Some recent discussion on that kind of thing here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=1521.89

- 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:  Mike K4ICY (MAJIKMIKE)
4736.10 In reply to 4736.7 
> ANd a single line that toggles it!!!

> script: /* Set mesh angle to fine */moi.view.meshAngle = (moi.view.meshAngle == '5' ? '25' : '5');


Awesome Burr!

So how does the "== '5' ? '25' : '5'" work? Can I go three+ state?

Not that I'd propose to add clutter to a Spartan UI layout, but could there be any way to add a visual cue or icon to that action.
It's hard to know what state the model is in until you start playing with the model...

Just an idea.
  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:  BurrMan
4736.11 In reply to 4736.10 
I was going to ask Michael if it was laid out correctly.. I just used another script and copied some bits from it to get that and it does work, but I'm not sure if it is overdone somehow...I need to learn JavaScript more to be more proficient at it...
  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
4736.12 In reply to 4736.10 
Hi Mike & Burr - so that statement with the ? : in it is shorthand notation for a conditional statement.

If you wanted to do a 3 state switch it may be easier to have it as if statements. That would be like this:

code:
var newang, ang = moi.view.meshAngle;

if ( ang == 5 )
    newang = 10;
else if ( ang == 10 )
    newang = 25;
else
    newang = 5;

moi.view.meshAngle = newang;

That then needs to go down to a single line to paste into the command field in the shortcut key editor.


Then for an indicator it is possible for a script to inject some UI into the side pane. Here's a version that will do the toggle and put the new value into into the side pane at the bottom of it. This one will only work in v3 since it looks for UI containers that are part of the V3 UI.

script: /* Toggle mesh angle */ var newang, ang = moi.view.meshAngle; if ( ang == 5 ) newang = 10; else if ( ang == 10 ) newang = 25; else newang = 5; moi.view.meshAngle = newang; var sidepane = moi.ui.getUIPanel( 'moi://ui/SidePane.htm' ); var endsection = sidepane.document.getElementById('MiddleBody').nextSibling; if ( endsection.lastChild.id != 'angval' ) endsection.insertAdjacentHTML( 'beforeEnd', '' ); endsection.lastChild.innerText = newang;
  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:  shayno
4736.13 
Playing with your scripts
This works for 2 views

script: /* toggle world axis rotation style */ moi.view.rotationStyle = (moi.view.rotationStyle == 'World' ? 'free' : 'world');

another that may be useful

script: /* Toggle Grid snapsize */moi.grid.snapsize = (moi.grid.snapsize == '0.25' ? '0.1' : '0.25');

cheers
shayne
  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:  BurrMan
4736.14 In reply to 4736.12 
Hi Michael,
I'm not getting the sidepane injection? Maybe I'm missing it? Could you double check the script you posted for this?
  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
4736.15 In reply to 4736.14 
Hi Burr,

> I'm not getting the sidepane injection? Maybe I'm missing it?
> Could you double check the script you posted for this?

Looks like it won't work if you have scene browser mode as inside the side pane instead of "adjacent" mode.

Also it looks like I messed it up so that it replaces a button instead of adding it to the side, let me make a new version here that should work better.

- 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:  Michael Gibson
4736.16 In reply to 4736.14 
Hi Burr, try this one:

script: /* Toggle mesh angle */ var newang, ang = moi.view.meshAngle; if ( ang == 5 ) newang = 10; else if ( ang == 10 ) newang = 25; else newang = 5; moi.view.meshAngle = newang; var sidepane = moi.ui.getUIPanel('moi://ui/SidePane.htm').document; if ( !sidepane.getElementById('meshangval') ) { sidepane.body.insertAdjacentHTML( 'beforeEnd', '<div id="meshangval" style="position:absolute; right:5px; bottom:5px;"></div>' ); } sidepane.getElementById('meshangval').innerText = newang;

That one should display the number in the bottom right corner of the side pane.

- 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:  Mike K4ICY (MAJIKMIKE)
4736.17 In reply to 4736.16 
Wow! Thanks Michael! :-)

A nice, quick way to juggle modeling speed vs. viewing quality.


So! On the same token - here is a script for changing view rotation style with one key:::

code:
script: /* Toggle view rotation style */ var newvrs, vrs = moi.view.rotationStyle; if ( vrs == 'World' ) newvrs = 'Free'; else if ( vrs == 'Free' ) newvrs = 'FirstPerson'; else newvrs = 'World'; moi.view.rotationStyle = newvrs; var sidepane = moi.ui.getUIPanel('moi://ui/SidePane.htm').document; if ( !sidepane.getElementById('viewrotationstyle') ) { sidepane.body.insertAdjacentHTML( 'beforeEnd', '<div id="viewrotationstyle" style=""></div>' ); } sidepane.getElementById('viewrotationstyle').innerText = newvrs;


It shows the view rotation style name in the bottom left.
Woohoo! And it can be done on the fly while adjusting the view.

EDITED: 23 Nov 2011 by MICHAEL GIBSON

  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:  BurrMan
4736.18 In reply to 4736.17 
Majik,
Your last toggle script throws an error on my end.. probably the forum juggling some text around and I cant read it good enough to catch whats wrong with it..
  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
4736.19 In reply to 4736.18 
Hi Burr, yeah the forum can see HTML tags like <div> and think that they're supposed to be part of the message markup.

I've edited Mike's message above to put it all in a <code></code> block so that the contents inside there won't be processed as message markup by the forum.

It will be nice in the future when these things won't have to go all one one line.

- 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:  BurrMan
4736.20 In reply to 4736.18 
Ah ok, I found it... This is missing:

code:
<div id="viewrotationstyle" style=""></div>


In the null carrier just after 'beforeEnd'

[EDIT] Thanks Michael ! lol. Had to wrap code tags to show what i found was missing :o[EDIT]
  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

 

 
Show messages:  1-20  21-27