Home  Previous Next

Code snippets are a block of codes to speed up the coding process.

In the code editor of the attribute editor, for example, the command of a command-button, or the menu editor with one menu item has been activated.

Press the down arrow button at the top right corner of the code editor, and the menu containing all the code snippets of the current language type ( Mel / Python ) will pop up,

select one of the code snippets, and the content of that snippet script file will be inserted into the cursor position of the code editor.

 

How to create a code snippet?

Go to "Misc Menu / Create Presets/Code Snippets..", or in any code editing widget, click on the top-right triangle menu, and select "Export As Code Snippet..".

In the pop-up dialog, input the category, the code snippet name, and code and create.

 

Where are those code snippet scripts?

For factory default code snippet scripts, they are in the Maya's user script folder/ MG-PickerStudio/MGPicker_Program/CodeSnippets,

the factory default code snippet scripts are maintained by the developer of MG-Picker Studio so better keep them intact.

For user command preset scripts, please put them here: Maya's user script folder/MG-PickerStudio/MGPicker_UserConfig/CodeSnippets.

Organize different types of snippets into two different folders: MEL/Python.

 

Home Previous Next