It is currently Thu Sep 02, 2010 9:55 pm

Registration
Login Help

Advertise Here

[Plugin] Align Camera Light

FAQMembersRegisterLogin

[Plugin] Align Camera Light

Postby Al Hart on Tue Nov 03, 2009 4:58 am

Our next Rendering Tip is going to suggest that you use lights attached to the camera for easier illumination as you render a scene.

Some rendering packages do not have the ability to snap a light to the camera, so I have provided the attached ruby script to help you align a camera light.

Download IRender_align_camera_light.rb and place it in the SketchUp Plugins folder.

[Edit: uploaded a new version with trace replaced by printf]
irender_align_camera_light.rb


How to use a Camera Light

Step1 - create camera light

Image

Create a component with one or more lights in it.

The origin of the component should be in the location where it will snap to the camera.

The blue axis will be aligned to the line from the camera to the eye.

The green axis be aligned to the cameras up vector.

The red axis will be aligned perpendicularly to the up vector - usually left and right of the camera.

Place any geometry or attributes in the camera_light component which will help illuminate the scene. (The construction lines will not effect the scene)

Do not place any geometry which will obstruct the camera.

Save the component as 'camera_light'

Step 2 - place camera_light component in a drawing

Image

It does not matter where you place it, it will be snapped into position when you align it.

Step 3 - Align Camera Light to camera

Image
Camera light placed in the model
(Zoomed out a bit so that we can see it).

Select Align Camera Light from the plugins menu. ‎

When aligned properly you will not be able to see it.

For testing, it may be handy to zoom out to let you see how the camera has been placed.

Step 4 - Render model with camera light

Image
Scene rendered with camera light.
(Zoomed out a bit. Normally the camera light would not be visible)
(Rendering made with IRender nXt)

Tips

* Two or more spotlights will usually provide the best effect.

* Normally the camera light will not be your only light. It is intended to augment other lighting.

Try it out
Try this our with your renderer and let us know how it works.
You do not have the required permissions to view the files attached to this post.
Al Hart
Image IRender nXt from Render Plus
User avatar
Al Hart
 
Posts: 1157
Joined: Sun Nov 18, 2007 3:54 pm
Location: Centennial, Co
Operating system: XP / Vista
SketchUp version: SU 7 Pro

Re: Align Camera Light

Postby xrok1 on Tue Nov 03, 2009 6:43 am

a very generous gesture Al, thank you.
here's what i get:
You do not have the required permissions to view the files attached to this post.
“There are three classes of people: those who see. Those who see when they are shown. Those who do not see.”

http://www.Twilightrender.com try it!
User avatar
xrok1
 
Posts: 1844
Joined: Sat Feb 16, 2008 1:53 am
Location: Canada
Name: Rocky
Operating system: Window7
SketchUp version: SU7pro

Re: Align Camera Light

Postby Ecuadorian on Tue Nov 03, 2009 6:48 am

Don't despair, Rocky. There's another way to do this: The good old Film & Stage plugin by @Last software, the creators of SketchUp itself. It was designed exactly for this kind of things. With it, you are able to create a camera component and add all the crazy light arrangements you want inside the camera component. All that stuff will follow you as you move the camera when you're looking through it:
camera-light.gif

stage-lights.jpg

The Film & Stage plugin is also the easiest way to copy cameras from one model to another, among other tricks. Download the free Film & Stage Plugin for Windows, or for Mac.
You do not have the required permissions to view the files attached to this post.
Are you reading signatures? Dude, you need to get out more often.
User avatar
Ecuadorian
 
Posts: 1213
Joined: Thu Jan 15, 2009 10:20 pm
Location: Guayaquil, Ecuador
Name: Miguel Lescano
Operating system: Windows 7 Pro 64-bit
SketchUp version: 7.1

Re: Align Camera Light

Postby xrok1 on Tue Nov 03, 2009 6:53 am

cool i have that plugin, i just never thought of modifying the component to include lights! :D
i'm going to give Al the benefit of doubt here and not assume that the 'trace' method is part of the iRender package. ;)
“There are three classes of people: those who see. Those who see when they are shown. Those who do not see.”

http://www.Twilightrender.com try it!
User avatar
xrok1
 
