bpy.ops.object.lamp_add( type='POINT', view_align=False, location=(0.0, 0.0, 0.0), rotation=(0.0, 0.0, 0.0), layers=( False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False) )
.1 There will be create sun lamp located at 5 to x-axis, 2 to y-axis and 1 to z-axis.
.2 Create spot lamp with location and rotation parameters. Assign current active object into lamp1 object variable. And then add name to current active lamp object.
bpy.ops.object.lamp_add( type='SPOT', location=(-0.7,-0.5,0.3), rotation=(1.223,-0.960), ) lamp1 = bpy.context.active_object.data lamp1.name="key Light"
.3 Change lamp type, If lamp will be sky or environment.
if light_type in ['SKY', 'ENV']: lamp.type = 'HEMI'
.4 First calculate rotation by using math library, then create area lamp by using rotation parameters.
import bpy from math import pi bpy.ops.object.lamp_add(type='AREA', ... , rotation=(0, (pi * degrees / 180), 0))
.5 Change last lamp energy.
bpy.data.lamp[-1].energy = 0.6
Who get fresh code scripts from codrate!
Will send your codrate site configuration email in your mail account.
codrate.com is a standard, fast cross browsing and highly versatile site. It is useful for many large number of Program Development Industries. So you can get support form Codrators , who are the codrate's joiners around world to help your program developments, You can answer other codrator's questions. Communicate with them. Share your knowledge with them. Do you have an interest in programming, So publish your articles about programming. It will help to maintain your professional co-profile. Actually codrate.com is not such as a regular web site. It will be gave new experience, best narrow cross-browser view, reduce processing time to receive browsing request, it's mean do not wasting your time to browsing codrate's web pages because it has been upgrade always modern coding ways. So, what do you waiting for ?. Try your own.