0
$\begingroup$

For now I do something like this:

import bpy

objs = bpy.data.objects
for obj in objs:
    if obj.type == 'LAMP':
        if obj.data.type == 'SUN':
            sun = obj
            break

text = bpy.data.worlds['World'].node_tree.nodes['Sky Texture']
eul = sun.rotation_euler
text.sun_direction = (0,0,1)
text.sun_direction.rotate(eul)

It seems to work fine. But I have some doubts because of this weird effect near the horizon: enter image description here

$\endgroup$

Your Answer

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

Browse other questions tagged or ask your own question.