Posts: 1844
Joined: Sat Feb 16, 2008 1:53 am
Location: Canada
Name: Rocky
Operating system: Window7
SketchUp version: SU7pro

Re: [Plugin] Align Camera Light

Postby notareal on Tue Nov 03, 2009 8:42 am

Good reminder! I have used The Film & Stage plugin time to time, too. Adding lights to the component is a nice idea. :thumb:
Welcome to try Thea Render, Thea support | kerkythea.net -team member
notareal
 
Posts: 434
Joined: Tue Nov 13, 2007 9:54 pm
Location: Oulu, Finland
Operating system: Windows 7
SketchUp version: 7

Re: Align Camera Light

Postby Al Hart on Tue Nov 03, 2009 3:36 pm

xrok1 wrote:a very generous gesture Al, thank you.
here's what i get:


oops - remove the trace line, put a # in front or replace it with printf. I'll upload a new copy.
You do not have the required permissions to view the files attached to this post.
Al Hart
Image IRender nXt from Render Plus
User avatar
Al Hart
 
Posts: 1157
Joined: Sun Nov 18, 2007 3:54 pm
Location: Centennial, Co
Operating system: XP / Vista
SketchUp version: SU 7 Pro

Re: Align Camera Light

Postby Al Hart on Tue Nov 03, 2009 3:55 pm

xrok1 wrote:i'm going to give Al the benefit of doubt here and not assume that the 'trace' method is part of the iRender package. ;)


trace(sformat, ...) is a routine like printf(), but it displays the file name and line number when the message is displayed. Ruby developers might find it handy.

Also, because it uses sprintf and puts, you don't need a \n and the end of every message:

something like:

new_value = 123
trace("new value: %s", new_value)


displays

new_value: 123
^^^C:/Program Files/Google/Google SketchUp 7/Plugins/irender_align_camera_light.rb:92


This is handy when debugging ruby files.

Code: Select all
def trace(*args)
   scall = caller(1)[0].to_s # who called the routine      
   begin
      smess = sprintf(*args)   
      puts smess + "\n    ^^^" + scall   # always output argument   
   rescue
      warn "arg ERROR in trace called from: " + caller(1)[0].to_s
   end      
end#def
Al Hart
Image IRender nXt from Render Plus
User avatar
Al Hart
 
Posts: 1157
Joined: Sun Nov 18, 2007 3:54 pm
Location: Centennial, Co
Operating system: XP / Vista
SketchUp version: SU 7 Pro

Re: [Plugin] Align Camera Light

Postby xrok1 on Tue Nov 03, 2009 11:50 pm

Thanks Al! :D
oops - remove the trace line, put a # in front or replace it with printf. I'll upload a new copy.

that did the trick
“There are three classes of people: those who see. Those who see when they are shown. Those who do not see.”

http://www.Twilightrender.com try it!
User avatar
xrok1
 
Posts: 1844
Joined: Sat Feb 16, 2008 1:53 am
Location: Canada
Name: Rocky
Operating system: Window7
SketchUp version: SU7pro

Re: [Plugin] Align Camera Light

Postby Jim on Tue Nov 03, 2009 11:53 pm

Al, would you mind splitting this trace code off to its own thread? It's useful, and being in its own thread would make it easier to find. Thanks.
I probably over-simplified that.
sketchup plugins & news blog
Jim
 
Posts: 2876
Joined: Mon Nov 12, 2007 10:13 pm
Name: Jim Foltz
Operating system: XP Pro SP3
SketchUp version: Google Pro 8.0

Re: [Plugin] Align Camera Light

Postby Al Hart on Wed Nov 04, 2009 12:32 am

Jim wrote:Al, would you mind splitting this trace code off to its own thread? It's useful, and being in its own thread would make it easier to find. Thanks.


Will do
Al Hart
Image IRender nXt from Render Plus
User avatar
Al Hart
 
Posts: 1157
Joined: Sun Nov 18, 2007 3:54 pm
Location: Centennial, Co
Operating system: XP / Vista
SketchUp version: SU 7 Pro

SketchUcation One-Liner Adverts

by Ad Machine on 5 minutes ago

1001bit Tools - Architectural tools for Google SketchUp
Ad Machine
Robot
 
Posts: 2010


 

Advertise Here

Who is online

Users browsing this forum: No registered users and 3 guests