named view new script
All  1-20

Next
 From:  pressure (PEER)
11036.1 
Here's a new script for making and restoring named views. It's based on Teddy Lindsey's excellent ViewManager, but with a few differences:
  • views are embedded in the .3DM
  • It can be run in the middle of running another command and when done with NamedView you'll end up back wherever you left off in that other command
  • Camera-to-target distance can be set directly. To choose the target select it and then click Reset on the 3D viewport. Then the target point will be the center of what was selected.
  • Field of view angle is easy to adjust
  • Both perspective and parallel projection views are supported
  • Option to automatically restore a view if exactly 1 view has been saved




It only works with v5 beta (version Mar-28-2023) or newer. Installation is a little different because this is an “instant script” rather than a “command”. That means it should go in a “scripts” folder. A “scripts” folder doesn't exist by default, so you might need to make it inside of the Moi appdata folder.

On Windows you can find the Moi appdata folder by typing Win+R to bring up the Windows "Run" dialog and then type in:
%AppData%\Moi\

On Mac from a Finder window, go to the menu and pick Go > "Go to folder" and type in:
~/Library/Application Support/Moi/

You should see “moi.ini” and a folder “commands”. Create a new folder scripts if it doesn't already exist directly inside the folder “Moi”. Then move NamedView.htm and NamedView.js into the “scripts” folder. Finally, set up a shortcut key by going to Options > Shortcut Keys and type in NamedView as the command name.

EDIT 2023-12-20 new version uploaded with bug fixes

- Peer

EDITED: 20 Dec 2023 by PEER


  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:  Metin (METIN_SEVEN)
11036.2 In reply to 11036.1 
This is great, Peer, thanks a lot for this, just what I needed.

And thanks to Teddy for the initial version as well.

─ Metin

visualizer • illustrator • 3D designer — metinseven.nl
  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:  pressure (PEER)
11036.3 In reply to 11036.2 
Glad you're using it Metin.

The version you downloaded had some bugs. I've updated the download link above with a new version.

- Peer
  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:  Metin (METIN_SEVEN)
11036.4 In reply to 11036.3 
Thanks Peer!

A little request, if possible…

Right now, after having saved a view, it requires four actions / clicks to restore the view:

1. activate the script,
2. click on the dropdown menu,
3. click again to select a view from the dropdown menu,
4. press Done or right-click.

I usually use just one view for an illustration, and navigate the 3D view a lot, then restore the stored view again. It would be more convenient if the last saved view is activated by default in the drop-down menu, so you'd just need to activate the script, then press Done (or right-click) to restore the last-saved view.

If possible, it would be even more convenient to have a separate command / script to directly restore the last-saved view with one keystroke or button, so you'd only need to activate the other script if you want to change or add a stored view.

Many thanks in advance for considering this, if it's possible.
  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)
11036.5 
?
When you save a 3Dm file then exit

When you re open this file it returns as it was at the save! ;)

(position, size etc...

EDITED: 21 Dec 2023 by PILOU

  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)
11036.6 In reply to 11036.1 
I put it inside the folder commands because it's don't appear on the general list of scripts...
All is working fine!

Except this opt.text = 'Select a view' can't be translated!...

EDITED: 21 Dec 2023 by PILOU

  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:  pressure (PEER)
11036.7 In reply to 11036.4 
Hi Metin,

Re:
> It would be more convenient if the last saved view is activated by
> default in the drop-down menu, so you'd just need to activate the
> script, then press Done (or right-click) to restore the last-saved view.

I think you can get that behavior now if there's only 1 view saved. Check the box "autoload". The next time you run the script the 1 saved view will get restored immediately.

Does that do what you want?

- Peer
  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:  pressure (PEER)
11036.8 In reply to 11036.6 
Thanks for translating it Pilou!

What's the problem that you're having with translating opt.text = 'Select a view' ?

- Peer
  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)
11036.9 In reply to 11036.8 
it is not taken into account!
Maybe inside a dictionary... maybe somewhere in a folder...or maybe impossible with this actual structure...
I will ask to 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:  pressure (PEER)
11036.10 In reply to 11036.9 
Pilou,

