CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 04-05-2013, 04:04 PM   #1
benio33
.
portfolio
Maciej Benczarski
Lead FX TD
Platige Image
Poland
 
Join Date: Oct 2005
Posts: 324
How to convert a single curve to dynamic hair curve using mel/python and get its name

Hello,

I'm facing a problem converting a set of curves to dynamic curves using mel/python and get the new ones names in return, so I can make further operations on them.

Situation is like that, I have curve "curve1". I want to make it dynamic and assign it to hair system "hairSystem1". As Maya creates a new curve for the task I wish to grab the curve's name in return.

... i'm using createHairCurveNode at the moment, but it is incredibly hard to get to work ... :(

Could anyone help?

Thank you,
M.
__________________
Beauty Pass - 3D apps vendors' jest of a lifetime - most of the time it has nothing to do with beauty, and it isn't a pass anyway.
 
Old 04-06-2013, 12:48 PM   #2
djx
Where's my pony?
 
djx's Avatar
David Johnson
vfx & creature td
Melbourne, Australia
 
Join Date: Jun 2003
Posts: 3,389
I also used createHairCurveNode, and I agree that it is not elegant, but it worked ok for me.
Using pymel you can streamline it a bit. First you need to create a hairSystem and a you have your startCurve (I'm assuming you looked up the other args that createHairCurveNode() expects...

Code:
import pymel.core as pm arg_list = [hsys, surf, u, v, numCVs, doOut, doStart, doRest, isPassive, startCurve, length, lastIndex, hsysGroup, hsysOutputHairGroup, simulationType] follicle = pm.mel.createHairCurveNode(*arg_list) follicle = pm.PyNode(follicle) hairSystem = follicle.outHair.connections()[0] hairCurve = follicle.outCurve.connections()[0]


David
__________________
http://www.djx.com.au
 
Old 04-06-2013, 06:47 PM   #3
benio33
.
portfolio
Maciej Benczarski
Lead FX TD
Platige Image
Poland
 
Join Date: Oct 2005
Posts: 324
Quote:
Originally Posted by djx
I also used createHairCurveNode, and I agree that it is not elegant, but it worked ok for me.
Using pymel you can streamline it a bit. First you need to create a hairSystem and a you have your startCurve (I'm assuming you looked up the other args that createHairCurveNode() expects...

Code:
import pymel.core as pm arg_list = [hsys, surf, u, v, numCVs, doOut, doStart, doRest, isPassive, startCurve, length, lastIndex, hsysGroup, hsysOutputHairGroup, simulationType] follicle = pm.mel.createHairCurveNode(*arg_list) follicle = pm.PyNode(follicle) hairSystem = follicle.outHair.connections()[0] hairCurve = follicle.outCurve.connections()[0]


David


Hey David, it works now. I had to make a few connections to nSolver as I'm using nHair, but all's fine now. Thank you.
__________________
Beauty Pass - 3D apps vendors' jest of a lifetime - most of the time it has nothing to do with beauty, and it isn't a pass anyway.
 
Old 04-06-2013, 06:47 PM   #4
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
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 06:01 PM.


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