Sketchup clock/time
-
It seems like a daft idea to me but...
Here goes...
You shadow settings location/date/time use whatever is set in the template for a new SKP, or what was last set in a SKP when it was saved...
You can also change all/some of those values 'in code', but you'd need a script that, either ran as the SKP opened [which I don't recommend because it'd be annoying if you had set your location or shadows etc up in a SKP for a particular place/day/time but Sketchup automatically changed it to 'today/now' every time you opened the SKP ]; or, a much better idea, is a Plugins menu item called something like 'Today's Date+Time
' [that leaves the current 'location' alone but lets you change the day/time to 'now' for your own weird reasons].
All you need is this short line of code
Sketchup.active_model.shadow_info["ShadowTime_time_t"]=Time.now.to_i
Copy/paste it +<enter> into the Ruby Console to see what it does...
To make a simple Plugins menu item [to which you can then shortcut if you must] you can use this short block of code inside a new file in the Plugins folder named say#Timenow.rb
- use Notepad.exe or a similar plain-text editor to make it.require 'sketchup.rb' unless file_loaded?(File.basename(__FILE__)) UI.menu("Plugins").add_item("Date|Time Now"){ Sketchup.active_model.shadow_info["ShadowTime_time_t"]=Time.now.to_i } end file_loaded(File.basename(__FILE__))
Save and restart Sketchup to get the new menu item available [note how starting the file-name with a '#' means it'll load early and appear near the start of the Plugins menu items].
-
Awesome. I accept you think I am a bit strange.. I figured that out a long time ago Thanks for the advice and the script!
-
Interesting. It'll be a lot of fun to work in SketchUp after sunset.
-
Hence my comments about its 'daftness'...
BUT as I show it readily IS possible to do it ! -
In other words this modifies lighting in the scene?
-
It sets the SKP's day/time to match the PC's System day/time at the very moment you run the tool [
Time.now.to_i
].
It uses the SKP's current location.
Assuming your SKP is geo-referenced to somewhere near where you are viewing it, then running the tool 'at night' [i.e. on average about 50% of the time] it will mean that you can't see any geometry etc !
If the model is located elsewhere then it's even more complicated ?
Setting your SKP's day/time to match 'now' seems daft to me...
I only supply the code I don't attest to its logic !
-
Honestly sir,
I really admire and use some of your magical wizard plugins indeed.
I think this one is the first exception, since I often draw things after 18:00 -
Perhaps its just me being rather weird again but surely this time change only affects what you see when you render ? I has no effect whatsoever on what I see when I am drawing in the editor. So why is this such a daft idea ?
Interestingly the suggested script yields:
Error Loading File #TimeNow.rb
/Library/Application Support/Google SketchUp 8/SketchUp/Plugins/#TimeNow.rb:6: parse error, unexpected $, expecting kEND
file_loaded(File.basename(FILE)) -
Look at my screen shot. How would you feel about drawing in SketchUp when your model looks like that? Personally I would find it difficult.
-
Marek
Sorry about that !
I made a silly typo in the code [I missed out the 'end' statement]
I've corrected the code in the earlier post...
Retry it... -
Hi Marek,
Just want you to know, I found this [Plugin] Put shadow on current day and hour in the plugin index by accident.
Not really accident, was checking on Matthew's plugins beside Toggle Unit.so, now there are two scripts or plugins about shadow's issue?
-
Now I don't feel quite so mad anymore and I hope all those people who declared me insane will give me a reprieve
-
Like a reverse vampire you can only do your Sketchup modeling during the hours of daylight
-
And you'll like garlic and sleeping in a maternity ward?
-
Funny you should say that....
I still don't understand what TIG means about only doing my Sketchup modelling during daylight hours ? The wierdo mad script to set the shadow clock to real time has no effect (on my iMac) to the Sketchup editor.. it doesn't go dark, I don't see glorious sunsets or sunrises...
Advertisement