[Solved] How can I add my script to a toolbar with a custom icon in 3dsMax?


#1

Hi !!

A few weeks ago, I have posted a new topic here but I don’t have recieve any answers yet :frowning: ! Maybe I have placed it in the wrong place…
Could you help me please ? I don’t know where to put my script files and how to add my custom icon to my toolbar.

Thanks a lot ! :slight_smile:


[Solved] How can I properly add my 3ds Max script to a toolbar with a custom icon?
#2

you can select all your code, drag & drop in your toolbar and next right click Edit button Appearance


#3

Thank you !

After right click on Edit button Appearance, I have this window and I don’t undestand how can I change my icon. I can’t browse my computer to find my *.png icon. :confused:

Annotation%202020-07-09%20175916


#4

you need use mcr to definite it

macroScript <name> 
[category:<string>] 
[buttonText:<string>] 
[toolTip:<string>] 
[icon:#(<string>, <index>)] 
[silentErrors:<boolean>] 
[autoUndoEnabled:boolean>] 
(<macro_script_body>)
(
   your script or  filein "file path"
)

this is the way max use , but you need 24x24 bmp image

you can use AEI ToolBar to add any scripts with icon , it can be download in scriptspot


#5

What is “ToolTip” ? The official documentation says : « The toolTip: argument specifies the tooltip for the button. If no tooltip is specified, is displayed for the button. » but I don’t really know what is ToolTip !!

There is my code :

macroScript PFCreatorMacro
    category:"PF Creator"
    toolTip:"PF Creator"
    buttonText:"PF Creator"
    icon:"pfcreator_24i"
    silentErrors:false
    autoUndoEnabled:false

My icon is pfcreator_24i.bmp and I placed it here : C:\Program Files\Autodesk\3ds Max 2020\UI_ln\Icons but I can’t find it in the Edit Macro Button :
Annotation%202020-07-09%20221821

I can’t find my icon when I click on Image Button. I can’t find my icon in Group, anywhere… Why ? I don’t undestand !!

My macro PFCreatorMacro.mcr is here C:\Users\MyName\AppData\Local\Autodesk\3dsMax\2020 - 64bit\ENU\usermacros.

Thank you for your help :smiley:


#6

when mouse on the button , a title appear, that’s tooltip
icon#(<string>, <index>) ,this is an array , 1 element is the path of the bmp, 2 element is the index of the icon , you need use this format , such asicon:#("pfcreator_24i", 1)
the most important is you need restart max , if not , even if you try the method official gives , icon may can’t show .


#7

Thank you for your answer.

Now my code is :

macroScript PFCreatorMacro
    category:"PF Creator"
    toolTip:"PF Creator"
    buttonText:"PF Creator"
    icon:#("pfcreator_24i",1)
    silentErrors:false
    autoUndoEnabled:false

I followed your steps, this tutorial but I can’t get my icon !! :frowning: I really don’t undestand what I’m doing wrong…

My files are here :slight_smile:
C:\Users\MyName\AppData\Local\Autodesk\3dsMax\2020 - 64bit\ENU\usermacros
C:\Users\MyName\AppData\Local\Autodesk\3dsMax\2020 - 64bit\ENU\usericons


#8

why you put it in a temp path?
all icons load in UI_ln folder


#9

Ok ! Now they’re in the right folder. But my icon doesn’t appear and I can’t find it in the Group list. Is it a bug or something like that ?! o_O


#10

your code pattern may be wrong , you can compare with existing mcr
if you really can’t fix it , use AEI ToolBar may be better


#11

It’s working !!

My code was correct but my customicon_24a.bmp icon wasn’t. The alpha was invert ! So I changed that.

I placed my icons at this location : C:\Program Files\Autodesk\3ds Max 2020\UI_ln\Icons and also at this location : C:\Users\MyName\AppData\Local\Autodesk\3dsMax\2020 - 64bit\ENU\usericons. When I restarted 3dsMax my icons wasn’t here !
So, I decided to restart my computer and for some reasons, It worked !! I don’t know why ! Weird !! :smiley:

Thank you so much for your help !