Export hair curves to maya

This script was written by Mario Baldi (BluEgo on CGTalk) in response to my request that he modify his existing zbrush-to-maya hair script. I’m testing it now, but I was hoping the blender/maya community here could battle test it as well so we can provide feedback.

Essentially, this will allow us to use blender for hair grooming and export those results to maya for dynamics and rendering in maya (mental ray/renderman/arnold/vray/whatever)

export_curves.py.zip (3.98 KB)

Here are comments and instructions from Mario:

I decided to go “wild”, and write an exporter for blender:
export_curves.py

This was my very first script for blender, and I really liked it.

I could improve it a bit with more options, but it should do what you need.

So, how to use it?
This is an addon, so you will have to install it first.
Go to File > User Preferences > Addons tab > click on Install Addon and choose export_curves.py.
If you want to keep it in the exporter list even when you close blender, you will have to click on Save as Default.

Now, as this exports only curves, and not poly lines, you will have to convert your hairstyle to curves.
So, after converting the hair particle system to polylines, select the polylines and click “alt-c” and confirm.

Now you are able to save your curves item to .ma.
Go to File > Export > Maya curves (.ma), choose if you want to export only selected curves, then save.

That’s it, let me know if you run into any problems.
I hope you will find it useful http://forums.cgsociety.org/images/smilies/wink.gif

Cheers!

Mario

2 Likes

Haha, I just wrote a script like this. Hadn’t really made it public, but good to see other people realize the potential Blender’s hair tools have over Maya’s!

Edit: My script actually does something different. It writes a file of hair segment coordinates directly from the Blender hair particle system, and the import script in Maya converts the hairs to curves. It’s a little more automated than this.

That sounds awesome too! Less clicking and prep work sounds good to me! I’ll give it a try! Thanks!

Yeah, Maya’s hair grooming tools are absolute crap compared to blender’s. This workflow is a godsend if your trying to render hair in maya.

You can download my addon from my addons link in my signature. You’ll have to change the paths in the .py files. They’re just empty strings right now. Open the .py files in notepad or some other text editor, and type in the path to some temp directory to use as a swap directory between Blender/Maya.

PM me if you need any help. I’d like to get some feedback to improve the workflow.

1 Like

super usefull!
I’ll test later :smiley:

looks like broken in 2.7.

Really great tool.

Made my hair for my characterusing this exporter to render in Maya with Vray.

Thank you very much! :slight_smile:

I just used it in Blender 2.75. First it didn’t work but I tried it again and it worked. Maybe you need to selection only in the export options!

Btw thanx a lot for this script! It just made my day :slight_smile:

@ohsnapitsjoel your script still work perfectly!

Lol, good! I haven’t looked at it in quite a while.

I just created an account to ask doubts. I tried using both the above tool and an youtube video (https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwikqOPFvODUAhXEKY8KHT-XD2UQtwIIIzAA&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Du7qF1J5W8co&usg=AFQjCNELldMtfn40MnTZw2JqErgBxCKaqw) by extruding the curves. Both didn’t work. I am using Blender ver 2.78c. Please, can someone help? I have already created the hair, and I am trying to export it to Maya, for the past one week.

you should convert the hair system to curves beafore exporting.

Can someone update this script to blender 2.8 ?
Thanks in advance

Can anyone please convert this script to work on 2.82, this seems like the only option and hope for us maya users, who want to use blender for curves generation and export that for use in maya. The least anyone can do is at least re-link the dead original link to the tool here,
https://dl.dropboxusercontent.com/u/1670571/blenderscripts/export_curves.py

I tried installing the the .py one above in the very first post, and I did not see any export as .ma in blender under file/export. Or am I missing where it really should be located?

1 Like

Here is it

1 Like

Reupload please.

2 Likes

Sorry for bothering you, but can we get a reupload one more time?

1 Like

You don’t bother me.
Here we goooooooo …

3 Likes

Many thanks!