Blender to Maya using OBJ. Problems.

Hi guys, I need your help. I have made a big scene in Blender and this scene is a candidate for the next CGtalk Lighting Challege. The organiser of the contest, Jeremy Birn, wants me to send him the scene in OBJ format. But when I export it using the OBJ format, J. Birn says that Maya imports all the objects as a single huge mesh. He wants the objects as in Blender, all separated. I have tried several options in the OBJ export panel, but they does not seem to work. Can you tell me what we are doing wrong, please?

Scene in blender:
http://www.zshare.net/download/63819994ca3dcc/

http://img187.imageshack.us/img187/9960/render11aix0.jpg

you can try to export as DXF. maya has a plugin for importing DXF files but i’m not sure if it’s loaded by default. it can be activated in the plug-in manager, look for “dwgTranslator.mll”.

non ad filled download mirror:
www.loklomedia.com/blender/scene8c.zip

(hope you don’t mind Alvaro)

I’m just experimenting right now on getting blender stuff into maya nicely…

The best method so far is to use the collada 1.4exporter. This will give you the same object set that you have in blender reproduced in maya… I’ve found that you have to set “bake matrices” to off and “Disable physics” to on the other options at your preference…

one otherway would be to export one object at a time to an obj file and load them one at a time into maya…

This is painful to do by hand on a large scene with hundreds of objects, but I guess it wouldn’t be too hard to script (I’d like that script too, if any one has/writes one!)

Then I guess maya would need an import script to read the whole directory of OBJs in…

Unfortunately i haven’t found a way to export multiple UVs yet, the blender collada exporter doesn’t support that yet, though they are working on it apparently!

NB maya world axis has Y as up rather than z and the scale will probably be 10 times or 100 times too small depending on what Maya has as working units. It’s probably easiest to set the cursor to the origin and set it as the transform center then multiselect all of your objects and rotate them 90degrees around X and scale by ten or one hundred… It’s easier to do this in blender than to try to fix in Maya in IMO.

-edit: you need to dowenload the collada plugin for maya from http://www.feelingsoftware.com

I dont have Maya in front,

but damn that scene looks awesome.
The stone objects are impressive - and the rest shows an insanely complex model job!

would you mind using this for class demonstrations in my render class?

You get the credit for the work of course. Students could try texturing and experiment with outdoor scene light setups.

shot me an email if you are interested.

[email protected]

Claas

I tried exporting this blend file with default settings, and the resulting OBJ file has every Blender object as an OBJ Object.
Try open the obj file you export and do a search for "o " (without ") if you dont find any then somthing is wrong with your blender install, otherwise the maya importer is not acting as expected or setup wrong.

You could try turning the objects into groups. replace "o " with "g "

If I export the scene from Blender as an obj

I get one object when I import the obj into Maya

I get a memory error and crash when I try to import (the Blender obj export) back into Blender (WinXP 2gig)

yep, same here…

How about 3ds to max and from max export to obj?

i think the maya OBJ importer and exporter doesn’t do a good job. i have also problems with exporting old maya scenes to OBJ format. many parts of the meshes were just corrupted or even ignored.

Hi, I wrote both exporter and importer, and also tested the scene importing and exporting from blender. The exported obj has nothing wrong with it as far as I can tell.

@Kai Kostack
Id be interested to know what exactly is going wrong. do the models that dont import into maya also fail the same way for other apps? can you provide a blend file?

regarding Memory Errors, This sucks but python is not that memory efficient.
To use less memory when importing, disable all the separate options when importing. - It seems like maya dosnt do separation, maybe this is why :wink:
I could rewrite obj import/export in C to improve this.

Also, If I recall correctly Winxp dosnt let you use more then 1.5 gig of ram per application, or some such limit,
might even be lower…

It may be a maya problem: the maya importer has only one option “import multiple objects?” I’ve treble checked that this is set to “true” but any blender exported obj files come through as one object…

Export and import of obj works fine for me within blender…(I’m mostly on linux though)
I’ve imported work from other artists that I work with through obj and it works fine…

FYI , If I import an obj into silo I get multiple objects,
in maya one object
in max one object, but the dialog tels me it found 167 unsupported commands in the file… (0 unrecognised commands though).

I still think that the cleanest way (free from other apps as middlemen) to get data from blender into maya is via collada…

I’m trawling the net to see if maya has any “alternative” obj importers…

I’ll try using “deep exploration” now to see if that works as a path

hmm… i just remembered i used to have a open-source(i think) app named mesh view or something like that installed, you could check for normals errors and convert file types with it, iirc. ill see if i can find it… :slight_smile:

edit: ahh… it was MeshLab

http://meshlab.sourceforge.net/

maybe of some use to someone.

I’m going to try the Collada route this weekend. Never got it working in the past though.

I really thank you for the help guys.

I also think there is something wrong with the Maya OBJ importer, if you import back the OBJ file in Blender with default options, all objects are separated.

Anyway, Ive send J. Birn the scene with materials, maybe an export “per material” basis will work.

I still think that the cleanest way (free from other apps as middlemen) to get data from blender into maya is via collada…
Thanks for the collada tip Michael, I’ve told Jeremy that tip.

would you mind using this for class demonstrations in my render class?
Of course you can.

no, i meant the importer and exporter from maya not blender’s. your software works pretty well. when i’m exporting scenes from maya i’m often getting very bad meshes with missing parts and such. and maya’s importer doesn’t care about separate objects and i couldn’t find an option to avoid joining everything together. maybe they don’t like easy data exchange of bigger projects with other packages. :confused:

edit:
i found it interesting that when you export multiple objects from maya you can import it back into maya as separate objects. i’ve exported some primitives as OBJ, if you want to have a look into this: primitives.zip

I looked at the file and compared it to a simple obj created in blender…

The blender exporter is prefixing objects with “o”, the maya one is prefixing them with “g”

i’ve changed the prefix on objects in my blender generated obj file, it reloads into blender fine, I’ll just need to check if it’ll load into Maya as individual objects…

(need to do that on my other computer, but I expect it to work…)

If it does perhaps Ideasman42 could add an extra option to the exporter script to allow either flag? It’d be great to enhance the blender -maya workflow!

anyway, I’m off to test now! - will post my result here.

edit: tested it now, the edited obj does indeed load as multiple separate objects in Maya…
It seems from the obj spec that “o” is for object and “g” is for group… perhaps an “export objects as groups” option for the exporter would be best… if it doesn’t cause issues with blender groups…

yet another edit…this is tricky to not get confused with the “object groups” button on the blender exporter… (which exports the blender groups I gather from the tooltip…

It’s a shame that max, maya and deep exploration all seem to ignore the “o” flag or just to treat it as a submesh…

edit: tested it now, the edited obj does indeed load as multiple separate objects in Maya…
It seems from the obj spec that “o” is for object and “g” is for group… perhaps an “export objects as groups” option for the exporter would be best… if it doesn’t cause issues with blender groups…
Seems that we have found the problem. Many thanks. I hope this can help other people too. It seems it will be the scene for the next CGtalk lighting challenge.

Michael W, the options already there.
Under ‘Grouping’ Disable “Objects” and enable “Object Groups”
Then maya should load the files fine, its strange maya dosnt respect multiple objects though.

strange indeed seeing that OBJ is a wavefront format…

thanks for the tip, that’s extremely useful to know!
My mistake was that I didn’t un-check “Objects”, I only checked “Object Groups” in my test…

Good news that this works though!