From: Ronster (RON)
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
From: Frenchy Pilou (PILOU)
Take a look here (in French before i refind the original! (If existing) ;)
http://moiscript.weebly.com/ajouter-une-icocircne.html
From: Michael Gibson
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
From: Ronster (RON)
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
From: Michael Gibson
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
From: Frenchy Pilou (PILOU)
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"
From: Ronster (RON)
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
From: Frenchy Pilou (PILOU)
We are on opposite time zone so you have the impression that we never sleep! :)
From: Michael Gibson
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
From: Ronster (RON)
Thanks Michael
From: Ronster (RON)
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:
CommandBar.htm
From: Michael Gibson
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
From: Ronster (RON)
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