4 Replies Latest reply on Oct 9, 2009 8:15 PM by tyree_2

    How to get location of 3D object in a hierarchy?

    cratica Level 1

      It's easy enough to get the location of a 3D object at the root, but how do I get the location of a 3d object that is in a hierarchy?

       

      For instance, if I have a baseball player (biped - 3dsmax), grouped as "player" and exported to Director, how do I then get the location of the biped's hand?  (or the glove that is linked to the biped's hand).

       

      I tried just doing the basic...

       

      put member("BBplayer").model("glove").transform.position

       

      but director can't find the glove.

       

      It can find the root model "BBplayer", but not any child object.

       

       

      Anyone know how to get the location of a child object?

       

      Thanks!!

        • 1. Re: How to get location of 3D object in a hierarchy?
          Sean_Wilson Adobe Community Professional

          You should use the 3DPI to ensure you have the model name correct. It will also tell you its worldPosition and probably even write you code to determine this!

          • 2. Re: How to get location of 3D object in a hierarchy?
            cratica Level 1

            I'm not sure I understand.   Are you saying that an xtra is required to access a child object's location?

             

            Or are you saying that Director has this capability but I am not using the correct syntax or my object name is wrong?

             

            If it's the object name, I'm 100% positive I am using the correct name of the object (at least as it was name in 3ds max).

             

            Thank you!

            • 3. Re: How to get location of 3D object in a hierarchy?
              cratica Level 1

              I downloaded and installed that xtra and it really just shows the same info that I get in my object inspector.

               

               

              Ok, so for a biped and related skin/mesh/objects to export correctly to the .w3d file type, one has to select all the biped parts and related

              meshes into one Group.  This group then becomes the object in Director that all things are based from.  My charcter looks and animates

              fine in Director.  However, I still can't get coordinate information from anything inside this group or inside the hierarchy of this group, only

              the group itself.

               

              If I look at the group, either in the object inspector or the xtra you suggested, none of the child models appear under modelResources, model or group.  They simply don't show up as being in this group or the children to the group.  Nothing does except a few things that are useless, like "group("Bip01 Footsteps"), or some of the nubs, like headnub, fingernub and a couple of toenubs.  Why some nubs show up and some don't is yet another mystery.

               

              Anyhow, none of this makes logical sense.

               

              I simply want to "get" location information for any 3d model in the scene, regardless of what group it's in or the structure.  Anybody?  It has to be possible, this is a fundamental need of any 3D programming.

               

              Thanks!!!

              • 4. Re: How to get location of 3D object in a hierarchy?
                tyree_2 Level 2

                you need the bone id number, look up bone id in director help. whatever name you gave it in max will be used to get the bone number. director changes all the bone names to numbers. this information is as important, as any other models information. director really shouldnt hide it and instead make it readily available without having to go look for it