Hey folks,
So after a good reception for my
Batch OBJ Tools for 3ds Max, I sat down today and wrote one for Maya too.
I'm happy to present
mopMultiObjTool script for Maya!
You can
download mopMultiObjTool.mel here, or by right-clicking on the screenshot and choosing "Save Link As":
This one has a slightly different feature set to the Max version due to some differences between the programs. The main core is the same though.
Feature list:- Import large amounts of OBJ files in one click!
- Double-click an OBJ file in the list to import it directly.
- Filter the file list with a simple string (for example I always prefix my meshes as "high" or "low" so I can sort the list of files easily).
- Export selected objects to a highlighted OBJ file in the list.
- Export multiple separate meshes from your scene to multiple OBJs in one click (it creates one OBJ per mesh, using the mesh name as the file name)!
- Delete files directly from the list, or right-click to browse to the containing folder in Windows Explorer.
- Choose to display folders in the file list for direct navigation.
This script has literally been written today, and I've tested it fairly extensively with a number of different scenes, OBJs and settings. I think I've got error handling in for all obvious cases, it should be a pretty smooth experience.
It's tested on Maya 2008 but should be fairly backwards and forwards compatible. Please let me know if you find any bugs or if you think of any extra features that would make this a more useful application.
Installation:
- Download the .mel file from the above link (right-click and Save Link As).
- Place it in your My Documents/maya/scripts folder.
- Re-start Maya and type mopMultiObjTool; in the MEL command line to launch the tool.
- I recommend you make a shelf button with this command for easy access.
Enjoy!
Replies
This should make a lot of things a lot faster and simpler; thanks MoP!
Simple, effective and super quick,
Real time saver for accessorizing characters in zbrush
edit: unfortunately it doesn't keep the size ratio, so its kinda useless for the subtool purpose.
There is a similar tool called RD Browser, with thumbnails for previewing the .obj,
http://tools3d.com/news.php
I also discover that in ZBrush 3.5 we can import .ma objects file, but not very well integrated. No polygroups for exemple.
I still need to add support for the Maya OBJ settings, so you can turn off the "import multiple objects" thing, and so it will take the default settings when exporting. I'll try to get a version with that support up tonight.
BeatKitano: What do you mean by "size ratio"? I've tried importing/exporting several OBJs that have been through ZBrush and Max, and they were always in the correct size and position for me. Can you give me an example of how it doesn't work for subtools?
walter: Ah yeah, Rich Diamant's stuff - I'd forgotten about that! He does some nice tools.
Maya
Zbrush
I've the feeling its related to the units in maya, but i don't remember changing anything, what's weird is thet zbrush export the obj in the correct size/position...
Are you appending a PolyMesh3D to the main tool, then importing the OBJ onto the PolyMesh3D? I find this method always gives the correct scale.
And this does exactly what is on those screens.
Sorry to have bothered you, works perfectly fine, thanks a lot
I'm storing these settings separately to Maya's OBJ settings just so they don't conflict or get confusing, you will probably want to set them up how you like before doing any importing/exporting.
The update also includes a fix for not showing the progress bar when exporting multiple OBJs.
mesh_001.obj visible on frame 1
mesh_002.obj visible on frame 2
so on and so forth.
I can't really do this manually for 20 sec animation.
BTW you don't need to restart Maya when adding scripts.
Just type in Rehash in the MEL command line.
sirtet: Interesting idea, I could look into it. It'd have to be a checkbox option though, since otherwise it could have unpredictable results on meshes numbered for other reasons.
The reason why I'm interested in bringing in an obj sequence on a frame to frame basis is to create a workaround RealFlows' requirement in Maya to have a plugin in order to read the .sd files RealFlow outputs dynamics.
At the school I attend we can get the RF plugin installed on the PCs but the PCs are limited in resources, processing and memeory, because of their 32-bit environment. Plus we can't utilize our RenderFarm because of the plugin. I am working to getting the RF plugin installed on the Macs but until then a workaround RF's plugin will give the production team options in rendering down the line.
Using your plugin I exported the RealFlow sequence out to objs (300 files), imported that obj sequence into Houdini then exported the sequence as a FBX file and finally imported the FBX file into Maya, producing a RealFlow workaround. lol
I'm still interested in the suggestion I proposed for plugin extension.
Not sure if anyone here uses RealFlow but if they do and want to break away from its .sd file structure this is the way to go.
- Same as I asked for the Max version, the "center to scene" before export checkbox, and fbx support.
- Something new, a bit trickier maybe, I'd love it if when I had a group selected instead of an object, it would combine all the objects in that group and export them as one file (with the group name as file name), would be super useful for many cases where I don't want to combine my stuff to keep it easy to work on.
Thanks again for the scripts! I use these all the time (this one and the Max version).
I might take a look at it this weekend if I find the time!
Would be great if the exporter could check if a model is in smooth preview, and if that's the case, actually sub divide it (with proper settings) before export, really annoying to have to do it manually.
should be pretty easy (thats what i always think then ram my head into a wall lol). Got a snow day today so might tinker around with MoP's code. Hope he doesnt hate me.
EDIT: Got it working though not yet in MoP's. Gonna have to browse through his script. Didnt even know I could query that haha.
hey rebb. Is that just a pymel command? Was trying to find if there was something like that for mel.
( It's actually a runtime-command referencing "performSmoothMeshPreviewToPolygon()" )
Heh yep, I wrote this script for our exporter at work too.
Basically it just queries the mesh sub-d preview settings, applies those as a polySmooth, exports the mesh, then deletes the polySmooth node and turns the sub-d preview back on.
I'm still amazed that Maya is so backwards in this regard. At least Turbosmooth in Max exports at the sub-dlevel you set it to.
When running the script, it loads the file dialog, lets me select the obj files and hit import, after which it outputs " p, li { white-space: pre-wrap; } But- no new objects appear in the viewport, or the outliner.
It does output two errors before that:
p, li { white-space: pre-wrap; }
Any clues or fixes will be much appreciated, this could really be a life saver for a current project...
Nadav
Would love to get my hands on this!
My MEL is real basic, only recently got into learning it...fun times!
Anyway, I have written a basic script that allows you to import multiple objs (no exporting unfortunately, atleast not right now). It's not much compared to what MoP's script does. But maybe it's useful to someone?
Let me know if you are interested.
http://www.polycount.com/forum/showthread.php?t=120645
Just make a text file paste all the text in it and overwrite the filename from
blabla.txt to mopMultiObjTool.mel
cheers
cheers!
you could drag and drop multiple objs from the windows explorer into the maya viewport to import them...