Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-06-27 15:41:53 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-07-06 21:06:09 +0300
commit74fd17e9d788394fa5bf781bb3e60bca7617b22c (patch)
treea27bcd7e67f74cd0abfeb06b6b9f13e049d736f2 /release/scripts/templates_py
parent4ac048f4e4ef1945fe085c3c0ebf263eb51d8d1b (diff)
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.
Diffstat (limited to 'release/scripts/templates_py')
-rw-r--r--release/scripts/templates_py/background_job.py10
-rw-r--r--release/scripts/templates_py/manipulator_custom_geometry.py12
-rw-r--r--release/scripts/templates_py/manipulator_simple.py14
3 files changed, 18 insertions, 18 deletions
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)