Author Topic: Maxscript CoronaSun  (Read 815 times)

2023-04-17, 15:45:18

J_kelloggs

  • Users
  • *
  • Posts: 2
    • View Profile
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



2023-04-17, 16:24:13
Reply #1

Avi

  • Corona Team
  • Active Users
  • ****
  • Posts: 806
    • View Profile
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?
Arpit Pandey | chaos-corona.com
3D Support Specialist - Corona | contact us

2023-04-17, 16:29:11
Reply #2

J_kelloggs

  • Users
  • *
  • Posts: 2
    • View Profile
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

2023-04-18, 10:13:04
Reply #3

clemens_at

  • Active Users
  • **
  • Posts: 150
    • View Profile
you are mixing position with rotation.

try:
Code: [Select]
sun.position = [0, 0, 0]

2023-04-20, 16:42:20
Reply #4

Avi

  • Corona Team
  • Active Users
  • ****
  • Posts: 806
    • View Profile
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
Arpit Pandey | chaos-corona.com
3D Support Specialist - Corona | contact us