How to convert a single curve to dynamic hair curve using mel/python and get its name

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
Old 04 April 2013   #1
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 April 2013   #2
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...

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 April 2013   #3
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...

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 April 2013   #4
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



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 09:10 AM.


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