Advertisement

mel plugin scripting help

Started by March 27, 2008 07:45 PM
0 comments, last by Kylotan 16 years, 9 months ago
Hi, this is my very first post, and I know how to use basic programming langauges (sort of), like Dark Basic Pro, and Blitz Basic 3D. I have some questions regarding making a plugin for Maya in the Maya 8.0 Script Editor. But first I would like to show you what I have so far in the Maya Script Editor: -------------------------------------------------------------- // Made by Spludge Interactive // Create a window with a some fields for entering text. string $window = `Custom PaintFX Maker`; text -label "Load Mesh: "; string $Mesh = `textField`; text -label "Load Texture 1: "; string $Texture1 = `textField`; text -label "Load Texture 2: "; string $Texture2 = `textField`; text -label "Load Texture 3: "; string $Texture3 = `textField`; text -label "Load Texture 4: "; string $Texture4 = `textField`; text -label "Load Texture 5: "; string $Texture5 = `textField`; //Store the file names of the textures and mesh in their own variables. textField -edit ( $Mesh) $Mesh; textField -edit ($Texture1) $Texture1; textField -edit ($Texture2) $Texture2; textField -edit ($Texture3) $Texture3; textField -edit ($Texture4) $Texture4; textField -edit ($Texture5) $Texture5; showWindow $window; //Done with window and text fields. // Make dialog boxes to open mesh and textures. //Mesh { file -import $Mesh; return 1; } fileBrowserDialog -m 0 -fc "$Mesh" -ft ".x, .3ds, .obj, .fbx" -om "Import" -ds 1, -wt "Load Mesh"; //Texture1 global proc int importImage( string $Texture1, string $fileType, int -dialogstyle, string -windowTitle ) { file -import $Texture1; return 1; } fileBrowserDialog -m 0 -fc "Texture1" -ft ".bmp, .jpg, .tga, .png" -an "Import_Image" -om "Import" -ds 1, -wt "Open Texture 1 image"; //Texture2 global proc int importImage( string $Texture2, string $fileType, int -dialogstyle, string -windowTitle ) { file -import $Texture2; return 1; } fileBrowserDialog -m 0 -fc "Texture2" -ft ".bmp, .jpg, .tga, .png" -an "Import_Image" -om "Import" -ds 1, -wt "Open Texture 2 image"; //Texture3 global proc int importImage( string $Texture3, string $fileType, int -dialogstyle, string -windowTitle ) { file -import $Texture3; return 1; } fileBrowserDialog -m 0 -fc "Texture3" -ft ".bmp, .jpg, .tga, .png" -an "Import_Image" -om "Import" -ds 1, -wt "Open Texture 3 image"; ------------------------------------------------------------------- I am trying to make a mel script in Maya 8.0 that will have a window where you can open a mesh file (like .x, and .3ds), and load up to 5 textures for the mesh (.bmp, .jpg, .tga, .png). Then I want there to be a button that makes the mesh into Maya PaintFX. I have never scripted anything before, even in Maya 8.0. So I am a total noobie at this. Questions: 1. Is there a command in the Maya Scipting language that can convert mesh files to paintFX? 2. If there is a command for converting meshes to PaintFX, what is it, and can you give me an example of how to use it please? 3. Are there any "if...then", or "if...then...else" statements/commands in Maya Scripting? If there aren't, is there a workaround for those? 4. How do you make the script into a .mel or .mll file? What's the difference between these two files? Thank you, -Spludge Interactive
Although this is technical, this is better suited to the Visual Arts forum I think, so I'll move it.

This topic is closed to new replies.

Advertisement