View Rotation Style
 1-12  13-27

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

Previous
Next
 From:  BurrMan
4736.21 In reply to 4736.20 
And Just a note on the script Majik posted... The labeling for it does appear in the sidepane, although down below my current bottom bar.. A scroll bar appears to the right and I have to scroll to read the readout..

Looking forward to the adjustment for that sidepane injection with "inside browser" (Dont knock yourself out) I'll see if I can adapt it to Majiks script too.
  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.22 In reply to 4736.21 
Hi Burr, so to switch Mike's script above to the other style labeling, go to the part
of his script where he has: moi.view.rotationStyle = newvrs;

That's the end of the part that actually toggles the setting, everything coming
after that is about pushing in some HTML for the display.

So delete everything after that and instead put in the second half of what I had
above for the other style "bottom corner" label, which would be this (just the
variable used at the very end is different from my previous script):

code:
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 = newvrs;


Let me know if that doesn't work right for you.

- 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.23 In reply to 4736.22 
Hi Michael,
I was able to get both the previous toggle scripts to work in Inside browser pane mode now.. Thanks! For the last post you made with the View Angle toggle, the last item was a "newang" in That script (As opposed to newvars).. It adopted to the viewpoint toggle script also!!! (Which used the "newvars" definition.
  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.24 
Can you resume that these new scripts can make?
I am a bit losted :)
  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.25 
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="position:absolute; left:5px; bottom:5px;"></div>' ); } sidepane.getElementById('viewrotationstyle').innerText = newvrs;


Okay, hope this worked.
  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.26 In reply to 4736.24 
Hi Frenchy,

"""""""""Can you resume that these new scripts can make?""""""""

One of the script "Toggles" the view mesh angle from a fine to coarse setting of 5, 10 and 25.. The other toggles the camera view/rotation type of free, around world Z axis and first person. The scripts are experimenting with "toggling" more than one value.. So repeated keypresses will cycle through a given value set. Lastly, they are putting the current value at the bottom of the sidepane as a readout, so you know the current setting.

Let me know if that doesnt make sense or is unclear somehow.
  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:  Frenchy Pilou (PILOU)
4736.27 In reply to 4736.26 
Thx for the explanation!
I must test them :)
---
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
 

Reply to All Reply to All

 

 
 
Show messages:  1-12  13-27