How to add more Command Bar buttons?

Next
 From:  Ronster (RON)
9434.1 
I know this will sound such a simple task to many of you as there seem to be loads of excellent and talented scripters here on the forum. I however, am not one of them and try as I might, I cannot understand whats involved. I simpluy want to add Max's subdivide, split, bridge and scale scripts to appear as buttons on the command bar..........Please help, I'm totally stuck :(
Ron
  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)
9434.2 In reply to 9434.1 
Take a look here (in French before i refind the original! (If existing) ;)

http://moiscript.weebly.com/ajouter-une-icocircne.html

EDITED: 20 Jul 2019 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:  Michael Gibson
9434.3 In reply to 9434.1 
Hi Ron, currently there isn't any GUI interface for adding or removing command bar buttons, but it is possible to do it by editing some text files and inserting your desired buttons into the HTML code.

To start with it would be helpful if you could say which version of MoI you are using and what operating system you are on and whether you have any other modifications from the default config like have you installed Max's "CustomUI" extension?

- 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:  Ronster (RON)
9434.4 In reply to 9434.3 
Hi Micheal, I use Moi v3 with the Dark Gray Theme 1.1 with Custom UI 1.03 and Custom UI Bar. After looking at the screens on the page I assumed that it would automatically add the buttons for Max's Plugins which I have installed but apparently not. I've looked through the Html but none of makes sense to me :(
Ron
  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
9434.5 In reply to 9434.4 
Hi Ron, what operating system are you on?

Do you have a icon images that you want to use for the buttons? One reason that buttons are not easy to add in some automatic fashion is because it takes some work to make good icons for them.

Can you maybe show me a screenshot and indicate where you want to add the buttons?

- 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:  Frenchy Pilou (PILOU)
9434.6 
Sorry i don't refind original ... but it's simple just edit the files like in the images shown! ;)
You must have created your new images icons in the folder ui/icons

Edit File ui/Commanbar.html and just add the 3 lines following (Centrage vertical)



For the icon text, add to the ui/EnglishStrings.txt file your textid reference, according to the example, Origin=Origin (text under the icon)

here that is for a fonction "Origin"

EDITED: 20 Jul 2019 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:  Ronster (RON)
9434.7 
Hi Guys, thanks for the speedy help. I'll give it a try tomorrow and see what happens. Just out of curiosity do you and Michael ever sleep? You always seem to here - very thankful you are though:)
Ron
  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)
9434.8 In reply to 9434.7 
We are on opposite time zone so you have the impression that we never sleep! :)
  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
9434.9 In reply to 9434.7 
Hi Ron, yes like Pilou writes above you'll need to insert a <moi:CommandButton> tag into the file CommandBar.htm .

Copy your icon .png file into the \ui\icons folder inside the main MoI installation folder, and then a simplified command button would go like this:

<moi:CommandButton icon="icons/YourIcon.png" command="commandname">Button text here</moi:CommandButton>

You would replace the "YourIcon.png" above with the actual file name of your icon file (make it a 64x64 pixel PNG file), replace "commandname" with the actual command you want to run, and replace "Button text here" with the text you want displayed at the bottom of the button.

If you run into difficulty if you can post your edited CommandBar.htm file here that would make it easier to see anything that's wrong.

Also if you want it to go in a particular place if you could say where that is that would make it easier to give you more specific instructions.

- 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:  Ronster (RON)
9434.10 In reply to 9434.9 
Thanks 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:  Ronster (RON)
9434.11 In reply to 9434.9 
Hi Michael, again thanks for the help. I've gotten the four buttons and lcons in place, but have no idea what the command names are. I assumed they would be the HTM named files for each button but this does not work. The buttons are for Max's latest Subdivde, Subbridge, SubSplit and Subscale scripts. I've tried all evening had no further luck. I've attached the CommandBar to this reply.
Many thanks Ron
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
9434.12 In reply to 9434.11 
Hi Ron, check out this post on what to put for the command parts of the buttons:
http://moi3d.com/forum/index.php?webtag=MOI&msg=7245.69

Basically each command consists of 2 files, one ending in .htm and the second ending in .js, like "ExampleCommand.htm" and "ExampleCommand.js". Then the command name you would use to trigger that would be the common part before the file extensions: "ExampleCommand".

- Michael

EDITED: 29 Jul 2019 by MICHAEL GIBSON

  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:  Ronster (RON)
9434.13 In reply to 9434.12 
Hi Michael, finally gotten round to putting your help to use. I now have exactly what I needed. Not being in any way a scripter or programmer, I can't believe I got things to work:)
Ron
  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