diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-07-06 20:59:17 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-07-06 20:59:17 +0300 |
commit | 6aa8e130eff59059886e203ff95221609f63b222 (patch) | |
tree | fe478c4920c5b2f602349eb2c216d2b653b5176b | |
parent | 7216192171a35c56523f9abcb279eb8a0a33577b (diff) |
Update for renaming lamp to light.
52 files changed, 318 insertions, 318 deletions
diff --git a/add_advanced_objects_menu/__init__.py b/add_advanced_objects_menu/__init__.py index 42a33445..e0388bf7 100644 --- a/add_advanced_objects_menu/__init__.py +++ b/add_advanced_objects_menu/__init__.py @@ -108,8 +108,8 @@ class INFO_MT_scene_elements_add(Menu): # Define the "Lights" menu -class INFO_MT_mesh_lamps_add(Menu): - bl_idname = "INFO_MT_scene_lamps" +class INFO_MT_mesh_lights_add(Menu): + bl_idname = "INFO_MT_scene_lights" bl_label = "Lighting Sets" def draw(self, context): @@ -191,7 +191,7 @@ def menu(self, context): layout.operator_context = 'INVOKE_REGION_WIN' self.layout.separator() self.layout.menu("INFO_MT_scene_elements", icon="SCENE_DATA") - self.layout.menu("INFO_MT_scene_lamps", icon="LAMP_SPOT") + self.layout.menu("INFO_MT_scene_lights", icon="LIGHT_SPOT") self.layout.separator() self.layout.menu("INFO_MT_array_mods", icon="MOD_ARRAY") self.layout.menu("INFO_MT_quick_tools", icon="MOD_BUILD") diff --git a/add_advanced_objects_menu/add_light_template.py b/add_advanced_objects_menu/add_light_template.py index 9e2c139f..5b4fbc86 100644 --- a/add_advanced_objects_menu/add_light_template.py +++ b/add_advanced_objects_menu/add_light_template.py @@ -5,10 +5,10 @@ from bpy.types import Operator from bpy.props import BoolProperty -def add_lamps(self, context): +def add_lights(self, context): if self.bKeyLight: - keyLight = bpy.data.lamps.new(name="Key_Light", type="SPOT") + keyLight = bpy.data.lights.new(name="Key_Light", type="SPOT") ob = bpy.data.objects.new("Key_Light", keyLight) constraint = ob.constraints.new(type='COPY_LOCATION') constraint.use_offset = True @@ -23,7 +23,7 @@ def add_lamps(self, context): ob.rotation_euler[2] = -0.785398 if self.bFillLight: - fillLight = bpy.data.lamps.new(name="Fill_Light", type="SPOT") + fillLight = bpy.data.lights.new(name="Fill_Light", type="SPOT") ob = bpy.data.objects.new("Fill_Light", fillLight) constraint = ob.constraints.new(type='COPY_LOCATION') constraint.use_offset = True @@ -39,7 +39,7 @@ def add_lamps(self, context): ob.data.energy = 0.3 if self.bBackLight: - backLight = bpy.data.lamps.new(name="Back_Light", type="SPOT") + backLight = bpy.data.lights.new(name="Back_Light", type="SPOT") ob = bpy.data.objects.new("Back_Light", backLight) constraint = ob.constraints.new(type='COPY_LOCATION') constraint.use_offset = True @@ -121,7 +121,7 @@ class OBJECT_OT_add_light_template(Operator): self.target = context.active_object self.camera = context.scene.camera - add_lamps(self, context) + add_lights(self, context) except Exception as e: self.report({'WARNING'}, diff --git a/add_advanced_objects_menu/copy2.py b/add_advanced_objects_menu/copy2.py index 489f6dee..9a94ac1d 100644 --- a/add_advanced_objects_menu/copy2.py +++ b/add_advanced_objects_menu/copy2.py @@ -168,7 +168,7 @@ def copy_to_from(scene, to_obj, from_obj, copymode, axes, edgescale, scale): if copymode == 'E': # don't pass edgescalling to object types that cannot be scaled - if from_obj.type in ["CAMERA", "LAMP", "EMPTY", "ARMATURE", "SPEAKER", "META"]: + if from_obj.type in ["CAMERA", "LIGHT", "EMPTY", "ARMATURE", "SPEAKER", "META"]: edgescale = False edge_copy(scene, to_obj, from_obj, axes, edgescale, scale) diff --git a/add_advanced_objects_menu/scene_objects_bi.py b/add_advanced_objects_menu/scene_objects_bi.py index f189bb11..f8afd906 100644 --- a/add_advanced_objects_menu/scene_objects_bi.py +++ b/add_advanced_objects_menu/scene_objects_bi.py @@ -47,7 +47,7 @@ class add_BI_scene(Operator): bpy.ops.view3d.viewnumpad(type='CAMERA') # add point lamp - bpy.ops.object.lamp_add( + bpy.ops.object.light_add( type="POINT", location=(4.07625, 1.00545, 5.90386), rotation=(0.650328, 0.055217, 1.866391) ) @@ -59,7 +59,7 @@ class add_BI_scene(Operator): lamp1.use_sphere = True # add point lamp2 - bpy.ops.object.lamp_add( + bpy.ops.object.light_add( type="POINT", location=(-0.57101, -4.24586, 5.53674), rotation=(1.571, 0, 0.785) ) diff --git a/add_advanced_objects_menu/scene_objects_cycles.py b/add_advanced_objects_menu/scene_objects_cycles.py index 85e85867..b6831791 100644 --- a/add_advanced_objects_menu/scene_objects_cycles.py +++ b/add_advanced_objects_menu/scene_objects_cycles.py @@ -47,7 +47,7 @@ class add_cycles_scene(Operator): bpy.ops.view3d.viewnumpad(type='CAMERA') # add point lamp - bpy.ops.object.lamp_add( + bpy.ops.object.light_add( type="POINT", location=(4.07625, 1.00545, 5.90386), rotation=(0.650328, 0.055217, 1.866391) ) @@ -59,7 +59,7 @@ class add_cycles_scene(Operator): lamp1.use_sphere = True # add point lamp2 - bpy.ops.object.lamp_add( + bpy.ops.object.light_add( type="POINT", location=(-0.57101, -4.24586, 5.53674), rotation=(1.571, 0, 0.785) ) diff --git a/add_advanced_objects_menu/trilighting.py b/add_advanced_objects_menu/trilighting.py index e0068e66..c163a894 100644 --- a/add_advanced_objects_menu/trilighting.py +++ b/add_advanced_objects_menu/trilighting.py @@ -173,7 +173,7 @@ class TriLighting(Operator): backx = obj_position.x + self.distance * singleback_vector.x backy = obj_position.y + self.distance * singleback_vector.y - backData = bpy.data.lamps.new(name="TriLamp-Back", type=self.secondarytype) + backData = bpy.data.lights.new(name="TriLamp-Back", type=self.secondarytype) backData.energy = backEnergy backLamp = bpy.data.objects.new(name="TriLamp-Back", object_data=backData) @@ -196,7 +196,7 @@ class TriLighting(Operator): rightx = obj_position.x + self.distance * singleright_vector.x righty = obj_position.y + self.distance * singleright_vector.y - rightData = bpy.data.lamps.new(name="TriLamp-Fill", type=self.secondarytype) + rightData = bpy.data.lights.new(name="TriLamp-Fill", type=self.secondarytype) rightData.energy = fillEnergy rightLamp = bpy.data.objects.new(name="TriLamp-Fill", object_data=rightData) scene.objects.link(rightLamp) @@ -215,7 +215,7 @@ class TriLighting(Operator): leftx = obj_position.x + self.distance * singleleft_vector.x lefty = obj_position.y + self.distance * singleleft_vector.y - leftData = bpy.data.lamps.new(name="TriLamp-Key", type=self.primarytype) + leftData = bpy.data.lights.new(name="TriLamp-Key", type=self.primarytype) leftData.energy = keyEnergy leftLamp = bpy.data.objects.new(name="TriLamp-Key", object_data=leftData) diff --git a/archimesh/__init__.py b/archimesh/__init__.py index cb22e157..b1a70a3a 100644 --- a/archimesh/__init__.py +++ b/archimesh/__init__.py @@ -53,7 +53,7 @@ if "bpy" in locals(): importlib.reload(achm_kitchen_maker) importlib.reload(achm_shelves_maker) importlib.reload(achm_books_maker) - importlib.reload(achm_lamp_maker) + importlib.reload(achm_light_maker) importlib.reload(achm_curtain_maker) importlib.reload(achm_venetian_maker) importlib.reload(achm_main_panel) @@ -66,7 +66,7 @@ else: from . import achm_venetian_maker from . import achm_door_maker from . import achm_kitchen_maker - from . import achm_lamp_maker + from . import achm_light_maker from . import achm_main_panel from . import achm_roof_maker from . import achm_room_maker @@ -108,7 +108,7 @@ class AchmInfoMtMeshDecorationAdd(Menu): # noinspection PyUnusedLocal def draw(self, context): self.layout.operator("mesh.archimesh_books", text="Add Books") - self.layout.operator("mesh.archimesh_lamp", text="Add Lamp") + self.layout.operator("mesh.archimesh_light", text="Add Lamp") self.layout.operator("mesh.archimesh_roller", text="Add Roller curtains") self.layout.operator("mesh.archimesh_venetian", text="Add Venetian blind") self.layout.operator("mesh.archimesh_japan", text="Add Japanese curtains") @@ -210,7 +210,7 @@ def register(): bpy.utils.register_class(achm_kitchen_maker.AchmExportInventory) bpy.utils.register_class(achm_shelves_maker.AchmShelves) bpy.utils.register_class(achm_books_maker.AchmBooks) - bpy.utils.register_class(achm_lamp_maker.AchmLamp) + bpy.utils.register_class(achm_light_maker.AchmLamp) bpy.utils.register_class(achm_curtain_maker.AchmRoller) bpy.utils.register_class(achm_curtain_maker.AchmJapan) bpy.utils.register_class(achm_venetian_maker.AchmVenetian) @@ -321,7 +321,7 @@ def unregister(): bpy.utils.unregister_class(achm_kitchen_maker.AchmExportInventory) bpy.utils.unregister_class(achm_shelves_maker.AchmShelves) bpy.utils.unregister_class(achm_books_maker.AchmBooks) - bpy.utils.unregister_class(achm_lamp_maker.AchmLamp) + bpy.utils.unregister_class(achm_light_maker.AchmLamp) bpy.utils.unregister_class(achm_curtain_maker.AchmRoller) bpy.utils.unregister_class(achm_curtain_maker.AchmJapan) bpy.utils.unregister_class(achm_venetian_maker.AchmVenetian) diff --git a/archimesh/achm_lamp_maker.py b/archimesh/achm_lamp_maker.py index a6b15435..67fbfc1e 100644 --- a/archimesh/achm_lamp_maker.py +++ b/archimesh/achm_lamp_maker.py @@ -130,7 +130,7 @@ def set_preset(self): # Lamps # ------------------------------------------------------------------ class AchmLamp(Operator): - bl_idname = "mesh.archimesh_lamp" + bl_idname = "mesh.archimesh_light" bl_label = "Lamp" bl_description = "Lamp Generator" bl_category = 'Archimesh' @@ -375,7 +375,7 @@ class AchmLamp(Operator): self.oldpreset = self.preset # Create lamp - create_lamp_mesh(self) + create_light_mesh(self) return {'FINISHED'} else: self.report({'WARNING'}, "Archimesh: Option only valid in Object mode") @@ -386,13 +386,13 @@ class AchmLamp(Operator): # Generate mesh data # All custom values are passed using self container (self.myvariable) # ------------------------------------------------------------------------------ -def create_lamp_mesh(self): +def create_light_mesh(self): # deactivate others for o in bpy.data.objects: if o.select is True: o.select = False bpy.ops.object.select_all(False) - generate_lamp(self) + generate_light(self) return @@ -401,13 +401,13 @@ def create_lamp_mesh(self): # Generate lamps # All custom values are passed using self container (self.myvariable) # ------------------------------------------------------------------------------ -def generate_lamp(self): +def generate_light(self): location = bpy.context.scene.cursor_location myloc = copy(location) # copy location to keep 3D cursor position # --------------------- # Lamp base # --------------------- - mydata = create_lamp_base("Lamp_base", self.base_height, + mydata = create_light_base("Lamp_base", self.base_height, myloc.x, myloc.y, myloc.z, self.base_segments, self.base_rings, [self.br01, self.br02, self.br03, self.br04, self.br05, self.br06, @@ -429,7 +429,7 @@ def generate_lamp(self): # --------------------- # Lampholder # --------------------- - myholder = create_lampholder("Lampholder", self.holder, + myholder = create_lightholder("Lampholder", self.holder, myloc.x, myloc.y, myloc.z, self.crt_mat) # refine @@ -444,7 +444,7 @@ def generate_lamp(self): # --------------------- # Lamp strings # --------------------- - mystrings = create_lampholder_strings("Lampstrings", self.holder, + mystrings = create_lightholder_strings("Lampstrings", self.holder, myloc.x, myloc.y, myloc.z, self.tr02, self.top_height, @@ -460,7 +460,7 @@ def generate_lamp(self): # --------------------- # Lampshade # --------------------- - mytop = create_lampshade("Lampshade", self.top_height, + mytop = create_lightshade("Lampshade", self.top_height, myloc.x, myloc.y, myloc.z, self.top_segments, self.tr01, self.tr02, @@ -517,7 +517,7 @@ def generate_lamp(self): # mat: Flag for creating materials # objcol: Color # ------------------------------------------------------------------------------ -def create_lamp_base(objname, height, px, py, pz, segments, rings, radios, ratios, subdivide, mat, objcol): +def create_light_base(objname, height, px, py, pz, segments, rings, radios, ratios, subdivide, mat, objcol): # Calculate heights h = height / (rings - 1) listheight = [] @@ -562,7 +562,7 @@ def create_lamp_base(objname, height, px, py, pz, segments, rings, radios, ratio # pZ: position Z axis # mat: Flag for creating materials # ------------------------------------------------------------------------------ -def create_lampholder(objname, height, px, py, pz, mat): +def create_lightholder(objname, height, px, py, pz, mat): mydata = create_cylinder_data(16, [0, height, height + 0.005, height + 0.008, height + 0.05], [0.005, 0.005, 0.010, 0.018, 0.018], False, False, False, 0, False) @@ -600,7 +600,7 @@ def create_lampholder(objname, height, px, py, pz, mat): # shadeh: height of lampshader # mat: Flag for creating materials # ------------------------------------------------------------------------------ -def create_lampholder_strings(objname, height, px, py, pz, radio, shadeh, mat): +def create_lightholder_strings(objname, height, px, py, pz, radio, shadeh, mat): mydata = create_cylinder_data(32, [height + 0.005, height + 0.005, height + 0.006, height + 0.006], [0.018, 0.025, 0.025, 0.018], False, False, False, 0, False) @@ -652,7 +652,7 @@ def create_lampholder_strings(objname, height, px, py, pz, radio, shadeh, mat): # opacity: opacity factor # mat: Flag for creating materials # ------------------------------------------------------------------------------ -def create_lampshade(objname, height, px, py, pz, segments, radio1, radio2, pleats, pleatsize, opacity, mat): +def create_lightshade(objname, height, px, py, pz, segments, radio1, radio2, pleats, pleatsize, opacity, mat): gap = 0.002 radios = [radio1 - gap, radio1 - gap, radio1, radio2, radio2 - gap, radio2 - gap] heights = [gap * 2, 0, 0, height, height, height - (gap * 2)] diff --git a/archimesh/achm_main_panel.py b/archimesh/achm_main_panel.py index d12c2a6b..e69a048f 100644 --- a/archimesh/achm_main_panel.py +++ b/archimesh/achm_main_panel.py @@ -462,10 +462,10 @@ class ArchimeshMainPanel(Panel): # Prop Buttons # ------------------------------ box = layout.box() - box.label("Props", icon='LAMP_DATA') + box.label("Props", icon='LIGHT_DATA') row = box.row() row.operator("mesh.archimesh_books") - row.operator("mesh.archimesh_lamp") + row.operator("mesh.archimesh_light") row = box.row() row.operator("mesh.archimesh_venetian") row.operator("mesh.archimesh_roller") diff --git a/archipack/archipack_floor.py b/archipack/archipack_floor.py index 8664b637..a367470e 100644 --- a/archipack/archipack_floor.py +++ b/archipack/archipack_floor.py @@ -337,7 +337,7 @@ class FloorGenerator(CutAblePolygon, CutAbleGenerator): segments=1, # d.bevel_res profile=0.5, vertex_only=False, - clamp_overlap=False, + clight_overlap=False, material=-1) bm.to_mesh(o.data) diff --git a/archipack/archipack_roof.py b/archipack/archipack_roof.py index aba6f12e..d848d170 100644 --- a/archipack/archipack_roof.py +++ b/archipack/archipack_roof.py @@ -1868,7 +1868,7 @@ class RoofGenerator(CutAbleGenerator): segments=d.tile_bevel_segs, profile=0.5, vertex_only=False, - clamp_overlap=True, + clight_overlap=True, material=-1) if d.tile_solidify: diff --git a/archipack/archipack_thumbs.py b/archipack/archipack_thumbs.py index 8f652ab2..bfc9d55e 100644 --- a/archipack/archipack_thumbs.py +++ b/archipack/archipack_thumbs.py @@ -111,7 +111,7 @@ def generateThumb(context, cls, preset): p.data.materials.append(m) # add 3 lights - bpy.ops.object.lamp_add( + bpy.ops.object.light_add( type='POINT', radius=1, view_align=False, @@ -123,7 +123,7 @@ def generateThumb(context, cls, preset): emit = nodes["Emission"] emit.inputs[1].default_value = 2000.0 - bpy.ops.object.lamp_add( + bpy.ops.object.light_add( type='POINT', radius=1, view_align=False, @@ -137,7 +137,7 @@ def generateThumb(context, cls, preset): falloff.inputs[0].default_value = 5 tree.links.new(falloff.outputs[2], emit.inputs[1]) - bpy.ops.object.lamp_add( + bpy.ops.object.light_add( type='POINT', radius=1, view_align=False, diff --git a/archipack/archipack_window.py b/archipack/archipack_window.py index 3524fbbf..167a27fc 100644 --- a/archipack/archipack_window.py +++ b/archipack/archipack_window.py @@ -993,7 +993,7 @@ class archipack_window(ArchipackObject, Manipulable, PropertyGroup): def find_portal(self, o): for child in o.children: - if child.type == 'LAMP': + if child.type == 'LIGHT': return child return None @@ -1002,7 +1002,7 @@ class archipack_window(ArchipackObject, Manipulable, PropertyGroup): lamp = self.find_portal(o) if self.portal: if lamp is None: - bpy.ops.object.lamp_add(type='AREA') + bpy.ops.object.light_add(type='AREA') lamp = context.active_object lamp.name = "Portal" lamp.parent = o @@ -1025,7 +1025,7 @@ class archipack_window(ArchipackObject, Manipulable, PropertyGroup): d = lamp.data context.scene.objects.unlink(lamp) bpy.data.objects.remove(lamp) - bpy.data.lamps.remove(d) + bpy.data.lights.remove(d) context.scene.objects.active = o @@ -1658,7 +1658,7 @@ class ARCHIPACK_PT_window(Panel): box.prop(prop, 'hole_inside_mat') box.prop(prop, 'hole_outside_mat') - layout.prop(prop, 'portal', icon="LAMP_AREA") + layout.prop(prop, 'portal', icon="LIGHT_AREA") class ARCHIPACK_PT_window_panel(Panel): @@ -1751,11 +1751,11 @@ class ARCHIPACK_OT_window(ArchipackCreateTool, Operator): if archipack_window.filter(o): bpy.ops.archipack.disable_manipulate() for child in o.children: - if child.type == 'LAMP': + if child.type == 'LIGHT': d = child.data context.scene.objects.unlink(child) bpy.data.objects.remove(child) - bpy.data.lamps.remove(d) + bpy.data.lights.remove(d) elif 'archipack_hole' in child: context.scene.objects.unlink(child) bpy.data.objects.remove(child, do_unlink=True) diff --git a/archipack/bmesh_utils.py b/archipack/bmesh_utils.py index 3f402d1d..1157d9a3 100644 --- a/archipack/bmesh_utils.py +++ b/archipack/bmesh_utils.py @@ -216,7 +216,7 @@ class BmeshEdit(): segments=1, profile=0.5, vertex_only=False, - clamp_overlap=True, + clight_overlap=True, material=-1, use_selection=True): """ @@ -245,7 +245,7 @@ class BmeshEdit(): segments=segments, profile=profile, vertex_only=vertex_only, - clamp_overlap=clamp_overlap, + clight_overlap=clight_overlap, material=material) bm.to_mesh(o.data) diff --git a/io_export_after_effects.py b/io_export_after_effects.py index 4a5c6b92..6f29c2fd 100644 --- a/io_export_after_effects.py +++ b/io_export_after_effects.py @@ -110,7 +110,7 @@ def get_selected(context): # not ready yet. is_plane(object) returns False in all cases. This is temporary solids.append([ob, convert_name(ob.name)]) - elif ob.type == 'LAMP': + elif ob.type == 'LIGHT': lights.append([ob, ob.data.type + convert_name(ob.name)]) # Type of lamp added to name else: diff --git a/io_export_dxf/export_dxf.py b/io_export_dxf/export_dxf.py index b6e51531..edaeff4a 100644 --- a/io_export_dxf/export_dxf.py +++ b/io_export_dxf/export_dxf.py @@ -27,7 +27,7 @@ if DEBUG: from .model.migiusModel import MigiusDXFLibDrawing -SUPPORTED_TYPES = ('MESH')#,'CURVE','EMPTY','TEXT','CAMERA','LAMP') +SUPPORTED_TYPES = ('MESH')#,'CURVE','EMPTY','TEXT','CAMERA','LIGHT') def exportDXF(context, filePath, settings): """ @@ -277,8 +277,8 @@ def _exportItem(ctx, o, mw, drawing, settings): elif (o.type == 'CAMERA') and settings['camera_as']: from .primitive_exporters.camera_exporter import CameraDXFExporter e = CameraDXFExporter(settings) - elif (o.type == 'LAMP') and settings['lamp_as']: - from .primitive_exporters.lamp_exporter import LampDXFExporter + elif (o.type == 'LIGHT') and settings['light_as']: + from .primitive_exporters.light_exporter import LampDXFExporter e = LampDXFExporter(settings) return e.export(ctx, drawing, o, mx, mx_n, color=ecolor, layer=elayer, lineType=eltype) diff --git a/io_export_dxf/operator.py b/io_export_dxf/operator.py index a2d9dcf7..39848b1d 100644 --- a/io_export_dxf/operator.py +++ b/io_export_dxf/operator.py @@ -160,10 +160,10 @@ class DXFExporter(bpy.types.Operator): # ('VIEW', 'VIEW', ''), # ('POINT', 'POINT', '') # ) -# lamp_asItems = ( +# light_asItems = ( # ('NO', 'Do not export', ''), # ('..BLOCK', '..BLOCK', ''), -# ('..A_LAMP', '..A_LAMP', ''), +# ('..A_LIGHT', '..A_LIGHT', ''), # ('POINT', 'POINT', '') # ) # --------- CONTROL PROPERTIES -------------------------------------------- @@ -207,9 +207,9 @@ class DXFExporter(bpy.types.Operator): # camera_as = EnumProperty( name="Export camera As:", default='NO', # description="Select representation of a camera", # items=camera_asItems) -# lamp_as = EnumProperty( name="Export lamp As:", default='NO', +# light_as = EnumProperty( name="Export lamp As:", default='NO', # description="Select representation of a lamp", -# items=lamp_asItems) +# items=light_asItems) # ---------------------------------------------------------- entitylayer_from = EnumProperty(name="Entity Layer", default="obj.data.name", description="Entity LAYER assigned to?", @@ -265,7 +265,7 @@ class DXFExporter(bpy.types.Operator): # 'group_as' : self._checkNO(self.group_as), # 'proxy_as' : self._checkNO(self.proxy_as), # 'camera_as' : self._checkNO(self.camera_as), -# 'lamp_as' : self._checkNO(self.lamp_as), +# 'light_as' : self._checkNO(self.light_as), 'entitylayer_from' : self.entitylayer_from, 'entitycolor_from' : self.entitycolor_from, diff --git a/io_export_dxf/primitive_exporters/lamp_exporter.py b/io_export_dxf/primitive_exporters/lamp_exporter.py index 01a65abd..2265d6ad 100644 --- a/io_export_dxf/primitive_exporters/lamp_exporter.py +++ b/io_export_dxf/primitive_exporters/lamp_exporter.py @@ -13,7 +13,7 @@ def exportLamp(ob, mx, mw, **common): [p] = toGlobalOrigin([p]) entities = [] - c = lamp_as_list[GUI_A['lamp_as'].val] + c = light_as_list[GUI_A['light_as'].val] if c=="POINT": # export as POINT dxfPOINT = DXF.Point(points=[p],**common) entities.append(dxfPOINT) diff --git a/io_export_unreal_psk_psa.py b/io_export_unreal_psk_psa.py index ca22ca46..ca331912 100644 --- a/io_export_unreal_psk_psa.py +++ b/io_export_unreal_psk_psa.py @@ -1201,8 +1201,8 @@ def parse_mesh(mesh, psk): # does with the mesh Y coordinates. this is otherwise known as MAGIC-2 uv[1] = 1.0 - uv[1] - # clamp UV coords if udk_option_clamp_uv is True - if bpy.context.scene.udk_option_clamp_uv: + # clamp UV coords if udk_option_clight_uv is True + if bpy.context.scene.udk_option_clight_uv: if (uv[0] > 1): uv[0] = 1 if (uv[0] < 0): @@ -2422,7 +2422,7 @@ class Panel_UDKExport(Panel): object_name = context.active_object.name row10 = layout.row() row10.prop(context.scene, "udk_option_smoothing_groups") - row10.prop(context.scene, "udk_option_clamp_uv") + row10.prop(context.scene, "udk_option_clight_uv") row10.prop(context.scene, "udk_option_verbose") row = layout.row() @@ -2792,7 +2792,7 @@ class ExportUDKAnimData(Operator): scene = context.scene layout.prop(scene, "udk_option_smoothing_groups") - layout.prop(scene, "udk_option_clamp_uv") + layout.prop(scene, "udk_option_clight_uv") layout.prop(scene, "udk_option_verbose") layout.prop(scene, "udk_option_filename_src") layout.prop(scene, "udk_option_export") @@ -2888,7 +2888,7 @@ def register(): description="Boolean for exporting psa format (Animation Data)", default=True ) - bpy.types.Scene.udk_option_clamp_uv = BoolProperty( + bpy.types.Scene.udk_option_clight_uv = BoolProperty( name="Clamp UV", description="True is to limit Clamp UV co-ordinates to [0-1]. False is unrestricted (x,y)", default=False @@ -2977,7 +2977,7 @@ def unregister(): del bpy.types.Scene.udk_option_filename_src del bpy.types.Scene.udk_option_export_psk del bpy.types.Scene.udk_option_export_psa - del bpy.types.Scene.udk_option_clamp_uv + del bpy.types.Scene.udk_option_clight_uv del bpy.types.Scene.udk_copy_merge del bpy.types.Scene.udk_option_export del bpy.types.Scene.udk_option_verbose diff --git a/io_import_dxf/dxfimport/do.py b/io_import_dxf/dxfimport/do.py index e570f9d7..117faede 100644 --- a/io_import_dxf/dxfimport/do.py +++ b/io_import_dxf/dxfimport/do.py @@ -738,7 +738,7 @@ class Do: if self.import_light: type_map = ["NONE", "SUN", "POINT", "SPOT"] layer = self.dwg.layers[en.layer] - lamp = bpy.data.lamps.new(en.name, type_map[en.light_type]) + lamp = bpy.data.lights.new(en.name, type_map[en.light_type]) if en.color != 256: aci = en.color else: diff --git a/io_mesh_pdb/__init__.py b/io_mesh_pdb/__init__.py index dcf9ec4a..7ad7d39f 100644 --- a/io_mesh_pdb/__init__.py +++ b/io_mesh_pdb/__init__.py @@ -82,7 +82,7 @@ class ImportPDB(Operator, ImportHelper): use_camera = BoolProperty( name="Camera", default=False, description="Do you need a camera?") - use_lamp = BoolProperty( + use_light = BoolProperty( name="Lamp", default=False, description = "Do you need a lamp?") ball = EnumProperty( @@ -162,7 +162,7 @@ class ImportPDB(Operator, ImportHelper): layout = self.layout row = layout.row() row.prop(self, "use_camera") - row.prop(self, "use_lamp") + row.prop(self, "use_light") row = layout.row() row.prop(self, "use_center") # Balls @@ -256,7 +256,7 @@ class ImportPDB(Operator, ImportHelper): self.sticks_radius, self.use_center, self.use_camera, - self.use_lamp, + self.use_light, filepath_pdb) return {'FINISHED'} diff --git a/io_mesh_pdb/import_pdb.py b/io_mesh_pdb/import_pdb.py index a7a0be7d..564d26a1 100644 --- a/io_mesh_pdb/import_pdb.py +++ b/io_mesh_pdb/import_pdb.py @@ -536,7 +536,7 @@ def build_stick(radius, length, sectors): # Function, which puts a camera and light source into the 3D scene def camera_light_source(use_camera, - use_lamp, + use_light, object_center_vec, object_size): @@ -592,27 +592,27 @@ def camera_light_source(use_camera, release_confirm=False) # Here a lamp is put into the scene, if chosen. - if use_lamp == True: + if use_light == True: # This is the distance from the object measured in terms of % # of the camera distance. It is set onto 50% (1/2) distance. - lamp_dl = sqrt(object_size) * 15 * 0.5 + light_dl = sqrt(object_size) * 15 * 0.5 # This is a factor to which extend the lamp shall go to the right # (from the camera point of view). - lamp_dy_right = lamp_dl * (3.0/4.0) + light_dy_right = light_dl * (3.0/4.0) # Create x, y and z for the lamp. - object_lamp_vec = Vector((lamp_dl,lamp_dy_right,lamp_dl)) - lamp_xyz_vec = object_center_vec + object_lamp_vec + object_light_vec = Vector((light_dl,light_dy_right,light_dl)) + light_xyz_vec = object_center_vec + object_light_vec # Create the lamp current_layers=bpy.context.scene.layers - lamp_data = bpy.data.lamps.new(name="A_lamp", type="POINT") - lamp_data.distance = 500.0 - lamp_data.energy = 3.0 - lamp_data.shadow_method = 'RAY_SHADOW' - lamp = bpy.data.objects.new("A_lamp", lamp_data) - lamp.location = lamp_xyz_vec + light_data = bpy.data.lights.new(name="A_light", type="POINT") + light_data.distance = 500.0 + light_data.energy = 3.0 + light_data.shadow_method = 'RAY_SHADOW' + lamp = bpy.data.objects.new("A_light", light_data) + lamp.location = light_xyz_vec lamp.layers = current_layers bpy.context.scene.objects.link(lamp) @@ -1145,7 +1145,7 @@ def import_pdb(Ball_type, Stick_diameter, put_to_center, use_camera, - use_lamp, + use_light, filepath_pdb): @@ -1376,7 +1376,7 @@ def import_pdb(Ball_type, # CAMERA and LIGHT SOURCES camera_light_source(use_camera, - use_lamp, + use_light, object_center_vec, object_size) diff --git a/io_online_sketchfab/__init__.py b/io_online_sketchfab/__init__.py index bad00e82..e483d17a 100644 --- a/io_online_sketchfab/__init__.py +++ b/io_online_sketchfab/__init__.py @@ -247,7 +247,7 @@ class ExportSketchfab(Operator): with open(SKETCHFAB_EXPORT_DATA_FILE, 'w') as s: json.dump({ "models": props.models, - "lamps": props.lamps, + "lights": props.lights, }, s) subprocess.check_call([ @@ -311,7 +311,7 @@ class VIEW3D_PT_sketchfab(Panel): layout.label("Export:") col = layout.box().column(align=True) col.prop(props, "models") - col.prop(props, "lamps") + col.prop(props, "lights") layout.label("Model info:") col = layout.box().column(align=True) diff --git a/io_online_sketchfab/pack_for_export.py b/io_online_sketchfab/pack_for_export.py index e9fbde72..9177b44e 100644 --- a/io_online_sketchfab/pack_for_export.py +++ b/io_online_sketchfab/pack_for_export.py @@ -87,12 +87,12 @@ def prepare_assets(export_settings): images.add(image) if ((export_settings['models'] == 'SELECTION' and ob.type == 'MESH') or - (export_settings['lamps'] == 'SELECTION' and ob.type == 'LAMP')): + (export_settings['lamps'] == 'SELECTION' and ob.type == 'LIGHT')): if not ob.select and not ob.hide: ob.hide = True hidden.add(ob) - elif export_settings['lamps'] == 'NONE' and ob.type == 'LAMP': + elif export_settings['lamps'] == 'NONE' and ob.type == 'LIGHT': if not ob.hide: ob.hide = True hidden.add(ob) diff --git a/io_scene_3ds/import_3ds.py b/io_scene_3ds/import_3ds.py index 862fe2a7..cf17edcd 100644 --- a/io_scene_3ds/import_3ds.py +++ b/io_scene_3ds/import_3ds.py @@ -83,27 +83,27 @@ MAT_24BIT_COLOR = 0x0011 # color defined as 3 bytes #>------ sub defines of OBJECT OBJECT_MESH = 0x4100 # This lets us know that we are reading a new object -OBJECT_LAMP = 0x4600 # This lets un know we are reading a light object -OBJECT_LAMP_SPOT = 0x4610 # The light is a spotloght. -OBJECT_LAMP_OFF = 0x4620 # The light off. -OBJECT_LAMP_ATTENUATE = 0x4625 -OBJECT_LAMP_RAYSHADE = 0x4627 -OBJECT_LAMP_SHADOWED = 0x4630 -OBJECT_LAMP_LOCAL_SHADOW = 0x4640 -OBJECT_LAMP_LOCAL_SHADOW2 = 0x4641 -OBJECT_LAMP_SEE_CONE = 0x4650 -OBJECT_LAMP_SPOT_RECTANGULAR = 0x4651 -OBJECT_LAMP_SPOT_OVERSHOOT = 0x4652 -OBJECT_LAMP_SPOT_PROJECTOR = 0x4653 -OBJECT_LAMP_EXCLUDE = 0x4654 -OBJECT_LAMP_RANGE = 0x4655 -OBJECT_LAMP_ROLL = 0x4656 -OBJECT_LAMP_SPOT_ASPECT = 0x4657 -OBJECT_LAMP_RAY_BIAS = 0x4658 -OBJECT_LAMP_INNER_RANGE = 0x4659 -OBJECT_LAMP_OUTER_RANGE = 0x465A -OBJECT_LAMP_MULTIPLIER = 0x465B -OBJECT_LAMP_AMBIENT_LIGHT = 0x4680 +OBJECT_LIGHT = 0x4600 # This lets un know we are reading a light object +OBJECT_LIGHT_SPOT = 0x4610 # The light is a spotloght. +OBJECT_LIGHT_OFF = 0x4620 # The light off. +OBJECT_LIGHT_ATTENUATE = 0x4625 +OBJECT_LIGHT_RAYSHADE = 0x4627 +OBJECT_LIGHT_SHADOWED = 0x4630 +OBJECT_LIGHT_LOCAL_SHADOW = 0x4640 +OBJECT_LIGHT_LOCAL_SHADOW2 = 0x4641 +OBJECT_LIGHT_SEE_CONE = 0x4650 +OBJECT_LIGHT_SPOT_RECTANGULAR = 0x4651 +OBJECT_LIGHT_SPOT_OVERSHOOT = 0x4652 +OBJECT_LIGHT_SPOT_PROJECTOR = 0x4653 +OBJECT_LIGHT_EXCLUDE = 0x4654 +OBJECT_LIGHT_RANGE = 0x4655 +OBJECT_LIGHT_ROLL = 0x4656 +OBJECT_LIGHT_SPOT_ASPECT = 0x4657 +OBJECT_LIGHT_RAY_BIAS = 0x4658 +OBJECT_LIGHT_INNER_RANGE = 0x4659 +OBJECT_LIGHT_OUTER_RANGE = 0x465A +OBJECT_LIGHT_MULTIPLIER = 0x465B +OBJECT_LIGHT_AMBIENT_LIGHT = 0x4680 OBJECT_CAMERA = 0x4700 # This lets un know we are reading a camera object @@ -596,7 +596,7 @@ def process_next_chunk(file, previous_chunk, importedObjects, IMAGE_SEARCH): new_chunk.bytes_read += temp_chunk.bytes_read - elif new_chunk.ID == OBJECT_LAMP: # Basic lamp support. + elif new_chunk.ID == OBJECT_LIGHT: # Basic lamp support. temp_data = file.read(STRUCT_SIZE_3FLOAT) @@ -604,7 +604,7 @@ def process_next_chunk(file, previous_chunk, importedObjects, IMAGE_SEARCH): new_chunk.bytes_read += STRUCT_SIZE_3FLOAT # no lamp in dict that would be confusing - contextLamp[1] = bpy.data.lamps.new("Lamp", 'POINT') + contextLamp[1] = bpy.data.lights.new("Lamp", 'POINT') contextLamp[0] = ob = bpy.data.objects.new("Lamp", contextLamp[1]) SCN.objects.link(ob) @@ -946,8 +946,8 @@ def load_3ds(filepath, axis_min = [1000000000] * 3 axis_max = [-1000000000] * 3 - global_clamp_size = IMPORT_CONSTRAIN_BOUNDS - if global_clamp_size != 0.0: + global_clight_size = IMPORT_CONSTRAIN_BOUNDS + if global_clight_size != 0.0: # Get all object bounds for ob in importedObjects: for v in ob.bound_box: @@ -963,7 +963,7 @@ def load_3ds(filepath, axis_max[2] - axis_min[2]) scale = 1.0 - while global_clamp_size < max_axis * scale: + while global_clight_size < max_axis * scale: scale = scale / 10.0 scale_mat = mathutils.Matrix.Scale(scale, 4) diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py index 9611cb1f..4a8bfc89 100644 --- a/io_scene_fbx/__init__.py +++ b/io_scene_fbx/__init__.py @@ -314,13 +314,13 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper): options={'ENUM_FLAG'}, items=(('EMPTY', "Empty", ""), ('CAMERA', "Camera", ""), - ('LAMP', "Lamp", ""), + ('LIGHT', "Lamp", ""), ('ARMATURE', "Armature", "WARNING: not supported in dupli/group instances"), ('MESH', "Mesh", ""), ('OTHER', "Other", "Other geometry types, like curve, metaball, etc. (converted to meshes)"), ), description="Which kind of object to export", - default={'EMPTY', 'CAMERA', 'LAMP', 'ARMATURE', 'MESH', 'OTHER'}, + default={'EMPTY', 'CAMERA', 'LIGHT', 'ARMATURE', 'MESH', 'OTHER'}, ) use_mesh_modifiers = BoolProperty( diff --git a/io_scene_fbx/export_fbx.py b/io_scene_fbx/export_fbx.py index e62d512d..704614ef 100644 --- a/io_scene_fbx/export_fbx.py +++ b/io_scene_fbx/export_fbx.py @@ -236,7 +236,7 @@ header_comment = \ def save_single(operator, scene, filepath="", global_matrix=None, context_objects=None, - object_types={'EMPTY', 'CAMERA', 'LAMP', 'ARMATURE', 'MESH'}, + object_types={'EMPTY', 'CAMERA', 'LIGHT', 'ARMATURE', 'MESH'}, use_mesh_modifiers=True, mesh_smooth_type='FACE', use_armature_deform_only=False, @@ -423,7 +423,7 @@ def save_single(operator, scene, filepath="", matrix_rot = (global_matrix * self.__anim_poselist[frame]).to_3x3() # Lamps need to be rotated - if obj_type == 'LAMP': + if obj_type == 'LIGHT': matrix_rot = matrix_rot * mtx_x90 elif obj_type == 'CAMERA': y = matrix_rot * Vector((0.0, 1.0, 0.0)) @@ -520,7 +520,7 @@ def save_single(operator, scene, filepath="", matrix_rot = rot.to_matrix() # Lamps need to be rotated - if ob and ob.type == 'LAMP': + if ob and ob.type == 'LIGHT': matrix_rot = matrix_rot * mtx_x90 elif ob and ob.type == 'CAMERA': y = matrix_rot * Vector((0.0, 1.0, 0.0)) @@ -1243,8 +1243,8 @@ def save_single(operator, scene, filepath="", Property: "CurrentMappingType", "enum", "",0 Property: "UVSwap", "bool", "",0''') - fw('\n\t\t\tProperty: "WrapModeU", "enum", "",%i' % tex.use_clamp_x) - fw('\n\t\t\tProperty: "WrapModeV", "enum", "",%i' % tex.use_clamp_y) + fw('\n\t\t\tProperty: "WrapModeU", "enum", "",%i' % tex.use_clight_x) + fw('\n\t\t\tProperty: "WrapModeV", "enum", "",%i' % tex.use_clight_y) fw(''' Property: "TextureRotationPivot", "Vector3D", "",0,0,0 @@ -1809,8 +1809,8 @@ def save_single(operator, scene, filepath="", if tmp_ob_type == 'CAMERA': if 'CAMERA' in object_types: ob_cameras.append(my_object_generic(ob, mtx)) - elif tmp_ob_type == 'LAMP': - if 'LAMP' in object_types: + elif tmp_ob_type == 'LIGHT': + if 'LIGHT' in object_types: ob_lights.append(my_object_generic(ob, mtx)) elif tmp_ob_type == 'ARMATURE': if 'ARMATURE' in object_types: @@ -2086,7 +2086,7 @@ def save_single(operator, scene, filepath="", assert(not (materials and ('MESH' not in object_types))) assert(not (textures and ('MESH' not in object_types))) - assert(not (ob_lights and ('LAMP' not in object_types))) + assert(not (ob_lights and ('LIGHT' not in object_types))) assert(not (ob_cameras and ('CAMERA' not in object_types))) except AssertionError: diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py index b75a8977..a06ddda7 100644 --- a/io_scene_fbx/export_fbx_bin.py +++ b/io_scene_fbx/export_fbx_bin.py @@ -571,13 +571,13 @@ def fbx_data_empty_elements(root, empty, scene_data): # No custom properties, already saved with object (Model). -def fbx_data_lamp_elements(root, lamp, scene_data): +def fbx_data_light_elements(root, lamp, scene_data): """ Write the Lamp data block. """ gscale = scene_data.settings.global_scale - lamp_key = scene_data.data_lamps[lamp] + light_key = scene_data.data_lights[lamp] do_light = True decay_type = FBX_LIGHT_DECAY_TYPES['CONSTANT'] do_shadow = False @@ -589,7 +589,7 @@ def fbx_data_lamp_elements(root, lamp, scene_data): do_shadow = lamp.shadow_method not in {'NOSHADOW'} shadow_color = lamp.shadow_color - light = elem_data_single_int64(root, b"NodeAttribute", get_fbx_uuid_from_key(lamp_key)) + light = elem_data_single_int64(root, b"NodeAttribute", get_fbx_uuid_from_key(light_key)) light.add_string(fbx_name_class(lamp.name.encode(), b"NodeAttribute")) light.add_string(b"Light") @@ -1568,7 +1568,7 @@ def fbx_data_object_elements(root, ob_obj, scene_data): obj_type = b"Null" elif (ob_obj.type in BLENDER_OBJECT_TYPES_MESHLIKE): obj_type = b"Mesh" - elif (ob_obj.type == 'LAMP'): + elif (ob_obj.type == 'LIGHT'): obj_type = b"Light" elif (ob_obj.type == 'CAMERA'): obj_type = b"Camera" @@ -2173,8 +2173,8 @@ def fbx_data_from_scene(scene, settings): perfmon.step("FBX export prepare: Wrapping Data (lamps, cameras, empties)...") - data_lamps = OrderedDict((ob_obj.bdata.data, get_blenderID_key(ob_obj.bdata.data)) - for ob_obj in objects if ob_obj.type == 'LAMP') + data_lights = OrderedDict((ob_obj.bdata.data, get_blenderID_key(ob_obj.bdata.data)) + for ob_obj in objects if ob_obj.type == 'LIGHT') # Unfortunately, FBX camera data contains object-level data (like position, orientation, etc.)... data_cameras = OrderedDict((ob_obj, get_blenderID_key(ob_obj.bdata.data)) for ob_obj in objects if ob_obj.type == 'CAMERA') @@ -2374,7 +2374,7 @@ def fbx_data_from_scene(scene, settings): tmp_scdata = FBXExportData( None, None, None, settings, scene, objects, None, None, 0.0, 0.0, - data_empties, data_lamps, data_cameras, data_meshes, None, + data_empties, data_lights, data_cameras, data_meshes, None, data_bones, data_leaf_bones, data_deformers_skin, data_deformers_shape, data_world, data_materials, data_textures, data_videos, ) @@ -2390,8 +2390,8 @@ def fbx_data_from_scene(scene, settings): if data_empties: templates[b"Null"] = fbx_template_def_null(scene, settings, nbr_users=len(data_empties)) - if data_lamps: - templates[b"Light"] = fbx_template_def_light(scene, settings, nbr_users=len(data_lamps)) + if data_lights: + templates[b"Light"] = fbx_template_def_light(scene, settings, nbr_users=len(data_lights)) if data_cameras: templates[b"Camera"] = fbx_template_def_camera(scene, settings, nbr_users=len(data_cameras)) @@ -2489,9 +2489,9 @@ def fbx_data_from_scene(scene, settings): bo_data_key = data_bones[ob_obj] connections.append((b"OO", get_fbx_uuid_from_key(bo_data_key), ob_obj.fbx_uuid, None)) else: - if ob_obj.type == 'LAMP': - lamp_key = data_lamps[ob_obj.bdata.data] - connections.append((b"OO", get_fbx_uuid_from_key(lamp_key), ob_obj.fbx_uuid, None)) + if ob_obj.type == 'LIGHT': + light_key = data_lights[ob_obj.bdata.data] + connections.append((b"OO", get_fbx_uuid_from_key(light_key), ob_obj.fbx_uuid, None)) elif ob_obj.type == 'CAMERA': cam_key = data_cameras[ob_obj] connections.append((b"OO", get_fbx_uuid_from_key(cam_key), ob_obj.fbx_uuid, None)) @@ -2592,7 +2592,7 @@ def fbx_data_from_scene(scene, settings): return FBXExportData( templates, templates_users, connections, settings, scene, objects, animations, animated, frame_start, frame_end, - data_empties, data_lamps, data_cameras, data_meshes, mesh_mat_indices, + data_empties, data_lights, data_cameras, data_meshes, mesh_mat_indices, data_bones, data_leaf_bones, data_deformers_skin, data_deformers_shape, data_world, data_materials, data_textures, data_videos, ) @@ -2801,10 +2801,10 @@ def fbx_objects_elements(root, scene_data): for empty in scene_data.data_empties: fbx_data_empty_elements(objects, empty, scene_data) - perfmon.step("FBX export fetch lamps (%d)..." % len(scene_data.data_lamps)) + perfmon.step("FBX export fetch lamps (%d)..." % len(scene_data.data_lights)) - for lamp in scene_data.data_lamps: - fbx_data_lamp_elements(objects, lamp, scene_data) + for lamp in scene_data.data_lights: + fbx_data_light_elements(objects, lamp, scene_data) perfmon.step("FBX export fetch cameras (%d)..." % len(scene_data.data_cameras)) @@ -2933,7 +2933,7 @@ def save_single(operator, scene, filepath="", ObjectWrapper.cache_clear() if object_types is None: - object_types = {'EMPTY', 'CAMERA', 'LAMP', 'ARMATURE', 'MESH', 'OTHER'} + object_types = {'EMPTY', 'CAMERA', 'LIGHT', 'ARMATURE', 'MESH', 'OTHER'} if 'OTHER' in object_types: object_types |= BLENDER_OTHER_OBJECT_TYPES diff --git a/io_scene_fbx/fbx_utils.py b/io_scene_fbx/fbx_utils.py index 82e17fe2..25f5759b 100644 --- a/io_scene_fbx/fbx_utils.py +++ b/io_scene_fbx/fbx_utils.py @@ -71,7 +71,7 @@ FBX_ANIM_PROPSGROUP_NAME = "d" FBX_KTIME = 46186158000 # This is the number of "ktimes" in one second (yep, precision over the nanosecond...) -MAT_CONVERT_LAMP = Matrix.Rotation(math.pi / 2.0, 4, 'X') # Blender is -Z, FBX is -Y. +MAT_CONVERT_LIGHT = Matrix.Rotation(math.pi / 2.0, 4, 'X') # Blender is -Z, FBX is -Y. MAT_CONVERT_CAMERA = Matrix.Rotation(math.pi / 2.0, 4, 'Y') # Blender is -Z, FBX is +X. # XXX I can't get this working :( # MAT_CONVERT_BONE = Matrix.Rotation(math.pi / 2.0, 4, 'Z') # Blender is +Y, FBX is -X. @@ -1069,8 +1069,8 @@ class ObjectWrapper(metaclass=MetaObjectWrapper): # Apply the bone correction. if scene_data.settings.bone_correction_matrix: matrix = matrix * scene_data.settings.bone_correction_matrix - elif self.bdata.type == 'LAMP': - matrix = matrix * MAT_CONVERT_LAMP + elif self.bdata.type == 'LIGHT': + matrix = matrix * MAT_CONVERT_LIGHT elif self.bdata.type == 'CAMERA': matrix = matrix * MAT_CONVERT_CAMERA @@ -1214,7 +1214,7 @@ FBXExportSettings = namedtuple("FBXExportSettings", ( FBXExportData = namedtuple("FBXExportData", ( "templates", "templates_users", "connections", "settings", "scene", "objects", "animations", "animated", "frame_start", "frame_end", - "data_empties", "data_lamps", "data_cameras", "data_meshes", "mesh_mat_indices", + "data_empties", "data_lights", "data_cameras", "data_meshes", "mesh_mat_indices", "data_bones", "data_leaf_bones", "data_deformers_skin", "data_deformers_shape", "data_world", "data_materials", "data_textures", "data_videos", )) diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py index 446be0ff..e9582278 100644 --- a/io_scene_fbx/import_fbx.py +++ b/io_scene_fbx/import_fbx.py @@ -60,7 +60,7 @@ fbx_elem_nil = None convert_deg_to_rad_iter = units_convertor_iter("degree", "radian") MAT_CONVERT_BONE = fbx_utils.MAT_CONVERT_BONE.inverted() -MAT_CONVERT_LAMP = fbx_utils.MAT_CONVERT_LAMP.inverted() +MAT_CONVERT_LIGHT = fbx_utils.MAT_CONVERT_LIGHT.inverted() MAT_CONVERT_CAMERA = fbx_utils.MAT_CONVERT_CAMERA.inverted() @@ -1477,7 +1477,7 @@ def blen_read_light(fbx_tmpl, fbx_obj, global_scale): elem_find_first(fbx_tmpl, b'Properties70', fbx_elem_nil)) # rare if fbx_props[0] is None: - lamp = bpy.data.lamps.new(name=elem_name_utf8, type='POINT') + lamp = bpy.data.lights.new(name=elem_name_utf8, type='POINT') return lamp light_type = { @@ -1485,7 +1485,7 @@ def blen_read_light(fbx_tmpl, fbx_obj, global_scale): 1: 'SUN', 2: 'SPOT'}.get(elem_props_get_enum(fbx_props, b'LightType', 0), 'POINT') - lamp = bpy.data.lamps.new(name=elem_name_utf8, type=light_type) + lamp = bpy.data.lights.new(name=elem_name_utf8, type=light_type) if light_type == 'SPOT': spot_size = elem_props_get_number(fbx_props, b'OuterAngle', None) @@ -1706,7 +1706,7 @@ class FbxImportHelperNode: if self.fbx_type == b'Camera': correction_matrix = MAT_CONVERT_CAMERA elif self.fbx_type == b'Light': - correction_matrix = MAT_CONVERT_LAMP + correction_matrix = MAT_CONVERT_LIGHT self.post_matrix = correction_matrix diff --git a/io_scene_ms3d/ms3d_ui.py b/io_scene_ms3d/ms3d_ui.py index 134447d1..b8753f5b 100644 --- a/io_scene_ms3d/ms3d_ui.py +++ b/io_scene_ms3d/ms3d_ui.py @@ -210,7 +210,7 @@ class Ms3dUi: return ms3d_value ########################################################################### - ICON_OPTIONS = 'LAMP' + ICON_OPTIONS = 'LIGHT' ICON_OBJECT = 'WORLD' ICON_PROCESSING = 'OBJECT_DATAMODE' ICON_MODIFIER = 'MODIFIER' diff --git a/io_scene_obj/__init__.py b/io_scene_obj/__init__.py index e5165c3b..b362c0a6 100644 --- a/io_scene_obj/__init__.py +++ b/io_scene_obj/__init__.py @@ -111,7 +111,7 @@ class ImportOBJ(bpy.types.Operator, ImportHelper, IOOBJOrientationHelper): ), ) - global_clamp_size = FloatProperty( + global_clight_size = FloatProperty( name="Clamp Size", description="Clamp bounds under this value (zero to disable)", min=0.0, max=1000.0, @@ -167,7 +167,7 @@ class ImportOBJ(bpy.types.Operator, ImportHelper, IOOBJOrientationHelper): row.prop(self, "use_groups_as_vgroups") row = layout.split(percentage=0.67) - row.prop(self, "global_clamp_size") + row.prop(self, "global_clight_size") layout.prop(self, "axis_forward") layout.prop(self, "axis_up") diff --git a/io_scene_obj/import_obj.py b/io_scene_obj/import_obj.py index f3e16fcf..fb273133 100644 --- a/io_scene_obj/import_obj.py +++ b/io_scene_obj/import_obj.py @@ -960,7 +960,7 @@ def get_float_func(filepath): def load(context, filepath, *, - global_clamp_size=0.0, + global_clight_size=0.0, use_smooth_groups=True, use_edges=True, use_split_objects=True, @@ -1314,7 +1314,7 @@ def load(context, axis_min = [1000000000] * 3 axis_max = [-1000000000] * 3 - if global_clamp_size: + if global_clight_size: # Get all object bounds for ob in new_objects: for v in ob.bound_box: @@ -1328,7 +1328,7 @@ def load(context, max_axis = max(axis_max[0] - axis_min[0], axis_max[1] - axis_min[1], axis_max[2] - axis_min[2]) scale = 1.0 - while global_clamp_size < max_axis * scale: + while global_clight_size < max_axis * scale: scale = scale / 10.0 for obj in new_objects: diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py index c2ebfca7..d6c4a293 100644 --- a/io_scene_x3d/export_x3d.py +++ b/io_scene_x3d/export_x3d.py @@ -48,7 +48,7 @@ H3D_CAMERA_FOLLOW = 'CAMERA_FOLLOW_TRANSFORM' H3D_VIEW_MATRIX = 'view_matrix' -def clamp_color(col): +def clight_color(col): return tuple([max(min(c, 1.0), 0.0) for c in col]) @@ -164,14 +164,14 @@ def h3d_shader_glsl_frag_patch(filepath, scene, global_vars, frag_uniform_var_ma lines.append("%s\n" % v) lines.append("// h3d custom vars end\n") lines.append("\n") - elif l.lstrip().startswith("lamp_visibility_other("): + elif l.lstrip().startswith("light_visibility_other("): w = l.split(', ') last_transform = w[1] + "_transform" # XXX - HACK!!! w[1] = '(view_matrix * %s_transform * vec4(%s.x, %s.y, %s.z, 1.0)).xyz' % (w[1], w[1], w[1], w[1]) l = ", ".join(w) - elif l.lstrip().startswith("lamp_visibility_sun_hemi("): + elif l.lstrip().startswith("light_visibility_sun_hemi("): w = l.split(', ') - w[0] = w[0][len("lamp_visibility_sun_hemi(") + 1:] + w[0] = w[0][len("light_visibility_sun_hemi(") + 1:] if not h3d_is_object_view(scene, frag_uniform_var_map[w[0]]): w[0] = '(mat3(normalize(view_matrix[0].xyz), normalize(view_matrix[1].xyz), normalize(view_matrix[2].xyz)) * -%s)' % w[0] @@ -179,10 +179,10 @@ def h3d_shader_glsl_frag_patch(filepath, scene, global_vars, frag_uniform_var_ma w[0] = ('(mat3(normalize((view_matrix*%s)[0].xyz), normalize((view_matrix*%s)[1].xyz), normalize((view_matrix*%s)[2].xyz)) * -%s)' % (last_transform, last_transform, last_transform, w[0])) - l = "\tlamp_visibility_sun_hemi(" + ", ".join(w) - elif l.lstrip().startswith("lamp_visibility_spot_circle("): + l = "\tlight_visibility_sun_hemi(" + ", ".join(w) + elif l.lstrip().startswith("light_visibility_spot_circle("): w = l.split(', ') - w[0] = w[0][len("lamp_visibility_spot_circle(") + 1:] + w[0] = w[0][len("light_visibility_spot_circle(") + 1:] if not h3d_is_object_view(scene, frag_uniform_var_map[w[0]]): w[0] = '(mat3(normalize(view_matrix[0].xyz), normalize(view_matrix[1].xyz), normalize(view_matrix[2].xyz)) * -%s)' % w[0] @@ -190,7 +190,7 @@ def h3d_shader_glsl_frag_patch(filepath, scene, global_vars, frag_uniform_var_ma w[0] = ('(mat3(normalize((view_matrix*%s)[0].xyz), normalize((view_matrix*%s)[1].xyz), normalize((view_matrix*%s)[2].xyz)) * %s)' % (last_transform, last_transform, last_transform, w[0])) - l = "\tlamp_visibility_spot_circle(" + ", ".join(w) + l = "\tlight_visibility_spot_circle(" + ", ".join(w) lines.append(l) @@ -241,7 +241,7 @@ def export(file, # since objects of different types will always have # different decorated names. uuid_cache_object = {} # object - uuid_cache_lamp = {} # 'LA_' + object.name + uuid_cache_light = {} # 'LA_' + object.name uuid_cache_view = {} # object, different namespace uuid_cache_mesh = {} # mesh uuid_cache_material = {} # material @@ -261,7 +261,7 @@ def export(file, # prevent uuid collisions. uuid_cache = {} uuid_cache_object = uuid_cache # object - uuid_cache_lamp = uuid_cache # 'LA_' + object.name + uuid_cache_light = uuid_cache # 'LA_' + object.name uuid_cache_view = uuid_cache # object, different namespace uuid_cache_mesh = uuid_cache # mesh uuid_cache_material = uuid_cache # material @@ -370,16 +370,16 @@ def export(file, ident_step = ident + (' ' * (-len(ident) + \ fw('%s<Fog ' % ident))) fw('fogType="%s"\n' % ('LINEAR' if (mtype == 'LINEAR') else 'EXPONENTIAL')) - fw(ident_step + 'color="%.3f %.3f %.3f"\n' % clamp_color(world.horizon_color)) + fw(ident_step + 'color="%.3f %.3f %.3f"\n' % clight_color(world.horizon_color)) fw(ident_step + 'visibilityRange="%.3f"\n' % mparam.depth) fw(ident_step + '/>\n') else: return - def writeNavigationInfo(ident, scene, has_lamp): + def writeNavigationInfo(ident, scene, has_light): ident_step = ident + (' ' * (-len(ident) + \ fw('%s<NavigationInfo ' % ident))) - fw('headlight="%s"\n' % bool_as_str(not has_lamp)) + fw('headlight="%s"\n' % bool_as_str(not has_light)) fw(ident_step + 'visibilityLimit="0.0"\n') fw(ident_step + 'type=\'"EXAMINE", "ANY"\'\n') fw(ident_step + 'avatarSize="0.25, 1.75, 0.75"\n') @@ -411,8 +411,8 @@ def export(file, return ident def writeSpotLight(ident, obj, matrix, lamp, world): - # note, lamp_id is not re-used - lamp_id = quoteattr(unique_name(obj, LA_ + obj.name, uuid_cache_lamp, clean_func=clean_def, sep="_")) + # note, light_id is not re-used + light_id = quoteattr(unique_name(obj, LA_ + obj.name, uuid_cache_light, clean_func=clean_def, sep="_")) if world: ambi = world.ambient_color @@ -435,11 +435,11 @@ def export(file, # radius = lamp.dist*math.cos(beamWidth) ident_step = ident + (' ' * (-len(ident) + \ fw('%s<SpotLight ' % ident))) - fw('DEF=%s\n' % lamp_id) + fw('DEF=%s\n' % light_id) fw(ident_step + 'radius="%.4f"\n' % radius) fw(ident_step + 'ambientIntensity="%.4f"\n' % amb_intensity) fw(ident_step + 'intensity="%.4f"\n' % intensity) - fw(ident_step + 'color="%.4f %.4f %.4f"\n' % clamp_color(lamp.color)) + fw(ident_step + 'color="%.4f %.4f %.4f"\n' % clight_color(lamp.color)) fw(ident_step + 'beamWidth="%.4f"\n' % beamWidth) fw(ident_step + 'cutOffAngle="%.4f"\n' % cutOffAngle) fw(ident_step + 'direction="%.4f %.4f %.4f"\n' % orientation) @@ -447,8 +447,8 @@ def export(file, fw(ident_step + '/>\n') def writeDirectionalLight(ident, obj, matrix, lamp, world): - # note, lamp_id is not re-used - lamp_id = quoteattr(unique_name(obj, LA_ + obj.name, uuid_cache_lamp, clean_func=clean_def, sep="_")) + # note, light_id is not re-used + light_id = quoteattr(unique_name(obj, LA_ + obj.name, uuid_cache_light, clean_func=clean_def, sep="_")) if world: ambi = world.ambient_color @@ -464,16 +464,16 @@ def export(file, ident_step = ident + (' ' * (-len(ident) + \ fw('%s<DirectionalLight ' % ident))) - fw('DEF=%s\n' % lamp_id) + fw('DEF=%s\n' % light_id) fw(ident_step + 'ambientIntensity="%.4f"\n' % amb_intensity) - fw(ident_step + 'color="%.4f %.4f %.4f"\n' % clamp_color(lamp.color)) + fw(ident_step + 'color="%.4f %.4f %.4f"\n' % clight_color(lamp.color)) fw(ident_step + 'intensity="%.4f"\n' % intensity) fw(ident_step + 'direction="%.4f %.4f %.4f"\n' % orientation) fw(ident_step + '/>\n') def writePointLight(ident, obj, matrix, lamp, world): - # note, lamp_id is not re-used - lamp_id = quoteattr(unique_name(obj, LA_ + obj.name, uuid_cache_lamp, clean_func=clean_def, sep="_")) + # note, light_id is not re-used + light_id = quoteattr(unique_name(obj, LA_ + obj.name, uuid_cache_light, clean_func=clean_def, sep="_")) if world: ambi = world.ambient_color @@ -488,9 +488,9 @@ def export(file, ident_step = ident + (' ' * (-len(ident) + \ fw('%s<PointLight ' % ident))) - fw('DEF=%s\n' % lamp_id) + fw('DEF=%s\n' % light_id) fw(ident_step + 'ambientIntensity="%.4f"\n' % amb_intensity) - fw(ident_step + 'color="%.4f %.4f %.4f"\n' % clamp_color(lamp.color)) + fw(ident_step + 'color="%.4f %.4f %.4f"\n' % clight_color(lamp.color)) fw(ident_step + 'intensity="%.4f"\n' % intensity) fw(ident_step + 'radius="%.4f" \n' % lamp.distance) @@ -1002,9 +1002,9 @@ def export(file, ident_step = ident + (' ' * (-len(ident) + \ fw('%s<Material ' % ident))) fw('DEF=%s\n' % material_id) - fw(ident_step + 'diffuseColor="%.3f %.3f %.3f"\n' % clamp_color(diffuseColor)) - fw(ident_step + 'specularColor="%.3f %.3f %.3f"\n' % clamp_color(specColor)) - fw(ident_step + 'emissiveColor="%.3f %.3f %.3f"\n' % clamp_color(emitColor)) + fw(ident_step + 'diffuseColor="%.3f %.3f %.3f"\n' % clight_color(diffuseColor)) + fw(ident_step + 'specularColor="%.3f %.3f %.3f"\n' % clight_color(specColor)) + fw(ident_step + 'emissiveColor="%.3f %.3f %.3f"\n' % clight_color(emitColor)) fw(ident_step + 'ambientIntensity="%.3f"\n' % ambient) fw(ident_step + 'shininess="%.3f"\n' % shininess) fw(ident_step + 'transparency="%s"\n' % transp) @@ -1035,12 +1035,12 @@ def export(file, #~ GPU_DATA_4F 5 #~ GPU_DATA_4UB 8 #~ GPU_DATA_9F 6 - #~ GPU_DYNAMIC_LAMP_DYNCO 7 - #~ GPU_DYNAMIC_LAMP_DYNCOL 11 - #~ GPU_DYNAMIC_LAMP_DYNENERGY 10 - #~ GPU_DYNAMIC_LAMP_DYNIMAT 8 - #~ GPU_DYNAMIC_LAMP_DYNPERSMAT 9 - #~ GPU_DYNAMIC_LAMP_DYNVEC 6 + #~ GPU_DYNAMIC_LIGHT_DYNCO 7 + #~ GPU_DYNAMIC_LIGHT_DYNCOL 11 + #~ GPU_DYNAMIC_LIGHT_DYNENERGY 10 + #~ GPU_DYNAMIC_LIGHT_DYNIMAT 8 + #~ GPU_DYNAMIC_LIGHT_DYNPERSMAT 9 + #~ GPU_DYNAMIC_LIGHT_DYNVEC 6 #~ GPU_DYNAMIC_OBJECT_COLOR 5 #~ GPU_DYNAMIC_OBJECT_IMAT 4 #~ GPU_DYNAMIC_OBJECT_MAT 2 @@ -1134,45 +1134,45 @@ def export(file, writeImageTexture(ident + '\t', uniform['image']) fw('%s</field>\n' % ident) - elif uniform['type'] == gpu.GPU_DYNAMIC_LAMP_DYNCO: - lamp_obj = uniform['lamp'] - frag_uniform_var_map[uniform['varname']] = lamp_obj + elif uniform['type'] == gpu.GPU_DYNAMIC_LIGHT_DYNCO: + light_obj = uniform['lamp'] + frag_uniform_var_map[uniform['varname']] = light_obj if uniform['datatype'] == gpu.GPU_DATA_3F: # should always be true! - lamp_obj_id = quoteattr(unique_name(lamp_obj, LA_ + lamp_obj.name, uuid_cache_lamp, clean_func=clean_def, sep="_")) - lamp_obj_transform_id = quoteattr(unique_name(lamp_obj, lamp_obj.name, uuid_cache_object, clean_func=clean_def, sep="_")) + light_obj_id = quoteattr(unique_name(light_obj, LA_ + light_obj.name, uuid_cache_light, clean_func=clean_def, sep="_")) + light_obj_transform_id = quoteattr(unique_name(light_obj, light_obj.name, uuid_cache_object, clean_func=clean_def, sep="_")) - value = '%.6f %.6f %.6f' % (global_matrix * lamp_obj.matrix_world).to_translation()[:] - field_descr = " <!--- Lamp DynCo '%s' -->" % lamp_obj.name + value = '%.6f %.6f %.6f' % (global_matrix * light_obj.matrix_world).to_translation()[:] + field_descr = " <!--- Lamp DynCo '%s' -->" % light_obj.name fw('%s<field name="%s" type="SFVec3f" accessType="inputOutput" value="%s" />%s\n' % (ident, uniform['varname'], value, field_descr)) # ------------------------------------------------------ # shader-patch - field_descr = " <!--- Lamp DynCo '%s' (shader patch) -->" % lamp_obj.name + field_descr = " <!--- Lamp DynCo '%s' (shader patch) -->" % light_obj.name fw('%s<field name="%s_transform" type="SFMatrix4f" accessType="inputOutput" />%s\n' % (ident, uniform['varname'], field_descr)) # transform frag_vars.append("uniform mat4 %s_transform;" % uniform['varname']) h3d_material_route.append( '<ROUTE fromNode=%s fromField="accumulatedForward" toNode=%s toField="%s_transform" />%s' % - (suffix_quoted_str(lamp_obj_transform_id, _TRANSFORM), material_id, uniform['varname'], field_descr)) + (suffix_quoted_str(light_obj_transform_id, _TRANSFORM), material_id, uniform['varname'], field_descr)) h3d_material_route.append( '<ROUTE fromNode=%s fromField="location" toNode=%s toField="%s" /> %s' % - (lamp_obj_id, material_id, uniform['varname'], field_descr)) + (light_obj_id, material_id, uniform['varname'], field_descr)) # ------------------------------------------------------ else: assert(0) - elif uniform['type'] == gpu.GPU_DYNAMIC_LAMP_DYNCOL: + elif uniform['type'] == gpu.GPU_DYNAMIC_LIGHT_DYNCOL: # odd we have both 3, 4 types. - lamp_obj = uniform['lamp'] - frag_uniform_var_map[uniform['varname']] = lamp_obj + light_obj = uniform['lamp'] + frag_uniform_var_map[uniform['varname']] = light_obj - lamp = lamp_obj.data + lamp = light_obj.data value = '%.6f %.6f %.6f' % (lamp.color * lamp.energy)[:] - field_descr = " <!--- Lamp DynColor '%s' -->" % lamp_obj.name + field_descr = " <!--- Lamp DynColor '%s' -->" % light_obj.name if uniform['datatype'] == gpu.GPU_DATA_3F: fw('%s<field name="%s" type="SFVec3f" accessType="inputOutput" value="%s" />%s\n' % (ident, uniform['varname'], value, field_descr)) elif uniform['datatype'] == gpu.GPU_DATA_4F: @@ -1180,26 +1180,26 @@ def export(file, else: assert(0) - elif uniform['type'] == gpu.GPU_DYNAMIC_LAMP_DYNENERGY: + elif uniform['type'] == gpu.GPU_DYNAMIC_LIGHT_DYNENERGY: # not used ? assert(0) - elif uniform['type'] == gpu.GPU_DYNAMIC_LAMP_DYNVEC: - lamp_obj = uniform['lamp'] - frag_uniform_var_map[uniform['varname']] = lamp_obj + elif uniform['type'] == gpu.GPU_DYNAMIC_LIGHT_DYNVEC: + light_obj = uniform['lamp'] + frag_uniform_var_map[uniform['varname']] = light_obj if uniform['datatype'] == gpu.GPU_DATA_3F: - lamp_obj = uniform['lamp'] - value = '%.6f %.6f %.6f' % ((global_matrix * lamp_obj.matrix_world).to_quaternion() * mathutils.Vector((0.0, 0.0, 1.0))).normalized()[:] - field_descr = " <!--- Lamp DynDirection '%s' -->" % lamp_obj.name + light_obj = uniform['lamp'] + value = '%.6f %.6f %.6f' % ((global_matrix * light_obj.matrix_world).to_quaternion() * mathutils.Vector((0.0, 0.0, 1.0))).normalized()[:] + field_descr = " <!--- Lamp DynDirection '%s' -->" % light_obj.name fw('%s<field name="%s" type="SFVec3f" accessType="inputOutput" value="%s" />%s\n' % (ident, uniform['varname'], value, field_descr)) # route so we can have the lamp update the view - if h3d_is_object_view(scene, lamp_obj): - lamp_id = quoteattr(unique_name(lamp_obj, LA_ + lamp_obj.name, uuid_cache_lamp, clean_func=clean_def, sep="_")) + if h3d_is_object_view(scene, light_obj): + light_id = quoteattr(unique_name(light_obj, LA_ + light_obj.name, uuid_cache_light, clean_func=clean_def, sep="_")) h3d_material_route.append( '<ROUTE fromNode=%s fromField="direction" toNode=%s toField="%s" />%s' % - (lamp_id, material_id, uniform['varname'], field_descr)) + (light_id, material_id, uniform['varname'], field_descr)) else: assert(0) @@ -1330,9 +1330,9 @@ def export(file, blending = world.use_sky_blend, world.use_sky_paper, world.use_sky_real - grd_triple = clamp_color(world.horizon_color) - sky_triple = clamp_color(world.zenith_color) - mix_triple = clamp_color((grd_triple[i] + sky_triple[i]) / 2.0 for i in range(3)) + grd_triple = clight_color(world.horizon_color) + sky_triple = clight_color(world.zenith_color) + mix_triple = clight_color((grd_triple[i] + sky_triple[i]) / 2.0 for i in range(3)) ident_step = ident + (' ' * (-len(ident) + \ fw('%s<Background ' % ident))) @@ -1469,7 +1469,7 @@ def export(file, if do_remove: bpy.data.meshes.remove(me) - elif obj_type == 'LAMP': + elif obj_type == 'LIGHT': data = obj.data datatype = data.type if datatype == 'POINT': @@ -1521,7 +1521,7 @@ def export(file, ident = '' ident = writeHeader(ident) - writeNavigationInfo(ident, scene, any(obj.type == 'LAMP' for obj in objects)) + writeNavigationInfo(ident, scene, any(obj.type == 'LIGHT' for obj in objects)) writeBackground(ident, world) writeFog(ident, world) diff --git a/io_scene_x3d/import_x3d.py b/io_scene_x3d/import_x3d.py index 3416bf22..cffdabfe 100644 --- a/io_scene_x3d/import_x3d.py +++ b/io_scene_x3d/import_x3d.py @@ -2790,9 +2790,9 @@ def appearance_LoadTexture(tex_node, ancestry, node): if bpyima: # Loading can still fail repeat_s = tex_node.getFieldAsBool('repeatS', True, ancestry) - bpyima.use_clamp_x = not repeat_s + bpyima.use_clight_x = not repeat_s repeat_t = tex_node.getFieldAsBool('repeatT', True, ancestry) - bpyima.use_clamp_y = not repeat_t + bpyima.use_clight_y = not repeat_t # Update the desc-based cache if desc: @@ -3148,7 +3148,7 @@ def importLamp_PointLight(node, ancestry): # is_on = node.getFieldAsBool('on', True, ancestry) # TODO radius = node.getFieldAsFloat('radius', 100.0, ancestry) - bpylamp = bpy.data.lamps.new(vrmlname, 'POINT') + bpylamp = bpy.data.lights.new(vrmlname, 'POINT') bpylamp.energy = intensity bpylamp.distance = radius bpylamp.color = color @@ -3169,7 +3169,7 @@ def importLamp_DirectionalLight(node, ancestry): intensity = node.getFieldAsFloat('intensity', 1.0, ancestry) # max is documented to be 1.0 but some files have higher. # is_on = node.getFieldAsBool('on', True, ancestry) # TODO - bpylamp = bpy.data.lamps.new(vrmlname, 'SUN') + bpylamp = bpy.data.lights.new(vrmlname, 'SUN') bpylamp.energy = intensity bpylamp.color = color @@ -3197,7 +3197,7 @@ def importLamp_SpotLight(node, ancestry): # is_on = node.getFieldAsBool('on', True, ancestry) # TODO radius = node.getFieldAsFloat('radius', 100.0, ancestry) - bpylamp = bpy.data.lamps.new(vrmlname, 'SPOT') + bpylamp = bpy.data.lights.new(vrmlname, 'SPOT') bpylamp.energy = intensity bpylamp.distance = radius bpylamp.color = color diff --git a/light_field_tools/light_field_tools.py b/light_field_tools/light_field_tools.py index b4693d52..f6d57c29 100644 --- a/light_field_tools/light_field_tools.py +++ b/light_field_tools/light_field_tools.py @@ -228,7 +228,7 @@ class OBJECT_OT_create_lightfield_rig(Operator): def createSpot(self, index, textured=False): scene = bpy.context.scene - bpy.ops.object.lamp_add( + bpy.ops.object.light_add( type='SPOT') spot = bpy.context.active_object diff --git a/measureit/measureit_main.py b/measureit/measureit_main.py index c85de95d..c726cff8 100644 --- a/measureit/measureit_main.py +++ b/measureit/measureit_main.py @@ -1344,7 +1344,7 @@ class AddLinkButton(Operator): if o is None: return False else: - if o.type == "MESH" or o.type == "EMPTY" or o.type == "CAMERA" or o.type == "LAMP": + if o.type == "MESH" or o.type == "EMPTY" or o.type == "CAMERA" or o.type == "LIGHT": if bpy.context.mode == 'OBJECT': return True else: @@ -1490,7 +1490,7 @@ class AddOriginButton(Operator): if o is None: return False else: - if o.type == "MESH" or o.type == "EMPTY" or o.type == "CAMERA" or o.type == "LAMP": + if o.type == "MESH" or o.type == "EMPTY" or o.type == "CAMERA" or o.type == "LIGHT": if bpy.context.mode == 'OBJECT': return True else: diff --git a/mesh_carver.py b/mesh_carver.py index 16308aa4..fc1b2501 100644 --- a/mesh_carver.py +++ b/mesh_carver.py @@ -1618,7 +1618,7 @@ def update_bevel(context): mod.limit_method = 'WEIGHT' mod.width = 0.01 mod.profile = 0.699099 - mod.use_clamp_overlap = False + mod.use_clight_overlap = False mod.segments = 3 mod.loop_slide = False @@ -1676,7 +1676,7 @@ def CreateBevel(context, CurrentObject): mod.limit_method = 'WEIGHT' mod.width = 0.01 mod.profile = 0.699099 - mod.use_clamp_overlap = False + mod.use_clight_overlap = False mod.segments = 3 mod.loop_slide = False diff --git a/modules/rna_manual_reference.py b/modules/rna_manual_reference.py index a477d3ec..a001346d 100644 --- a/modules/rna_manual_reference.py +++ b/modules/rna_manual_reference.py @@ -382,7 +382,7 @@ url_manual_mapping = ( ("bpy.types.alphaoversequence*", "editors/vse/sequencer/strips/effects/alpha_over_under_overdrop.html#bpy-types-alphaoversequence"), ("bpy.types.armatureeditbones*", "rigging/armatures/bones/editing/index.html#bpy-types-armatureeditbones"), ("bpy.types.childofconstraint*", "rigging/constraints/relationship/child_of.html#bpy-types-childofconstraint"), - ("bpy.types.clamptoconstraint*", "rigging/constraints/tracking/clamp_to.html#bpy-types-clamptoconstraint"), + ("bpy.types.clamptoconstraint*", "rigging/constraints/tracking/clight_to.html#bpy-types-clamptoconstraint"), ("bpy.types.collisionmodifier*", "physics/collision.html#bpy-types-collisionmodifier"), ("bpy.types.collisionsettings*", "physics/collision.html#bpy-types-collisionsettings"), ("bpy.types.compositornodergb*", "compositing/types/input/rgb.html#bpy-types-compositornodergb"), @@ -754,7 +754,7 @@ url_manual_mapping = ( ("bpy.types.area*", "interface/window_system/areas.html#bpy-types-area"), ("bpy.types.boid*", "physics/particles/emitter/physics/boids.html#bpy-types-boid"), ("bpy.types.bone*", "rigging/armatures/bones/index.html#bpy-types-bone"), - ("bpy.types.lamp*", "render/blender_render/lighting/index.html#bpy-types-lamp"), + ("bpy.types.light*", "render/blender_render/lighting/index.html#bpy-types-lamp"), ("bpy.types.mask*", "editors/movie_clip_editor/masking/index.html#bpy-types-mask"), ("bpy.types.menu*", "interface/controls/buttons/menus.html#bpy-types-menu"), ("bpy.types.mesh*", "modeling/meshes/index.html#bpy-types-mesh"), @@ -779,7 +779,7 @@ url_manual_mapping = ( ("bpy.ops.file*", "editors/file_browser/index.html#bpy-ops-file"), ("bpy.ops.font*", "modeling/texts/index.html#bpy-ops-font"), ("bpy.ops.info*", "editors/info/index.html#bpy-ops-info"), - ("bpy.ops.lamp*", "render/blender_render/lighting/index.html#bpy-ops-lamp"), + ("bpy.ops.light*", "render/blender_render/lighting/index.html#bpy-ops-lamp"), ("bpy.ops.mask*", "editors/movie_clip_editor/masking/index.html#bpy-ops-mask"), ("bpy.ops.mesh*", "modeling/meshes/index.html#bpy-ops-mesh"), ("bpy.ops.node*", "editors/node_editor/nodes/index.html#bpy-ops-node"), diff --git a/node_wrangler.py b/node_wrangler.py index 1c8967ac..81566ed4 100644 --- a/node_wrangler.py +++ b/node_wrangler.py @@ -107,7 +107,7 @@ shaders_input_nodes_props = ( # Keeping mixed case to avoid having to translate entries when adding new nodes in operators. shaders_output_nodes_props = ( ('ShaderNodeOutputMaterial', 'OUTPUT_MATERIAL', 'Material Output'), - ('ShaderNodeOutputLamp', 'OUTPUT_LAMP', 'Lamp Output'), + ('ShaderNodeOutputLight', 'OUTPUT_LIGHT', 'Light Output'), ('ShaderNodeOutputWorld', 'OUTPUT_WORLD', 'World Output'), ) # (rna_type.identifier, type, rna_type.name) @@ -324,7 +324,7 @@ compo_layout_nodes_props = ( blender_mat_input_nodes_props = ( ('ShaderNodeMaterial', 'MATERIAL', 'Material'), ('ShaderNodeCameraData', 'CAMERA', 'Camera Data'), - ('ShaderNodeLampData', 'LAMP', 'Lamp Data'), + ('ShaderNodeLightData', 'LIGHT', 'Light Data'), ('ShaderNodeValue', 'VALUE', 'Value'), ('ShaderNodeRGB', 'RGB', 'RGB'), ('ShaderNodeTexture', 'TEXTURE', 'Texture'), @@ -1330,7 +1330,7 @@ class NWDeleteUnused(Operator, NWBase): def is_unused_node(self, node): end_types = ['OUTPUT_MATERIAL', 'OUTPUT', 'VIEWER', 'COMPOSITE', \ - 'SPLITVIEWER', 'OUTPUT_FILE', 'LEVELS', 'OUTPUT_LAMP', \ + 'SPLITVIEWER', 'OUTPUT_FILE', 'LEVELS', 'OUTPUT_LIGHT', \ 'OUTPUT_WORLD', 'GROUP_INPUT', 'GROUP_OUTPUT', 'FRAME'] if node.type in end_types: return False @@ -1596,13 +1596,13 @@ class NWEmissionViewer(Operator, NWBase): space = context.space_data shader_type = space.shader_type if shader_type == 'OBJECT': - if space.id not in [lamp for lamp in bpy.data.lamps]: # cannot use bpy.data.lamps directly as iterable + if space.id not in [light for light in bpy.data.lights]: # cannot use bpy.data.lights directly as iterable shader_output_type = "OUTPUT_MATERIAL" shader_output_ident = "ShaderNodeOutputMaterial" shader_viewer_ident = "ShaderNodeEmission" else: - shader_output_type = "OUTPUT_LAMP" - shader_output_ident = "ShaderNodeOutputLamp" + shader_output_type = "OUTPUT_LIGHT" + shader_output_ident = "ShaderNodeOutputLight" shader_viewer_ident = "ShaderNodeEmission" elif shader_type == 'WORLD': diff --git a/render_povray/__init__.py b/render_povray/__init__.py index 90d80f13..c1f6c539 100644 --- a/render_povray/__init__.py +++ b/render_povray/__init__.py @@ -2278,7 +2278,7 @@ def register(): bpy.types.INFO_MT_file_import.append(ui.menu_func_import) bpy.types.TEXT_MT_templates.append(ui.menu_func_templates) bpy.types.RENDER_PT_povray_radiosity.prepend(ui.rad_panel_func) - bpy.types.LAMP_PT_POV_lamp.prepend(ui.lamp_panel_func) + bpy.types.LIGHT_PT_POV_light.prepend(ui.light_panel_func) bpy.types.WORLD_PT_world.prepend(ui.world_panel_func) # was used for parametric objects but made the other addon unreachable on # unregister for other tools to use created a user action call instead @@ -2312,7 +2312,7 @@ def unregister(): #bpy.types.TEXTURE_PT_context_texture.remove(TEXTURE_PT_povray_type) #addon_utils.disable("add_mesh_extra_objects", default_set=False) bpy.types.WORLD_PT_world.remove(ui.world_panel_func) - bpy.types.LAMP_PT_POV_lamp.remove(ui.lamp_panel_func) + bpy.types.LIGHT_PT_POV_light.remove(ui.light_panel_func) bpy.types.RENDER_PT_povray_radiosity.remove(ui.rad_panel_func) bpy.types.TEXT_MT_templates.remove(ui.menu_func_templates) bpy.types.INFO_MT_file_import.remove(ui.menu_func_import) diff --git a/render_povray/nodes.py b/render_povray/nodes.py index ef185473..769961b6 100644 --- a/render_povray/nodes.py +++ b/render_povray/nodes.py @@ -52,7 +52,7 @@ class ObjectNodeTree(bpy.types.NodeTree): @classmethod def get_from_context(cls, context): ob = context.active_object - if ob and ob.type not in {'LAMP'}: + if ob and ob.type not in {'LIGHT'}: ma = ob.active_material if ma is not None: nt_name = ma.node_tree diff --git a/render_povray/primitives.py b/render_povray/primitives.py index 29734ae7..6059ccb1 100644 --- a/render_povray/primitives.py +++ b/render_povray/primitives.py @@ -1052,7 +1052,7 @@ class POVRAY_OT_rainbow_add(bpy.types.Operator): def execute(self,context): cam = context.scene.camera - bpy.ops.object.lamp_add(type='SPOT', radius=1) + bpy.ops.object.light_add(type='SPOT', radius=1) ob = context.object ob.data.show_cone = False ob.data.spot_blend = 0.5 diff --git a/render_povray/render.py b/render_povray/render.py index 9838f25d..920dc7ff 100644 --- a/render_povray/render.py +++ b/render_povray/render.py @@ -2067,7 +2067,7 @@ def write_pov(filename, scene=None, info_callback=None): # XXX I moved all those checks here, as there is no need to compute names # for object we won't export here! - if (ob.type in {'LAMP', 'CAMERA', #'EMPTY', #empties can bear dupligroups + if (ob.type in {'LIGHT', 'CAMERA', #'EMPTY', #empties can bear dupligroups 'META', 'ARMATURE', 'LATTICE'}): continue smokeFlag=False @@ -3666,11 +3666,11 @@ def write_pov(filename, scene=None, info_callback=None): csg = True sel = renderable_objects(scene) - exportLamps([L for L in sel if (L.type == 'LAMP' and L.pov.object_as != 'RAINBOW')]) + exportLamps([L for L in sel if (L.type == 'LIGHT' and L.pov.object_as != 'RAINBOW')]) if comments: file.write("\n//--Rainbows--\n\n") - exportRainbows([L for L in sel if (L.type == 'LAMP' and L.pov.object_as == 'RAINBOW')]) + exportRainbows([L for L in sel if (L.type == 'LIGHT' and L.pov.object_as == 'RAINBOW')]) if comments: diff --git a/render_povray/ui.py b/render_povray/ui.py index b4a08292..750dcf1a 100644 --- a/render_povray/ui.py +++ b/render_povray/ui.py @@ -461,25 +461,25 @@ del properties_data_mesh ################################################################################ -# from bl_ui import properties_data_lamp -# for member in dir(properties_data_lamp): - # subclass = getattr(properties_data_lamp, member) +# from bl_ui import properties_data_light +# for member in dir(properties_data_light): + # subclass = getattr(properties_data_light, member) # try: # subclass.COMPAT_ENGINES.add('POVRAY_RENDER') # except: # pass -# del properties_data_lamp -#########################LAMPS################################ +# del properties_data_light +#########################LIGHTS################################ -from bl_ui import properties_data_lamp +from bl_ui import properties_data_light # These panels are kept -properties_data_lamp.DATA_PT_custom_props_lamp.COMPAT_ENGINES.add('POVRAY_RENDER') -properties_data_lamp.DATA_PT_context_lamp.COMPAT_ENGINES.add('POVRAY_RENDER') +properties_data_light.DATA_PT_custom_props_light.COMPAT_ENGINES.add('POVRAY_RENDER') +properties_data_light.DATA_PT_context_light.COMPAT_ENGINES.add('POVRAY_RENDER') ## make some native panels contextual to some object variable ## by recreating custom panels inheriting their properties -class PovLampButtonsPanel(properties_data_lamp.DataButtonsPanel): +class PovLampButtonsPanel(properties_data_light.DataButtonsPanel): COMPAT_ENGINES = {'POVRAY_RENDER'} POV_OBJECT_TYPES = {'RAINBOW'} @@ -496,17 +496,17 @@ class PovLampButtonsPanel(properties_data_lamp.DataButtonsPanel): # Complex py/bpy/rna interactions (with metaclass and all) simply do not allow it to work. # So we simply have to explicitly copy here the interesting bits. ;) -class LAMP_PT_POV_preview(PovLampButtonsPanel, bpy.types.Panel): - bl_label = properties_data_lamp.DATA_PT_preview.bl_label +class LIGHT_PT_POV_preview(PovLampButtonsPanel, bpy.types.Panel): + bl_label = properties_data_light.DATA_PT_preview.bl_label - draw = properties_data_lamp.DATA_PT_preview.draw + draw = properties_data_light.DATA_PT_preview.draw -class LAMP_PT_POV_lamp(PovLampButtonsPanel, bpy.types.Panel): - bl_label = properties_data_lamp.DATA_PT_lamp.bl_label +class LIGHT_PT_POV_light(PovLampButtonsPanel, bpy.types.Panel): + bl_label = properties_data_light.DATA_PT_light.bl_label - draw = properties_data_lamp.DATA_PT_lamp.draw + draw = properties_data_light.DATA_PT_light.draw -class POV_LAMP_MT_presets(bpy.types.Menu): +class POV_LIGHT_MT_presets(bpy.types.Menu): bl_label = "Lamp Presets" preset_subdir = "pov/lamp" preset_operator = "script.execute_preset" @@ -515,19 +515,19 @@ class POV_LAMP_MT_presets(bpy.types.Menu): class AddPresetLamp(AddPresetBase, bpy.types.Operator): '''Add a Lamp Preset''' - bl_idname = "object.lamp_preset_add" + bl_idname = "object.light_preset_add" bl_label = "Add Lamp Preset" - preset_menu = "POV_LAMP_MT_presets" + preset_menu = "POV_LIGHT_MT_presets" # variable used for all preset values preset_defines = [ - "lampdata = bpy.context.object.data" + "lightdata = bpy.context.object.data" ] # properties to store in the preset preset_values = [ - "lampdata.type", - "lampdata.color", + "lightdata.type", + "lightdata.color", ] # where to store the preset @@ -538,68 +538,68 @@ class AddPresetLamp(AddPresetBase, bpy.types.Operator): # Draw into an existing panel -def lamp_panel_func(self, context): +def light_panel_func(self, context): layout = self.layout row = layout.row(align=True) - row.menu(POV_LAMP_MT_presets.__name__, text=POV_LAMP_MT_presets.bl_label) + row.menu(POV_LIGHT_MT_presets.__name__, text=POV_LIGHT_MT_presets.bl_label) row.operator(AddPresetLamp.bl_idname, text="", icon='ZOOMIN') row.operator(AddPresetLamp.bl_idname, text="", icon='ZOOMOUT').remove_active = True classes = ( - POV_LAMP_MT_presets, + POV_LIGHT_MT_presets, AddPresetLamp, ) -class LAMP_PT_POV_sunsky(PovLampButtonsPanel, bpy.types.Panel): - bl_label = properties_data_lamp.DATA_PT_sunsky.bl_label +class LIGHT_PT_POV_sunsky(PovLampButtonsPanel, bpy.types.Panel): + bl_label = properties_data_light.DATA_PT_sunsky.bl_label @classmethod def poll(cls, context): - lamp = context.lamp + lamp = context.light engine = context.scene.render.engine return (lamp and lamp.type == 'SUN') and (engine in cls.COMPAT_ENGINES) - draw = properties_data_lamp.DATA_PT_sunsky.draw + draw = properties_data_light.DATA_PT_sunsky.draw -class LAMP_PT_POV_shadow(PovLampButtonsPanel, bpy.types.Panel): - bl_label = properties_data_lamp.DATA_PT_shadow.bl_label +class LIGHT_PT_POV_shadow(PovLampButtonsPanel, bpy.types.Panel): + bl_label = properties_data_light.DATA_PT_shadow.bl_label - draw = properties_data_lamp.DATA_PT_shadow.draw + draw = properties_data_light.DATA_PT_shadow.draw -class LAMP_PT_POV_area(PovLampButtonsPanel, bpy.types.Panel): - bl_label = properties_data_lamp.DATA_PT_area.bl_label +class LIGHT_PT_POV_area(PovLampButtonsPanel, bpy.types.Panel): + bl_label = properties_data_light.DATA_PT_area.bl_label @classmethod def poll(cls, context): - lamp = context.lamp + lamp = context.light engine = context.scene.render.engine return (lamp and lamp.type == 'AREA') and (engine in cls.COMPAT_ENGINES) - draw = properties_data_lamp.DATA_PT_area.draw + draw = properties_data_light.DATA_PT_area.draw -class LAMP_PT_POV_spot(PovLampButtonsPanel, bpy.types.Panel): - bl_label = properties_data_lamp.DATA_PT_spot.bl_label +class LIGHT_PT_POV_spot(PovLampButtonsPanel, bpy.types.Panel): + bl_label = properties_data_light.DATA_PT_spot.bl_label @classmethod def poll(cls, context): - lamp = context.lamp + lamp = context.light engine = context.scene.render.engine return (lamp and lamp.type == 'SPOT') and (engine in cls.COMPAT_ENGINES) - draw = properties_data_lamp.DATA_PT_spot.draw + draw = properties_data_light.DATA_PT_spot.draw -class LAMP_PT_POV_falloff_curve(PovLampButtonsPanel, bpy.types.Panel): - bl_label = properties_data_lamp.DATA_PT_falloff_curve.bl_label - bl_options = properties_data_lamp.DATA_PT_falloff_curve.bl_options +class LIGHT_PT_POV_falloff_curve(PovLampButtonsPanel, bpy.types.Panel): + bl_label = properties_data_light.DATA_PT_falloff_curve.bl_label + bl_options = properties_data_light.DATA_PT_falloff_curve.bl_options @classmethod def poll(cls, context): - lamp = context.lamp + lamp = context.light engine = context.scene.render.engine return (lamp and lamp.type in {'POINT', 'SPOT'} and lamp.falloff_type == 'CUSTOM_CURVE') and (engine in cls.COMPAT_ENGINES) - draw = properties_data_lamp.DATA_PT_falloff_curve.draw + draw = properties_data_light.DATA_PT_falloff_curve.draw class OBJECT_PT_povray_obj_rainbow(PovLampButtonsPanel, bpy.types.Panel): bl_label = "POV-Ray Rainbow" @@ -641,7 +641,7 @@ class OBJECT_PT_povray_obj_rainbow(PovLampButtonsPanel, bpy.types.Panel): col.prop(obj.pov, "arc_angle") col.prop(obj.pov, "falloff_angle") -del properties_data_lamp +del properties_data_light ############################################################################### class RENDER_PT_povray_export_settings(RenderButtonsPanel, bpy.types.Panel): diff --git a/space_view3d_display_tools/select_tools.py b/space_view3d_display_tools/select_tools.py index eb5c0aaa..b53c6da2 100644 --- a/space_view3d_display_tools/select_tools.py +++ b/space_view3d_display_tools/select_tools.py @@ -65,7 +65,7 @@ class ShowHideObject(Operator): i.hide = True i.select = False - if i.type not in ['CAMERA', 'LAMP']: + if i.type not in ['CAMERA', 'LIGHT']: i.hide_render = True except: continue @@ -103,7 +103,7 @@ class HideAllObjects(Operator): i.hide = True i.select = False - if i.type not in ['CAMERA', 'LAMP']: + if i.type not in ['CAMERA', 'LIGHT']: i.hide_render = True else: obj_name = context.object.name @@ -113,7 +113,7 @@ class HideAllObjects(Operator): i.hide = True i.select = False - if i.type not in ['CAMERA', 'LAMP']: + if i.type not in ['CAMERA', 'LIGHT']: i.hide_render = True return {'FINISHED'} @@ -232,11 +232,11 @@ class OBJECT_OT_HideShowByTypeTemplate(): ('LATTICE', 'Lattice', ''), ('EMPTY', 'Empty', ''), ('CAMERA', 'Camera', ''), - ('LAMP', 'Lamp', ''), + ('LIGHT', 'Lamp', ''), ('ALL', 'All', '')), name="Type", description="Type", - default='LAMP', + default='LIGHT', options={'ANIMATABLE'} ) diff --git a/space_view3d_display_tools/selection_restrictor.py b/space_view3d_display_tools/selection_restrictor.py index feb3b8b8..71561bfe 100644 --- a/space_view3d_display_tools/selection_restrictor.py +++ b/space_view3d_display_tools/selection_restrictor.py @@ -45,7 +45,7 @@ curve = 'OUTLINER_OB_CURVE' arm = 'OUTLINER_OB_ARMATURE' empty = 'OUTLINER_OB_EMPTY' cam = 'OUTLINER_OB_CAMERA' -lamp = 'OUTLINER_OB_LAMP' +lamp = 'OUTLINER_OB_LIGHT' lat = 'OUTLINER_OB_LATTICE' font = 'OUTLINER_OB_FONT' meta = 'OUTLINER_OB_META' @@ -135,10 +135,10 @@ def check_restrictors(dummy): # lamp if bpy.context.scene.get('lamprestrictor') is None: lamprestrictorenabled = True - lamp = 'OUTLINER_OB_LAMP' + lamp = 'OUTLINER_OB_LIGHT' else: lamprestrictorenabled = False - lamp = 'LAMP_DATA' + lamp = 'LIGHT_DATA' # lattice if bpy.context.scene.get('latrestrictor') is None: @@ -408,7 +408,7 @@ class RestrictorCam(Operator): # Restrictor for Lamps class RestrictorLamp(Operator): - bl_idname = "restrictor.lamp" + bl_idname = "restrictor.light" bl_label = "Restrictor Lamps" bl_option = {'REGISTER', 'UNDO'} bl_description = "Lamps selection restrictor" @@ -421,18 +421,18 @@ class RestrictorLamp(Operator): lamprestrictorenabled = True if bpy.context.scene.get('lamprestrictor') is not None: del bpy.context.scene['lamprestrictor'] - lamp = 'OUTLINER_OB_LAMP' + lamp = 'OUTLINER_OB_LIGHT' for ob in bpy.context.scene.objects: - if ob.type == 'LAMP': + if ob.type == 'LIGHT': if ob.get('ignore_restrictors') is None: ob.hide_select = False else: lamprestrictorenabled = False bpy.context.scene['lamprestrictor'] = 1 - lamp = 'LAMP_DATA' + lamp = 'LIGHT_DATA' for ob in bpy.context.scene.objects: - if ob.type == 'LAMP': + if ob.type == 'LIGHT': if ob.get('ignore_restrictors') is None: ob.hide_select = True ob.select = False @@ -638,7 +638,7 @@ class RefreshRestrictors(Operator): 'armrestrictor': ("OUTLINER_OB_ARMATURE", "ARMATURE_DATA", "ARMATURE"), 'emptyrestrictor': ("OUTLINER_OB_EMPTY", "EMPTY_DATA", "EMPTY"), 'camrestrictor': ("OUTLINER_OB_CAMERA", "CAMERA_DATA", "CAMERA"), - 'lamprestrictor': ("OUTLINER_OB_LAMP", "LAMP_DATA", "LAMP"), + 'lamprestrictor': ("OUTLINER_OB_LIGHT", "LIGHT_DATA", "LIGHT"), 'latrestrictor': ("OUTLINER_OB_LATTICE", "LATTICE", "LATTICE"), 'fontrestrictor': ("OUTLINER_OB_FONT", "FONT", "FONT"), 'metarestrictor': ("OUTLINER_OB_META", "META_DATA", "META"), @@ -664,7 +664,7 @@ class RefreshRestrictors(Operator): arm = gl_icon if types == "ARMATURE" else arm empty = gl_icon if types == "EMPTY" else empty cam = gl_icon if types == "CAMERA" else cam - lamp = gl_icon if types == "LAMP" else lamp + lamp = gl_icon if types == "LIGHT" else lamp lat = gl_icon if types == "LATTICE" else lat font = gl_icon if types == "FONT" else font meta = gl_icon if types == "META" else meta @@ -701,7 +701,7 @@ class RestrictorSelection(Menu): layout.operator("restrictor.arm", icon=arm, text="Armature") layout.operator("restrictor.empty", icon=empty, text="Empty") layout.operator("restrictor.cam", icon=cam, text="Camera") - layout.operator("restrictor.lamp", icon=lamp, text="Lamp") + layout.operator("restrictor.light", icon=lamp, text="Lamp") layout.operator("restrictor.lat", icon=lat, text="Lattice") layout.operator("restrictor.font", icon=font, text="Font") layout.operator("restrictor.meta", icon=meta, text="MetaBall") diff --git a/space_view3d_display_tools/useless_tools.py b/space_view3d_display_tools/useless_tools.py index 512fcf2d..22931423 100644 --- a/space_view3d_display_tools/useless_tools.py +++ b/space_view3d_display_tools/useless_tools.py @@ -204,7 +204,7 @@ class UTSubsurfHideSelAll(Operator): objects = bpy.context.selected_objects if self.selected else bpy.data.objects for e in objects: try: - if e.type not in {"LAMP", "CAMERA", "EMPTY"}: + if e.type not in {"LIGHT", "CAMERA", "EMPTY"}: e.modifiers['Subsurf'].show_viewport = self.show except Exception as k: name = getattr(e, "name", "Nameless") @@ -233,7 +233,7 @@ class UTOptimalDisplaySelAll(Operator): objects = bpy.context.selected_objects if self.selected else bpy.data.objects for e in objects: try: - if e.type not in {"LAMP", "CAMERA", "EMPTY"}: + if e.type not in {"LIGHT", "CAMERA", "EMPTY"}: e.modifiers['Subsurf'].show_only_control_edges = self.on except Exception as k: name = getattr(e, "name", "Nameless") diff --git a/space_view3d_pie_menus/pie_modes_menu.py b/space_view3d_pie_menus/pie_modes_menu.py index 40f6ba4a..87c1ee9e 100644 --- a/space_view3d_pie_menus/pie_modes_menu.py +++ b/space_view3d_pie_menus/pie_modes_menu.py @@ -429,7 +429,7 @@ class PieObjectEditMode(Menu): pie.operator("view3d.pie_interactive_mode_grease_pencil", icon="GREASEPENCIL") else: message = "Active Object has only Object Mode available" if ob \ - and ob.type in {"LAMP", "CAMERA", "EMPTY", "SPEAKER"} else \ + and ob.type in {"LIGHT", "CAMERA", "EMPTY", "SPEAKER"} else \ "No active object found. Please select one first" pie = layout.menu_pie() pie.separator() diff --git a/space_view3d_spacebar_menu.py b/space_view3d_spacebar_menu.py index 329e0ad3..95a9a7e6 100644 --- a/space_view3d_spacebar_menu.py +++ b/space_view3d_spacebar_menu.py @@ -489,7 +489,7 @@ class VIEW3D_MT_Space_Dynamic_Menu(Menu): layout.operator("view3d.properties", icon='MENU_PANEL') # Lamp Object Mode # - if obj and obj.type == 'LAMP' and obj.mode in {'OBJECT'}: + if obj and obj.type == 'LIGHT' and obj.mode in {'OBJECT'}: layout.operator_context = 'INVOKE_REGION_WIN' layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM') @@ -841,8 +841,8 @@ class VIEW3D_MT_AddMenu(Menu): UseSeparator(self, context) layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA') - layout.operator_menu_enum("object.lamp_add", "type", - icon="OUTLINER_OB_LAMP") + layout.operator_menu_enum("object.light_add", "type", + icon="OUTLINER_OB_LIGHT") UseSeparator(self, context) layout.operator_menu_enum("object.effector_add", "type", text="Force Field", diff --git a/system_blend_info.py b/system_blend_info.py index 8b2a0939..65b1d9f9 100644 --- a/system_blend_info.py +++ b/system_blend_info.py @@ -102,10 +102,10 @@ class OBJECT_PT_blendinfo(bpy.types.Panel): icon='CAMERA_DATA') row = ob_cols[1].row() - lamps = [o for o in objects.values() if o.type == 'LAMP'] + lamps = [o for o in objects.values() if o.type == 'LIGHT'] num = len(lamps) row.label(text=quantity_string(num, "Lamp", "Lamps"), - icon='LAMP_DATA') + icon='LIGHT_DATA') row = ob_cols[0].row() armatures = [o for o in objects.values() if o.type == 'ARMATURE'] @@ -159,9 +159,9 @@ class OBJECT_PT_blendinfo(bpy.types.Panel): icon='CAMERA_DATA') row = db_cols[1].row() - num = len(bpy.data.lamps) + num = len(bpy.data.lights) row.label(text=quantity_string(num, "Lamp", "Lamps"), - icon='LAMP_DATA') + icon='LIGHT_DATA') row = db_cols[0].row() num = len(bpy.data.armatures) diff --git a/uv_texture_atlas.py b/uv_texture_atlas.py index 974d998c..b0936a8a 100644 --- a/uv_texture_atlas.py +++ b/uv_texture_atlas.py @@ -127,15 +127,15 @@ class TexAtl_Main(Panel): self.layout.prop(group, 'unwrap_type', text='Lightmap', expand=True) row = self.layout.row() row.operator( - "object.ms_auto", text="Auto Unwrap", icon="LAMP_SPOT") + "object.ms_auto", text="Auto Unwrap", icon="LIGHT_SPOT") row.prop(group, 'autoUnwrapPrecision', text='') self.layout.label(text="Manual Unwrap:") row = self.layout.row() row.operator( - "object.ms_run", text="StartManualUnwrap", icon="LAMP_SPOT") + "object.ms_run", text="StartManualUnwrap", icon="LIGHT_SPOT") row.operator( - "object.ms_run_remove", text="FinishManualUnwrap", icon="LAMP_SPOT") + "object.ms_run_remove", text="FinishManualUnwrap", icon="LIGHT_SPOT") class TexAtl_RunAuto(Operator): |