So you wanna save that view?

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

So you wanna save that view?

Post by 7feet »

A while ago Barry Baker had asked for a way to come back to, or save particular views when using the Orbit Workspace tool. Well, I don't think he was the only one. I was working on updating all the scripts that I had written so I could put them in one spot on my site. And then I started thinking about that request and that I'd like that too. Typical.

So this one is more complicated. Most of them are "Button" type tools, which really need to be entered into the _tool_list.txt file to be of any damn use. I was just going to finish putting everything together, but then I got this bug up my bum and reworked the Orbit Workspace tool. Thoroughly. And changed the name, but that's beside the point.

First, now you can orbit around the workspace, but then go back to the position before the last move. Or reset to view to the camera and then switch back to where you were. Or save and recall any 4 orbit views you'd like. If you've saved some views, this handy-dandy package will give you some buttons on the tool window that will allow you to recall them at will. As well as a button to reset the view to the camera, or go directly to a front, rear, top or bottom view of the scene. I couldn't get the left or right view to work consistently, Moho has a mighty odd way of interacting between the screen dimensions and how the Orbit function works.

So, there are new buttons:

The "Clear" button clears all the saved movement data. And best to use it before you move the view around to one you want to save. The tool seems to be much more consistent if you clear everything and start from scratch to create a view you want to save.

The "Reset View" button sends the view back to camera position, but doesn't clear the "I moved the view to here" info, so it works with the "Previous" button. You can use them to go back and forth between your camera and Orbited view.

There are 4 views that you can save. Some caveats. One, if you change the size of the working window, all bets are off. All the Orbit Workspace fuctions use a relation between mouse distance and the size (and aspect ratio) of the working window I just haven't been able to puzzle out. But if you keep the main window the same size, you can instantly call up whatever view you want. Also, it is much better to hit "Clear" and then set up a view to save. If you have (non-destructively) reset the view, or used one of the buttons to set the front, back, etc views, what you save will not reflect your current view. I'll fix that, but I thought this was too nifty, and most usable knowing what not to do.

So...
Clear to completely clear the orbit position (but never the saved settings)
Reset View The view resets, but not the position.
Previous Last place you moved to.
..........................good to go between camera and orbit views

4 arbitrary viewing positions (sorry they can't be saved with the file, but maybe LM could throw that in) that you can save, at least during the session. Because the position is saved as a global variable, it should be fine, and there, if you close and reopen Moho.

The values will disappear, however, if you re-load all the scripts ( <CTRL> <F5> ). I don't believe that happens when you re-open Moho with a new script around. And again, don't change the main window size.

The file includes the 4 Button tools for standard views (top,bottom,front,rear), 4 saved positions (Saved View 1-4) a separate Reset View button, and the Orbiter tool, as well as the little bit you need to add to the _tool_list.txt file. Just cut-n-paste the copied contents of that file onto the end of your tool_list.txt file (found in the Moho>Scripts>Tool directory). Where you see the "..." at the end of the line, that's the spot where you put in you're own keyboard shortcuts. To set up a "Buttton" type tool, meaning one you just click on and something happens, it has to be listed in the _tool_list file. A pain in the arse, and something it seems only "Button" tools are left to, but that's the way it is. So here it is.

7feetView

The .ZIP file has all the relevant tool scripts and icons (going to the Moho>scripts>tool folder) and the _tool_list bit. You can copy the text in the "sf_add to _tool_list.txt" file onto the end of your "_tool_list.txt" file to create a new tool group. Also, if you just want the Orbiter tool, thats here:

Orbiter

I fixed up pretty much all my scripts this week. But this was new, and I thought it was useful. More momentarily.


--Brian
User avatar
bupaje
Posts: 1175
Joined: Fri Nov 12, 2004 5:44 pm
Location: California
Contact:

Post by bupaje »

Hey Brian. Just been taking this for a test spin and it is very cool -and useful- thank you.
User avatar
Barry Baker
Posts: 342
Joined: Fri Aug 27, 2004 6:58 am
Location: UK
Contact:

Post by Barry Baker »

I just took a test drive too, and it is GREAT! Really useful addition to the workflow. Thanks for your brilliant work, Brian. :D :D :D
User avatar
Rai López
Posts: 2259
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

:shock: WOW! Good news here, seems GREAT! :D I can't wait to try it! THANKS for all that work 7feet!!!
Post Reply