Fibermesh to maya curves (script)

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  01 January 2012
Fibermesh to maya curves (script)

Well, it looks like there are a lot of fibermesh conversion plugs out there

This is my contribution, a free script to convert fibermesh to maya curves:

fibermesh_to_curves.py

Currently the main drawback in maya, is that every curve is a single item, so after a certain number the scene becomes slower.
Anyway curves should be used as guides, not to be rendered as they are. In the next release (maybe tonight) I will add a control to generate only a certain percent amount of curves.

To use it:
- copy the script in your script folder
- in a shelf button, copy this code:

  import fibermesh_to_curves as ftc
   ftc.fibermesh_to_curves()
   


Please let me know if you'lll find some bugs and I will fix them

UPDATE:

You can also launch the script in gui mode, with this code:
import fibermesh_to_curves as ftc 
ftc.fibermesh_to_curves(guiMode=True)


And here there are two small videos showing the script in action:
Running the script
Converting curves to maya hair

Last edited by BluEgo : 02 February 2012 at 07:53 PM.
 
  01 January 2012
grande marioneeeee

frk
__________________
Francesco Lupo
-

http://frankinolupo.blogspot.it/
"..ora che ho perso la vista.. ci vedo di più"
 
  01 January 2012
Thanks Frankino

I just added the chance to specify a tolerance value.
This value must be in the range (0..1), where 1 means that all the fiber curves will be generated

So, if instead of writing:
import fibermesh_to_curves as ftc 
ftc.fibermesh_to_curves()


...you write:
import fibermesh_to_curves as ftc 
ftc.fibermesh_to_curves(0.5)


...then you will generate exactly half the curves.

Next days i will write a mel interface, such that it will be easier to interact with this value
 
  01 January 2012
Excellent work BluEgo. I’ll venture to try out our script when I get the chance.

And thank you for your generosity!
__________________
"Even the Christmas vacation will be darkened by New Zealand scripts…"
~ J.R.R. Tolkien, The Letters of J.R.R. Tolkien, Letter 34
 
  01 January 2012
Thanks a lot for sharing!

Cheers!
__________________
"Knowing is not enough, we must apply. Willing is not enough, we must do."-Bruce Lee


 
  01 January 2012
Really nice script, very handy. The density option in particular makes it really flexible.
Many thanks.

Cheers,
Brian
 
  01 January 2012
Thanks Mario, this will go well with RMS.
__________________
LEIF3D.com
 
  02 February 2012
Thanks to everyone!

I just updated the above link with the mini-gui.
To activate it, copy this code in a shelf button:


import fibermesh_to_curves as ftc
ftc.fibermesh_to_curves(guiMode=True)


You can still use the script in the old way, specifying a value between the parenthesys instead of launching the gui.

I hadn't the time to see if there are any bugs so far. It looks to work though. Please report any problem and I will try to solve them.

I am also considering to develop some tools for the generated curves, as I am not new to this kind of stuff.
The first I would like to do is to rebuild curves proportionally according their length, specifing a min/max number of vertices, and automatically generate and hair system.

Last edited by BluEgo : 02 February 2012 at 03:27 AM.
 
  02 February 2012
Hola.

I'm a newbie and on a Mac. Which script folder path should I place the python script into?


Thx
 
  02 February 2012
I tested the script a little bit yesterday in both Maya 2009 and 2012 SAP and so far everything works like a charm. The only thing I noticed is that the curves are reversed/the starting cv is at the tip of the hair. Well, it's nothing that a quick "Reverse Curve" can't fix, but under certain circumstances something to be aware of.
Adding a gui is icing on the cake. I'll check the new version out today.
Mille gracie, Mario!

Cheers!

PS: Your additional ideas sound great!
__________________
"Knowing is not enough, we must apply. Willing is not enough, we must do."-Bruce Lee



Last edited by TheRazorsEdge : 02 February 2012 at 01:23 PM.
 
  02 February 2012
Okay, just tried the latest version of the script in Maya 2012 and get this warning:

# Warning: Not all selected edges were used in the curve. Selection must form a continuous, non-branching path. #


The script does not generate full curves along the entire length of the fibers. Instead the generated curves consist of just a single edge for each fiber.

Any ideas?

edit: Okay… this anomaly seems to happen through the use of GoZ.
When I export the Fibers subtool via the 'Tool->Export' procedure, and Import the resulting .OBJ manually into Maya, the script works as expected.
__________________
"Even the Christmas vacation will be darkened by New Zealand scripts…"
~ J.R.R. Tolkien, The Letters of J.R.R. Tolkien, Letter 34

Last edited by DutchDimension : 02 February 2012 at 12:04 PM.
 
  02 February 2012
Hey DutchDimension,
thank you a lot for your feedback!

I didn't know about that, I always import objs.

I will fix it in a way you could import both trough obj and goz.


@trashtalk: Here there are all the paths you need (look for PYTHONPATH):
http://download.autodesk.com/us/may...help/index.html

Last edited by BluEgo : 02 February 2012 at 02:30 PM.
 
  02 February 2012
Thumbs up

[/QUOTE]
I am also considering to develop some tools for the generated curves, as I am not new to this kind of stuff.
The first I would like to do is to rebuild curves proportionally according their length, specifing a min/max number of vertices, and automatically generate and hair system.[/QUOTE]

That will be great for us new to using hair in Maya.
Thanks
__________________

 
  02 February 2012
So, I just updated the link above.
I wrote a general purpose routine to recognize the pattern of a poly strip.
It should work with goz now (and not only, even with hand made poly strips), but I still have to try with it.
Please report any issue and let me know if it works ;-)

Edit:
Mhhh, it looks like it still doesnt' work with goz. I have to figure out what happens when files are transmitted with it.

Last edited by BluEgo : 02 February 2012 at 02:00 PM.
 
  02 February 2012
could someone do a quick video tut on how to setup this script and then adding a hair system for a simple render from Mentalray.
Just a ball with fiber hair on it would be helpful to see someones process.
__________________

 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 03:16 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.