Show messages:
1-10
11-30
31-45
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
From: coi (MARCO)
yyaha..that is working now. tnx.
one tiny thing: if i delete a view, the drop down displays 'select a view'. but if i keep on pressing the delete button - without choosing a view - it silently keeps on deleting views starting with the oldest entry. maybe it would be possible to disable(and greying out) the delete button, if there is no actual view selected.
From: Michael Gibson
Hi Jörg, it looks like that .views.json file was created by the old script. You'll need to delete it and make a new one with the latest script and then that should be working.
- Michael
From: pixelhouse
Hi Michael,
yes, the file was created with the old script. Please take a look to my edit in my last post.
Greetings
Jörg
From: Michael Gibson
Hi Teddy, for renaming there is an "Edit name" dialog that you can use if it would be more convenient.
That goes like this:
code:
var dlg = moi.ui.createDialog( 'EditNameDialog.htm', 'resizeable,defaultWidth:26em,fixedHeight' );
/* If you want to initialize the starting name text do this: */
dlg.htmlWindow.nameval = 'initname';
var result = dlg.window.doModal();
if ( result !== -1 ) /* return value of -1 means canceled */
{
/* new name in result */
}
- Michael
From: Michael Gibson
Hi Jörg,
re:
> Please take a look to my edit in my last post.
So it sounds like the main function of the proper view being restored is ok now. For now if you have problems renaming the views inside the command you should be able to do it by editing the .json file in a text editor.
- Michael
From: Teddy Lindsey (TEDDYLINDSEY)
Thanks for the feedback everyone!
Michael: thanks for the tip on using the EditNameDialog! I didn't realize that was possible. I'm sure you're really busy but I would love to see a scripting guide that goes over the various capabilities of the underlying API and object model. It would be super helpful! Also, how would I go about changing the "Cancel" button to an "OK" or "Close" button?
I've attached a new version (v0.2.2) that incorporates the following changes based on the feedback and bugs reported:
- Delete and Rename buttons are only enabled when a view is selected (thanks Marco).
- Renaming now uses a dialog prompt which is much better.
Attachments:
View Manager 0.2.2.zip
From: Michael Gibson
Hi Teddy, thanks for your updates!
re:
> I'm sure you're really busy but I would love to see a scripting guide that goes over the various
> capabilities of the underlying API and object model. It would be super helpful!
Unfortunately that's a very time consuming area of work, both in generating the documentation itself as well as the time intensive nature of supporting developers.
It's just not an area that I am able to focus on as of yet, not until more stuff is finished up in base MoI itself.
> Also, how would I go about changing the "Cancel" button to an "OK" or "Close" button?
Do you mean on the edit name dialog? It should be showing an OK button on it already.
- Michael
From: Teddy Lindsey (TEDDYLINDSEY)
Michael: I completely understand having too much on your plate to keep the docs up to date. Hopefully someone in the community could pick that up again at some point.
For the Cancel button, I want to change the one that appears in the sidebar panel. I'm using a commandDialog for my script. Maybe I should be using a different type of component?
Image Attachments:
view_manager_cancel_button.jpg
From: Michael Gibson
Hi Teddy,
re:
> For the Cancel button, I want to change the one that appears in the sidebar panel.
For that at the bottom of your ViewManager.htm file, replace this:
code:
<moi:CommandCancel />
with this:
code:
<moi:CommandDoneCancel />
There is no MoI command that puts "OK" or "Close" in that command ui area so if you want it to have one of those you would need to do it manually instead of using a control template.
You can see what <moi:CommandDoneCancel> and other controls expand to by finding the file CommandDoneCancel.htm in the ui folder. When the parser finds a control name with the moi: prefix, it looks if there is an .htm file with that name and if there is it takes the contents of that and inserts it.
- Michael
Show messages:
1-10
11-30
31-45