I think if you replace
code:
opt.text = 'Select a view';

with
code:
opt.text = 'your translation text';

That should show up in the dropdown.

- Peer
  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:  Metin (METIN_SEVEN)
11036.11 In reply to 11036.7 
Hi Peer,

What I'd like is restoring a saved view as easy as possible, preferably with one hotkey, as I need to return to the view about 100 times during a single MoI session. I constantly rotate, pan and zoom the 3D view to make adjustments, and it would be great if I could easily return to your script's last-saved view after each adjustment.

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:  Frenchy Pilou (PILOU)
11036.12 In reply to 11036.10 
I am affraid not! :)
---
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:  Frenchy Pilou (PILOU)
11036.13 
Semi resolve! :)

I had both in Scripts and commands

Now works fine in Scripts! OK!

but when i move them in Commands i have a message! ;(
NamedView is missing or was renamed

and then



sure they are not in the Scripts folder but at the first time this morning that was working fine! :)

Fact to translate is maybe the glitch ...
I will try with the English version! :)

No it's the same don't works in the folder commands and nothing in the folder Script!

That works only alone in the folder scripts! :)

EDIT that works when both in Folder Commands & Scripts!
Maybe the accents ...


Bingo!
Yes definitly verified : alone in commands don't works, alone in scripts works but not list, in both works + list! :)

EDITED: 21 Dec 2023 by PILOU

  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:  pressure (PEER)
11036.14 In reply to 11036.13 
Hi Pilou,

Re:
> alone in commands don't works

This plugin should go in scripts only. It won't work as well if it's in commands. Specifically, if it (or a duplicate of it) is in commands and it is run in the middle of another command it will cancel that other command.

Re:
> alone in scripts works but not list

That's because the thing that's generating the list is only looking in commands and and not in scripts. What's the add-on that's generating the list? The one from Max Smirnov?

- Peer
  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:  pressure (PEER)
11036.15 In reply to 11036.11 
Hi Metin,

Re:
> What I'd like is restoring a saved view as
> easy as possible, preferably with one
> hotkey, as I need to return to the view
> about 100 times during a single MoI
> session.

Yup that's exactly what I use this script for. Initially I aimed for the kind of quick recall you're talking about, but couldn't quite figure out a good UI for that. Like if the last saved view is the one that's loaded then there's the problem that maybe it's not the last saved one that I want and there's no way to reorder the views.

Do you actually need the ability to save multiple views? I don't: I use one .3dm for each illustration and so only ever have one view.

- Peer
  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)
11036.16 In reply to 11036.14 
Yes the scripts list by Max!
But magically with your 2 files inside the folders that is working! :)
And you win a shortcut! ;)
  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:  Metin (METIN_SEVEN)
11036.17 In reply to 11036.15 
Hi Peer,

Ah, now I get the Autoload function, sorry. I thought that meant that the last view would be automatically set after loading a 3DM scene, but it means that the last saved view is automatically activated.

That's great, thanks again!

─ Metin

visualizer • illustrator • 3D designer — metinseven.nl
  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:  pressure (PEER)
11036.18 In reply to 11036.17 
Hi Metin,

Re:
> but it means that the last saved view is automatically activated.

Not really. Autoload only works if there's exactly 1 saved view. If there are 2 or more saved views then it won't do anything.

- Peer
  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:  Metin (METIN_SEVEN)
11036.19 In reply to 11036.18 
That's fine, I usually need only one view. Thanks again!

─ Metin

visualizer • illustrator • 3D designer — metinseven.nl
  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:  BurrMan
11036.20 In reply to 11036.13 
“”””” Bingo!
Yes definitly verified ”””””

There was a setting in the custom ui that was a limit on how many items it would show. Years ago i had to change this to get wverything to show all the time.

I dont remember where, but if you are being “truncated” then look 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
 

Reply to All Reply to All

 

 
 
Show messages: All  1-20