david | animation,mel script | Saturday, November 11th, 2006

I've just updated djRivet.mel to make it work with maya 7 (previously it was maya 8 only). Only a couple of minor changes were required. The main thing to note is that if you are using maya 7 then you will also need to install and load the closestPointOnMesh plugin that comes with the maya 7 bonus tools. (Maya 8 installs the plugin by default.)

djRivet.mel can be used to constrain objects to the surface of a poly mesh or a nurbs surface. The target surface can then be deformed or transformed and the objects will stick to it and move with it without themselves being deformed.

Each object is parent-constrained to a follicle which is attached to the target surface at a specified uv coordinate, which can be fine tuned or animated after the attachment is made.

The script was inspired by Michael Bazhutkin who created rivet.mel a few years back, using a more complicated system of nodes and construction history. I used rivet.mel for several years and would still recommend it to people using versions of maya that don't have access to the follicle node, which is part of maya hair.

28 Aug 2007 update


  1. Hi David. First I'd like to thank you for this wonderful script, it helped me a lot :)
    I'm facing a problem now. I attached an object (a button model) on another object (a coat model), when I rotate the coat, the button stick to the position on the coat but its rotation doesn't follow.
    I've checked and found out that the follicle doesn't follow the facing direction of the poly surface. Did you encounter this problem before? Do you know how to solve it? Cause I'm stuck at there :(


    Comment by chyo — August 27, 2007 @ 1:42 pm

  2. Chyo, I'm not sure what went wrong, but I have a question. Is it the follicle or the button object that is not rotating? If it is the follicle then something must have gone wrong with the internal connections. The only way I have been able to reproduce this behavior is to manually delete a connection to the follicle. If you want to email me a sample scene file that shows the problem I can look at it for you.

    thanks for your feedback

    Comment by david — August 28, 2007 @ 1:03 am

  3. Chyo, I have looked at your scene. The problem seems to be with the maya7 follicleShape node not correctly interpreting the surface normals, and this is due to the way the surface uv's are layed out in small discontinuous shells. If the uv's are in larger shells then the follicles behave correctly. Try stitching together some of those shells and reattach the buttons. (The problem has been fixed in maya 8.5, where your scene works correctly)

    good luck

    Comment by david — August 30, 2007 @ 12:19 am

  4. Hi David~
    this mel really useful.Thank you for sharing it.
    but I got a problem now , I have a character with skinCluster , many feather follow the skin by the djRivet , it work perfactly , but when I scale the Main control to scale the character , all feather move away to the wrong position .do you know Why ??
    really need your help , and really thank you~


    Comment by cypher — May 11, 2013 @ 12:02 am

  5. Hi David~
    I figure out it , the follicle need to be scaleConstraint !~ha ha ~
    thank you again !~


    Comment by cypher — May 11, 2013 @ 6:36 pm

  6. You beat me to it! Glad you figured it out.
    I actually have an updated version of the script (now in python) that has optional scaleConstraint built in. I probably should update the download - and I will in the near future.


    Comment by david — May 11, 2013 @ 11:35 pm

RSS feed for comments on this post.

Leave a comment

You must be logged in to post a comment.

Powered by WordPress | Based on a theme by Roy Tanck