Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: J_kelloggs on 2023-04-17, 15:45:18

Title: Maxscript CoronaSun
Post by: J_kelloggs on 2023-04-17, 15:45:18
Hello,
so my goal is to find the parameter to change the position of the sun but for some reason i cant find the one used by corona.
 Making a script to change the position of the corona sun based on the time selected in a drop down menu

this is what i have tried so far but recive this error
Code: [Select]
"06:00": sun.position = eulerangles [0, 0, 0]
Code: [Select]
-- Error occurred in anonymous codeblock; filename: "" position: 899; line: 29
-- MAXScript Rollout Handler Exception:
-- Argument count error: EulerAngles wanted 3, got 1
-- MAXScript callstack:
-- thread data: threadID:9404
-- ------------------------------------------------------
-- [stack level: 0]
-- In TOD.selected(); filename: "" position: 900; line: 29
-- member of: Rollout:SLA
-- Parameters:
-- sel: 2
-- Locals:
-- sel: 2
-- TimeofDay: "06:00"
-- Externals:
-- owner: Rollout:SLA
-- TOD: RolloutControl:TOD in rollout:SLA : ComboBoxControl:TOD
-- SLA: Rollout:SLA
-- sun: Object
-- ------------------------------------------------------
-- [stack level: 1]
-- called from top-level


Title: Re: Maxscript CoronaSun
Post by: Avi on 2023-04-17, 16:24:13
Hi,

is this script any different from the 3ds Max native Daylight system which you can use with Corona sun, that does the same thing?
Title: Re: Maxscript CoronaSun
Post by: J_kelloggs on 2023-04-17, 16:29:11
its basically the same i just need to move the corona sun in the viewport with the maxscript cuz the full code will have things to modify the render settings too just need help with this part of the code
Title: Re: Maxscript CoronaSun
Post by: clemens_at on 2023-04-18, 10:13:04
you are mixing position with rotation.

try:
Code: [Select]
sun.position = [0, 0, 0]
Title: Re: Maxscript CoronaSun
Post by: Avi on 2023-04-20, 16:42:20
Hi,

our devs have suggested the following code. Please try this and let me know if it solves your issue.

Code: [Select]
corona_sun = getNodeByName "Corona Sun001"
corona_sun.position = [5,5,5]

Replace the "Corona Sun001" string by name of the Corona Sun in your scene