Announcement

Collapse
No announcement yet.

Attaching an object to a face / vertex

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Attaching an object to a face / vertex

    I'm working on a fish model for a game on the upcoming journey 3D DVD. What I am trying to do is attach an object ( namely and eyeball ) to a skinned mesh. I am using 3dsmax 9 and the skin modifier. I vaguely remember a modifier for doing this, but cannot seem to find it now - any idea's ?

    Thanks a million as always


    Adam

  • #2
    Skin wrapper could work.
    Lasse Kilpia
    VFX Artist
    Post Control Helsinki

    Comment


    • #3
      I usually use a position script controller on the child object

      Code:
      getvert $'parentobj' 109
      Where "parentobj" = the mesh you want o follow and "109" is the vertex number you want it to follow
      Eric Boer
      Dev

      Comment


      • #4
        An attachment controller will do the same thing. It attaches the object to a single face on the source object and then uses barycentric coordinates (learned that from Bobo's DVD) to position the object within the face. You can cycle through the face numbers or simply type it in if you know which one you want.

        Different combinations in the A and B slots will give you one of the three verts and lock it on there pretty well.

        Last edited by jonahhawk; 19-06-2008, 08:30 PM.

        Comment


        • #5
          Cool!

          I haven't used the position script before. What is the rest of the code to get it to stick to the vert over time as the mesh deforms? some sort of loop to get it to update and check the position at each frame?

          The differences from the Attachment Controller are that getting the object to track normal to the surface would require more scripting (I'm slooooowly learning this from above DVD). Also that bit of code requires that the source object be an Editable Mesh.

          If the source object is named Sphere01, for editable poly the code is

          Code:
          polyop.getvert $Sphere01 109

          Comment


          • #6
            Originally posted by jonahhawk View Post
            Cool!

            I haven't used the position script before. What is the rest of the code to get it to stick to the vert over time as the mesh deforms? some sort of loop to get it to update and check the position at each frame?

            The differences from the Attachment Controller are that getting the object to track normal to the surface would require more scripting (I'm slooooowly learning this from above DVD). Also that bit of code requires that the source object be an Editable Mesh.

            If the source object is named Sphere01, for editable poly the code is

            Code:
            polyop.getvert $Sphere01 109
            It evaluates at every frame so no more code is needed, I haven't tried the attachment controller, will give it a look.
            Eric Boer
            Dev

            Comment


            • #7
              ah now I see. It doesn't update the position until the timeline is scrubbed. I kept rotating the parent and the child didn't move. Odd.

              Does this happen with your setup as well Eric?

              That is pretty fun to play with though. Adding an orientation constraint to the rotation of the child seems to help the updating as I do anything to the parent. This is a great little tip. Thanks!
              Last edited by jonahhawk; 20-06-2008, 03:01 AM.

              Comment


              • #8
                Sweet

                Sweet - thanks a million I can't wait to give these a try

                Thanks again

                Comment


                • #9
                  One should maybe point out that the attachment controller also orients the object to the triangle in question, while the script doesn't.
                  Signing out,
                  Christian

                  Comment


                  • #10
                    Originally posted by jonahhawk View Post
                    ...

                    The differences from the Attachment Controller are that getting the object to track normal to the surface would require more scripting...
                    Isn't that what I said?

                    Comment

                    Working...
                    X