CGTalk > Main Forums > News
To minimize the ads you see on this page create a CGTalk account and log in HERE
Thread Closed share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 01-30-2012, 06:07 PM   #1
BluEgo
Veteran
portfolio
Mario Baldi
3D Character Artist
Prague, Czechia
 
Join Date: Jun 2002
Posts: 46
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:
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:
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-04-2012 at 07:53 PM.
 
Old 01-30-2012, 07:19 PM   #2
Playmobil
Frequenter
 
Playmobil's Avatar
portfolio
Francesco Lupo
3D Modeler
Rainbow-CGI
Roma, Italy
 
Join Date: Apr 2002
Posts: 130
Send a message via ICQ to Playmobil Send a message via MSN to Playmobil
grande marioneeeee

frk
__________________
Francesco Lupo
-

http://frankinolupo.blogspot.it/
"..ora che ho perso la vista.. ci vedo di più"
 
Old 01-31-2012, 04:25 AM   #3
BluEgo
Veteran
portfolio
Mario Baldi
3D Character Artist
Prague, Czechia
 
Join Date: Jun 2002
Posts: 46
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:
Code:
import fibermesh_to_curves as ftc ftc.fibermesh_to_curves()


...you write:
Code:
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
 
Old 01-31-2012, 12:03 PM   #4
DutchDimension
Think different
 
DutchDimension's Avatar
portfolio
Dutch Dimension
DMP/Environment Artist
MPC
United Kingdom
 
Join Date: Sep 2009
Posts: 1,171
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
 
Old 01-31-2012, 01:03 PM   #5
TheRazorsEdge
detail freak
 
TheRazorsEdge's Avatar
portfolio
Felix Lahme
Essen, Germany
 
Join Date: Apr 2007
Posts: 2,053
Thanks a lot for sharing!

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


 
Old 01-31-2012, 01:16 PM   #6
Horganovski
Freelance Animator/Rigger
 
Horganovski's Avatar
portfolio
Brian Horgan
Graphite9
Dublin, Ireland
 
Join Date: Apr 2007
Posts: 4,791
Really nice script, very handy. The density option in particular makes it really flexible.
Many thanks.

Cheers,
Brian
 
Old 01-31-2012, 09:29 PM   #7
leif3d
Solving 9999 things a day
 
leif3d's Avatar
portfolio
Leif Pedersen
Miami, USA
 
Join Date: Feb 2003
Posts: 1,909
Thanks Mario, this will go well with RMS.
__________________
LEIF3D.com
 
Old 02-01-2012, 12:49 AM   #8
BluEgo
Veteran
portfolio
Mario Baldi
3D Character Artist
Prague, Czechia
 
Join Date: Jun 2002
Posts: 46
Thanks to everyone!

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

Code:
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-04-2012 at 03:27 AM.
 
Old 02-01-2012, 07:43 AM   #9
trashtalk
Lord of the posts
Julian Howard
Saint Louis, USA
 
Join Date: Nov 2005
Posts: 519
Hola.

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


Thx
 
Old 02-01-2012, 10:39 AM   #10
TheRazorsEdge
detail freak
 
TheRazorsEdge's Avatar
portfolio
Felix Lahme
Essen, Germany
 
Join Date: Apr 2007
Posts: 2,053
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-01-2012 at 01:23 PM.
 
Old 02-01-2012, 12:01 PM   #11
DutchDimension
Think different
 
DutchDimension's Avatar
portfolio
Dutch Dimension
DMP/Environment Artist
MPC
United Kingdom
 
Join Date: Sep 2009
Posts: 1,171
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-01-2012 at 12:04 PM.
 
Old 02-01-2012, 02:20 PM   #12
BluEgo
Veteran
portfolio
Mario Baldi
3D Character Artist
Prague, Czechia
 
Join Date: Jun 2002
Posts: 46
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-01-2012 at 02:30 PM.
 
Old 02-01-2012, 08:06 PM   #13
GQ1
Tahiti
 
GQ1's Avatar
portfolio
Garrick Quinones
NYC, USA
 
Join Date: May 2002
Posts: 312
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
__________________

 
Old 02-02-2012, 12:57 AM   #14
BluEgo
Veteran
portfolio
Mario Baldi
3D Character Artist
Prague, Czechia
 
Join Date: Jun 2002
Posts: 46
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-02-2012 at 02:00 PM.
 
Old 02-03-2012, 01:15 AM   #15
GQ1
Tahiti
 
GQ1's Avatar
portfolio
Garrick Quinones
NYC, USA
 
Join Date: May 2002
Posts: 312
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 08:41 PM.


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