I would like to change a color of an ambient light dynamically, so I thought adding this to the render script’s on_message function:
elseif message_id == "change_ambient_light" then
print("Render","changing ambient light to", message.light)
self.ambient_light = message.light or vmath.vector4(0.05, 0.05, 0.1, 0.1)
update_window(self)
end
and sending a trigger message (in main script’s init after 10 seconds):
timer.delay(10, false, function()
msg.post("@render:", "change_ambient_light", { light = vmath.vector4(0.8, 0.1, 0.05, 0.2) } )
print("sent")
end)
would do, but it’s not working - even "Render",...
message isn’t printed, so I’m quessing the message is sent to the void ("sent"
is printed) Would you please tell me, what am I doing wrong? Is it even possible or should I do something else?