Script request
 1-20  21-35

Next
 From:  Stargazer
9322.1 
Hello!

First time posting here.

It would be nice to have a script that aligns the view to the closest standard isometric view.

I'm working mostly in maximized 3D view. For example when viewing a model from bottom, calling the script switches to bottom view and by calling it again it will toggle back to 3D view.

It's very helpful for easily switching between the views when needed.



Thanks!!
  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
9322.2 In reply to 9322.1 
Hi Stargazer, welcome to the forum!

I've attached a script that I think does what you described. It's a bit long to paste directly into a shortcut key so I made it in its own separate file.

To run it as "instant script" you will need to create a "scripts" folder alongside the commands folder and put it in there.

For v4 it can go into appdata, use Options > General >"Edit .ini file" button to see where the MoI appdata folder is. There will be "commands" and "startup" folders in there, make a new folder named scripts as a sibling to those and then put the .js file in there.

Then in a keyboard shortcut put in SetNearestOrthoView.js as the command name. Make sure the ending .js part is there, that's the signal that will make MoI look in the scripts folder and run it as "instant script" rather than as a command which means you can run it while currently running in some other command.

- 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:  Frenchy Pilou (PILOU)
9322.3 
I believe that you can rename also the name of the 2 files HTML & JS with a short name like for example Tom
then Press Tab and write Tom or tom or toM but without space ;)
---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery My MagicaVoxel 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:  Michael Gibson
9322.4 In reply to 9322.3 
Hi Pilou, there is no HTML file in this case. It is possible to rename the script to something else but for this case if you renamed it tom.js you would type in tom.js. Note the ending .js there - that will make MoI run it as an "instant script" rather than as a command.

Commands should not have the ending .js while code intended to run as immediate script code should have a .js at the end.

Utility functions that involve selection or view manipulation can be good to run as immediate script because they can then do their thing even while inside some other currently running command.

- 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:  Stargazer
9322.5 
Amazing!! thank you guys!
  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)
9322.6 In reply to 9322.4 
Thx for the info...I had tryed with the new InsertCircle ! (and of course keept the .js & .html ;)
---
Pilou
Is beautiful that please without concept!
My Moi French Site My Gallery My MagicaVoxel 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:  vector illustrator (QUARITEXA)
9322.7 In reply to 9322.2 
Great script. Is it possible to improve it for orienting ortho with current 3d.

Now it acts like this:


But more relevant like 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
9322.8 In reply to 9322.7 
Hi Quaritexa, can you please post the .3dm file that you show there? If I can reproduce what you show and test with it that might help me understand what you want to do 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:  vector illustrator (QUARITEXA)
9322.9 In reply to 9322.8 
It's not a file. The problem is the correct orientation of the ortho view. Look...

When I switch from this projection:


The view switches to this:


And from this:


Switches also to this:


Instead of 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:  nameless
9322.10 In reply to 9322.9 
This is a very interesting function. It reminds me of a blender viewport behaviour I quite enjoy. What quaritexa suggests brings it even closer.

Is it possible to assign a mouseclick in shortcuts field? (Like Alt+ Middle Mouse Button or something)
  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:  vector illustrator (QUARITEXA)
9322.11 In reply to 9322.10 
I don't know about v4, but on v3 you can assign it with external utility: autohotkey.com (windows), hammerspoon.org (mac).

With ahk v2 it is:
code:
#if WinActive("ahk_class MoiMainWindow ahk_exe MoI.exe") 
and not WinActive("ahk_class #32770")
!MButton:: Send "5" ;SetNearestOrthoView.js

And bind 'SetNearestOrthoView.js' to '5' in moi's shortcut keys.

EDITED: 25 Feb 2020 by QUARITEXA

  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
9322.12 In reply to 9322.9 
Hi Quaritexa,

re:
> It's not a file. The problem is the correct orientation of the ortho view. Look...

Having the file of what you show in the screenshot just would have helped me repeat your steps.

But it's clearer to me now with your last one.

I guess it might be possible to do that by applying a tilt to the Top view but that will have some side effects because it will stay tilted until you manually reset it to have a 0 tilt angle. So I'm not sure that would work very well.

I think the process to modify the script to do that would be something like: after the ortho view is set, get view.cameraFrame from it and form 4 potential directions, one for cameraFrame.xaxis, cameraFrame.yaxis, cameraFrame.xaxis flipped, cameraFrame.yaxis flipped, and find the closest match from those and set view.tiltAngle to either 0, 90, 180, or 270 .

- 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:  vector illustrator (QUARITEXA)
9322.13 In reply to 9322.12 
Unfortunately, I don't know moi scripting well enough to implement this small option.
  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:  bemfarmer
9322.14 In reply to 9322.12 
Hi Michael,

Are there currently any scripts which set the tilt for top view?
I see your code for getting the tilt in the forum topic "Align 3dview to surface".

Wikipedia's ortho view topic is interesting.

-Brian
  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
9322.15 In reply to 9322.14 
Hi Brian,

re:
> Are there currently any scripts which set the tilt for top view?

Some info here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=8104.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:  bemfarmer
9322.16 In reply to 9322.15 
Thank you.
- B
  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
9322.17 In reply to 9322.13 
Hi Quaritexa,

re:
> Unfortunately, I don't know moi scripting well enough to implement this small option.

Well like many things it's quite a bit more complicated than you might think at first.

But I've attached a version that's pretty close, give it a try. I think it's doing what you wanted when it is locking on the the Top or Bottom view but not quite right with Front or Side views.

- 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:  nameless
9322.18 In reply to 9322.17 
I want to jump in and say how useful this script is. It makes switching to ortho views so much more natural, at least for me.

I prefer the ambiguity of the top and bottom views of the first script, compared to the side view one of the second version. Thanks QT for bringing this to my attention and Michael for the work on the scripts.

In my opinion this script is so helpful, it should be bundled with MoI in some form. I have developed sufficient muscle memory with F shortucts to toggle each view, but this script beats it by far. Combined with the align C plane to selected it completes the deal. Very impressed :)
  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:  vector illustrator (QUARITEXA)
9322.19 In reply to 9322.18 
This Views switching is very convenient. I've using it for the several days. If it were possible to solve the tilt problem, it would be generally luxurious.
  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
9322.20 In reply to 9322.17 
possibly what they want is just throwing the "Camera" in the 3d viewport, to that particular perspective. not really going to the actual "TOP". So that would then keep all the UCS twist and rotation stuff, without resetting it.

Is it possible to get that camera point without moving to the actual ortho viewport? Just a thought.....
  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-35