Sun animation?

General Project and community related discussion.

Moderator: coordinators

Re: Sun animation?

Postby SATtva » Thu May 13, 2010 4:40 am

Doug, I'm absolutely not blaming you. :) You're right, when the feature is rarely used, it's hard to debug it. Well, maybe I've just found the problem: longitude data in geographic presets is swapped. It seems West longitude should be a positive value, and East longitude -- a negative value, not the opposite. When I swap the sign, both Moscow and New York sun looks correct for a given time of day. I'll fix the data before RC3.
Linux builds packager
聞くのは一時の恥、聞かぬのは一生の恥
User avatar
SATtva
Developer
 
Posts: 5489
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

Re: Sun animation?

Postby dougal2 » Thu May 13, 2010 5:14 am

SATtva wrote:Doug, I'm absolutely not blaming you. :)

I know, just saying... ;)
User avatar
dougal2
Developer
 
Posts: 3073
Joined: Mon Jan 14, 2008 7:21 am

Re: Sun animation?

Postby Abel » Thu May 13, 2010 8:01 am

dougal2 wrote:hrm...that probably goes to show just how often people use it :?
At the time it was implemented I was fairly certain it was correct, and I asked for feedback regarding its accuracy; nobody replied IIRC.

There were some reports in viewtopic.php?f=11&t=3116;. I'm glad the feature is about to get fixed!
User avatar
Abel
Developer
 
Posts: 1413
Joined: Sat Oct 20, 2007 8:13 am
Location: Helsinki, Finland

Re: Sun animation?

Postby dougal2 » Thu May 13, 2010 8:06 am

Yes, I remember that discussion now - the situation remains however that I personally am unable to verify that either the data or the calculations are correct :(
User avatar
dougal2
Developer
 
Posts: 3073
Joined: Mon Jan 14, 2008 7:21 am

Re: Sun animation?

Postby SATtva » Thu May 13, 2010 8:17 am

I tried to enter my city coordinates (with the correct negative longitude), and calculated sun direction mostly corresponds to what I see behind the window, it came up just slightly lower than it is in reality.
Linux builds packager
聞くのは一時の恥、聞かぬのは一生の恥
User avatar
SATtva
Developer
 
Posts: 5489
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

Re: Sun animation?

Postby SATtva » Sat May 15, 2010 9:04 am

I've both updated coordinates data and added an ability of IPO keyframing to datatime: with Lux IPO option enabled you'll see additional option under Geographic Sun with day minutes, you can attach an IPO curve to that field.
Linux builds packager
聞くのは一時の恥、聞かぬのは一生の恥
User avatar
SATtva
Developer
 
Posts: 5489
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

Re: Sun animation?

Postby heretic » Mon May 17, 2010 4:11 am

Personally am sure its used quite often - applies to me and for sure loads more. In my case I plain never verified it (even though I once hit "Now" and it looked different from what I saw outside - I blamed me, not luxrender ;) ).

Bottom line: your effort is greatly appreciated!
-----
3D with blender since November 2009, LuxRender since May 2010. http://www.flickr.com/photos/nur-bilder/
User avatar
heretic
 
Posts: 175
Joined: Thu May 06, 2010 4:48 pm

Re: Sun animation?

Postby MaRo » Mon May 17, 2010 4:17 am

SATtva wrote:I've both updated coordinates data and added an ability of IPO keyframing to datatime: with Lux IPO option enabled you'll see additional option under Geographic Sun with day minutes, you can attach an IPO curve to that field.


Hooo, definitely interesting. Would you be kind enough to put up a very quick tutorial (maybe just a few lines of explanations) for the less knowledgeable in advanced features like IPO curves in Blender? (i.e. myself :oops: )

Anyway, thanks again for the hard work!
"Hello, IT. Have you tried turning it off and on again?"
User avatar
MaRo
 
Posts: 179
Joined: Thu Oct 15, 2009 11:32 am
Location: Villevêque, France

Re: Sun animation?

Postby SATtva » Mon May 17, 2010 10:49 am

Ok, here we go. (In fact, I think it deserves a short tutorial in the wiki. Maybe heretic would find some time to fill that white spot. :)) Lets pretend we want our sunrise to begin at frame 1 and the sunset to be at frame 150.

  1. Add an Empty to your scene, place it anywhere you like.
  2. Select an Empty and open the Ipo Curve Editor window in Blender.
  3. In the right pane of the window click on the property you'll use to animate an Empty. Well, Empty is of no interest to us, we just need a curve to attach it to the Lux property. Lets select a LocZ property as this is the most straightforward and guaranteed to work (not all object properties can be attached to Lux properties: if LuxBlend crashes on you, you'll know to create a curve for another object property :)).
  4. Hold down Ctrl and left-click near the origin of coordinates.
  5. Press N, in Transform Properties enter 1 for Xmin, and 0 for Ymin.
  6. Press Tab to enter Edit Mode for the curve (which doesn't looks like a curve yet :)).
  7. Again, hold down Ctrl and left-click somewhere to the right and above of the first point.
  8. Make sure the newly added point is selected, then in Transform Properties for Vertex X enter frame number 150 (for the sunset), and in Vertex Y enter the number of minutes (starting from 00:00) when the sunset happens at the selected day at selected location. If it is 20:45, enter 1245 in the field (i.e. 20*60+45). The curve will fly up like crazy, but this shouldn't bother us.
  9. Press Tab again to leave Edit Mode.
  10. Press T, and select Linear interpolation for the sun to have a uniform motion speed over the skydome.
Now pay attention to the name of Ipo curve object which is shown in the window's header. By default, it's something like ObIpo. You can click and rename it (to SunIpo, for example) or leave as is, but please remember it, or select the name and press Ctrl+C to copy it.

  1. Open LuxBlend and go to the System tab. Once there, press "Enable Parameter IPO Keyframing" button to, well, to enable IPO Keyframing. :)
  2. Now go to the Cam/Env tab. Activate "Geographic Sun" if you didn't done this already, then press "Sun IPO Keyframing" button, and a little "I" button to the right of "IPO day minutes" field.
  3. In the "Ipo" field which appeared below enter the name of Ipo curve (ObIpo, if you leaved the default one).
  4. The direction of the sun lamp will change according to new data. Most likely it will point in the above direction, because, as you remember, we've set the first point of curve at 0, meaning 00:00. Now you can return back to the Ipo Curve Editor and update the first point of curve. I leave this to you as your homework. ;)
After everything is done, you'll see how sun automatically updates direction as you're going through frames. Please note, however, that pressing Alt+A to preview animation won't update sun lamp dynamically -- LuxBlend updates it only on manual frames shift and during export.
Linux builds packager
聞くのは一時の恥、聞かぬのは一生の恥
User avatar
SATtva
Developer
 
Posts: 5489
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

Re: Sun animation?

Postby MaRo » Tue May 18, 2010 3:00 am

Ah, I can't wait to get out of work, and test it tonight!

And if I manage to get a good grasp of it, I will have a very good reason to buy new hardware to be able to render much faster :mrgreen: , otherwise I will be old before my 250 frames of a complete sunrise->sunset animation are ready :)

Again, thank you very much SATtva, your dedication to help users (like other Lux contributors) is really appreciated!
User avatar
MaRo
 
Posts: 179
Joined: Thu Oct 15, 2009 11:32 am
Location: Villevêque, France

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest