WIP on lighting set up Script

here is a script to add different basic light set up in scene

here are some examples of light set up

3/4 point light set up
Light box 1-2 light set up

ect…

Special render

Sepia render
Clay render
sketchup render

Warnings:

Always save your original file under a new name or save it in another folder
to keep your original files.

This script will erase all lights and most empties in a scene for new light set up

So you will loose your scene world values set up and lamps set up in you file.

The program/script cannot guess what your thinking for a specific scene and we had to use average values or estimate some other parameters to design an average light set up!

The light set up assume some general principles of ligthing and use average values
so after adding a new light set up you may have to manually fine tune the set up
by re adjusting lights intensity or location/ rotation to get your final light set up!

to run this

you select an item in menus which you can find in the tool pro area at bottom of tool shelf window
then at bottom you click on the execute to add the new light set up

below the execute button there is a manual erase button to erase all
lamps and empties added by the set up


here is the latest new version i did for this ligthing set up

file sample here

lightbewsetup119.blend (254 KB)

see last post running in 2.65 SVN 51992

this is still a WIP so
Any C & C and suggestions are welcome

Thanks Happy 2.65

menus samples


Great job on the script… But it was missing 2 important things…

  • Registration Entry Point - To work as a plugin the script must register
  • Your name in the author section -Give yourself credit! You contributed allot of code!

I fixed those two things…

sorry as i said only a WIP and still trying to learn python
but any C & C suggestions to improve it is welcome

any other light set up we can do here !

need to pass the color to the lamps not done yet !

should be easy to add now!

have fun with light set ip

but what does the register do now ?
and what does it register

happy 2.5

RickyBlender i tried your setup works apart from the studio setup. i have a little suggestion maybe you could use some simple math to calculate light settings so they work together and give variations on the same setup when it’s enabled (the random module would come in handy there). just an idea :smiley:

here’s the link on the module >>> http://docs.python.org/release/3.0.1/library/random.html

Before your script had to run from the text editor window. The registration section allow the script to be installed as a plugin… This is good for blender noobs who don’t know how to run a python script.

can you be more specific

and for the studio set up what is not working ?
did you use 545 not certain if this can work before that version cause API changes !

what would be random ?

well i wanted to wait a little to make it an addon but
it’ so easy to add it i mean i can still run it from the text editor anyway
so it’s done!LOL

now what else to improve this thing !

happy 2.5

im using 2.56a and i get this error with studio lamps…

File “lightsetupricky5.py”. line 523, in execute
ob=bpy.data.objects[namewall]
KeyError: ‘bpy_prop_collection[key]: key “90dgreeswall” not found’

i think that it’s a missing object or something maybe you need to find a way that doesn’t rely on certain objects in the scene.

well you could randomize an integer to give different lamp energy settings, colors, if it use’s diffuse or specular or not etc… etc… on each lamp setup you have. something like this…


import random
3_point_lamp = random.randint(0,1) # can be wide range as you want

if 3_point_lamp==0:
     # lamp settings here
if 3_point_lamp==1:
     # different lamp settings here

well i’m using 545 from today yafaray

and i don’t see this error anywhere and this is the wall in studio and it is removed ok
on pc PC no error here!

anybody else sees this error ?

not certain if random values for light intensity or spec or col would be something usefull

the idea of the script is to give some specific ligth set up

Etoven can give us your feedback on this random thing !

happy 2.5

I’m using Blender 2.56a Build 34417 and I’m not getting any error with studio lights… One thing I did notice that if you click remove all lamps and there are no lamps in the scene it crashes. There needs to be a check for that…

As for the random thing… I would be more for specific energy settings not random ones.

ok how an a test be done to check if there are any lamp!
may be check the count if = 0

and for color some set up requiries specific color to enhance contrast for instance
and it’s not random at all !

for energie well function of the scene size
if we had IES lamps might be possible to calculate this but until we get theses don’t think there is any way to estimate this!

happy 2.5

Ok, I have just confirmed that this plugin is not compatible with the release from the blender.org website… The problem is that build is to old, and the plugin is written for a more finalized version of blender 2.56. I suggest you go to graphicall.org and download a newer version of blender if you want to use this plugin.

I just had a idea… Maybe we could setup a parameter for a domain object which must be a cube (the script would check to make sure it has only has 6 faces) the script would then integrate threw all the faces on the domain parameter to calculate the scene size. Then the lamp energy could be a function of that calculated size.

Ricky what do you think? I might be able to code that with a little research…

Here is the basic formula to calculate lamp energy as a function of the scene size…


I started on implementing my idea…
I have done the following:

  • Function that checks that domain is a mesh
  • Function that checks that domain is a cube (6 faces)
  • Function that checks that domain is square
  • Function that gets the boundry locations for the domain
  • Function that measures the distance between two objects… (Will need this later)

ok did you integrate the erase with the execute new light set up?

but where did you get the Lamp energie equation
and is this for blender lamp?

this wont tell you how the light intensity is on the scene ?
any reference on this ?

hope it’s a good approximation?

i’ll look a it today?

happy 2.5

Yes

The Lamp energie equation is derived from a function of equations… You’ll just have to trust me, I’m great at high level math. And yes this is for a blender lamp

L = light intensity I called it energy, but I mean the light intensity value

BTW, the lamps haven’t been setup yet… Just most of the calculations required… I’ll working on actually applying it to the lamps this afternoon.

ok if you can evaluate the ligth energie in blender
i did not know there was such equation s available

now if you want real light calculation here is a basic intro to the lumen method
http://web.archive.org/web/20080316005415/http://www.lightcalc.com/glossary.html

but don’t know how to relate this lumen method to inside blender lamp enregie
if you have any relationship let me know please!

this is moving faster then i tough ! LOL

but nice to see it evolve people might begin to use this now !

in which time zone are you located ?
i’m about - 4 or - 5 GMT

thanks and happy 2.5

I’m in eastern standard time GMT - 5 that makes it 10:00 AM right now…