10
$\begingroup$

Basically, I'm wondering if I can set the sun lamp's light direction towards a position, such as an object, with a simple command, rather than doing rotations with R which is hard to control.

$\endgroup$
13
$\begingroup$

One way to do this is with a Track To constraint:

  1. Select the sun lamp
  2. ⇧ Shift select the object you wish to point the lamp at
  3. Press ⎈ CtrlT and choose Track To Constraint.

The sun lamp will now always "look" at that object, so you can move it around with G for easy adjustment.

You can adjust the constraint (or remove it) in the Constraints tab of the Properties area when the sun lamp is active:

enter image description here

$\endgroup$
  • $\begingroup$ Although, this works very well for objects, you won't be able to set the direction to a position in 3D space i.e the location of the 3d cursor pointing to that position. Is there a way to do that? Otherwise I'm happy to accept this as the answer. $\endgroup$ – ManWithAComputer Apr 27 '17 at 4:26
  • $\begingroup$ @ManWithAComputor I'm not aware of anything exactly like that, however should be possible to create a custom operator which does this (using python). As for something native, you can do some stuff with making the lamp the active camera (Ctrl Numpad 0) and using Ctrl Alt Numpad 0 (align camera to view), which when combined with view manipulation shortcuts (e.g. Numpad .) can sort of do this. Not exactly "fast" though. In fact, tracking the sun to an empty and snapping said empty to the cursor location (Shift S) is likely faster. $\endgroup$ – gandalf3 Apr 27 '17 at 6:04
  • 1
    $\begingroup$ @ManWithAComputer, You could use an Empty (an invisible object) and track to that. $\endgroup$ – lumpynose May 2 '17 at 19:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.