Transform nConstraint on hair curve


#1

So I have set up some basic nHair and I am trying to transform constrain a couple CVs on one of the start curves, but have run into an odd issue. No matter which start curve I pick and apply the transform constraint to, Maya seems to always create the constraint on curve1, the first dynamic curve of the whole hair system. The constraint’s locator is still created where it would be expected if the right curves CVs had been constrained. Other than that issue the constraint functions as expected. Hopefully this is something simple that I overlooked, any suggestions?


#2

This is a bug in the constraint creation script. You could create output curves for your hair system then select cvs on those instead of the input curves, but you may not wish to deal with output curves.

Instead you could fix the problem mel script by hand in a text only editor as follows:
Find the file createNConstraint.mel (for example in C:\Program Files\Autodesk\Maya2014\scripts\others)

Find this line (line312):

			string $hairCon = `connectionInfo -sfd ($follicle+".currentPosition")`;

Insert the following code directly after it:

			if( size( $hairCon ) == 0 ){
				string $hairCons[] = `connectionInfo -dfs ($follicle+".outHair")`;
				$hairCon = $hairCons[0];
			}

When you next run Maya you should be able to constrain vertices on the input hair curves.

Duncan


#3

Thanks so much for super quick reply Duncan, I’ll give it a shot!


#4

Okay so it constrains the correct CVs now, but unfortunately that has made it so the constraints locator doesn’t have any effect when moving or rotating :(.


#5

Are you keyframing the constraint position? The transform constraint works relative to the start position of the constrained cvs. The constraint’s transform at the start frame becomes the base transform. So if you move the constraint, but do not keyframe its position, then it will simply lock the positions and not drag them.


#6

I was not keying the position, but now that I have tried that it’s working. Before I fixed the createNconstraint script it would respond by just moving the locator, so I was expecting it to still work like that. There is no problem keying it, I just got confused. Thanks so much for the help!


#7

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.