# Navigating Constraints

**URL:** https://forum.highend3d.com/t/navigating-constraints/2083
**Category:** Maya
**Tags:** mel
**Created:** [July 17, 2007, 9:06pm UTC](https://forum.highend3d.com/t/navigating-constraints/2083 "2007-07-17T21:06:32Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![daniel-faust](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@daniel-faust](https://forum.highend3d.com/u/daniel-faust)
#### Post date: [July 17, 2007, 9:06pm UTC](https://forum.highend3d.com/t/navigating-constraints/2083/1 "2007-07-17T21:06:32Z")

</div>

Hi,

I have a locator which is constrained to a camera. Starting from the locators tranform, how do I check if the locator is constrained to another object, and, if so, to which object it is constrained to?

Can this only be archieved through navigating the incoming connections on the locators transform and check if the source of that connection is a constraint, and then check what inputs the data into the constraint?

Or is there a special command like $camera = getConstraintTarget("locator1"); avaliable?

Thanks in advance,

Daniel

---

<div class="post-metadata">

### Author: ![ewerybody](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/e/bcef8e/32.png) [@ewerybody](https://forum.highend3d.com/u/ewerybody)
#### Post date: [July 18, 2007, 8:15am UTC](https://forum.highend3d.com/t/navigating-constraints/2083/2 "2007-07-18T08:15:32Z")

</div>

maybe via listConnections ?

for if the selected object is a "controller":  
CODE  
stringArrayRemoveDuplicates(`listConnections -source 1 -destination 0 -type "constraint"`)

or the selection is conntrolled by a constraint:CODE  
stringArrayRemoveDuplicates(`listConnections -source 0 -destination 1 -type "constraint"`)

listConnections spits out the constraint for every attribute. Thats why i put the stringArrayRemoveDuplicates around.  
And of course you can put your object into the call as well.. selection was just for testing.  
 ![]()

---

<div class="post-metadata">

### Author: ![daniel-faust](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@daniel-faust](https://forum.highend3d.com/u/daniel-faust)
#### Post date: [July 18, 2007, 8:29am UTC](https://forum.highend3d.com/t/navigating-constraints/2083/3 "2007-07-18T08:29:30Z")

</div>

Ok, thanks. That's already a lot better than grabbing a .translateX and a .target[0].targetTranslate to get the target. I'll change that.

---

<div class="post-metadata">

### Author: ![ewerybody](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/e/bcef8e/32.png) [@ewerybody](https://forum.highend3d.com/u/ewerybody)
#### Post date: [July 18, 2007, 9:57am UTC](https://forum.highend3d.com/t/navigating-constraints/2083/4 "2007-07-18T09:57:29Z")

</div>

Des isch doch koi Sach.
