Updated MayaPandaUI Interface - Egg & Bam Exporter for Maya




Hello,
Attached you should find an actual working attachment of the MayaPandaUI Maya script files. When I first encountered this tool in the Panda3d installation, I had many issues with it not running, not fitting on the screen, (the height was stuck higher than my monitor resolution), to the commands not working in other versions I found & tried on the internet. So, I decided I would dig my way through the Mel scripting language. I learned a lot through trial and error while working on this script, and in the end, it has paid off. I bring to you, this modified, working version. I hope those that use this find it as helpful as I do.
As the picture depicts, I added numerous feature buttons for exporting and file conversions. The script had the base of the code in it, just no way to use them. I have also added numerous egg-object-types to a UI to tag your geometry with; as well as a UI to remove tags from geometry.
There is an included “Instructions.txt” file in the download archive attachment that explains what files need to go where to have this work in your Maya. (since the plug-ins directory of Panda do not have them for Maya)

Would love to hear any compliments or issues with this updated version. :smiley:
Revision History
(Current revisions only are listed to save screen space.)
(see release_notes.txt for full revisions)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// -
// - 07/11/2017 : Mods by Sean /a.k.a. “Sweet” (primary coding was done 07/06/2016)
// - Added support to the following processes to handle converting multiple files at one time.
// - --MP_BrowseForFile, MP_GetEggFile2Bam, MP_GetMayaFile2Egg, MP_GetBamFile2Egg,
// - --MP_ImportPandaFile
// - By adding multiple file support,
// - --The script can now process more than one file at a time when performing these tasks.
// - Example: User wants to convert multiple files from eggs to bams.
// - --After clicking on the appropriate button to start processing, user can use standard windows function of
// - ----holding down the shift or control keys and click on the file(s) to select for conversion.
// - --The script will then process all the selected file(s) one at a time.
// - !!!WARNING WHEN USING MULTIPLE FILE CONVERSIONS:!!!
// - When attempting to convert multiple files, DO NOT USE THE CUSTOM NAME FEATURE. Doing so
// - --gives EVERY FILE the same export name. This will result in only the last file being created,
// - --as all previous files will have been over-writen by the previous file as they are created.
// - Added “MP_” suffix every process and many variables so the script cannot interfere with other scripts.
// - Added GUI checkBox and needed function(s) to remove the “groundPlane_transform” tuple from exported
// - —egg MESH files.
// - --While this Maya node is normally empty, care should be taken to ensure it is empty when exporting.
// - --Otherwise there runs the risk of data loss in the egg/bam file(s).
// -
// - 10/01/2017 : Mods by Sean /a.k.a. “Sweet”
// - Added the ability to add UVScroll values to nodes via the “Add Egg Tags” GUI.
// - Recoded the way confirmDialogs pull their menu and annotation values.
// - Added egg-object-type button annotation.
// —Now, descriptions pop up, when the mouse is hovered over the button(s), that describe what each
// - ----button is for.
// - --This annotation was primarily taken right from the Panda3d information.
// - Added release notes from original developer that were missing from the version I initialy used to
// - ----rewrite this script.
// —Why ‘Ben Chang’ left these out from his version, I have no idea.
// —But, I added them so the original developers would get their credit.
// -
/////////////////////////////////////////////////////////////////////////////////////////////

NOTE: If there is NOT a userSetup.Mel file in the directory specified in the instruction.txt file,
you can/must manually create the file using any text editor.

Files in Archive:
MayaPandaUI.mel
eggImportOptions.mel
Panda Exporter_v1.9.png
Panda Exporter_v1.9_EggObjectTypesWindows.png
release_notes.txt
instructions.txt
MayaPandaUI_v1.9.zip (144 KB)

I’m going to be adding support for adding a character name to the created bam file from the exporter, as well as the ‘-force-joint’ option. Should be done in a day or so depending on my workload and free time. May be other options included as well, just not certain at the moment.

EDIT:
New version 1.3 now released! 06/09/2015

