UI/Python: rename Lamps to Lights, to follow more standard terminology.

Internally it's still mostly named lamps, though some modules like Cycles
were already calling them lights.
This commit is contained in:
Brecht Van Lommel
2018-06-27 14:41:53 +02:00
parent 4ac048f4e4
commit 74fd17e9d7
96 changed files with 899 additions and 939 deletions

View File

@@ -42,11 +42,11 @@ def example_function(text, save_path, render_path):
scene.camera = cam_ob # set the active camera
cam_ob.location = 0.0, 0.0, 10.0
# Lamp
lamp_data = bpy.data.lamps.new("MyLamp", 'POINT')
lamp_ob = bpy.data.objects.new(name="MyCam", object_data=lamp_data)
scene.objects.link(lamp_ob)
lamp_ob.location = 2.0, 2.0, 5.0
# Light
light_data = bpy.data.lights.new("MyLight", 'POINT')
light_ob = bpy.data.objects.new(name="MyCam", object_data=light_data)
scene.objects.link(light_ob)
light_ob.location = 2.0, 2.0, 5.0
if save_path:
bpy.ops.wm.save_as_mainfile(filepath=save_path)

View File

@@ -1,6 +1,6 @@
# Example of a custom widget that defines it's own geometry.
#
# Usage: Select a lamp in the 3D view and drag the arrow at it's rear
# Usage: Select a light in the 3D view and drag the arrow at it's rear
# to change it's energy value.
#
import bpy
@@ -75,7 +75,7 @@ class MyCustomShapeWidget(Manipulator):
)
def _update_offset_matrix(self):
# offset behind the lamp
# offset behind the light
self.matrix_offset.col[3][2] = self.target_get_value("offset") / -10.0
def draw(self, context):
@@ -113,8 +113,8 @@ class MyCustomShapeWidget(Manipulator):
class MyCustomShapeWidgetGroup(ManipulatorGroup):
bl_idname = "OBJECT_WGT_lamp_test"
bl_label = "Test Lamp Widget"
bl_idname = "OBJECT_WGT_light_test"
bl_label = "Test Light Widget"
bl_space_type = 'VIEW_3D'
bl_region_type = 'WINDOW'
bl_options = {'3D', 'PERSISTENT'}
@@ -122,10 +122,10 @@ class MyCustomShapeWidgetGroup(ManipulatorGroup):
@classmethod
def poll(cls, context):
ob = context.object
return (ob and ob.type == 'LAMP')
return (ob and ob.type == 'LIGHT')
def setup(self, context):
# Assign the 'offset' target property to the lamp energy.
# Assign the 'offset' target property to the light energy.
ob = context.object
mpr = self.manipulators.new(MyCustomShapeWidget.bl_idname)
mpr.target_set_prop("offset", ob.data, "energy")

View File

@@ -1,7 +1,7 @@
# Example of a group that edits a single property
# using the predefined manipulator arrow.
#
# Usage: Select a lamp in the 3D view and drag the arrow at it's rear
# Usage: Select a light in the 3D view and drag the arrow at it's rear
# to change it's energy value.
#
import bpy
@@ -10,9 +10,9 @@ from bpy.types import (
)
class MyLampWidgetGroup(ManipulatorGroup):
bl_idname = "OBJECT_WGT_lamp_test"
bl_label = "Test Lamp Widget"
class MyLightWidgetGroup(ManipulatorGroup):
bl_idname = "OBJECT_WGT_light_test"
bl_label = "Test Light Widget"
bl_space_type = 'VIEW_3D'
bl_region_type = 'WINDOW'
bl_options = {'3D', 'PERSISTENT'}
@@ -20,10 +20,10 @@ class MyLampWidgetGroup(ManipulatorGroup):
@classmethod
def poll(cls, context):
ob = context.object
return (ob and ob.type == 'LAMP')
return (ob and ob.type == 'LIGHT')
def setup(self, context):
# Arrow manipulator has one 'offset' property we can assign to the lamp energy.
# Arrow manipulator has one 'offset' property we can assign to the light energy.
ob = context.object
mpr = self.manipulators.new("MANIPULATOR_WT_arrow_3d")
mpr.target_set_prop("offset", ob.data, "energy")
@@ -44,4 +44,4 @@ class MyLampWidgetGroup(ManipulatorGroup):
mpr.matrix_basis = ob.matrix_world.normalized()
bpy.utils.register_class(MyLampWidgetGroup)
bpy.utils.register_class(MyLightWidgetGroup)