I don't know if this is the right way or not, but what about using an
aimConstraint with a locator? It seems like there are more internal
operations happening when you manually move the targetPos manipulator as
opposed to directly setting the attribute. But it works with an
aimConstraint on a locator.

On Tue, Sep 18, 2018 at 12:43 PM Jason Huang <[email protected]>
wrote:

> Hi all,
>
> I am trying to set a VRay rect light's target at the world origin.
>
> I first try to modify the mel code to Python. With moving a rect light's
> target in the viewport, I got the code below as a starting point.
> setAttr "VRayLightRectShape1.targetPos" -type double3 14.13 -108.221315 -
> 203.228502 ;
>
> However, when I execute this as MEL, the target isn't moving at all.
> setAttr "VRayLightRectShape1.targetPos" -type double3 0.0 0.0 0.0 ;
>
> I have also tried anyway in Python the following code.
> cmds.setAttr('VRayLightRectShape1.targetPos', 0.0, 0.0, 0.0, type=
> "double3")
> There is no error but nor is the light's target moving to the world origin.
>
> Is there a way to access a Rect light's target and set its translate or an
> efficient way to set a rect light pointing at the world origin or a locator?
>
>
> Thanks!
>
> --
> 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/7050a496-b852-46c2-85b9-32151253ce8a%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/7050a496-b852-46c2-85b9-32151253ce8a%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/CAPGFgA1OMH78kXQpws7NkXhYqLXe4yuj%3D9D7pLzvuzKVmxYi2g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to