CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 02-02-2013, 04:31 AM   #1
em3
day dreamer
 
em3's Avatar
portfolio
Dave Tyner
3D Artist
Polyform Media
Denver, United%2BStates
 
Join Date: Jan 2004
Posts: 984
Send a message via Yahoo to em3
daylight system bug?

I am using max 2013 and trying to control a daylight objects position. I wrote a very simple script

Code:
days = for d = 193 to 195 collect d sun2=$daylight001 na=1 for da = 1 to days.count do ( --format "da:% na:%\n" days[da] na with animate on at time na sun2.solar_date.controller.value = days[da] na+=10 )


it works the second time I run it but not the first.Is there a bug with the daylight system?
__________________
www.davetyner.com
 
Old 02-02-2013, 04:43 AM   #2
em3
day dreamer
 
em3's Avatar
portfolio
Dave Tyner
3D Artist
Polyform Media
Denver, United%2BStates
 
Join Date: Jan 2004
Posts: 984
Send a message via Yahoo to em3
Changed the code so that I add the keys, then add the value. Works great. Makes me think the original problem was some kind of screen refresh or something?

Code:
days = for d = 193 to 195 collect d sun2=$daylight001 na=1 for da = 1 to days.count do ( addNewKey sun2.solar_date.controller na sun2.solar_date.controller.keys[i].value = days[da] na+=10 )
__________________
www.davetyner.com
 
Old 02-02-2013, 08:59 AM   #3
spacefrog
Frog of the posts
 
spacefrog's Avatar
Josef Wienerroither
Freelance
Vienna, Austria
 
Join Date: Sep 2002
Posts: 2,427
Just a short notice about the sunsystems date and time controllers for maxscript

You have no access to absolute dates using that method, it's always just an OFFSET from the summer solstice or similar, which gets stored with the daylight system in the moment when it gets created.
As far i remember it even depends on the year (according to the system date) the daylight system you want to controll was created in the scene ( no joke ). So essentially you can't specifiy an exact date for sun positioning, because the value you have to assign to the controllers to get a certain date TOTALLY DEPENDS ON THE DATE the daylight system was created... This is a horrible maxscript interface design oversight

I internally did a recompile of the daylight system plugin which exposes absolut date and time properties ( meaning they are not an offset to some internally stored date, but absolut dates)
__________________

PowerPreview: High Quality Nitrous Previews for 3ds Max 2012|2013|2014

[ Free Download (ScriptSpot) ]

Home of The Frogs | Online Portfolio
 
Old 02-02-2013, 06:39 PM   #4
em3
day dreamer
 
em3's Avatar
portfolio
Dave Tyner
3D Artist
Polyform Media
Denver, United%2BStates
 
Join Date: Jan 2004
Posts: 984
Send a message via Yahoo to em3
Quote:
Originally Posted by spacefrog
Just a short notice about the sunsystems date and time controllers for maxscript

You have no access to absolute dates using that method, it's always just an OFFSET from the summer solstice or similar, which gets stored with the daylight system in the moment when it gets created.
As far i remember it even depends on the year (according to the system date) the daylight system you want to controll was created in the scene ( no joke ). So essentially you can't specifiy an exact date for sun positioning, because the value you have to assign to the controllers to get a certain date TOTALLY DEPENDS ON THE DATE the daylight system was created... This is a horrible maxscript interface design oversight

I internally did a recompile of the daylight system plugin which exposes absolut date and time properties ( meaning they are not an offset to some internally stored date, but absolut dates)


Thanks spacefrog! I did write a time/date translator based on the daylight controller values that is working out pretty good so far.
__________________
www.davetyner.com
 
Old 02-02-2013, 06:39 PM   #5
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 09:48 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.