On Sat, Sep 29, 2018, 3:47 AM delibrax <[email protected]> wrote:
> Hi there,
>
> I have two function here,
>
> def locator(obj):
> mc.select(cl=1)
> loc = mc.spaceLocator()
> cls = mc.cluster(obj)
> mc.parentConstraint(cls, loc, mo=0)
> mc.delete(cls)
> return obj
>
>
> and another one is here
>
> def snapLocator(obj):
> for i in obj:
> mc.select(cl=1)
> loc = mc.spaceLocator()
> cls = mc.cluster(i)
> mc.parentConstraint(cls, loc, mo=0)
> mc.delete(cls)
> return obj
>
> Because both of them is quite similar so I'm thinking to make those in one
> function. And with that situation I would like to run in maya *with
> pressing ctrl* button and *without ctrl button *keyboard like hotkeys as
> maked difference command. Any idea about if else statement on this case?
> Thank you.
>
What about making one call the other?
def snapLocator(obj):
for i in obj:
locator(I)
return obj
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/fe48e04a-98dd-4441-839f-80a003e2f0c8%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/fe48e04a-98dd-4441-839f-80a003e2f0c8%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA05kxE4OLC_yGzGMmKRYJzpsB-v9qoDM%3DiLJ6eSeu65sQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.