From 74fd17e9d788394fa5bf781bb3e60bca7617b22c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 27 Jun 2018 14:41:53 +0200 Subject: 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. --- release/scripts/templates_py/background_job.py | 10 +++++----- .../scripts/templates_py/manipulator_custom_geometry.py | 12 ++++++------ release/scripts/templates_py/manipulator_simple.py | 14 +++++++------- 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'release/scripts/templates_py') diff --git a/release/scripts/templates_py/background_job.py b/release/scripts/templates_py/background_job.py index 2f444641a51..020dabeb258 100644 --- a/release/scripts/templates_py/background_job.py +++ b/release/scripts/templates_py/background_job.py @@ -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) diff --git a/release/scripts/templates_py/manipulator_custom_geometry.py b/release/scripts/templates_py/manipulator_custom_geometry.py index 48bb6956f85..de324a909db 100644 --- a/release/scripts/templates_py/manipulator_custom_geometry.py +++ b/release/scripts/templates_py/manipulator_custom_geometry.py @@ -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") diff --git a/release/scripts/templates_py/manipulator_simple.py b/release/scripts/templates_py/manipulator_simple.py index 8ddb870cd13..cb10a8b94bb 100644 --- a/release/scripts/templates_py/manipulator_simple.py +++ b/release/scripts/templates_py/manipulator_simple.py @@ -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) -- cgit v1.2.3