v4 UI Customization

Next
 From:  nate (NKURENCE)
9157.1 
Hi,

I've got 2 (hopefully) quick questions re customizing the UI in v4:

1. Where can I modify (or disable?) the appearance of the viewport margins? (see screen)
2. Is it possible to set the Browser tabs to be open by default on launch?

Thanks kindly!
Nate


Attachments:

  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
9157.2 In reply to 9157.1 
Hi nate,

re:
> 1. Where can I modify (or disable?) the appearance of the viewport margins? (see screen)

That's one of the few remaining pieces that is still coming from a bitmap source - you need to modify the image ViewportForeground.png in the ui folder to control that, keep the modified image the same size (33x33) as the original.


> 2. Is it possible to set the Browser tabs to be open by default on launch?

It's possible in v4 by using a startup script. Make a text file like "InitSceneBrowser.js" inside of MoI's appdata/startup folder. The appdata folder will be where moi.ini is also stored, you can find that by using Options > General > "Edit .ini path" - that will put up a dialog showing you the path to moi.ini .

Then for the .js file contents put this:
code:
var items = moi.ui.sceneBrowser.rootItems;
for ( var i = 0; i < items.length; ++i )
    items[i].expanded = true; 

- 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:  nate (NKURENCE)
9157.3 In reply to 9157.2 
Excellent, thank you so much!
My viewport is much happier now :)

For the .js, I've done just as you showed but it's popping a Script error on launch:

"
ReferenceError: Can't find variable: book
InitSceneBrowser.js line 1
1: >> book
"

Any ideas?

Thanks again–
  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
9157.4 In reply to 9157.3 
Hi nate, re: "book" error - my guess is that your InitSceneBrowser.js file is some kind of rich text document (with stuff like fonts, style formatting, etc...) in it rather than plain text. Can you post it here so I can take a look at it?

- 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:  nate (NKURENCE)
9157.5 In reply to 9157.4 
Sure, here it is.

Looks like you're right about the formatting.
I resaved it with Sublime and it cut the file size down from ~800b to ~100b.

'book' error is gone, but now it's giving me this guy:

"
TypeError: null is not an object (evaluating 'items[i].expanded = true')
InitSceneBrowser.js line 3
1: var items = moi.ui.sceneBrowser.rootItems;
2: for ( var i = 0; i < items.length; ++i )
3:>> items[i].expanded = true;
"

Thanks again for the help,
Nate
Attachments:

  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
9157.6 In reply to 9157.5 
Hi nate, your script is working fine for me over here. What version of MoI v4 are you using, is it the most recent one from http://moi3d.com/beta.htm ?

You'll need to be running a recent one (Aug-28-2018 or newer) for it to work, that's when this script interface for the scene browser was added.

- 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:  nate (NKURENCE)
9157.7 In reply to 9157.6 
Hmm, ok good to know. Using the Oct-17-2018 beta here.
I'll noodle around w/it and see if I can make some progress.
If not it's a small matter ;)

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
9157.8 In reply to 9157.7 
Hi nate, I double checked over here using Oct-17-2018 beta on Mac and your InitSceneBrowser.js file is working fine for me over here.

If you've been modifying things maybe you have the program guts of an older version or something like that?

If you use Help > About MoI, does that say you have Oct-17-2018 ?

- 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:  nate (NKURENCE)
9157.9 In reply to 9157.8 
Hi Michael,

I downloaded a fresh copy of the beta and emptied the appdata folder to try and isolate the issue.
Of all things it seems to be setting the Browser position from "adjacent" to "opposite".
Last thing I would have expected, but one of the first things I tried.

Nate
  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
9157.10 In reply to 9157.9 
Hi nate, yup I can reproduce the error with browser position opposite. It looks like the scene browser is not quite initialized fully in that particular mode, at the time the startup script runs. I'll look into a fix.

- 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:  Michael Gibson
9157.11 In reply to 9157.9 
Hi Nate, so that bug where the scene browser is not ready to be accessed by a startup script when it's in "opposite" mode will be fixed in the next v4 beta. Thanks for reporting it!

- 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
 From:  nate (NKURENCE)
9157.12 In reply to 9157.11 
Excellent to hear. Thank you, 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
 

Reply to All Reply to All