// - 07/06/2015 : Mods by Sean / a.k.a “Sweet”
// - Corrected bad entry to the pview program call. I had pview_638 and should be just pview.

This should correct the issue of pview not being called properly when the check box is checked to view the created egg file after creation.

This is AMAZING. Thank you very much for this. I was able to export some stuff today, and it WORKED without headache. I’m going to fiddle with animations tomorrow and I’ll let you know.

You’re welcome. Exporting animations should be a breeze as well. I haven’t had any issues in creating the eggs of them myself. But yes, would be great to hear how you managed.

~Sean~

I’ll try this. Having some problems with Blender. Thanks for your work!

Also, you must copy the three “.mll” from your Panda3d
plugins directory, that reflect the version of Maya your running,
to your “\programFiles\MayaVersion\bin\plug-ins” directory
Example:
libmayapview[mayaVersion].mll
libmayasavepview[mayaVersion].mll
mayaeggimport[mayaVersion].mll

Where can I find the 2016 version?

I’m not certain if the newest public release has them in it or not. I’ve been building my own Panda from source for some time now. However, rdb posted a link to a build he had done just for this question you ask.
[url]Compiling Panda 1.90 Maya 2016 support files - #4 by rdb]

Yeah I found that later, still can’t load the plugin(s).

I’ll use Blender :slight_smile:

Updates, Updates, Updates, Updates, Updates
Made many changes in the operation and functionality of this script.
Too many to relist in here, check the revisions for the specifics.
Please let me know if something isn’t working as it should.

~Sweet~

