Show messages:
1
2-21
22-41
42-45
From: bemfarmer
Hi Teddy,
This looks to be a very useful script.
>>>>>
As I have been having a lot of trouble (in general) in manipulating the 3DView of some object with the mouse, (why I do not know, maybe it is the hi-def monitor?),
I would also like to have a 3DViewMgr script which would switch the 3DView to various camera positions. An example would be to view the object in 3DView, with the orientation comparable to the Top View, etc.. This would give the mouse manipulation in 3DView a fresh start to deviate from a TopView orientation a bit.
There may be some existing scripts? Not sure.
>>>
I've also recently noticed that a bunch of my old shortcuts reference add-on scripts without the _ prefix, so they do not work from the shortcut. This must
have been faulty for a long time...(but is my fault.)
- Brian
From: Teddy Lindsey (TEDDYLINDSEY)
Brian (bemfarmer), I hope you do find the script useful! Seems like we both had the same need for a view manager of some kind.
With regards to what you originally posted about having a view that's oriented exactly like one of the orthographic views, you can edit the .views.json file manually and put in specific values to get a precise camera and target view. In the example below, the target is located at the XYZ origin but the camera is located 250 units above the XY plane, yielding a camera view like the Top orthographic view.
Example:
code:
{
"version": "0.1",
"views": [
{
"name": "Top",
"camera": "0,0,250",
"target": "0,0,0"
}
]
}
From: bemfarmer
Thank you Teddy,.
- B
From: Larry Fahnoe (FAHNOE)
Hi Teddy,
Very handy script, thanks! This certainly beats my keeping notes on the settings in Options > View > 3D view angles.
--Larry
From: bemfarmer
So my problem with 3D view manipulation was the Option View Rotate/Pan/Zoom was set to World Z Axis.
I prefer Free Rotation, most of the time.
- Brian
I think a script for some 3D View camera position presets might be useful.
Did some searches back as far as 2016, re camera and target.
See Michael's script "SetNearestOrthoView".
From: TOM (SIRTOM)
Fantastic ! Thank you !
From: Teddy Lindsey (TEDDYLINDSEY)
I'm glad that folks are finding it useful! Please let me know if you run into any bugs or have improvements to suggest.
- Teddy
From: pixelhouse
hmm, it seems that the position of the saved view is inverted and I see my model from the bottom side.
I have tested out different angles and positions in Moi V4 but every saved position are totaly wrong.
I hit "v" (my shortcut for this script) to save the position of the view, its open the window to manage the saved positions. This works fine!
To hide the window I click "Cancel" so I can select and hide objects and hit v again to save the next view.
When I will go back to an defined position I hit v to open the window, I select my saved view and the camera is changing to the new position. But the position isn`t correct.
Best regards
Jörg
edit:
Here screensots of the position that I saved and the saved position from the View Manager.
Image Attachments:
screenshot viewmanager01.JPG
screenshot viewmanager02.JPG
From: Michael Gibson
Hi Jörg, I tested over here and it was working fine for me.
I think the issue is that you're probably using Options > View > Rotate/Pan/Zoom options > Rotation style = "Free rotation" instead of "Rotate around world z axis" mode.
Currently this ViewManager script only saves and restores a camera and a target point, it does not save or restore the "up" direction that defines the view's rotation around that line.
This isn't an issue when using Rotation style = "Rotate around world z axis" view rotation mode because that mode always keeps the "up" direction along the world z axis. But when using Rotation style = "Free rotation" you can have some other "up direction" which will be lost.
I think it should only take a minor adjustment to the script to make it additionally save and restore the "up" direction, I'll give that a try.
- Michael
From: Michael Gibson
Hi Jörg, please give this updated version a try, it should save and restore the "up" direction too now.
- Michael
EDIT: Updated to work with locales that have comma as decimal point separator, new version a few messages down.
From: pixelhouse
Hi Michael,
I use the correct settings (world) for the rotation. I'm using another laguage, but this sould be not the problem.
I have made a screenshot of the Rotate/Pan/Zoom settings.
With the new script the model is rotating vertically.
I have nbo idea what the problem is.
Thanks for your support, guys!
Jörg
Image Attachments:
screenshot settings.JPG
From: coi (MARCO)
nah..doesn't work here either.
From: Michael Gibson
Hi Jörg, what version do you have under Help > About MoI ?
- Michael
From: Michael Gibson
Hi Jörg, can you also please post an example .3dm file and the .views.json file that ViewManager saved?
Maybe it's an issue with the ViewManager script only saving out 2 decimal places when it writes out coordinate information to the .view.json file.
Or it could be a localization problem when commas are used for the decimal places. If I can see the output that it generated on your system maybe that will help me to figure out the problem.
- Michael
From: Teddy Lindsey (TEDDYLINDSEY)
Michael: thanks for jumping in and fixing the issue with the View Manager Script not handling the "up direction"!
It sounds like it might be helpful to separate out the X, Y and Z values for the camera, target and up Idirection into separate fields in the JSON to avoid localization issues with how commas are handled. I'd be happy to refactor script to handle this as well as a bug I've found that can cause duplication of views when renaming them.
Since it's been a while since I wrote this, I wanted to consult some documentation on scripting for Moi, but it looks like the sites I've used in the past are no longer around, e.g.,
http://moi.maxsm.net/api/
Can you point me to another site where I might be able to reacquaint myself with the API?
From: Michael Gibson
Hi Teddy, I think the Internet Archive snapshot of Max's API page might work:
https://web.archive.org/web/20200218200812/http://moi.maxsm.net:80/api/
re: Localization issue - I'm not really sure yet if that's why it's not working for some people. Maybe that can be confirmed or ruled out by checking out an example saved view file.
- Michael
From: Michael Gibson
Ok, I think it is a comma as decimal separator locale problem. The problem is the MoI point's toString() method uses a locale dependent method for making UI presentable text and the View Manager script is using that.
Here's a quick fix putting in a ptToString() function using built in toFixed() Javascript number to string conversion which shouldn't be locale dependent.
- Michael
EDIT: removed this version, there is a newer one right below.
From: Teddy Lindsey (TEDDYLINDSEY)
I've attached an update (View Manager v.0.2.1) that incorporates the latest fixes from Michael for the locale-specific comma problem in addition to the following improvements:
- Fixed a bug where renaming a view might cause duplicate views.
- Improved logic for creating new View names to avoid duplicating an existing View name.
- Teddy
Attachments:
View Manager 0.2.1.zip
From: Michael Gibson
Thanks Teddy!
- Michael
From: pixelhouse
Hi Michael,
I use the V4 Dec. 22 2020
I have saved a small scene in which there are 3 saved views.
I have tested the saved views and the problem still exist.
Thanks for your help!
Jörg
Hi TEDDY,
the new version seems to be good! I will test it out more and in the next hours.
Thanks a lot!
---Edit---
hmm, I still have problems. I have create 3 different views, have try to rename one of this, by clicking "save" all views are lost.
I don't understand, why we have only a "cancel" button and no "OK" button to save the views they are in the list. After Cancel the created views are lost, without click cancel, I can't select objects in the scene.
the positions of the saved views are now correct :)
Hope I can describe it clear to you :)
Attachments:
View Manager.zip
Show messages:
1
2-21
22-41
42-45