Jump to content

Import From Maya With Multiple Shaders


Recommended Posts

I was wondering if there is an easy or a better way to do this.

I have an object with multiple shaders attached to it (to different polygons) Do I have to export individual OBJ for each shader (i.e. I select all polygons a shader is attached to, and export selection to obj.. and so on for each shader)

Another way would be to actually reassign shaders in houdini, by manually selecting polygons and so on for each shader. This might work if you have a simple object, where it would take you literaly 10 minutes to go through geometry and assigne shaders, but it would be a pain with huge object with lots of shaders.

So my question is, what is the best way to export an object from Maya with multiple shader?

Link to comment
Share on other sites

I did a simple (yet to be finished) python script.. which does the task for OBJ objects exported from XSI.... which parse the .obj and the .mtl files and looks for objects.. and creates the VOP net.. and the relative SHOP shader.. and applies it to the correct object (or group in Houdini). It was in my plan to make the same for Maya.. but if you feel ok to do it and you might find usefullwhat I've done already here's the script.

Apparently every 3D app writes the obj file using different "schema"... like XSI writes down lot of notes.. while Maya doesnt... that's why I have to improve my script or write one for Maya and one for XSI.

hope this helps.

XSIOBJ_2_Houdini.py.tar.gz.zip

Link to comment
Share on other sites

  • 8 months later...

I recently came up with a method that was a bit annoying, but it works.

Each polygonal object / null in Maya becomes a group in Houdini.

So for me, I had an airplane. The nose I wanted chrome... the body texture maped, the wheels black etc.

I had combined everything into a single mesh... which is why this was annoying, because when I looked at what Houdini does with a Maya obj, I realized that I would need to break the mesh apart again.

Basically, if you select faces objects based on your texture (ie: rightclick the shader node and select all objects with the shader it will select the different faces.) You can then extract the mesh (you may need to separate first).

So for example, on my propellor. I decided that applying the shader directly to faces rather than through a uv texture map offered the cleanest separation of colors as I wanted the tips to be red, while the rest was white. Modeled it as one object, then extracted the faces to have two.

In the end, you can combine polys back into a series of meshes organized by the shader you want, so if you have 7 shaders, you'll have 7 meshes. Then parent them to a Null, and export the null as obj.

Houdini will read in the obj, and assign a group with the name for each mesh you had in Maya. (plus a default one which I delete as it contains no geo).

No scripts involved, so it could be tedious for lots and lots of models, but hopefully it was a help.

edit: I can't believe I didn't notice the date on this before responding.

Edited by Allegro
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...