If there is a feature or function anyone would like to have in this tool, don’t hesitate to post the inquiry. If it is doable and something I am willing to add, I’d be happy in including it. FYI, there are already a few additions I have been wanting to add in, and eventually I’ll make the time to code them, lol, Such as a remake of some of the functionality of another tool by Andrew Gartner,Shuying Feng and the PandaSE team (Spring '10) ‘Panda3D Tools GUI’. More specifically, the gui functions pertaining to panda’s egg-opchar and egg-palettize commands.

Should be last updates for a while. At least until I am able to write some more options in.
All seems to work great, but let me know if something does not.

// - 03/20/2016 : Mods by Sean /a.k.a. “Sweet”
// - Added Export Option ‘Convert Cameras’ which will Convert all camera nodes to locators.
// - Will preserve position and rotation.
// - Added Texture Reference Path option to ‘Output Path & Name Options’.
// - It’s now possible to reference textures to a specified path without it also copying the
// - textures to that directory.
// - The option to copy textures and reference them to a custom file output path exists as an option as well.
// - This feature works when clicking ‘Maya File 2 Egg’ or ‘Egg File 2 Bam’ as well.
// - Modified ‘argsBuilder’ and ‘export2Bam’ process to support updated relative texture pathing options.
// - Modified ‘browseForFolderPreProcess’ processing code to allow for updated relative texture
// - path options above
// - Also cleaned out some unused switch options in process.
// - Miscellaneous code cleanups.
// - Modified, cleaned and streamlined ‘exportPrep’ and ‘export2Bam’ processes for complex functions
// - that were no longer needed due to previous revisions.
// - Reworked the ‘pview’ related codes. Now, if exporting scene or node(s) to panda files, system command
// - pview is run against final file
// - If not exporting, then it sends either the selected or entire scene to the ‘libmayapview’ plugin if loaded.
// - The use of the ‘libmayasavepview’ plugin has been eliminated for now.

~Sweet~

Updated:
Added an easier method for listing and deleting egg-object-type tags that are currently on nodes.
Select at least one node and click the button on the main GUI to display the window.
Each object-type will be represented by a button.
To delete any of the three possible tags, simply click the appropriate button!

The window self-updates, when it’s being displayed, when either a tag is added or deleted
for the currently selected nodes.
~Sweet~

Hey Sean, when I import a character model with a rig it does not seem to import it right, do you know how I could fix this? Awesome tool by the way. prntscr.com/bg12uj

The way in which a model imports has truly nothing to do with this tool. Importing eggs is controlled 100% by the two processes, first, bam2egg and then the actual Maya egg import plugin. Just from what I know, your issue may be as simple as setting the joint display size in the scene. Outside of that, I’m not going to be much help.

Updated
Primarily worked on the whole texture referencing processes so that the different ways they can be utilized function as they should have. All seems to be running good with them now. :smiley:
~Sweet~

//showWindow PandaExporter2;
source “C:/Users/ponyboy837/Documents/maya/2016/scripts/MayaPandaTool.mel”;
// Error: animationOptionsUI(); //
// Error: “C:/Users/ponyboy837/Documents/maya/2016/scripts/MayaPandaTool.mel” line 634.44: Wrong number of arguments on call to animationOptionsUI. //
// Error: animationOptionsUI(); //
// Error: “C:/Users/ponyboy837/Documents/maya/2016/scripts/MayaPandaTool.mel” line 640.44: Wrong number of arguments on call to animationOptionsUI. //
// Warning: New procedure definition for “animationOptionsUI” has a different argument list and/or return type. //
// Warning: New procedure definition for “browseForFolder” has a different argument list and/or return type. //
// Warning: New procedure definition for “browseForFile” has a different argument list and/or return type. //
// Warning: New procedure definition for “argsBuilder” has a different argument list and/or return type. //
// Warning: New procedure definition for “export2Egg” has a different argument list and/or return type. //
// Error: export2Bam ( $selectedFile ); //
// Error: “C:/Users/ponyboy837/Documents/maya/2016/scripts/MayaPandaTool.mel” line 1189.45: Wrong number of arguments on call to export2Bam. //
// Error: export2Bam ( $eggFile ); //
// Error: “C:/Users/ponyboy837/Documents/maya/2016/scripts/MayaPandaTool.mel” line 1290.40: Wrong number of arguments on call to export2Bam. //
// Warning: New procedure definition for “export2Bam” has a different argument list and/or return type. //

Can you update it for Maya 2016? I’d appreciate it. :slight_smile:

This script should run fine under Maya 2016. I know a few people running it. I myself ran it when I adjusted some gui calls the middle of last year to test that version. Given the error I’m seeing, did you try to resource the script again?

No i only resourced it once. So it beats me.

I suppose I asked the question, primarily because the only instance in which I’ve ever seen the error you received, “Wrong number of arguments on call to” occurs when the script has been loaded into memory, the script variables have been modified, then the script is again loaded. Though this can happen through normal script running do to testing or purposefully modifying a script, if this error occurs, it is, (or rather has been in my history of using Maya), corrected by re-loading the script a second time.

Questions:

  1. Is the version you are trying to run of my utility, the first time you’ve used it? OR, did you previously have an earlier version installed?

  2. If you used a previous version, is it still in the directory for scripts? If it is still in a scripts directory, you must remove it from there as Maya actually automatically sources ALL scripts in those directories, even if they are explicitly ‘sourced’ from another MEL script. This can cause conflicts if the scripts in question differ.

  3. Is “C:/Users/ponyboy837/Documents/maya/2016/scripts/MayaPandaTool.mel” the only file you have on your computer? OR, is there by chance a [previous or another] version at “C:/Users/ponyboy837/Documents/maya/scripts/MayaPandaTool.mel”
    (notice in the above I used the non-version dependent scripts directory instead of the 2016 version scripts directory)

  4. Are you manually loading this with the script editor?, or is it being loaded via a “userSetup.mel” file? If you intend to use this frequently, or even if you do not, I’d recommend utilizing the userSetup.mel file to load the script at Maya run time. Just makes life a lot easier as it creates a drop-down menu item on the top of the Maya GUI.

  1. First Time.

  2. I’ll check that out.

  3. Only one i’m sure of. There is not another at “C:/Users/ponyboy837/Documents/maya/scripts/MayaPandaTool.mel”.

  4. I’ll look into using the MEL file as i don’t remember exactly what i did anymore. But thanks for asking and helping me out.