diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-27 15:41:53 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-07-06 21:06:09 +0300 |
commit | 74fd17e9d788394fa5bf781bb3e60bca7617b22c (patch) | |
tree | a27bcd7e67f74cd0abfeb06b6b9f13e049d736f2 | |
parent | 4ac048f4e4ef1945fe085c3c0ebf263eb51d8d1b (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.
96 files changed, 899 insertions, 939 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index df6949f2095..85947b4bd28 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -887,17 +887,17 @@ class CyclesMaterialSettings(bpy.types.PropertyGroup): del bpy.types.Material.cycles -class CyclesLampSettings(bpy.types.PropertyGroup): +class CyclesLightSettings(bpy.types.PropertyGroup): @classmethod def register(cls): - bpy.types.Lamp.cycles = PointerProperty( - name="Cycles Lamp Settings", - description="Cycles lamp settings", + bpy.types.Light.cycles = PointerProperty( + name="Cycles Light Settings", + description="Cycles light settings", type=cls, ) cls.cast_shadow = BoolProperty( name="Cast Shadow", - description="Lamp casts shadows", + description="Light casts shadows", default=True, ) cls.samples = IntProperty( @@ -914,20 +914,20 @@ class CyclesLampSettings(bpy.types.PropertyGroup): ) cls.use_multiple_importance_sampling = BoolProperty( name="Multiple Importance Sample", - description="Use multiple importance sampling for the lamp, " - "reduces noise for area lamps and sharp glossy materials", + description="Use multiple importance sampling for the light, " + "reduces noise for area lights and sharp glossy materials", default=True, ) cls.is_portal = BoolProperty( name="Is Portal", - description="Use this area lamp to guide sampling of the background, " - "note that this will make the lamp invisible", + description="Use this area light to guide sampling of the background, " + "note that this will make the light invisible", default=False, ) @classmethod def unregister(cls): - del bpy.types.Lamp.cycles + del bpy.types.Light.cycles class CyclesWorldSettings(bpy.types.PropertyGroup): @@ -1460,7 +1460,7 @@ def register(): bpy.utils.register_class(CyclesRenderSettings) bpy.utils.register_class(CyclesCameraSettings) bpy.utils.register_class(CyclesMaterialSettings) - bpy.utils.register_class(CyclesLampSettings) + bpy.utils.register_class(CyclesLightSettings) bpy.utils.register_class(CyclesWorldSettings) bpy.utils.register_class(CyclesVisibilitySettings) bpy.utils.register_class(CyclesMeshSettings) @@ -1475,7 +1475,7 @@ def unregister(): bpy.utils.unregister_class(CyclesRenderSettings) bpy.utils.unregister_class(CyclesCameraSettings) bpy.utils.unregister_class(CyclesMaterialSettings) - bpy.utils.unregister_class(CyclesLampSettings) + bpy.utils.unregister_class(CyclesLightSettings) bpy.utils.unregister_class(CyclesWorldSettings) bpy.utils.unregister_class(CyclesMeshSettings) bpy.utils.unregister_class(CyclesObjectSettings) diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 7a4ed4fbdaf..6688874de49 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -1008,7 +1008,7 @@ class CYCLES_OBJECT_PT_cycles_settings(CyclesButtonsPanel, Panel): def poll(cls, context): ob = context.object return (CyclesButtonsPanel.poll(context) and - ob and ((ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META', 'LAMP'}) or + ob and ((ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META', 'LIGHT'}) or (ob.dupli_type == 'COLLECTION' and ob.dupli_group))) def draw(self, context): @@ -1029,7 +1029,7 @@ class CYCLES_OBJECT_PT_cycles_settings(CyclesButtonsPanel, Panel): flow.prop(visibility, "transmission") flow.prop(visibility, "scatter") - if ob.type != 'LAMP': + if ob.type != 'LIGHT': flow.prop(visibility, "shadow") row = layout.row() @@ -1049,7 +1049,7 @@ class CYCLES_OBJECT_PT_cycles_settings(CyclesButtonsPanel, Panel): class CYCLES_OT_use_shading_nodes(Operator): - """Enable nodes on a material, world or lamp""" + """Enable nodes on a material, world or light""" bl_idname = "cycles.use_shading_nodes" bl_label = "Use Nodes" @@ -1063,8 +1063,8 @@ class CYCLES_OT_use_shading_nodes(Operator): context.material.use_nodes = True elif context.world: context.world.use_nodes = True - elif context.lamp: - context.lamp.use_nodes = True + elif context.light: + context.light.use_nodes = True return {'FINISHED'} @@ -1089,7 +1089,7 @@ def panel_node_draw(layout, id_data, output_type, input_name): return True -class CYCLES_LAMP_PT_preview(CyclesButtonsPanel, Panel): +class CYCLES_LIGHT_PT_preview(CyclesButtonsPanel, Panel): bl_label = "Preview" bl_context = "data" bl_options = {'DEFAULT_CLOSED'} @@ -1097,52 +1097,52 @@ class CYCLES_LAMP_PT_preview(CyclesButtonsPanel, Panel): @classmethod def poll(cls, context): return ( - context.lamp and + context.light and not ( - context.lamp.type == 'AREA' and - context.lamp.cycles.is_portal + context.light.type == 'AREA' and + context.light.cycles.is_portal ) and CyclesButtonsPanel.poll(context) ) def draw(self, context): - self.layout.template_preview(context.lamp) + self.layout.template_preview(context.light) -class CYCLES_LAMP_PT_lamp(CyclesButtonsPanel, Panel): - bl_label = "Lamp" +class CYCLES_LIGHT_PT_light(CyclesButtonsPanel, Panel): + bl_label = "Light" bl_context = "data" @classmethod def poll(cls, context): - return context.lamp and CyclesButtonsPanel.poll(context) + return context.light and CyclesButtonsPanel.poll(context) def draw(self, context): layout = self.layout - lamp = context.lamp - clamp = lamp.cycles + light = context.light + clamp = light.cycles # cscene = context.scene.cycles - layout.prop(lamp, "type", expand=True) + layout.prop(light, "type", expand=True) layout.use_property_split = True col = layout.column() - if lamp.type in {'POINT', 'SUN', 'SPOT'}: - col.prop(lamp, "shadow_soft_size", text="Size") - elif lamp.type == 'AREA': - col.prop(lamp, "shape", text="Shape") + if light.type in {'POINT', 'SUN', 'SPOT'}: + col.prop(light, "shadow_soft_size", text="Size") + elif light.type == 'AREA': + col.prop(light, "shape", text="Shape") sub = col.column(align=True) - if lamp.shape in {'SQUARE', 'DISK'}: - sub.prop(lamp, "size") - elif lamp.shape in {'RECTANGLE', 'ELLIPSE'}: - sub.prop(lamp, "size", text="Size X") - sub.prop(lamp, "size_y", text="Y") + if light.shape in {'SQUARE', 'DISK'}: + sub.prop(light, "size") + elif light.shape in {'RECTANGLE', 'ELLIPSE'}: + sub.prop(light, "size", text="Size X") + sub.prop(light, "size_y", text="Y") - if not (lamp.type == 'AREA' and clamp.is_portal): + if not (light.type == 'AREA' and clamp.is_portal): sub = col.column() if use_branched_path(context): subsub = sub.row(align=True) @@ -1151,53 +1151,53 @@ class CYCLES_LAMP_PT_lamp(CyclesButtonsPanel, Panel): sub.prop(clamp, "max_bounces") sub = col.column(align=True) - sub.active = not (lamp.type == 'AREA' and clamp.is_portal) + sub.active = not (light.type == 'AREA' and clamp.is_portal) sub.prop(clamp, "cast_shadow") sub.prop(clamp, "use_multiple_importance_sampling", text="Multiple Importance") - if lamp.type == 'AREA': + if light.type == 'AREA': col.prop(clamp, "is_portal", text="Portal") - if lamp.type == 'HEMI': - layout.label(text="Not supported, interpreted as sun lamp") + if light.type == 'HEMI': + layout.label(text="Not supported, interpreted as sun light") -class CYCLES_LAMP_PT_nodes(CyclesButtonsPanel, Panel): +class CYCLES_LIGHT_PT_nodes(CyclesButtonsPanel, Panel): bl_label = "Nodes" bl_context = "data" @classmethod def poll(cls, context): - return context.lamp and not (context.lamp.type == 'AREA' and - context.lamp.cycles.is_portal) and \ + return context.light and not (context.light.type == 'AREA' and + context.light.cycles.is_portal) and \ CyclesButtonsPanel.poll(context) def draw(self, context): layout = self.layout - lamp = context.lamp - if not panel_node_draw(layout, lamp, 'OUTPUT_LAMP', 'Surface'): - layout.prop(lamp, "color") + light = context.light + if not panel_node_draw(layout, light, 'OUTPUT_LIGHT', 'Surface'): + layout.prop(light, "color") -class CYCLES_LAMP_PT_spot(CyclesButtonsPanel, Panel): +class CYCLES_LIGHT_PT_spot(CyclesButtonsPanel, Panel): bl_label = "Spot Shape" bl_context = "data" @classmethod def poll(cls, context): - lamp = context.lamp - return (lamp and lamp.type == 'SPOT') and CyclesButtonsPanel.poll(context) + light = context.light + return (light and light.type == 'SPOT') and CyclesButtonsPanel.poll(context) def draw(self, context): layout = self.layout - lamp = context.lamp + light = context.light layout.use_property_split = True col = layout.column() - col.prop(lamp, "spot_size", text="Size") - col.prop(lamp, "spot_blend", text="Blend", slider=True) - col.prop(lamp, "show_cone") + col.prop(light, "spot_size", text="Size") + col.prop(light, "spot_blend", text="Blend", slider=True) + col.prop(light, "show_cone") class CYCLES_WORLD_PT_preview(CyclesButtonsPanel, Panel): @@ -1789,7 +1789,7 @@ def get_panels(): 'DATA_PT_area', 'DATA_PT_camera_dof', 'DATA_PT_falloff_curve', - 'DATA_PT_lamp', + 'DATA_PT_light', 'DATA_PT_preview', 'DATA_PT_spot', 'MATERIAL_PT_context_material', @@ -1843,10 +1843,10 @@ classes = ( CYCLES_OBJECT_PT_motion_blur, CYCLES_OBJECT_PT_cycles_settings, CYCLES_OT_use_shading_nodes, - CYCLES_LAMP_PT_preview, - CYCLES_LAMP_PT_lamp, - CYCLES_LAMP_PT_nodes, - CYCLES_LAMP_PT_spot, + CYCLES_LIGHT_PT_preview, + CYCLES_LIGHT_PT_light, + CYCLES_LIGHT_PT_nodes, + CYCLES_LIGHT_PT_spot, CYCLES_WORLD_PT_preview, CYCLES_WORLD_PT_surface, CYCLES_WORLD_PT_volume, diff --git a/intern/cycles/blender/addon/version_update.py b/intern/cycles/blender/addon/version_update.py index 3334ccd65fd..b6ace0e6b57 100644 --- a/intern/cycles/blender/addon/version_update.py +++ b/intern/cycles/blender/addon/version_update.py @@ -55,10 +55,10 @@ def check_is_new_shading_world(world): return check_is_new_shading_ntree(world.node_tree) -def check_is_new_shading_lamp(lamp): - if not lamp.node_tree: +def check_is_new_shading_light(light): + if not light.node_tree: return False - return check_is_new_shading_ntree(lamp.node_tree) + return check_is_new_shading_ntree(light.node_tree) def foreach_notree_node(nodetree, callback, traversed): @@ -83,9 +83,9 @@ def foreach_cycles_node(callback): foreach_notree_node(world.node_tree, callback, traversed) - for lamp in bpy.data.lamps: - if check_is_new_shading_world(lamp): - foreach_notree_node(lamp.node_tree, + for light in bpy.data.lights: + if check_is_new_shading_world(light): + foreach_notree_node(light.node_tree, callback, traversed) @@ -393,12 +393,12 @@ def do_versions(self): if not cscene.is_property_set("tile_order"): cscene.tile_order = 'CENTER' - for lamp in bpy.data.lamps: - clamp = lamp.cycles + for light in bpy.data.lights: + clight = light.cycles # MIS - if not clamp.is_property_set("use_multiple_importance_sampling"): - clamp.use_multiple_importance_sampling = False + if not clight.is_property_set("use_multiple_importance_sampling"): + clight.use_multiple_importance_sampling = False for mat in bpy.data.materials: cmat = mat.cycles diff --git a/intern/cycles/blender/blender_camera.cpp b/intern/cycles/blender/blender_camera.cpp index 228f0645f94..fc86094949f 100644 --- a/intern/cycles/blender/blender_camera.cpp +++ b/intern/cycles/blender/blender_camera.cpp @@ -232,7 +232,7 @@ static void blender_camera_from_object(BlenderCamera *bcam, bcam->motion_steps = object_motion_steps(b_ob, b_ob); } else { - /* from lamp not implemented yet */ + /* from light not implemented yet */ } } diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index 70d6092622a..ed01d728931 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -89,7 +89,7 @@ bool BlenderSync::object_is_light(BL::Object& b_ob) { BL::ID b_ob_data = b_ob.data(); - return (b_ob_data && b_ob_data.is_a(&RNA_Lamp)); + return (b_ob_data && b_ob_data.is_a(&RNA_Light)); } static uint object_ray_visibility(BL::Object& b_ob) @@ -127,56 +127,56 @@ void BlenderSync::sync_light(BL::Object& b_parent, return; } - BL::Lamp b_lamp(b_ob.data()); + BL::Light b_light(b_ob.data()); /* type */ - switch(b_lamp.type()) { - case BL::Lamp::type_POINT: { - BL::PointLamp b_point_lamp(b_lamp); - light->size = b_point_lamp.shadow_soft_size(); + switch(b_light.type()) { + case BL::Light::type_POINT: { + BL::PointLight b_point_light(b_light); + light->size = b_point_light.shadow_soft_size(); light->type = LIGHT_POINT; break; } - case BL::Lamp::type_SPOT: { - BL::SpotLamp b_spot_lamp(b_lamp); - light->size = b_spot_lamp.shadow_soft_size(); + case BL::Light::type_SPOT: { + BL::SpotLight b_spot_light(b_light); + light->size = b_spot_light.shadow_soft_size(); light->type = LIGHT_SPOT; - light->spot_angle = b_spot_lamp.spot_size(); - light->spot_smooth = b_spot_lamp.spot_blend(); + light->spot_angle = b_spot_light.spot_size(); + light->spot_smooth = b_spot_light.spot_blend(); break; } - case BL::Lamp::type_HEMI: { + case BL::Light::type_HEMI: { light->type = LIGHT_DISTANT; light->size = 0.0f; break; } - case BL::Lamp::type_SUN: { - BL::SunLamp b_sun_lamp(b_lamp); - light->size = b_sun_lamp.shadow_soft_size(); + case BL::Light::type_SUN: { + BL::SunLight b_sun_light(b_light); + light->size = b_sun_light.shadow_soft_size(); light->type = LIGHT_DISTANT; break; } - case BL::Lamp::type_AREA: { - BL::AreaLamp b_area_lamp(b_lamp); + case BL::Light::type_AREA: { + BL::AreaLight b_area_light(b_light); light->size = 1.0f; light->axisu = transform_get_column(&tfm, 0); light->axisv = transform_get_column(&tfm, 1); - light->sizeu = b_area_lamp.size(); - switch(b_area_lamp.shape()) { - case BL::AreaLamp::shape_SQUARE: + light->sizeu = b_area_light.size(); + switch(b_area_light.shape()) { + case BL::AreaLight::shape_SQUARE: light->sizev = light->sizeu; light->round = false; break; - case BL::AreaLamp::shape_RECTANGLE: - light->sizev = b_area_lamp.size_y(); + case BL::AreaLight::shape_RECTANGLE: + light->sizev = b_area_light.size_y(); light->round = false; break; - case BL::AreaLamp::shape_DISK: + case BL::AreaLight::shape_DISK: light->sizev = light->sizeu; light->round = true; break; - case BL::AreaLamp::shape_ELLIPSE: - light->sizev = b_area_lamp.size_y(); + case BL::AreaLight::shape_ELLIPSE: + light->sizev = b_area_light.size_y(); light->round = true; break; } @@ -192,22 +192,22 @@ void BlenderSync::sync_light(BL::Object& b_parent, /* shader */ vector<Shader*> used_shaders; - find_shader(b_lamp, used_shaders, scene->default_light); + find_shader(b_light, used_shaders, scene->default_light); light->shader = used_shaders[0]; /* shadow */ PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles"); - PointerRNA clamp = RNA_pointer_get(&b_lamp.ptr, "cycles"); - light->cast_shadow = get_boolean(clamp, "cast_shadow"); - light->use_mis = get_boolean(clamp, "use_multiple_importance_sampling"); + PointerRNA clight = RNA_pointer_get(&b_light.ptr, "cycles"); + light->cast_shadow = get_boolean(clight, "cast_shadow"); + light->use_mis = get_boolean(clight, "use_multiple_importance_sampling"); - int samples = get_int(clamp, "samples"); + int samples = get_int(clight, "samples"); if(get_boolean(cscene, "use_square_samples")) light->samples = samples * samples; else light->samples = samples; - light->max_bounces = get_int(clamp, "max_bounces"); + light->max_bounces = get_int(clight, "max_bounces"); if(b_ob != b_ob_instance) { light->random_id = random_id; @@ -217,7 +217,7 @@ void BlenderSync::sync_light(BL::Object& b_parent, } if(light->type == LIGHT_AREA) - light->is_portal = get_boolean(clamp, "is_portal"); + light->is_portal = get_boolean(clight, "is_portal"); else light->is_portal = false; @@ -315,7 +315,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph, /* light is handled separately */ if(object_is_light(b_ob)) { - /* don't use lamps for excluded layers used as mask layer */ + /* don't use lights for excluded layers used as mask layer */ if(!motion && !((layer_flag & view_layer.holdout_layer) && (layer_flag & view_layer.exclude_layer))) { diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp index e2463200001..e254ee6f68d 100644 --- a/intern/cycles/blender/blender_shader.cpp +++ b/intern/cycles/blender/blender_shader.cpp @@ -1393,45 +1393,45 @@ void BlenderSync::sync_world(BL::Depsgraph& b_depsgraph, bool update_all) background->tag_update(scene); } -/* Sync Lamps */ +/* Sync Lights */ -void BlenderSync::sync_lamps(BL::Depsgraph& b_depsgraph, bool update_all) +void BlenderSync::sync_lights(BL::Depsgraph& b_depsgraph, bool update_all) { shader_map.set_default(scene->default_light); BL::Depsgraph::ids_iterator b_id; for(b_depsgraph.ids.begin(b_id); b_id != b_depsgraph.ids.end(); ++b_id) { - if (!b_id->is_a(&RNA_Lamp)) { + if (!b_id->is_a(&RNA_Light)) { continue; } - BL::Lamp b_lamp(*b_id); + BL::Light b_light(*b_id); Shader *shader; /* test if we need to sync */ - if(shader_map.sync(&shader, b_lamp) || update_all) { + if(shader_map.sync(&shader, b_light) || update_all) { ShaderGraph *graph = new ShaderGraph(); /* create nodes */ - if(b_lamp.use_nodes() && b_lamp.node_tree()) { - shader->name = b_lamp.name().c_str(); + if(b_light.use_nodes() && b_light.node_tree()) { + shader->name = b_light.name().c_str(); - BL::ShaderNodeTree b_ntree(b_lamp.node_tree()); + BL::ShaderNodeTree b_ntree(b_light.node_tree()); add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, graph, b_ntree); } else { float strength = 1.0f; - if(b_lamp.type() == BL::Lamp::type_POINT || - b_lamp.type() == BL::Lamp::type_SPOT || - b_lamp.type() == BL::Lamp::type_AREA) + if(b_light.type() == BL::Light::type_POINT || + b_light.type() == BL::Light::type_SPOT || + b_light.type() == BL::Light::type_AREA) { strength = 100.0f; } EmissionNode *emission = new EmissionNode(); - emission->color = get_float3(b_lamp.color()); + emission->color = get_float3(b_light.color()); emission->strength = strength; graph->add(emission); @@ -1459,7 +1459,7 @@ void BlenderSync::sync_shaders(BL::Depsgraph& b_depsgraph) shader_map.pre_sync(); sync_world(b_depsgraph, auto_refresh_update); - sync_lamps(b_depsgraph, auto_refresh_update); + sync_lights(b_depsgraph, auto_refresh_update); sync_materials(b_depsgraph, auto_refresh_update); /* false = don't delete unused shaders, not supported */ diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index f9e04bdef7c..cbca623ece7 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -113,10 +113,10 @@ void BlenderSync::sync_recalc(BL::Depsgraph& b_depsgraph) BL::Material b_mat(b_id); shader_map.set_recalc(b_mat); } - /* Lamp */ - else if (b_id.is_a(&RNA_Lamp)) { - BL::Lamp b_lamp(b_id); - shader_map.set_recalc(b_lamp); + /* Light */ + else if (b_id.is_a(&RNA_Light)) { + BL::Light b_light(b_id); + shader_map.set_recalc(b_light); } /* Object */ else if (b_id.is_a(&RNA_Object)) { diff --git a/intern/cycles/blender/blender_sync.h b/intern/cycles/blender/blender_sync.h index 1dce7ec99ef..cd1a37d3f13 100644 --- a/intern/cycles/blender/blender_sync.h +++ b/intern/cycles/blender/blender_sync.h @@ -100,7 +100,7 @@ public: private: /* sync */ - void sync_lamps(BL::Depsgraph& b_depsgraph, bool update_all); + void sync_lights(BL::Depsgraph& b_depsgraph, bool update_all); void sync_materials(BL::Depsgraph& b_depsgraph, bool update_all); void sync_objects(BL::Depsgraph& b_depsgraph, float motion_time = 0.0f); void sync_motion(BL::RenderSettings& b_render, diff --git a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py index bbeb1780355..1d3a0a23267 100644 --- a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py +++ b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py @@ -385,7 +385,7 @@ def dump_rna_messages(msgs, reports, settings, verbose=False): return def full_class_id(cls): - """Gives us 'ID.Lamp.AreaLamp' which is best for sorting.""" + """Gives us 'ID.Light.AreaLight' which is best for sorting.""" # Always the same issue, some classes listed in blacklist should actually no more exist (they have been # unregistered), but are still listed by __subclasses__() calls... :/ if cls in blacklist_rna_class: diff --git a/release/scripts/modules/bl_previews_utils/bl_previews_render.py b/release/scripts/modules/bl_previews_utils/bl_previews_render.py index 2efd6349d73..f2c766b2b2d 100644 --- a/release/scripts/modules/bl_previews_utils/bl_previews_render.py +++ b/release/scripts/modules/bl_previews_utils/bl_previews_render.py @@ -31,7 +31,7 @@ from mathutils import ( ) -INTERN_PREVIEW_TYPES = {'MATERIAL', 'LAMP', 'WORLD', 'TEXTURE', 'IMAGE'} +INTERN_PREVIEW_TYPES = {'MATERIAL', 'LIGHT', 'WORLD', 'TEXTURE', 'IMAGE'} OBJECT_TYPES_RENDER = {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT'} @@ -73,15 +73,15 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): # Helpers. RenderContext = collections.namedtuple("RenderContext", ( - "scene", "world", "camera", "lamp", "camera_data", "lamp_data", "image", # All those are names! - "backup_scene", "backup_world", "backup_camera", "backup_lamp", "backup_camera_data", "backup_lamp_data", + "scene", "world", "camera", "light", "camera_data", "light_data", "image", # All those are names! + "backup_scene", "backup_world", "backup_camera", "backup_light", "backup_camera_data", "backup_light_data", )) RENDER_PREVIEW_SIZE = bpy.app.render_preview_size def render_context_create(engine, objects_ignored): if engine == '__SCENE': - backup_scene, backup_world, backup_camera, backup_lamp, backup_camera_data, backup_lamp_data = [()] * 6 + backup_scene, backup_world, backup_camera, backup_light, backup_camera_data, backup_light_data = [()] * 6 scene = bpy.context.screen.scene exclude_props = {('world',), ('camera',), ('tool_settings',), ('preview',)} backup_scene = tuple(rna_backup_gen(scene, exclude_props=exclude_props)) @@ -96,20 +96,20 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): camera.rotation_euler = Euler((1.1635528802871704, 0.0, 0.7853981852531433), 'XYZ') # (66.67, 0.0, 45.0) scene.camera = camera scene.objects.link(camera) - # TODO: add lamp if none found in scene? - lamp = None - lamp_data = None + # TODO: add light if none found in scene? + light = None + light_data = None else: - backup_scene, backup_world, backup_camera, backup_lamp, backup_camera_data, backup_lamp_data = [None] * 6 + backup_scene, backup_world, backup_camera, backup_light, backup_camera_data, backup_light_data = [None] * 6 scene = bpy.data.scenes.new("TEMP_preview_render_scene") world = bpy.data.worlds.new("TEMP_preview_render_world") camera_data = bpy.data.cameras.new("TEMP_preview_render_camera") camera = bpy.data.objects.new("TEMP_preview_render_camera", camera_data) - lamp_data = bpy.data.lamps.new("TEMP_preview_render_lamp", 'SPOT') - lamp = bpy.data.objects.new("TEMP_preview_render_lamp", lamp_data) + light_data = bpy.data.lights.new("TEMP_preview_render_light", 'SPOT') + light = bpy.data.objects.new("TEMP_preview_render_light", light_data) - objects_ignored.add((camera.name, lamp.name)) + objects_ignored.add((camera.name, light.name)) scene.world = world @@ -117,10 +117,10 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): scene.camera = camera scene.objects.link(camera) - lamp.rotation_euler = Euler((0.7853981852531433, 0.0, 1.7453292608261108), 'XYZ') # (45.0, 0.0, 100.0) - lamp_data.falloff_type = 'CONSTANT' - lamp_data.spot_size = 1.0471975803375244 # 60 - scene.objects.link(lamp) + light.rotation_euler = Euler((0.7853981852531433, 0.0, 1.7453292608261108), 'XYZ') # (45.0, 0.0, 100.0) + light_data.falloff_type = 'CONSTANT' + light_data.spot_size = 1.0471975803375244 # 60 + scene.objects.link(light) if engine == 'BLENDER_RENDER': scene.render.engine = 'BLENDER_RENDER' @@ -154,9 +154,9 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): image.filepath = scene.render.filepath return RenderContext( - scene.name, world.name if world else None, camera.name, lamp.name if lamp else None, - camera_data.name, lamp_data.name if lamp_data else None, image.name, - backup_scene, backup_world, backup_camera, backup_lamp, backup_camera_data, backup_lamp_data, + scene.name, world.name if world else None, camera.name, light.name if light else None, + camera_data.name, light_data.name if light_data else None, image.name, + backup_scene, backup_world, backup_camera, backup_light, backup_camera_data, backup_light_data, ) def render_context_delete(render_context): @@ -171,8 +171,8 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): scene.camera = None if render_context.camera: scene.objects.unlink(bpy.data.objects[render_context.camera, None]) - if render_context.lamp: - scene.objects.unlink(bpy.data.objects[render_context.lamp, None]) + if render_context.light: + scene.objects.unlink(bpy.data.objects[render_context.light, None]) bpy.data.scenes.remove(scene, do_unlink=True) scene = None else: @@ -213,18 +213,18 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): print("ERROR:", e) success = False - if render_context.lamp: + if render_context.light: try: - lamp = bpy.data.objects[render_context.lamp, None] - if render_context.backup_lamp is None: + light = bpy.data.objects[render_context.light, None] + if render_context.backup_light is None: if scene is not None: - scene.objects.unlink(lamp) - lamp.user_clear() - bpy.data.objects.remove(lamp) - bpy.data.lamps.remove(bpy.data.lamps[render_context.lamp_data, None]) + scene.objects.unlink(light) + light.user_clear() + bpy.data.objects.remove(light) + bpy.data.lights.remove(bpy.data.lights[render_context.light_data, None]) else: - rna_backup_restore(lamp, render_context.backup_lamp) - rna_backup_restore(bpy.data.lamps[render_context.lamp_data, None], render_context.backup_lamp_data) + rna_backup_restore(light, render_context.backup_light) + rna_backup_restore(bpy.data.lights[render_context.light_data, None], render_context.backup_light_data) except Exception as e: print("ERROR:", e) success = False @@ -305,7 +305,7 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): scene = bpy.data.scenes[render_context.scene, None] if objects is not None: camera = bpy.data.objects[render_context.camera, None] - lamp = bpy.data.objects[render_context.lamp, None] if render_context.lamp is not None else None + light = bpy.data.objects[render_context.light, None] if render_context.light is not None else None cos = objects_bbox_calc(camera, objects, offset_matrix) loc, ortho_scale = camera.camera_fit_coords(scene, cos) camera.location = loc @@ -320,9 +320,9 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): max_dist = dist camera.data.clip_start = min_dist / 2 camera.data.clip_end = max_dist * 2 - if lamp: - loc, ortho_scale = lamp.camera_fit_coords(scene, cos) - lamp.location = loc + if light: + loc, ortho_scale = light.camera_fit_coords(scene, cos) + light.location = loc scene.update() bpy.ops.render.render(write_still=True) diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index b14565e2a9a..c4bf8422d3f 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -61,7 +61,7 @@ class Library(bpy_types.ID): # we could make this an attribute in rna. attr_links = ("actions", "armatures", "brushes", "cameras", "curves", "grease_pencil", "collections", "images", - "lamps", "lattices", "materials", "metaballs", + "lights", "lattices", "materials", "metaballs", "meshes", "node_groups", "objects", "scenes", "sounds", "speakers", "textures", "texts", "fonts", "worlds") diff --git a/release/scripts/presets/interface_theme/24x_blues.xml b/release/scripts/presets/interface_theme/24x_blues.xml index 36cfeeb5980..18b866eeb0f 100644 --- a/release/scripts/presets/interface_theme/24x_blues.xml +++ b/release/scripts/presets/interface_theme/24x_blues.xml @@ -253,7 +253,7 @@ text_keyframe="#ddd700" camera="#000000" empty="#000000" - lamp="#00000028" + light="#00000028" speaker="#000000" vertex="#000000" vertex_select="#ff8500" diff --git a/release/scripts/presets/interface_theme/back_to_black.xml b/release/scripts/presets/interface_theme/back_to_black.xml index 1636f5b5cf6..464625d0ba5 100644 --- a/release/scripts/presets/interface_theme/back_to_black.xml +++ b/release/scripts/presets/interface_theme/back_to_black.xml @@ -253,7 +253,7 @@ text_keyframe="#ddd700" camera="#535353" empty="#535353" - lamp="#fff0d328" + light="#fff0d328" speaker="#535353" vertex="#72cfdd" vertex_select="#ff8500" diff --git a/release/scripts/presets/interface_theme/blender_24x.xml b/release/scripts/presets/interface_theme/blender_24x.xml index 818e557adf0..d0459e02115 100644 --- a/release/scripts/presets/interface_theme/blender_24x.xml +++ b/release/scripts/presets/interface_theme/blender_24x.xml @@ -244,7 +244,7 @@ gp_vertex="#000000" gp_vertex_select="#ff8500" gp_vertex_size="3" - lamp="#00000028" + light="#00000028" speaker="#000000" camera="#000000" view_overlay="#000000" diff --git a/release/scripts/presets/interface_theme/blender_27x.xml b/release/scripts/presets/interface_theme/blender_27x.xml index 6a78dd5fc8f..db9d042ae55 100644 --- a/release/scripts/presets/interface_theme/blender_27x.xml +++ b/release/scripts/presets/interface_theme/blender_27x.xml @@ -304,7 +304,7 @@ text_keyframe="#ddd700" camera="#000000" empty="#000000" - lamp="#00000028" + light="#00000028" speaker="#000000" vertex="#000000" vertex_select="#ff8500" diff --git a/release/scripts/presets/interface_theme/dark_blue_gradient.xml b/release/scripts/presets/interface_theme/dark_blue_gradient.xml index d226f8531b2..589aeab3a50 100644 --- a/release/scripts/presets/interface_theme/dark_blue_gradient.xml +++ b/release/scripts/presets/interface_theme/dark_blue_gradient.xml @@ -244,7 +244,7 @@ gp_vertex="#000000" gp_vertex_select="#ff8500" gp_vertex_size="3" - lamp="#00000028" + light="#00000028" speaker="#000000" camera="#000000" view_overlay="#000000" diff --git a/release/scripts/presets/interface_theme/default++.xml b/release/scripts/presets/interface_theme/default++.xml index 413fbc1aa71..3599a094381 100644 --- a/release/scripts/presets/interface_theme/default++.xml +++ b/release/scripts/presets/interface_theme/default++.xml @@ -253,7 +253,7 @@ text_keyframe="#ddd700" camera="#000000" empty="#000000" - lamp="#00000028" + light="#00000028" speaker="#000000" vertex="#000000" vertex_select="#ff8500" diff --git a/release/scripts/presets/interface_theme/elsyiun.xml b/release/scripts/presets/interface_theme/elsyiun.xml index b9292856fe9..51af13a6009 100644 --- a/release/scripts/presets/interface_theme/elsyiun.xml +++ b/release/scripts/presets/interface_theme/elsyiun.xml @@ -244,7 +244,7 @@ gp_vertex="#000000" gp_vertex_select="#ff8500" gp_vertex_size="3" - lamp="#00000028" + light="#00000028" speaker="#000000" camera="#000000" view_overlay="#000000" diff --git a/release/scripts/presets/interface_theme/flatty_light.xml b/release/scripts/presets/interface_theme/flatty_light.xml index bdcf381f8f9..497b6575731 100644 --- a/release/scripts/presets/interface_theme/flatty_light.xml +++ b/release/scripts/presets/interface_theme/flatty_light.xml @@ -304,7 +304,7 @@ text_keyframe="#ddd700" camera="#b3b3b3" empty="#b3b3b3" - lamp="#cccccc33" + light="#cccccc33" speaker="#b3b3b3" vertex="#000000" vertex_select="#ff8500" diff --git a/release/scripts/presets/interface_theme/graph.xml b/release/scripts/presets/interface_theme/graph.xml index a032d8bd3b2..904fcdf41ec 100644 --- a/release/scripts/presets/interface_theme/graph.xml +++ b/release/scripts/presets/interface_theme/graph.xml @@ -244,7 +244,7 @@ gp_vertex="#000000" gp_vertex_select="#ff8500" gp_vertex_size="3" - lamp="#00000028" + light="#00000028" speaker="#000000" camera="#8d8c8d" view_overlay="#000000" diff --git a/release/scripts/presets/interface_theme/hexagon.xml b/release/scripts/presets/interface_theme/hexagon.xml index 4b24abc5fa7..1ca52b76253 100644 --- a/release/scripts/presets/interface_theme/hexagon.xml +++ b/release/scripts/presets/interface_theme/hexagon.xml @@ -244,7 +244,7 @@ gp_vertex="#000000" gp_vertex_select="#ff8500" gp_vertex_size="3" - lamp="#00000028" + light="#00000028" speaker="#000000" camera="#000000" view_overlay="#000000" diff --git a/release/scripts/presets/interface_theme/modern_minimalist.xml b/release/scripts/presets/interface_theme/modern_minimalist.xml index 8ba9402ecdb..3b982514f4f 100644 --- a/release/scripts/presets/interface_theme/modern_minimalist.xml +++ b/release/scripts/presets/interface_theme/modern_minimalist.xml @@ -253,7 +253,7 @@ text_keyframe="#ddd700" camera="#8d8c8d" empty="#8d8c8d" - lamp="#8d8c8d40" + light="#8d8c8d40" speaker="#8d8c8d" vertex="#bfbfbf" vertex_select="#00bdff" diff --git a/release/scripts/presets/interface_theme/north.xml b/release/scripts/presets/interface_theme/north.xml index 69cb90a64ce..8ab51261994 100644 --- a/release/scripts/presets/interface_theme/north.xml +++ b/release/scripts/presets/interface_theme/north.xml @@ -253,7 +253,7 @@ text_keyframe="#ddd700" camera="#000000" empty="#000000" - lamp="#00000028" + light="#00000028" speaker="#000000" vertex="#000000" vertex_select="#f2b252" diff --git a/release/scripts/presets/interface_theme/rtheme.xml b/release/scripts/presets/interface_theme/rtheme.xml index 27f33aa2fe5..34d4f6bd0db 100644 --- a/release/scripts/presets/interface_theme/rtheme.xml +++ b/release/scripts/presets/interface_theme/rtheme.xml @@ -244,7 +244,7 @@ gp_vertex="#000000" gp_vertex_select="#ff8500" gp_vertex_size="3" - lamp="#00000028" + light="#00000028" speaker="#000000" camera="#000000" view_overlay="#000000" diff --git a/release/scripts/presets/interface_theme/sandyslate.xml b/release/scripts/presets/interface_theme/sandyslate.xml index c5bae419bca..0b4756a40e8 100644 --- a/release/scripts/presets/interface_theme/sandyslate.xml +++ b/release/scripts/presets/interface_theme/sandyslate.xml @@ -244,7 +244,7 @@ gp_vertex="#000000" gp_vertex_select="#ff8500" gp_vertex_size="3" - lamp="#ff000080" + light="#ff000080" speaker="#979797" camera="#ff0000" view_overlay="#000000" diff --git a/release/scripts/presets/interface_theme/science_lab.xml b/release/scripts/presets/interface_theme/science_lab.xml index 2fe4cf99e41..e8a32f6ac29 100644 --- a/release/scripts/presets/interface_theme/science_lab.xml +++ b/release/scripts/presets/interface_theme/science_lab.xml @@ -244,7 +244,7 @@ gp_vertex="#000000" gp_vertex_select="#ff8500" gp_vertex_size="3" - lamp="#dbac00b9" + light="#dbac00b9" speaker="#229cd8" camera="#e28400" view_overlay="#666666" diff --git a/release/scripts/presets/interface_theme/softblend.xml b/release/scripts/presets/interface_theme/softblend.xml index ab0a5994838..ce20f7d4085 100644 --- a/release/scripts/presets/interface_theme/softblend.xml +++ b/release/scripts/presets/interface_theme/softblend.xml @@ -244,7 +244,7 @@ gp_vertex="#000000" gp_vertex_select="#ff8500" gp_vertex_size="3" - lamp="#ffe56666" + light="#ffe56666" speaker="#c2e787" camera="#000000" view_overlay="#000000" diff --git a/release/scripts/presets/interface_theme/true_blue_menu.xml b/release/scripts/presets/interface_theme/true_blue_menu.xml index 2b464ae120e..26e39f3bcdf 100644 --- a/release/scripts/presets/interface_theme/true_blue_menu.xml +++ b/release/scripts/presets/interface_theme/true_blue_menu.xml @@ -253,7 +253,7 @@ text_keyframe="#ddd700" camera="#000000" empty="#a78721" - lamp="#d6df1628" + light="#d6df1628" speaker="#a83f2d" vertex="#657780" vertex_select="#00cccb" diff --git a/release/scripts/presets/sunsky/classic.py b/release/scripts/presets/sunsky/classic.py deleted file mode 100644 index edb065d553c..00000000000 --- a/release/scripts/presets/sunsky/classic.py +++ /dev/null @@ -1,14 +0,0 @@ -import bpy -bpy.context.lamp.sky.atmosphere_turbidity = 4.0 -bpy.context.lamp.sky.sky_blend_type = 'ADD' -bpy.context.lamp.sky.sky_blend = 1.0 -bpy.context.lamp.sky.horizon_brightness = 10.0 -bpy.context.lamp.sky.spread = 1.49011614159e-09 -bpy.context.lamp.sky.sky_color_space = 'SMPTE' -bpy.context.lamp.sky.sky_exposure = 1.0 -bpy.context.lamp.sky.sun_brightness = 1.00000011921 -bpy.context.lamp.sky.sun_size = 1.00000166893 -bpy.context.lamp.sky.backscattered_light = 0.0 -bpy.context.lamp.sky.sun_intensity = 4.0 -bpy.context.lamp.sky.atmosphere_inscattering = 1.0 -bpy.context.lamp.sky.atmosphere_extinction = 1.0 diff --git a/release/scripts/presets/sunsky/desert.py b/release/scripts/presets/sunsky/desert.py deleted file mode 100644 index 8dd587a6eaf..00000000000 --- a/release/scripts/presets/sunsky/desert.py +++ /dev/null @@ -1,14 +0,0 @@ -import bpy -bpy.context.lamp.sky.atmosphere_turbidity = 6.0 -bpy.context.lamp.sky.sky_blend_type = 'ADD' -bpy.context.lamp.sky.sky_blend = 1.0 -bpy.context.lamp.sky.horizon_brightness = 4.99999761581 -bpy.context.lamp.sky.spread = 1.49011614159e-09 -bpy.context.lamp.sky.sky_color_space = 'SMPTE' -bpy.context.lamp.sky.sky_exposure = 1.0 -bpy.context.lamp.sky.sun_brightness = 1.00000011921 -bpy.context.lamp.sky.sun_size = 4.0 -bpy.context.lamp.sky.backscattered_light = 1.0 -bpy.context.lamp.sky.sun_intensity = 1.0 -bpy.context.lamp.sky.atmosphere_inscattering = 1.0 -bpy.context.lamp.sky.atmosphere_extinction = 1.0 diff --git a/release/scripts/presets/sunsky/mountain.py b/release/scripts/presets/sunsky/mountain.py deleted file mode 100644 index f0540af8100..00000000000 --- a/release/scripts/presets/sunsky/mountain.py +++ /dev/null @@ -1,14 +0,0 @@ -import bpy -bpy.context.lamp.sky.atmosphere_turbidity = 2.00000023842 -bpy.context.lamp.sky.sky_blend_type = 'ADD' -bpy.context.lamp.sky.sky_blend = 1.0 -bpy.context.lamp.sky.horizon_brightness = 0.100000016391 -bpy.context.lamp.sky.spread = 1.0 -bpy.context.lamp.sky.sky_color_space = 'SMPTE' -bpy.context.lamp.sky.sky_exposure = 1.0 -bpy.context.lamp.sky.sun_brightness = 1.99999988079 -bpy.context.lamp.sky.sun_size = 4.0 -bpy.context.lamp.sky.backscattered_light = -1.0 -bpy.context.lamp.sky.sun_intensity = 10.0 -bpy.context.lamp.sky.atmosphere_inscattering = 1.0 -bpy.context.lamp.sky.atmosphere_extinction = 1.0 diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py index 250c88b9009..d898239d7a9 100644 --- a/release/scripts/startup/bl_operators/anim.py +++ b/release/scripts/startup/bl_operators/anim.py @@ -110,7 +110,7 @@ class ANIM_OT_keying_set_export(Operator): # - special handling is needed for "nested" ID-blocks # (e.g. nodetree in Material) if ksp.id.bl_rna.identifier.startswith("ShaderNodeTree"): - # Find material or lamp using this node tree... + # Find material or light using this node tree... id_bpy_path = "bpy.data.nodes[\"%s\"]" found = False @@ -121,14 +121,14 @@ class ANIM_OT_keying_set_export(Operator): break if not found: - for lamp in bpy.data.lamps: - if lamp.node_tree == ksp.id: - id_bpy_path = "bpy.data.lamps[\"%s\"].node_tree" % (lamp.name) + for light in bpy.data.lights: + if light.node_tree == ksp.id: + id_bpy_path = "bpy.data.lights[\"%s\"].node_tree" % (light.name) found = True break if not found: - self.report({'WARN'}, "Could not find material or lamp using Shader Node Tree - %s" % (ksp.id)) + self.report({'WARN'}, "Could not find material or light using Shader Node Tree - %s" % (ksp.id)) elif ksp.id.bl_rna.identifier.startswith("CompositorNodeTree"): # Find compositor nodetree using this node tree... for scene in bpy.data.scenes: diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py index 5f3075b403f..95c4bbbfba9 100644 --- a/release/scripts/startup/bl_operators/clip.py +++ b/release/scripts/startup/bl_operators/clip.py @@ -915,17 +915,17 @@ class CLIP_OT_setup_tracking_scene(Operator): return [(layers_a[i] | layers_b[i]) for i in range(len(layers_a))] @staticmethod - def _createLamp(scene): - lamp = bpy.data.lamps.new(name="Lamp", type='POINT') - lampob = bpy.data.objects.new(name="Lamp", object_data=lamp) - scene.objects.link(lampob) + def _createLight(scene): + light = bpy.data.lights.new(name="Light", type='POINT') + lightob = bpy.data.objects.new(name="Light", object_data=light) + scene.objects.link(lightob) - lampob.matrix_local = Matrix.Translation((4.076, 1.005, 5.904)) + lightob.matrix_local = Matrix.Translation((4.076, 1.005, 5.904)) - lamp.distance = 30 - lamp.shadow_method = 'RAY_SHADOW' + light.distance = 30 + light.shadow_method = 'RAY_SHADOW' - return lampob + return lightob def _createSampleObject(self, scene): vertices = self._getPlaneVertices(1.0, -1.0) + \ @@ -947,20 +947,20 @@ class CLIP_OT_setup_tracking_scene(Operator): all_layers = self._mergeLayers(fg.layers, bg.layers) - # ensure all lamps are active on foreground and background - has_lamp = False + # ensure all lights are active on foreground and background + has_light = False has_mesh = False for ob in scene.objects: - if ob.type == 'LAMP': + if ob.type == 'LIGHT': ob.layers = all_layers - has_lamp = True + has_light = True elif ob.type == 'MESH' and "is_ground" not in ob: has_mesh = True - # create sample lamp if there's no lamps in the scene - if not has_lamp: - lamp = self._createLamp(scene) - lamp.layers = all_layers + # create sample light if there's no lights in the scene + if not has_light: + light = self._createLight(scene) + light.layers = all_layers # create sample object if there's no meshes in the scene if not has_mesh: diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index da9054fb681..51ba45cdcd7 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -34,7 +34,7 @@ _modules = [ "properties_data_camera", "properties_data_curve", "properties_data_empty", - "properties_data_lamp", + "properties_data_light", "properties_data_lattice", "properties_data_mesh", "properties_data_metaball", diff --git a/release/scripts/startup/bl_ui/properties_data_lamp.py b/release/scripts/startup/bl_ui/properties_data_lamp.py deleted file mode 100644 index d613967584c..00000000000 --- a/release/scripts/startup/bl_ui/properties_data_lamp.py +++ /dev/null @@ -1,363 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# <pep8 compliant> -import bpy -from bpy.types import Menu, Panel -from rna_prop_ui import PropertyPanel - - -class DataButtonsPanel: - bl_space_type = 'PROPERTIES' - bl_region_type = 'WINDOW' - bl_context = "data" - - @classmethod - def poll(cls, context): - engine = context.engine - return context.lamp and (engine in cls.COMPAT_ENGINES) - - -class DATA_PT_context_lamp(DataButtonsPanel, Panel): - bl_label = "" - bl_options = {'HIDE_HEADER'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} - - def draw(self, context): - layout = self.layout - - ob = context.object - lamp = context.lamp - space = context.space_data - - split = layout.split(percentage=0.65) - - if ob: - split.template_ID(ob, "data") - elif lamp: - split.template_ID(space, "pin_id") - - -class DATA_PT_preview(DataButtonsPanel, Panel): - bl_label = "Preview" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} - - def draw(self, context): - self.layout.template_preview(context.lamp) - - -class DATA_PT_lamp(DataButtonsPanel, Panel): - bl_label = "Lamp" - COMPAT_ENGINES = {'BLENDER_RENDER'} - - def draw(self, context): - layout = self.layout - - lamp = context.lamp - - layout.row().prop(lamp, "type", expand=True) - - layout.use_property_split = True - - col = col.column() - col.prop(lamp, "color") - col.prop(lamp, "energy") - - if lamp.type in {'POINT', 'SPOT'}: - - col = col.column() - col.label(text="Falloff") - col.prop(lamp, "falloff_type") - col.prop(lamp, "distance") - col.prop(lamp, "shadow_soft_size") - - if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED': - sub = col.column(align=True) - sub.prop(lamp, "linear_attenuation", slider=True, text="Linear") - sub.prop(lamp, "quadratic_attenuation", slider=True, text="Quadratic") - - elif lamp.falloff_type == 'INVERSE_COEFFICIENTS': - col.label(text="Inverse Coefficients") - sub = col.column(align=True) - sub.prop(lamp, "constant_coefficient", text="Constant") - sub.prop(lamp, "linear_coefficient", text="Linear") - sub.prop(lamp, "quadratic_coefficient", text="Quadratic") - - if lamp.type == 'AREA': - col.prop(lamp, "distance") - - col = split.column() - col.label() - - -class DATA_PT_EEVEE_lamp(DataButtonsPanel, Panel): - bl_label = "Lamp" - COMPAT_ENGINES = {'BLENDER_EEVEE'} - - def draw(self, context): - layout = self.layout - lamp = context.lamp - - layout.row().prop(lamp, "type", expand=True) - - layout.use_property_split = True - - col = layout.column() - col.prop(lamp, "color") - col.prop(lamp, "energy") - col.prop(lamp, "specular_factor", text="Specular") - - col.separator() - - if lamp.type in {'POINT', 'SPOT', 'SUN'}: - col.prop(lamp, "shadow_soft_size", text="Radius") - elif lamp.type == 'AREA': - col.prop(lamp, "shape") - - sub = col.column(align=True) - - if lamp.shape in {'SQUARE', 'DISK'}: - sub.prop(lamp, "size") - elif lamp.shape in {'RECTANGLE', 'ELLIPSE'}: - sub.prop(lamp, "size", text="Size X") - sub.prop(lamp, "size_y", text="Y") - - -class DATA_PT_EEVEE_shadow(DataButtonsPanel, Panel): - bl_label = "Shadow" - COMPAT_ENGINES = {'BLENDER_EEVEE'} - - @classmethod - def poll(cls, context): - lamp = context.lamp - engine = context.engine - return (lamp and lamp.type in {'POINT', 'SUN', 'SPOT', 'AREA'}) and (engine in cls.COMPAT_ENGINES) - - def draw_header(self, context): - lamp = context.lamp - self.layout.prop(lamp, "use_shadow", text="") - - def draw(self, context): - layout = self.layout - layout.use_property_split = True - - lamp = context.lamp - - layout.active = lamp.use_shadow - - col = layout.column() - sub = col.column(align=True) - sub.prop(lamp, "shadow_buffer_clip_start", text="Clip Start") - sub.prop(lamp, "shadow_buffer_clip_end", text="End") - - col.prop(lamp, "shadow_buffer_soft", text="Softness") - - col.separator() - - col.prop(lamp, "shadow_buffer_bias", text="Bias") - col.prop(lamp, "shadow_buffer_exp", text="Exponent") - col.prop(lamp, "shadow_buffer_bleed_bias", text="Bleed Bias") - - -class DATA_PT_EEVEE_shadow_cascaded_shadow_map(DataButtonsPanel, Panel): - bl_label = "Cascaded Shadow Map" - bl_parent_id = "DATA_PT_EEVEE_shadow" - bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_EEVEE'} - - @classmethod - def poll(cls, context): - lamp = context.lamp - engine = context.engine - - return (lamp and lamp.type == 'SUN') and (engine in cls.COMPAT_ENGINES) - - def draw(self, context): - layout = self.layout - lamp = context.lamp - layout.use_property_split = True - - col = layout.column() - - col.prop(lamp, "shadow_cascade_count", text="Count") - col.prop(lamp, "shadow_cascade_fade", text="Fade") - - col.prop(lamp, "shadow_cascade_max_distance", text="Max Distance") - col.prop(lamp, "shadow_cascade_exponent", text="Distribution") - - -class DATA_PT_EEVEE_shadow_contact(DataButtonsPanel, Panel): - bl_label = "Contact Shadows" - bl_parent_id = "DATA_PT_EEVEE_shadow" - COMPAT_ENGINES = {'BLENDER_EEVEE'} - - @classmethod - def poll(cls, context): - lamp = context.lamp - engine = context.engine - return (lamp and lamp.type in {'POINT', 'SUN', 'SPOT', 'AREA'}) and (engine in cls.COMPAT_ENGINES) - - def draw_header(self, context): - lamp = context.lamp - - layout = self.layout - layout.active = lamp.use_shadow - layout.prop(lamp, "use_contact_shadow", text="") - - def draw(self, context): - layout = self.layout - lamp = context.lamp - layout.use_property_split = True - - col = layout.column() - col.active = lamp.use_shadow and lamp.use_contact_shadow - - col.prop(lamp, "contact_shadow_distance", text="Distance") - col.prop(lamp, "contact_shadow_soft_size", text="Softness") - col.prop(lamp, "contact_shadow_bias", text="Bias") - col.prop(lamp, "contact_shadow_thickness", text="Thickness") - - -class DATA_PT_area(DataButtonsPanel, Panel): - bl_label = "Area Shape" - COMPAT_ENGINES = {'BLENDER_RENDER'} - - @classmethod - def poll(cls, context): - lamp = context.lamp - engine = context.engine - return (lamp and lamp.type == 'AREA') and (engine in cls.COMPAT_ENGINES) - - def draw(self, context): - layout = self.layout - - lamp = context.lamp - - col = layout.column() - col.row().prop(lamp, "shape", expand=True) - sub = col.row(align=True) - - if lamp.shape in {'SQUARE', 'DISK'}: - sub.prop(lamp, "size") - elif lamp.shape in {'RECTANGLE', 'ELLIPSE'}: - sub.prop(lamp, "size", text="Size X") - sub.prop(lamp, "size_y", text="Size Y") - - -class DATA_PT_spot(DataButtonsPanel, Panel): - bl_label = "Spot Shape" - COMPAT_ENGINES = {'BLENDER_RENDER'} - - @classmethod - def poll(cls, context): - lamp = context.lamp - engine = context.engine - return (lamp and lamp.type == 'SPOT') and (engine in cls.COMPAT_ENGINES) - - def draw(self, context): - layout = self.layout - - lamp = context.lamp - - split = layout.split() - - col = split.column() - sub = col.column() - sub.prop(lamp, "spot_size", text="Size") - sub.prop(lamp, "spot_blend", text="Blend", slider=True) - col.prop(lamp, "use_square") - col.prop(lamp, "show_cone") - - col = split.column() - - col.active = (lamp.shadow_method != 'BUFFER_SHADOW' or lamp.shadow_buffer_type != 'DEEP') - col.prop(lamp, "use_halo") - sub = col.column(align=True) - sub.active = lamp.use_halo - sub.prop(lamp, "halo_intensity", text="Intensity") - if lamp.shadow_method == 'BUFFER_SHADOW': - sub.prop(lamp, "halo_step", text="Step") - - -class DATA_PT_spot(DataButtonsPanel, Panel): - bl_label = "Spot Shape" - bl_parent_id = "DATA_PT_EEVEE_lamp" - COMPAT_ENGINES = {'BLENDER_EEVEE'} - - @classmethod - def poll(cls, context): - lamp = context.lamp - engine = context.engine - return (lamp and lamp.type == 'SPOT') and (engine in cls.COMPAT_ENGINES) - - def draw(self, context): - layout = self.layout - layout.use_property_split = True - - lamp = context.lamp - - col = layout.column() - - col.prop(lamp, "spot_size", text="Size") - col.prop(lamp, "spot_blend", text="Blend", slider=True) - - col.prop(lamp, "show_cone") - - -class DATA_PT_falloff_curve(DataButtonsPanel, Panel): - bl_label = "Falloff Curve" - bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} - - @classmethod - def poll(cls, context): - lamp = context.lamp - engine = context.engine - - return (lamp and lamp.type in {'POINT', 'SPOT'} and lamp.falloff_type == 'CUSTOM_CURVE') and (engine in cls.COMPAT_ENGINES) - - def draw(self, context): - lamp = context.lamp - - self.layout.template_curve_mapping(lamp, "falloff_curve", use_negative_slope=True) - - -class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} - _context_path = "object.data" - _property_type = bpy.types.Lamp - - -classes = ( - DATA_PT_context_lamp, - DATA_PT_preview, - DATA_PT_lamp, - DATA_PT_EEVEE_lamp, - DATA_PT_EEVEE_shadow, - DATA_PT_EEVEE_shadow_contact, - DATA_PT_EEVEE_shadow_cascaded_shadow_map, - DATA_PT_area, - DATA_PT_spot, - DATA_PT_falloff_curve, - DATA_PT_custom_props_lamp, -) - -if __name__ == "__main__": # only for live edit. - from bpy.utils import register_class - for cls in classes: - register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_data_light.py b/release/scripts/startup/bl_ui/properties_data_light.py new file mode 100644 index 00000000000..057f7dffce0 --- /dev/null +++ b/release/scripts/startup/bl_ui/properties_data_light.py @@ -0,0 +1,363 @@ +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +# <pep8 compliant> +import bpy +from bpy.types import Menu, Panel +from rna_prop_ui import PropertyPanel + + +class DataButtonsPanel: + bl_space_type = 'PROPERTIES' + bl_region_type = 'WINDOW' + bl_context = "data" + + @classmethod + def poll(cls, context): + engine = context.engine + return context.light and (engine in cls.COMPAT_ENGINES) + + +class DATA_PT_context_light(DataButtonsPanel, Panel): + bl_label = "" + bl_options = {'HIDE_HEADER'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + + def draw(self, context): + layout = self.layout + + ob = context.object + light = context.light + space = context.space_data + + split = layout.split(percentage=0.65) + + if ob: + split.template_ID(ob, "data") + elif light: + split.template_ID(space, "pin_id") + + +class DATA_PT_preview(DataButtonsPanel, Panel): + bl_label = "Preview" + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + + def draw(self, context): + self.layout.template_preview(context.light) + + +class DATA_PT_light(DataButtonsPanel, Panel): + bl_label = "Light" + COMPAT_ENGINES = {'BLENDER_RENDER'} + + def draw(self, context): + layout = self.layout + + light = context.light + + layout.row().prop(light, "type", expand=True) + + layout.use_property_split = True + + col = col.column() + col.prop(light, "color") + col.prop(light, "energy") + + if light.type in {'POINT', 'SPOT'}: + + col = col.column() + col.label(text="Falloff") + col.prop(light, "falloff_type") + col.prop(light, "distance") + col.prop(light, "shadow_soft_size") + + if light.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED': + sub = col.column(align=True) + sub.prop(light, "linear_attenuation", slider=True, text="Linear") + sub.prop(light, "quadratic_attenuation", slider=True, text="Quadratic") + + elif light.falloff_type == 'INVERSE_COEFFICIENTS': + col.label(text="Inverse Coefficients") + sub = col.column(align=True) + sub.prop(light, "constant_coefficient", text="Constant") + sub.prop(light, "linear_coefficient", text="Linear") + sub.prop(light, "quadratic_coefficient", text="Quadratic") + + if light.type == 'AREA': + col.prop(light, "distance") + + col = split.column() + col.label() + + +class DATA_PT_EEVEE_light(DataButtonsPanel, Panel): + bl_label = "Light" + COMPAT_ENGINES = {'BLENDER_EEVEE'} + + def draw(self, context): + layout = self.layout + light = context.light + + layout.row().prop(light, "type", expand=True) + + layout.use_property_split = True + + col = layout.column() + col.prop(light, "color") + col.prop(light, "energy") + col.prop(light, "specular_factor", text="Specular") + + col.separator() + + if light.type in {'POINT', 'SPOT', 'SUN'}: + col.prop(light, "shadow_soft_size", text="Radius") + elif light.type == 'AREA': + col.prop(light, "shape") + + sub = col.column(align=True) + + if light.shape in {'SQUARE', 'DISK'}: + sub.prop(light, "size") + elif light.shape in {'RECTANGLE', 'ELLIPSE'}: + sub.prop(light, "size", text="Size X") + sub.prop(light, "size_y", text="Y") + + +class DATA_PT_EEVEE_shadow(DataButtonsPanel, Panel): + bl_label = "Shadow" + COMPAT_ENGINES = {'BLENDER_EEVEE'} + + @classmethod + def poll(cls, context): + light = context.light + engine = context.engine + return (light and light.type in {'POINT', 'SUN', 'SPOT', 'AREA'}) and (engine in cls.COMPAT_ENGINES) + + def draw_header(self, context): + light = context.light + self.layout.prop(light, "use_shadow", text="") + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + + light = context.light + + layout.active = light.use_shadow + + col = layout.column() + sub = col.column(align=True) + sub.prop(light, "shadow_buffer_clip_start", text="Clip Start") + sub.prop(light, "shadow_buffer_clip_end", text="End") + + col.prop(light, "shadow_buffer_soft", text="Softness") + + col.separator() + + col.prop(light, "shadow_buffer_bias", text="Bias") + col.prop(light, "shadow_buffer_exp", text="Exponent") + col.prop(light, "shadow_buffer_bleed_bias", text="Bleed Bias") + + +class DATA_PT_EEVEE_shadow_cascaded_shadow_map(DataButtonsPanel, Panel): + bl_label = "Cascaded Shadow Map" + bl_parent_id = "DATA_PT_EEVEE_shadow" + bl_options = {'DEFAULT_CLOSED'} + COMPAT_ENGINES = {'BLENDER_EEVEE'} + + @classmethod + def poll(cls, context): + light = context.light + engine = context.engine + + return (light and light.type == 'SUN') and (engine in cls.COMPAT_ENGINES) + + def draw(self, context): + layout = self.layout + light = context.light + layout.use_property_split = True + + col = layout.column() + + col.prop(light, "shadow_cascade_count", text="Count") + col.prop(light, "shadow_cascade_fade", text="Fade") + + col.prop(light, "shadow_cascade_max_distance", text="Max Distance") + col.prop(light, "shadow_cascade_exponent", text="Distribution") + + +class DATA_PT_EEVEE_shadow_contact(DataButtonsPanel, Panel): + bl_label = "Contact Shadows" + bl_parent_id = "DATA_PT_EEVEE_shadow" + COMPAT_ENGINES = {'BLENDER_EEVEE'} + + @classmethod + def poll(cls, context): + light = context.light + engine = context.engine + return (light and light.type in {'POINT', 'SUN', 'SPOT', 'AREA'}) and (engine in cls.COMPAT_ENGINES) + + def draw_header(self, context): + light = context.light + + layout = self.layout + layout.active = light.use_shadow + layout.prop(light, "use_contact_shadow", text="") + + def draw(self, context): + layout = self.layout + light = context.light + layout.use_property_split = True + + col = layout.column() + col.active = light.use_shadow and light.use_contact_shadow + + col.prop(light, "contact_shadow_distance", text="Distance") + col.prop(light, "contact_shadow_soft_size", text="Softness") + col.prop(light, "contact_shadow_bias", text="Bias") + col.prop(light, "contact_shadow_thickness", text="Thickness") + + +class DATA_PT_area(DataButtonsPanel, Panel): + bl_label = "Area Shape" + COMPAT_ENGINES = {'BLENDER_RENDER'} + + @classmethod + def poll(cls, context): + light = context.light + engine = context.engine + return (light and light.type == 'AREA') and (engine in cls.COMPAT_ENGINES) + + def draw(self, context): + layout = self.layout + + light = context.light + + col = layout.column() + col.row().prop(light, "shape", expand=True) + sub = col.row(align=True) + + if light.shape in {'SQUARE', 'DISK'}: + sub.prop(light, "size") + elif light.shape in {'RECTANGLE', 'ELLIPSE'}: + sub.prop(light, "size", text="Size X") + sub.prop(light, "size_y", text="Size Y") + + +class DATA_PT_spot(DataButtonsPanel, Panel): + bl_label = "Spot Shape" + COMPAT_ENGINES = {'BLENDER_RENDER'} + + @classmethod + def poll(cls, context): + light = context.light + engine = context.engine + return (light and light.type == 'SPOT') and (engine in cls.COMPAT_ENGINES) + + def draw(self, context): + layout = self.layout + + light = context.light + + split = layout.split() + + col = split.column() + sub = col.column() + sub.prop(light, "spot_size", text="Size") + sub.prop(light, "spot_blend", text="Blend", slider=True) + col.prop(light, "use_square") + col.prop(light, "show_cone") + + col = split.column() + + col.active = (light.shadow_method != 'BUFFER_SHADOW' or light.shadow_buffer_type != 'DEEP') + col.prop(light, "use_halo") + sub = col.column(align=True) + sub.active = light.use_halo + sub.prop(light, "halo_intensity", text="Intensity") + if light.shadow_method == 'BUFFER_SHADOW': + sub.prop(light, "halo_step", text="Step") + + +class DATA_PT_spot(DataButtonsPanel, Panel): + bl_label = "Spot Shape" + bl_parent_id = "DATA_PT_EEVEE_light" + COMPAT_ENGINES = {'BLENDER_EEVEE'} + + @classmethod + def poll(cls, context): + light = context.light + engine = context.engine + return (light and light.type == 'SPOT') and (engine in cls.COMPAT_ENGINES) + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + + light = context.light + + col = layout.column() + + col.prop(light, "spot_size", text="Size") + col.prop(light, "spot_blend", text="Blend", slider=True) + + col.prop(light, "show_cone") + + +class DATA_PT_falloff_curve(DataButtonsPanel, Panel): + bl_label = "Falloff Curve" + bl_options = {'DEFAULT_CLOSED'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + + @classmethod + def poll(cls, context): + light = context.light + engine = context.engine + + return (light and light.type in {'POINT', 'SPOT'} and light.falloff_type == 'CUSTOM_CURVE') and (engine in cls.COMPAT_ENGINES) + + def draw(self, context): + light = context.light + + self.layout.template_curve_mapping(light, "falloff_curve", use_negative_slope=True) + + +class DATA_PT_custom_props_light(DataButtonsPanel, PropertyPanel, Panel): + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + _context_path = "object.data" + _property_type = bpy.types.Light + + +classes = ( + DATA_PT_context_light, + DATA_PT_preview, + DATA_PT_light, + DATA_PT_EEVEE_light, + DATA_PT_EEVEE_shadow, + DATA_PT_EEVEE_shadow_contact, + DATA_PT_EEVEE_shadow_cascaded_shadow_map, + DATA_PT_area, + DATA_PT_spot, + DATA_PT_falloff_curve, + DATA_PT_custom_props_light, +) + +if __name__ == "__main__": # only for live edit. + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index 93fbc7799bf..92022e019cc 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -132,8 +132,8 @@ class DopesheetFilterPopoverBase: flow.prop(dopesheet, "show_cameras", text="Cameras") if bpy.data.grease_pencil: flow.prop(dopesheet, "show_gpencil", text="Grease Pencil Objects") - if bpy.data.lamps: - flow.prop(dopesheet, "show_lamps", text="Lamps") + if bpy.data.lights: + flow.prop(dopesheet, "show_lights", text="Lights") if bpy.data.materials: flow.prop(dopesheet, "show_materials", text="Materials") if bpy.data.textures: diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 3960f336cd0..9d8c14ba9c3 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -61,7 +61,7 @@ class NODE_HT_header(Header): NODE_MT_editor_menus.draw_collapsible(context, layout) # No shader nodes for Eevee lamps - if snode_id and not (context.engine == 'BLENDER_EEVEE' and ob.type == 'LAMP'): + if snode_id and not (context.engine == 'BLENDER_EEVEE' and ob.type == 'LIGHT'): row = layout.row() row.prop(snode_id, "use_nodes") @@ -73,12 +73,11 @@ class NODE_HT_header(Header): # Show material.new when no active ID/slot exists if not id_from and ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'METABALL'}: row.template_ID(ob, "active_material", new="material.new") - # Material ID, but not for Lamps - if id_from and ob.type != 'LAMP': + # Material ID, but not for Lights + if id_from and ob.type != 'LIGHT': row.template_ID(id_from, "active_material", new="material.new") if snode.shader_type == 'WORLD': - NODE_MT_editor_menus.draw_collapsible(context, layout) if snode_id: diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index f19b0304afa..37a5804f12c 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -270,8 +270,8 @@ class OUTLINER_PT_filter(Panel): sub.prop(space, "use_filter_object_mesh", text="Meshes", icon="MESH_DATA") if bpy.data.armatures: sub.prop(space, "use_filter_object_armature", text="Armatures", icon="ARMATURE_DATA") - if bpy.data.lamps: - sub.prop(space, "use_filter_object_lamp", text="Lamps", icon="LAMP_DATA") + if bpy.data.lights: + sub.prop(space, "use_filter_object_light", text="Lights", icon="LIGHT_DATA") if bpy.data.cameras: sub.prop(space, "use_filter_object_camera", text="Cameras", icon="CAMERA_DATA") diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 1f00f8af1ff..8d560ff8815 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -28,23 +28,23 @@ from bpy.app.translations import pgettext_iface as iface_ from bpy.app.translations import contexts as i18n_contexts -def opengl_lamp_buttons(column, lamp): +def opengl_light_buttons(column, light): split = column.row() - split.prop(lamp, "use", text="", icon='OUTLINER_OB_LAMP' if lamp.use else 'LAMP_DATA') + split.prop(light, "use", text="", icon='OUTLINER_OB_LIGHT' if light.use else 'LIGHT_DATA') col = split.column() - col.active = lamp.use + col.active = light.use row = col.row() row.label(text="Diffuse:") - row.prop(lamp, "diffuse_color", text="") + row.prop(light, "diffuse_color", text="") row = col.row() row.label(text="Specular:") - row.prop(lamp, "specular_color", text="") + row.prop(light, "specular_color", text="") col = split.column() - col.active = lamp.use - col.prop(lamp, "direction", text="") + col.active = light.use + col.prop(light, "direction", text="") class USERPREF_HT_header(Header): @@ -454,7 +454,7 @@ class USERPREF_PT_edit(Panel): col.prop(edit, "use_duplicate_text", text="Text") col.prop(edit, "use_duplicate_metaball", text="Metaball") col.prop(edit, "use_duplicate_armature", text="Armature") - col.prop(edit, "use_duplicate_lamp", text="Lamp") + col.prop(edit, "use_duplicate_light", text="Light") col.prop(edit, "use_duplicate_material", text="Material") col.prop(edit, "use_duplicate_texture", text="Texture") #col.prop(edit, "use_duplicate_fcurve", text="F-Curve") @@ -580,14 +580,14 @@ class USERPREF_PT_system(Panel): split.label(text="Colors:") split.label(text="Direction:") - lamp = system.solid_lights[0] - opengl_lamp_buttons(column, lamp) + light = system.solid_lights[0] + opengl_light_buttons(column, light) - lamp = system.solid_lights[1] - opengl_lamp_buttons(column, lamp) + light = system.solid_lights[1] + opengl_light_buttons(column, light) - lamp = system.solid_lights[2] - opengl_lamp_buttons(column, lamp) + light = system.solid_lights[2] + opengl_light_buttons(column, light) column.separator() diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 4dfc9a9129b..ce764ef98c7 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -1399,15 +1399,15 @@ class INFO_MT_armature_add(Menu): layout.operator("object.armature_add", text="Single Bone", icon='BONE_DATA') -class INFO_MT_lamp_add(Menu): - bl_idname = "INFO_MT_lamp_add" - bl_label = "Lamp" +class INFO_MT_light_add(Menu): + bl_idname = "INFO_MT_light_add" + bl_label = "Light" def draw(self, context): layout = self.layout layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator_enum("object.lamp_add", "type") + layout.operator_enum("object.light_add", "type") class INFO_MT_lightprobe_add(Menu): @@ -1467,7 +1467,7 @@ class INFO_MT_add(Menu): else: INFO_MT_camera_add.draw(self, context) - layout.menu("INFO_MT_lamp_add", icon='OUTLINER_OB_LAMP') + layout.menu("INFO_MT_light_add", icon='OUTLINER_OB_LIGHT') layout.separator() layout.menu("INFO_MT_lightprobe_add", icon='OUTLINER_OB_LIGHTPROBE') layout.separator() @@ -1739,14 +1739,14 @@ class VIEW3D_MT_object_specials(Menu): props.input_scale = 0.01 props.header_text = "Empty Draw Size: %.3f" - if obj.type == 'LAMP': - lamp = obj.data + if obj.type == 'LIGHT': + light = obj.data layout.operator_context = 'INVOKE_REGION_WIN' emission_node = None - if lamp.node_tree: - for node in lamp.node_tree.nodes: + if light.node_tree: + for node in light.node_tree.nodes: if getattr(node, "type", None) == 'EMISSION': emission_node = node break @@ -1757,28 +1757,28 @@ class VIEW3D_MT_object_specials(Menu): props.data_path_item = "data.node_tree" \ ".nodes[\"" + emission_node.name + "\"]" \ ".inputs[\"Strength\"].default_value" - props.header_text = "Lamp Strength: %.3f" + props.header_text = "Light Strength: %.3f" props.input_scale = 0.1 - if lamp.type == 'AREA': + if light.type == 'AREA': props = layout.operator("wm.context_modal_mouse", text="Size X") props.data_path_iter = "selected_editable_objects" props.data_path_item = "data.size" - props.header_text = "Lamp Size X: %.3f" + props.header_text = "Light Size X: %.3f" - if lamp.shape in {'RECTANGLE', 'ELLIPSE'}: + if light.shape in {'RECTANGLE', 'ELLIPSE'}: props = layout.operator("wm.context_modal_mouse", text="Size Y") props.data_path_iter = "selected_editable_objects" props.data_path_item = "data.size_y" - props.header_text = "Lamp Size Y: %.3f" + props.header_text = "Light Size Y: %.3f" - elif lamp.type in {'SPOT', 'POINT', 'SUN'}: + elif light.type in {'SPOT', 'POINT', 'SUN'}: props = layout.operator("wm.context_modal_mouse", text="Size") props.data_path_iter = "selected_editable_objects" props.data_path_item = "data.shadow_soft_size" - props.header_text = "Lamp Size: %.3f" + props.header_text = "Light Size: %.3f" - if lamp.type == 'SPOT': + if light.type == 'SPOT': layout.separator() props = layout.operator("wm.context_modal_mouse", text="Spot Size") props.data_path_iter = "selected_editable_objects" @@ -4437,7 +4437,7 @@ classes = ( INFO_MT_edit_curve_add, INFO_MT_edit_armature_add, INFO_MT_armature_add, - INFO_MT_lamp_add, + INFO_MT_light_add, INFO_MT_lightprobe_add, INFO_MT_camera_add, INFO_MT_add, diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index 888045487f0..e6500b7c2c0 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -189,7 +189,7 @@ shader_node_categories = [ ]), ShaderNodeCategory("SH_NEW_OUTPUT", "Output", items=[ NodeItem("ShaderNodeOutputMaterial", poll=object_eevee_cycles_shader_nodes_poll), - NodeItem("ShaderNodeOutputLamp", poll=object_cycles_shader_nodes_poll), + NodeItem("ShaderNodeOutputLight", poll=object_cycles_shader_nodes_poll), NodeItem("ShaderNodeOutputWorld", poll=world_shader_nodes_poll), NodeItem("ShaderNodeOutputLineStyle", poll=line_style_shader_nodes_poll), NodeItem("NodeGroupOutput", poll=group_input_output_item_poll), 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) diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 9eb026b1c4f..13d6fd10eaa 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -733,7 +733,7 @@ void BKE_nodetree_remove_layer_n(struct bNodeTree *ntree, struct Scene *scene, c #define SH_NODE_OUTPUT_MATERIAL 124 #define SH_NODE_OUTPUT_WORLD 125 -#define SH_NODE_OUTPUT_LAMP 126 +#define SH_NODE_OUTPUT_LIGHT 126 #define SH_NODE_FRESNEL 127 #define SH_NODE_MIX_SHADER 128 #define SH_NODE_ATTRIBUTE 129 diff --git a/source/blender/blenkernel/intern/idcode.c b/source/blender/blenkernel/intern/idcode.c index 0edeaab8900..8328d71128a 100644 --- a/source/blender/blenkernel/intern/idcode.c +++ b/source/blender/blenkernel/intern/idcode.c @@ -67,7 +67,7 @@ static IDType idtypes[] = { { ID_IM, "Image", "images", BLT_I18NCONTEXT_ID_IMAGE, IDTYPE_FLAGS_ISLINKABLE }, { ID_IP, "Ipo", "ipos", "", IDTYPE_FLAGS_ISLINKABLE }, /* deprecated */ { ID_KE, "Key", "shape_keys", BLT_I18NCONTEXT_ID_SHAPEKEY, 0 }, - { ID_LA, "Lamp", "lamps", BLT_I18NCONTEXT_ID_LAMP, IDTYPE_FLAGS_ISLINKABLE }, + { ID_LA, "Light", "lights", BLT_I18NCONTEXT_ID_LAMP, IDTYPE_FLAGS_ISLINKABLE }, { ID_LI, "Library", "libraries", BLT_I18NCONTEXT_ID_LIBRARY, 0 }, { ID_LS, "FreestyleLineStyle", "linestyles", BLT_I18NCONTEXT_ID_FREESTYLELINESTYLE, IDTYPE_FLAGS_ISLINKABLE }, { ID_LT, "Lattice", "lattices", BLT_I18NCONTEXT_ID_LATTICE, IDTYPE_FLAGS_ISLINKABLE }, diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index f8040f0cf24..b7ca73e9f4a 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1999,7 +1999,7 @@ void do_versions_ipos_to_animato(Main *bmain) for (id = bmain->lamp.first; id; id = id->next) { Lamp *la = (Lamp *)id; - if (G.debug & G_DEBUG) printf("\tconverting lamp %s\n", id->name + 2); + if (G.debug & G_DEBUG) printf("\tconverting light %s\n", id->name + 2); /* we're only interested in the IPO */ if (la->ipo) { diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 0418634c704..a7c13ab2a81 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -653,7 +653,7 @@ static const char *get_obdata_defname(int type) case OB_FONT: return DATA_("Text"); case OB_MBALL: return DATA_("Mball"); case OB_CAMERA: return DATA_("Camera"); - case OB_LAMP: return DATA_("Lamp"); + case OB_LAMP: return DATA_("Light"); case OB_LATTICE: return DATA_("Lattice"); case OB_ARMATURE: return DATA_("Armature"); case OB_SPEAKER: return DATA_("Speaker"); diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index a382b7cca9c..ced6e967acf 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -389,7 +389,7 @@ Object *DocumentImporter::create_lamp_object(COLLADAFW::InstanceLight *lamp, Sce { const COLLADAFW::UniqueId& lamp_uid = lamp->getInstanciatedObjectId(); if (uid_lamp_map.find(lamp_uid) == uid_lamp_map.end()) { - fprintf(stderr, "Couldn't find lamp by UID.\n"); + fprintf(stderr, "Couldn't find light by UID.\n"); return NULL; } @@ -1122,7 +1122,7 @@ bool DocumentImporter::writeLight(const COLLADAFW::Light *light) else lamp = (Lamp *)BKE_lamp_add(bmain, (char *)la_id.c_str()); if (!lamp) { - fprintf(stderr, "Cannot create lamp.\n"); + fprintf(stderr, "Cannot create light.\n"); return true; } @@ -1234,7 +1234,7 @@ bool DocumentImporter::writeLight(const COLLADAFW::Light *light) break; case COLLADAFW::Light::UNDEFINED: { - fprintf(stderr, "Current lamp type is not supported.\n"); + fprintf(stderr, "Current light type is not supported.\n"); lamp->type = LA_LOCAL; } break; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index f64c4f5aff0..1e0420ef6bc 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -679,7 +679,7 @@ void DepsgraphRelationBuilder::build_object_data_lamp(Object *object) build_lamp(lamp); ComponentKey object_parameters_key(&object->id, DEG_NODE_TYPE_PARAMETERS); ComponentKey lamp_parameters_key(&lamp->id, DEG_NODE_TYPE_PARAMETERS); - add_relation(lamp_parameters_key, object_parameters_key, "Lamp -> Object"); + add_relation(lamp_parameters_key, object_parameters_key, "Light -> Object"); } void DepsgraphRelationBuilder::build_object_data_lightprobe(Object *object) @@ -1968,7 +1968,7 @@ void DepsgraphRelationBuilder::build_lamp(Lamp *lamp) build_nodetree(lamp->nodetree); ComponentKey lamp_parameters_key(&lamp->id, DEG_NODE_TYPE_PARAMETERS); ComponentKey nodetree_key(&lamp->nodetree->id, DEG_NODE_TYPE_SHADING); - add_relation(nodetree_key, lamp_parameters_key, "NTree->Lamp Parameters"); + add_relation(nodetree_key, lamp_parameters_key, "NTree->Light Parameters"); build_nested_nodetree(&lamp->id, lamp->nodetree); } } diff --git a/source/blender/draw/engines/eevee/eevee_lights.c b/source/blender/draw/engines/eevee/eevee_lights.c index 880519911ed..2b1bd9fbce3 100644 --- a/source/blender/draw/engines/eevee/eevee_lights.c +++ b/source/blender/draw/engines/eevee/eevee_lights.c @@ -334,7 +334,7 @@ void EEVEE_lights_cache_add(EEVEE_ViewLayerData *sldata, Object *ob) /* Step 1 find all lamps in the scene and setup them */ if (linfo->num_light >= MAX_LIGHT) { - printf("Too many lamps in the scene !!!\n"); + printf("Too many lights in the scene !!!\n"); } else { Lamp *la = (Lamp *)ob->data; diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 6bd333294c5..5bbaabcc6bc 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -638,7 +638,7 @@ static int acf_object_icon(bAnimListElem *ale) /* icon depends on object-type */ switch (ob->type) { case OB_LAMP: - return ICON_OUTLINER_OB_LAMP; + return ICON_OUTLINER_OB_LIGHT; case OB_MESH: return ICON_OUTLINER_OB_MESH; case OB_CAMERA: @@ -1452,16 +1452,16 @@ static bAnimChannelType ACF_DSMAT = acf_dsmat_setting_ptr /* pointer for setting */ }; -/* Lamp Expander ------------------------------------------- */ +/* Light Expander ------------------------------------------- */ // TODO: just get this from RNA? -static int acf_dslam_icon(bAnimListElem *UNUSED(ale)) +static int acf_dslight_icon(bAnimListElem *UNUSED(ale)) { - return ICON_LAMP_DATA; + return ICON_LIGHT_DATA; } /* get the appropriate flag(s) for the setting when it is valid */ -static int acf_dslam_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg) +static int acf_dslight_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg) { /* clear extra return data first */ *neg = false; @@ -1486,7 +1486,7 @@ static int acf_dslam_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Setting } /* get pointer to the setting */ -static void *acf_dslam_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type) +static void *acf_dslight_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type) { Lamp *la = (Lamp *)ale->data; @@ -1510,9 +1510,9 @@ static void *acf_dslam_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings set } /* lamp expander type define */ -static bAnimChannelType ACF_DSLAM = +static bAnimChannelType ACF_DSLIGHT = { - "Lamp Expander", /* type name */ + "Light Expander", /* type name */ ACHANNEL_ROLE_EXPANDER, /* role */ acf_generic_dataexpand_color, /* backdrop color */ @@ -1521,12 +1521,12 @@ static bAnimChannelType ACF_DSLAM = acf_generic_basic_offset, /* offset */ acf_generic_idblock_name, /* name */ - acf_generic_idblock_name_prop, /* name prop */ - acf_dslam_icon, /* icon */ + acf_generic_idblock_name_prop, /* name prop */ + acf_dslight_icon, /* icon */ acf_generic_dataexpand_setting_valid, /* has setting */ - acf_dslam_setting_flag, /* flag for setting */ - acf_dslam_setting_ptr /* pointer for setting */ + acf_dslight_setting_flag, /* flag for setting */ + acf_dslight_setting_ptr /* pointer for setting */ }; /* Texture Expander ------------------------------------------- */ @@ -3580,7 +3580,7 @@ static void ANIM_init_channel_typeinfo_data(void) animchannelTypeInfo[type++] = &ACF_FILLDRIVERS; /* Drivers Expander */ animchannelTypeInfo[type++] = &ACF_DSMAT; /* Material Channel */ - animchannelTypeInfo[type++] = &ACF_DSLAM; /* Lamp Channel */ + animchannelTypeInfo[type++] = &ACF_DSLIGHT; /* Light Channel */ animchannelTypeInfo[type++] = &ACF_DSCAM; /* Camera Channel */ animchannelTypeInfo[type++] = &ACF_DSCACHEFILE; /* CacheFile Channel */ animchannelTypeInfo[type++] = &ACF_DSCUR; /* Curve Channel */ diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h index 4c67a306e75..68318835a00 100644 --- a/source/blender/editors/include/UI_icons.h +++ b/source/blender/editors/include/UI_icons.h @@ -119,7 +119,7 @@ DEF_ICON(FULLSCREEN_EXIT) DEF_ICON(BLANK1) // Not actually blank - this is used all over the place /* BUTTONS */ -DEF_ICON(LAMP) +DEF_ICON(LIGHT) DEF_ICON(MATERIAL) DEF_ICON(TEXTURE) DEF_ICON(ANIM) @@ -216,7 +216,7 @@ DEF_ICON(MESH_DATA) DEF_ICON(CURVE_DATA) DEF_ICON(META_DATA) DEF_ICON(LATTICE_DATA) -DEF_ICON(LAMP_DATA) +DEF_ICON(LIGHT_DATA) DEF_ICON(MATERIAL_DATA) DEF_ICON(TEXTURE_DATA) DEF_ICON(ANIM_DATA) @@ -304,7 +304,7 @@ DEF_ICON(OUTLINER_OB_MESH) DEF_ICON(OUTLINER_OB_CURVE) DEF_ICON(OUTLINER_OB_LATTICE) DEF_ICON(OUTLINER_OB_META) -DEF_ICON(OUTLINER_OB_LAMP) +DEF_ICON(OUTLINER_OB_LIGHT) DEF_ICON(OUTLINER_OB_CAMERA) DEF_ICON(OUTLINER_OB_ARMATURE) DEF_ICON(OUTLINER_OB_FONT) @@ -336,7 +336,7 @@ DEF_ICON(OUTLINER_DATA_MESH) DEF_ICON(OUTLINER_DATA_CURVE) DEF_ICON(OUTLINER_DATA_LATTICE) DEF_ICON(OUTLINER_DATA_META) -DEF_ICON(OUTLINER_DATA_LAMP) +DEF_ICON(OUTLINER_DATA_LIGHT) DEF_ICON(OUTLINER_DATA_CAMERA) DEF_ICON(OUTLINER_DATA_ARMATURE) DEF_ICON(OUTLINER_DATA_FONT) @@ -377,11 +377,11 @@ DEF_ICON(MESH_CAPSULE) #ifndef DEF_ICON_BLANK_SKIP DEF_ICON(BLANK611) #endif -DEF_ICON(LAMP_POINT) -DEF_ICON(LAMP_SUN) -DEF_ICON(LAMP_SPOT) -DEF_ICON(LAMP_HEMI) -DEF_ICON(LAMP_AREA) +DEF_ICON(LIGHT_POINT) +DEF_ICON(LIGHT_SUN) +DEF_ICON(LIGHT_SPOT) +DEF_ICON(LIGHT_HEMI) +DEF_ICON(LIGHT_AREA) #ifndef DEF_ICON_BLANK_SKIP DEF_ICON(BLANK617) DEF_ICON(BLANK618) diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index c3246213d4e..4748ff3310a 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1554,7 +1554,7 @@ int UI_idcode_icon_get(const int idcode) case ID_IM: return ICON_IMAGE_DATA; case ID_LA: - return ICON_LAMP_DATA; + return ICON_LIGHT_DATA; case ID_LS: return ICON_LINE_DATA; case ID_LT: diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 1c3ed3e3c75..f80e4e486d6 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -518,7 +518,7 @@ static const char *template_id_browse_tip(const StructRNA *type) case ID_IM: return N_("Browse Image to be linked"); case ID_LS: return N_("Browse Line Style Data to be linked"); case ID_LT: return N_("Browse Lattice Data to be linked"); - case ID_LA: return N_("Browse Lamp Data to be linked"); + case ID_LA: return N_("Browse Light Data to be linked"); case ID_CA: return N_("Browse Camera Data to be linked"); case ID_WO: return N_("Browse World Settings to be linked"); case ID_SCR: return N_("Choose Screen layout"); @@ -1863,7 +1863,7 @@ void uiTemplatePreview( char _preview_id[UI_MAX_NAME_STR]; if (id && !ELEM(GS(id->name), ID_MA, ID_TE, ID_WO, ID_LA, ID_LS)) { - RNA_warning("Expected ID of type material, texture, lamp, world or line style"); + RNA_warning("Expected ID of type material, texture, light, world or line style"); return; } @@ -1954,7 +1954,7 @@ void uiTemplatePreview( pr_texture, 10, TEX_PR_OTHER, 0, 0, ""); } else if (GS(parent->name) == ID_LA) { - uiDefButS(block, UI_BTYPE_ROW, B_MATPRV, IFACE_("Lamp"), 0, 0, UI_UNIT_X * 10, UI_UNIT_Y, + uiDefButS(block, UI_BTYPE_ROW, B_MATPRV, IFACE_("Light"), 0, 0, UI_UNIT_X * 10, UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, ""); } else if (GS(parent->name) == ID_WO) { diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index a8c3c905dd4..a8917f4c4aa 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -120,12 +120,12 @@ /* this is an exact copy of the define in rna_lamp.c * kept here because of linking order. * Icons are only defined here */ -const EnumPropertyItem rna_enum_lamp_type_items[] = { - {LA_LOCAL, "POINT", ICON_LAMP_POINT, "Point", "Omnidirectional point light source"}, - {LA_SUN, "SUN", ICON_LAMP_SUN, "Sun", "Constant direction parallel ray light source"}, - {LA_SPOT, "SPOT", ICON_LAMP_SPOT, "Spot", "Directional cone light source"}, - {LA_HEMI, "HEMI", ICON_LAMP_HEMI, "Hemi", "180 degree constant light source"}, - {LA_AREA, "AREA", ICON_LAMP_AREA, "Area", "Directional area light source"}, +const EnumPropertyItem rna_enum_light_type_items[] = { + {LA_LOCAL, "POINT", ICON_LIGHT_POINT, "Point", "Omnidirectional point light source"}, + {LA_SUN, "SUN", ICON_LIGHT_SUN, "Sun", "Constant direction parallel ray light source"}, + {LA_SPOT, "SPOT", ICON_LIGHT_SPOT, "Spot", "Directional cone light source"}, + {LA_HEMI, "HEMI", ICON_LIGHT_HEMI, "Hemi", "180 degree constant light source"}, + {LA_AREA, "AREA", ICON_LIGHT_AREA, "Area", "Directional area light source"}, {0, NULL, 0, NULL, NULL} }; @@ -985,9 +985,9 @@ void OBJECT_OT_drop_named_image(wmOperatorType *ot) ED_object_add_generic_props(ot, false); } -/********************* Add Lamp Operator ********************/ +/********************* Add Light Operator ********************/ -static const char *get_lamp_defname(int type) +static const char *get_light_defname(int type) { switch (type) { case LA_LOCAL: return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "Point"); @@ -996,11 +996,11 @@ static const char *get_lamp_defname(int type) case LA_HEMI: return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "Hemi"); case LA_AREA: return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "Area"); default: - return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "Lamp"); + return CTX_DATA_(BLT_I18NCONTEXT_ID_LAMP, "Light"); } } -static int object_lamp_add_exec(bContext *C, wmOperator *op) +static int object_light_add_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Object *ob; @@ -1013,10 +1013,10 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op) if (!ED_object_add_generic_get_opts(C, op, 'Z', loc, rot, NULL, &layer, NULL)) return OPERATOR_CANCELLED; - ob = ED_object_add_type(C, OB_LAMP, get_lamp_defname(type), loc, rot, false, layer); + ob = ED_object_add_type(C, OB_LAMP, get_light_defname(type), loc, rot, false, layer); float size = RNA_float_get(op->ptr, "radius"); - /* Better defaults for lamp size. */ + /* Better defaults for light size. */ switch (type) { case LA_LOCAL: case LA_SPOT: @@ -1041,23 +1041,23 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void OBJECT_OT_lamp_add(wmOperatorType *ot) +void OBJECT_OT_light_add(wmOperatorType *ot) { /* identifiers */ - ot->name = "Add Lamp"; - ot->description = "Add a lamp object to the scene"; - ot->idname = "OBJECT_OT_lamp_add"; + ot->name = "Add Light"; + ot->description = "Add a light object to the scene"; + ot->idname = "OBJECT_OT_light_add"; /* api callbacks */ ot->invoke = WM_menu_invoke; - ot->exec = object_lamp_add_exec; + ot->exec = object_light_add_exec; ot->poll = ED_operator_objectmode; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* properties */ - ot->prop = RNA_def_enum(ot->srna, "type", rna_enum_lamp_type_items, 0, "Type", ""); + ot->prop = RNA_def_enum(ot->srna, "type", rna_enum_light_type_items, 0, "Type", ""); RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_LAMP); ED_object_add_unit_props(ot); diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index b1ea6d72346..1b5c6df2632 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -115,7 +115,7 @@ void OBJECT_OT_armature_add(struct wmOperatorType *ot); void OBJECT_OT_empty_add(struct wmOperatorType *ot); void OBJECT_OT_lightprobe_add(struct wmOperatorType *ot); void OBJECT_OT_drop_named_image(struct wmOperatorType *ot); -void OBJECT_OT_lamp_add(struct wmOperatorType *ot); +void OBJECT_OT_light_add(struct wmOperatorType *ot); void OBJECT_OT_effector_add(struct wmOperatorType *ot); void OBJECT_OT_camera_add(struct wmOperatorType *ot); void OBJECT_OT_speaker_add(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 43d993531bc..5a83d085aee 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -114,7 +114,7 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_empty_add); WM_operatortype_append(OBJECT_OT_lightprobe_add); WM_operatortype_append(OBJECT_OT_drop_named_image); - WM_operatortype_append(OBJECT_OT_lamp_add); + WM_operatortype_append(OBJECT_OT_light_add); WM_operatortype_append(OBJECT_OT_camera_add); WM_operatortype_append(OBJECT_OT_speaker_add); WM_operatortype_append(OBJECT_OT_add); diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index b1dee812f45..d5f7a93cc6e 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -485,7 +485,7 @@ enum { OBJECT_GRPSEL_PASS = 8, OBJECT_GRPSEL_COLOR = 9, OBJECT_GRPSEL_KEYINGSET = 10, - OBJECT_GRPSEL_LAMP_TYPE = 11, + OBJECT_GRPSEL_LIGHT_TYPE = 11, }; static const EnumPropertyItem prop_select_grouped_types[] = { @@ -499,7 +499,7 @@ static const EnumPropertyItem prop_select_grouped_types[] = { {OBJECT_GRPSEL_PASS, "PASS", 0, "Pass", "Render pass Index"}, {OBJECT_GRPSEL_COLOR, "COLOR", 0, "Color", "Object Color"}, {OBJECT_GRPSEL_KEYINGSET, "KEYINGSET", 0, "Keying Set", "Objects included in active Keying Set"}, - {OBJECT_GRPSEL_LAMP_TYPE, "LAMP_TYPE", 0, "Lamp Type", "Matching lamp types"}, + {OBJECT_GRPSEL_LIGHT_TYPE, "LIGHT_TYPE", 0, "Light Type", "Matching light types"}, {0, NULL, 0, NULL, NULL} }; @@ -803,9 +803,9 @@ static int object_select_grouped_exec(bContext *C, wmOperator *op) case OBJECT_GRPSEL_KEYINGSET: changed |= select_grouped_keyingset(C, ob, op->reports); break; - case OBJECT_GRPSEL_LAMP_TYPE: + case OBJECT_GRPSEL_LIGHT_TYPE: if (ob->type != OB_LAMP) { - BKE_report(op->reports, RPT_ERROR, "Active object must be a lamp"); + BKE_report(op->reports, RPT_ERROR, "Active object must be a light"); break; } changed |= select_grouped_lamptype(C, ob); diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 721d248ae4c..d2a0879464b 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -485,7 +485,7 @@ static int apply_objects_internal( if (la->type == LA_AREA) { if (apply_rot || apply_loc) { BKE_reportf(reports, RPT_ERROR, - "Area Lamps can only have scale applied: \"%s\"", + "Area Lights can only have scale applied: \"%s\"", ob->id.name + 2); changed = false; } @@ -1540,8 +1540,8 @@ static int object_transform_axis_target_modal(bContext *C, wmOperator *op, const void OBJECT_OT_transform_axis_target(wmOperatorType *ot) { /* identifiers */ - ot->name = "Interactive Lamp Track to Cursor"; - ot->description = "Interactively point cameras and lamps to a location (Ctrl translates)"; + ot->name = "Interactive Light Track to Cursor"; + ot->description = "Interactively point cameras and lights to a location (Ctrl translates)"; ot->idname = "OBJECT_OT_transform_axis_target"; /* api callbacks */ diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index ae364828119..d6a968d993c 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -427,7 +427,7 @@ static void make_renderinfo_string(const RenderStats *rs, if (rs->totface) spos += sprintf(spos, IFACE_("Fa:%d "), rs->totface); if (rs->tothalo) spos += sprintf(spos, IFACE_("Ha:%d "), rs->tothalo); if (rs->totstrand) spos += sprintf(spos, IFACE_("St:%d "), rs->totstrand); - if (rs->totlamp) spos += sprintf(spos, IFACE_("La:%d "), rs->totlamp); + if (rs->totlamp) spos += sprintf(spos, IFACE_("Li:%d "), rs->totlamp); if (rs->mem_peak == 0.0f) spos += sprintf(spos, IFACE_("| Mem:%.2fM (%.2fM, Peak %.2fM) "), diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 07e0c124998..1673e0d7ca0 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -1654,7 +1654,7 @@ static int paste_mtex_exec(bContext *C, wmOperator *UNUSED(op)) if (id == NULL) { Material *ma = CTX_data_pointer_get_type(C, "material", &RNA_Material).data; - Lamp *la = CTX_data_pointer_get_type(C, "lamp", &RNA_Lamp).data; + Lamp *la = CTX_data_pointer_get_type(C, "light", &RNA_Light).data; World *wo = CTX_data_pointer_get_type(C, "world", &RNA_World).data; ParticleSystem *psys = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem).data; FreestyleLineStyle *linestyle = CTX_data_pointer_get_type(C, "line_style", &RNA_FreestyleLineStyle).data; diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 4c6de3ec012..faee9c2b7ac 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -234,7 +234,7 @@ static int buttons_context_path_data(ButsContextPath *path, int type) else if (RNA_struct_is_a(ptr->type, &RNA_MetaBall) && (type == -1 || type == OB_MBALL)) return 1; else if (RNA_struct_is_a(ptr->type, &RNA_Lattice) && (type == -1 || type == OB_LATTICE)) return 1; else if (RNA_struct_is_a(ptr->type, &RNA_Camera) && (type == -1 || type == OB_CAMERA)) return 1; - else if (RNA_struct_is_a(ptr->type, &RNA_Lamp) && (type == -1 || type == OB_LAMP)) return 1; + else if (RNA_struct_is_a(ptr->type, &RNA_Light) && (type == -1 || type == OB_LAMP)) return 1; else if (RNA_struct_is_a(ptr->type, &RNA_Speaker) && (type == -1 || type == OB_SPEAKER)) return 1; else if (RNA_struct_is_a(ptr->type, &RNA_LightProbe) && (type == -1 || type == OB_LIGHTPROBE)) return 1; /* try to get an object in the path, no pinning supported here */ @@ -679,7 +679,7 @@ void buttons_context_compute(const bContext *C, SpaceButs *sbuts) const char *buttons_context_dir[] = { "texture_slot", "scene", "world", "object", "mesh", "armature", "lattice", "curve", - "meta_ball", "lamp", "speaker", "lightprobe", "camera", "material", "material_slot", + "meta_ball", "light", "speaker", "lightprobe", "camera", "material", "material_slot", "texture", "texture_user", "texture_user_property", "bone", "edit_bone", "pose_bone", "particle_system", "particle_system_editable", "particle_settings", "cloth", "soft_body", "fluid", "smoke", "collision", "brush", "dynamic_paint", @@ -736,8 +736,8 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r set_pointer_type(path, result, &RNA_MetaBall); return 1; } - else if (CTX_data_equals(member, "lamp")) { - set_pointer_type(path, result, &RNA_Lamp); + else if (CTX_data_equals(member, "light")) { + set_pointer_type(path, result, &RNA_Light); return 1; } else if (CTX_data_equals(member, "camera")) { diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 09e2660a762..968757bc637 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -2357,7 +2357,7 @@ static void filelist_readjob_main_rec(Main *bmain, FileList *filelist) filelist->filelist.entries[9].entry->relpath = BLI_strdup("Ika"); filelist->filelist.entries[10].entry->relpath = BLI_strdup("Wave"); filelist->filelist.entries[11].entry->relpath = BLI_strdup("Lattice"); - filelist->filelist.entries[12].entry->relpath = BLI_strdup("Lamp"); + filelist->filelist.entries[12].entry->relpath = BLI_strdup("Light"); filelist->filelist.entries[13].entry->relpath = BLI_strdup("Camera"); filelist->filelist.entries[14].entry->relpath = BLI_strdup("Ipo"); filelist->filelist.entries[15].entry->relpath = BLI_strdup("World"); diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index d7015ed5e53..118a14c887d 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1215,7 +1215,7 @@ static void node_shader_set_butfunc(bNodeType *ntype) ntype->draw_buttons = node_shader_buts_uvalongstroke; break; case SH_NODE_OUTPUT_MATERIAL: - case SH_NODE_OUTPUT_LAMP: + case SH_NODE_OUTPUT_LIGHT: case SH_NODE_OUTPUT_WORLD: ntype->draw_buttons = node_buts_output_shader; break; diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index cc32e5ef499..1a6710035c2 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -424,7 +424,7 @@ void ED_node_shader_default(const bContext *C, ID *id) Lamp *la = (Lamp *)id; la->nodetree = ntree; - output_type = SH_NODE_OUTPUT_LAMP; + output_type = SH_NODE_OUTPUT_LIGHT; shader_type = SH_NODE_EMISSION; copy_v3_v3(color, &la->r); @@ -628,7 +628,7 @@ void ED_node_set_active(Main *bmain, bNodeTree *ntree, bNode *node) nodeClearActiveID(ntree, ID_TE); if (ELEM(node->type, SH_NODE_OUTPUT_MATERIAL, - SH_NODE_OUTPUT_WORLD, SH_NODE_OUTPUT_LAMP, SH_NODE_OUTPUT_LINESTYLE)) + SH_NODE_OUTPUT_WORLD, SH_NODE_OUTPUT_LIGHT, SH_NODE_OUTPUT_LINESTYLE)) { bNode *tnode; diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index ed4853f5ede..c829b808348 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -1141,7 +1141,7 @@ static void tselem_draw_icon( ICON_DRAW(ICON_RENDER_RESULT); break; case TSE_LINKED_LAMP: - ICON_DRAW(ICON_LAMP_DATA); + ICON_DRAW(ICON_LIGHT_DATA); break; case TSE_LINKED_MAT: ICON_DRAW(ICON_MATERIAL_DATA); @@ -1200,7 +1200,7 @@ static void tselem_draw_icon( Object *ob = (Object *)tselem->id; switch (ob->type) { case OB_LAMP: - ICON_CLICK_DRAW(ICON_OUTLINER_OB_LAMP); break; + ICON_CLICK_DRAW(ICON_OUTLINER_OB_LIGHT); break; case OB_MESH: ICON_CLICK_DRAW(ICON_OUTLINER_OB_MESH); break; case OB_CAMERA: @@ -1251,17 +1251,17 @@ static void tselem_draw_icon( Lamp *la = (Lamp *)tselem->id; switch (la->type) { case LA_LOCAL: - tselem_draw_icon_uibut(&arg, ICON_LAMP_POINT); break; + tselem_draw_icon_uibut(&arg, ICON_LIGHT_POINT); break; case LA_SUN: - tselem_draw_icon_uibut(&arg, ICON_LAMP_SUN); break; + tselem_draw_icon_uibut(&arg, ICON_LIGHT_SUN); break; case LA_SPOT: - tselem_draw_icon_uibut(&arg, ICON_LAMP_SPOT); break; + tselem_draw_icon_uibut(&arg, ICON_LIGHT_SPOT); break; case LA_HEMI: - tselem_draw_icon_uibut(&arg, ICON_LAMP_HEMI); break; + tselem_draw_icon_uibut(&arg, ICON_LIGHT_HEMI); break; case LA_AREA: - tselem_draw_icon_uibut(&arg, ICON_LAMP_AREA); break; + tselem_draw_icon_uibut(&arg, ICON_LIGHT_AREA); break; default: - tselem_draw_icon_uibut(&arg, ICON_OUTLINER_DATA_LAMP); break; + tselem_draw_icon_uibut(&arg, ICON_OUTLINER_DATA_LIGHT); break; } break; } diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 15d241a88cc..83189159086 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -1050,11 +1050,11 @@ static void view3d_main_region_message_subscribe( &RNA_Window, /* These object have properties that impact drawing. */ - &RNA_AreaLamp, + &RNA_AreaLight, &RNA_Camera, - &RNA_Lamp, + &RNA_Light, &RNA_Speaker, - &RNA_SunLamp, + &RNA_SunLight, /* General types the 3D view depends on. */ &RNA_Object, diff --git a/source/blender/editors/space_view3d/view3d_manipulator_empty.c b/source/blender/editors/space_view3d/view3d_manipulator_empty.c index 75e4a9e3314..fc15ec593f5 100644 --- a/source/blender/editors/space_view3d/view3d_manipulator_empty.c +++ b/source/blender/editors/space_view3d/view3d_manipulator_empty.c @@ -186,7 +186,7 @@ static void WIDGETGROUP_empty_image_refresh(const bContext *C, wmManipulatorGrou void VIEW3D_WGT_empty_image(wmManipulatorGroupType *wgt) { - wgt->name = "Area Lamp Widgets"; + wgt->name = "Area Light Widgets"; wgt->idname = "VIEW3D_WGT_empty_image"; wgt->flag |= (WM_MANIPULATORGROUPTYPE_PERSISTENT | diff --git a/source/blender/editors/space_view3d/view3d_manipulator_lamp.c b/source/blender/editors/space_view3d/view3d_manipulator_lamp.c index f98a2f336bc..0e1015a66f1 100644 --- a/source/blender/editors/space_view3d/view3d_manipulator_lamp.c +++ b/source/blender/editors/space_view3d/view3d_manipulator_lamp.c @@ -99,13 +99,13 @@ static void WIDGETGROUP_lamp_spot_refresh(const bContext *C, wmManipulatorGroup /* need to set property here for undo. TODO would prefer to do this in _init */ PointerRNA lamp_ptr; const char *propname = "spot_size"; - RNA_pointer_create(&la->id, &RNA_Lamp, la, &lamp_ptr); + RNA_pointer_create(&la->id, &RNA_Light, la, &lamp_ptr); WM_manipulator_target_property_def_rna(mpr, "offset", &lamp_ptr, propname, -1); } void VIEW3D_WGT_lamp_spot(wmManipulatorGroupType *wgt) { - wgt->name = "Spot Lamp Widgets"; + wgt->name = "Spot Light Widgets"; wgt->idname = "VIEW3D_WGT_lamp_spot"; wgt->flag |= (WM_MANIPULATORGROUPTYPE_PERSISTENT | @@ -213,7 +213,7 @@ static void WIDGETGROUP_lamp_area_refresh(const bContext *C, wmManipulatorGroup void VIEW3D_WGT_lamp_area(wmManipulatorGroupType *wgt) { - wgt->name = "Area Lamp Widgets"; + wgt->name = "Area Light Widgets"; wgt->idname = "VIEW3D_WGT_lamp_area"; wgt->flag |= (WM_MANIPULATORGROUPTYPE_PERSISTENT | @@ -291,7 +291,7 @@ static void WIDGETGROUP_lamp_target_draw_prepare(const bContext *C, wmManipulato void VIEW3D_WGT_lamp_target(wmManipulatorGroupType *wgt) { - wgt->name = "Target Lamp Widgets"; + wgt->name = "Target Light Widgets"; wgt->idname = "VIEW3D_WGT_lamp_target"; wgt->flag |= (WM_MANIPULATORGROUPTYPE_PERSISTENT | diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 06bbde0497c..fe8868235c4 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -69,7 +69,7 @@ extern StructRNA RNA_AnimVizMotionPaths; extern StructRNA RNA_AnimVizOnionSkinning; extern StructRNA RNA_AnyType; extern StructRNA RNA_Area; -extern StructRNA RNA_AreaLamp; +extern StructRNA RNA_AreaLight; extern StructRNA RNA_Armature; extern StructRNA RNA_ArmatureModifier; extern StructRNA RNA_ArmatureSensor; @@ -281,7 +281,7 @@ extern StructRNA RNA_GaussianBlurSequence; extern StructRNA RNA_GlowSequence; extern StructRNA RNA_GreasePencil; extern StructRNA RNA_Header; -extern StructRNA RNA_HemiLamp; +extern StructRNA RNA_HemiLight; extern StructRNA RNA_Histogram; extern StructRNA RNA_HookModifier; extern StructRNA RNA_ID; @@ -312,9 +312,9 @@ extern StructRNA RNA_KeyingSetInfo; extern StructRNA RNA_KeyingSetPath; extern StructRNA RNA_KeyingSetsAll; extern StructRNA RNA_KinematicConstraint; -extern StructRNA RNA_Lamp; -extern StructRNA RNA_LampSkySettings; -extern StructRNA RNA_LampTextureSlot; +extern StructRNA RNA_Light; +extern StructRNA RNA_LightSkySettings; +extern StructRNA RNA_LightTextureSlot; extern StructRNA RNA_LaplacianDeformModifier; extern StructRNA RNA_LaplacianSmoothModifier; extern StructRNA RNA_Lattice; @@ -476,7 +476,7 @@ extern StructRNA RNA_ParticleSystemModifier; extern StructRNA RNA_ParticleTarget; extern StructRNA RNA_PivotConstraint; extern StructRNA RNA_PointCache; -extern StructRNA RNA_PointLamp; +extern StructRNA RNA_PointLight; extern StructRNA RNA_PointerProperty; extern StructRNA RNA_Pose; extern StructRNA RNA_PoseBone; @@ -529,7 +529,7 @@ extern StructRNA RNA_ShaderNodeGeometry; extern StructRNA RNA_ShaderNodeHueSaturation; extern StructRNA RNA_ShaderNodeIESLight; extern StructRNA RNA_ShaderNodeInvert; -extern StructRNA RNA_ShaderNodeLampData; +extern StructRNA RNA_ShaderNodeLightData; extern StructRNA RNA_ShaderNodeMapping; extern StructRNA RNA_ShaderNodeMaterial; extern StructRNA RNA_ShaderNodeMath; @@ -588,7 +588,7 @@ extern StructRNA RNA_Speaker; extern StructRNA RNA_SpeedControlSequence; extern StructRNA RNA_Spline; extern StructRNA RNA_SplineIKConstraint; -extern StructRNA RNA_SpotLamp; +extern StructRNA RNA_SpotLight; extern StructRNA RNA_Stereo3dDisplay; extern StructRNA RNA_StretchToConstraint; extern StructRNA RNA_StringProperty; @@ -596,7 +596,7 @@ extern StructRNA RNA_Struct; extern StructRNA RNA_StucciTexture; extern StructRNA RNA_StudioLight; extern StructRNA RNA_SubsurfModifier; -extern StructRNA RNA_SunLamp; +extern StructRNA RNA_SunLight; extern StructRNA RNA_SurfaceCurve; extern StructRNA RNA_SurfaceDeformModifier; extern StructRNA RNA_SurfaceModifier; diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index ce1edba75fd..bafb2bf5753 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -129,7 +129,7 @@ extern const EnumPropertyItem rna_enum_symmetrize_direction_items[]; extern const EnumPropertyItem rna_enum_texture_type_items[]; -extern const EnumPropertyItem rna_enum_lamp_type_items[]; +extern const EnumPropertyItem rna_enum_light_type_items[]; extern const EnumPropertyItem rna_enum_unpack_method_items[]; diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 1dd4535610c..4b06d917ab7 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -3407,7 +3407,7 @@ static RNAProcessItem PROCESS_ITEMS[] = { {"rna_group.c", NULL, RNA_def_collections}, {"rna_image.c", "rna_image_api.c", RNA_def_image}, {"rna_key.c", NULL, RNA_def_key}, - {"rna_lamp.c", NULL, RNA_def_lamp}, + {"rna_lamp.c", NULL, RNA_def_light}, {"rna_lattice.c", "rna_lattice_api.c", RNA_def_lattice}, {"rna_layer.c", NULL, RNA_def_view_layer}, {"rna_linestyle.c", NULL, RNA_def_linestyle}, diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index a2648d7db02..0a294bfaab9 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -61,7 +61,7 @@ const EnumPropertyItem rna_enum_id_type_items[] = { {ID_GR, "COLLECTION", ICON_GROUP, "Collection", ""}, {ID_IM, "IMAGE", ICON_IMAGE_DATA, "Image", ""}, {ID_KE, "KEY", ICON_SHAPEKEY_DATA, "Key", ""}, - {ID_LA, "LAMP", ICON_LAMP_DATA, "Lamp", ""}, + {ID_LA, "LIGHT", ICON_LIGHT_DATA, "Light", ""}, {ID_LI, "LIBRARY", ICON_LIBRARY_DATA_DIRECT, "Library", ""}, {ID_LS, "LINESTYLE", ICON_LINE_DATA, "Line Style", ""}, {ID_LT, "LATTICE", ICON_LATTICE_DATA, "Lattice", ""}, @@ -183,7 +183,7 @@ short RNA_type_to_ID_code(const StructRNA *type) if (base_type == &RNA_Collection) return ID_GR; if (base_type == &RNA_Image) return ID_IM; if (base_type == &RNA_Key) return ID_KE; - if (base_type == &RNA_Lamp) return ID_LA; + if (base_type == &RNA_Light) return ID_LA; if (base_type == &RNA_Library) return ID_LI; if (base_type == &RNA_FreestyleLineStyle) return ID_LS; if (base_type == &RNA_Lattice) return ID_LT; @@ -227,7 +227,7 @@ StructRNA *ID_code_to_RNA_type(short idcode) case ID_GR: return &RNA_Collection; case ID_IM: return &RNA_Image; case ID_KE: return &RNA_Key; - case ID_LA: return &RNA_Lamp; + case ID_LA: return &RNA_Light; case ID_LI: return &RNA_Library; case ID_LS: return &RNA_FreestyleLineStyle; case ID_LT: return &RNA_Lattice; diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 638589c104a..7228f4a4683 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -620,7 +620,7 @@ StructRNA *RNA_struct_base(StructRNA *type) /** * Use to find the subtype directly below a base-type. * - * So if type were `RNA_SpotLamp`, `RNA_struct_base_of(type, &RNA_ID)` would return `&RNA_Lamp`. + * So if type were `RNA_SpotLIght`, `RNA_struct_base_of(type, &RNA_ID)` would return `&RNA_Light`. */ const StructRNA *RNA_struct_base_child_of(const StructRNA *type, const StructRNA *parent_type) { diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index 97c9d5a9866..12e28d457fb 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -423,10 +423,10 @@ static void rna_def_dopesheet(BlenderRNA *brna) RNA_def_property_ui_icon(prop, ICON_MATERIAL_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - prop = RNA_def_property(srna, "show_lamps", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "show_lights", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOLAM); - RNA_def_property_ui_text(prop, "Display Lamp", "Include visualization of lamp related animation data"); - RNA_def_property_ui_icon(prop, ICON_LAMP_DATA, 0); + RNA_def_property_ui_text(prop, "Display Light", "Include visualization of light related animation data"); + RNA_def_property_ui_icon(prop, ICON_LIGHT_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_linestyles", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 8b59d46aaf8..a57777f0630 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -155,7 +155,7 @@ void RNA_def_fcurve(struct BlenderRNA *brna); void RNA_def_gpencil(struct BlenderRNA *brna); void RNA_def_image(struct BlenderRNA *brna); void RNA_def_key(struct BlenderRNA *brna); -void RNA_def_lamp(struct BlenderRNA *brna); +void RNA_def_light(struct BlenderRNA *brna); void RNA_def_lattice(struct BlenderRNA *brna); void RNA_def_linestyle(struct BlenderRNA *brna); void RNA_def_main(struct BlenderRNA *brna); @@ -283,7 +283,7 @@ void rna_TextureSlot_update(struct bContext *C, struct PointerRNA *ptr); bool rna_Armature_object_poll(struct PointerRNA *ptr, struct PointerRNA value); bool rna_Camera_object_poll(struct PointerRNA *ptr, struct PointerRNA value); bool rna_Curve_object_poll(struct PointerRNA *ptr, struct PointerRNA value); -bool rna_Lamp_object_poll(struct PointerRNA *ptr, struct PointerRNA value); +bool rna_Light_object_poll(struct PointerRNA *ptr, struct PointerRNA value); bool rna_Lattice_object_poll(struct PointerRNA *ptr, struct PointerRNA value); bool rna_Mesh_object_poll(struct PointerRNA *ptr, struct PointerRNA value); @@ -354,7 +354,7 @@ void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop); -void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop); +void RNA_def_main_lights(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_libraries(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_screens(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop); diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index dff27e1c625..1fb76a93e27 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -20,7 +20,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -/** \file blender/makesrna/intern/rna_lamp.c +/** \file blender/makesrna/intern/rna_light.c * \ingroup RNA */ @@ -54,7 +54,7 @@ #include "WM_api.h" #include "WM_types.h" -static void rna_Lamp_buffer_size_set(PointerRNA *ptr, int value) +static void rna_Light_buffer_size_set(PointerRNA *ptr, int value) { Lamp *la = (Lamp *)ptr->data; @@ -63,27 +63,27 @@ static void rna_Lamp_buffer_size_set(PointerRNA *ptr, int value) la->bufsize &= (~15); /* round to multiple of 16 */ } -static StructRNA *rna_Lamp_refine(struct PointerRNA *ptr) +static StructRNA *rna_Light_refine(struct PointerRNA *ptr) { Lamp *la = (Lamp *)ptr->data; switch (la->type) { case LA_LOCAL: - return &RNA_PointLamp; + return &RNA_PointLight; case LA_SUN: - return &RNA_SunLamp; + return &RNA_SunLight; case LA_SPOT: - return &RNA_SpotLamp; + return &RNA_SpotLight; case LA_HEMI: - return &RNA_HemiLamp; + return &RNA_HemiLight; case LA_AREA: - return &RNA_AreaLamp; + return &RNA_AreaLight; default: - return &RNA_Lamp; + return &RNA_Light; } } -static void rna_Lamp_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +static void rna_Light_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { Lamp *la = ptr->id.data; @@ -91,7 +91,7 @@ static void rna_Lamp_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRN WM_main_add_notifier(NC_LAMP | ND_LIGHTING, la); } -static void rna_Lamp_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +static void rna_Light_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { Lamp *la = ptr->id.data; @@ -99,19 +99,19 @@ static void rna_Lamp_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poin WM_main_add_notifier(NC_LAMP | ND_LIGHTING_DRAW, la); } -static void rna_Lamp_use_nodes_update(bContext *C, PointerRNA *ptr) +static void rna_Light_use_nodes_update(bContext *C, PointerRNA *ptr) { Lamp *la = (Lamp *)ptr->data; if (la->use_nodes && la->nodetree == NULL) ED_node_shader_default(C, &la->id); - rna_Lamp_update(CTX_data_main(C), CTX_data_scene(C), ptr); + rna_Light_update(CTX_data_main(C), CTX_data_scene(C), ptr); } #else -/* Don't define icons here, so they don't show up in the Lamp UI (properties Editor) - DingTo */ -const EnumPropertyItem rna_enum_lamp_type_items[] = { +/* Don't define icons here, so they don't show up in the Light UI (properties Editor) - DingTo */ +const EnumPropertyItem rna_enum_light_type_items[] = { {LA_LOCAL, "POINT", 0, "Point", "Omnidirectional point light source"}, {LA_SUN, "SUN", 0, "Sun", "Constant direction parallel ray light source"}, {LA_SPOT, "SPOT", 0, "Spot", "Directional cone light source"}, @@ -120,21 +120,22 @@ const EnumPropertyItem rna_enum_lamp_type_items[] = { {0, NULL, 0, NULL, NULL} }; -static void rna_def_lamp(BlenderRNA *brna) +static void rna_def_light(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - srna = RNA_def_struct(brna, "Lamp", "ID"); - RNA_def_struct_refine_func(srna, "rna_Lamp_refine"); - RNA_def_struct_ui_text(srna, "Lamp", "Lamp data-block for lighting a scene"); - RNA_def_struct_ui_icon(srna, ICON_LAMP_DATA); + srna = RNA_def_struct(brna, "Light", "ID"); + RNA_def_struct_sdna(srna, "Lamp"); + RNA_def_struct_refine_func(srna, "rna_Light_refine"); + RNA_def_struct_ui_text(srna, "Light", "Light data-block for lighting a scene"); + RNA_def_struct_ui_icon(srna, ICON_LIGHT_DATA); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, rna_enum_lamp_type_items); - RNA_def_property_ui_text(prop, "Type", "Type of Lamp"); + RNA_def_property_enum_items(prop, rna_enum_light_type_items); + RNA_def_property_ui_text(prop, "Type", "Type of Light"); RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_LAMP); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "dist"); @@ -142,43 +143,43 @@ static void rna_def_lamp(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0, 1000, 1, 3); RNA_def_property_ui_text(prop, "Distance", "Falloff distance - the light is at half the original intensity at this point"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_range(prop, 0, 10, 1, 3); - RNA_def_property_ui_text(prop, "Energy", "Amount of light that the lamp emits"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_ui_text(prop, "Energy", "Amount of light emitted"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "r"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Color", "Light color"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "specular_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "spec_fac"); RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 2); RNA_def_property_ui_text(prop, "Specular Factor", "Specular reflection multiplier"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); /* nodes */ prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); - RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based lamps"); + RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based lights"); prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the lamp"); - RNA_def_property_update(prop, 0, "rna_Lamp_use_nodes_update"); + RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the light"); + RNA_def_property_update(prop, 0, "rna_Light_use_nodes_update"); /* common */ rna_def_animdata_common(srna); } -static void rna_def_lamp_falloff(StructRNA *srna) +static void rna_def_light_falloff(StructRNA *srna) { PropertyRNA *prop; @@ -195,54 +196,54 @@ static void rna_def_lamp_falloff(StructRNA *srna) prop = RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_fallofftype_items); RNA_def_property_ui_text(prop, "Falloff Type", "Intensity Decay with distance"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "curfalloff"); - RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_ui_text(prop, "Falloff Curve", "Custom light falloff curve"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "linear_attenuation", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "att1"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Linear Attenuation", "Linear distance attenuation"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "quadratic_attenuation", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "att2"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Quadratic Attenuation", "Quadratic distance attenuation"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "constant_coefficient", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "coeff_const"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_text(prop, "Constant Coefficient", "Constant distance attenuation coefficient"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "linear_coefficient", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "coeff_lin"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_text(prop, "Linear Coefficient", "Linear distance attenuation coefficient"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "quadratic_coefficient", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "coeff_quad"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_text(prop, "Quadratic Coefficient", "Quadratic distance attenuation coefficient"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); } -static void rna_def_lamp_shadow(StructRNA *srna, int sun) +static void rna_def_light_shadow(StructRNA *srna, int sun) { PropertyRNA *prop; prop = RNA_def_property(srna, "use_shadow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SHADOW); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "shadow_buffer_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "bufsize"); @@ -250,66 +251,66 @@ static void rna_def_lamp_shadow(StructRNA *srna, int sun) RNA_def_property_ui_text(prop, "Shadow Buffer Size", "Resolution of the shadow buffer, higher values give crisper shadows " "but use more memory"); - RNA_def_property_int_funcs(prop, NULL, "rna_Lamp_buffer_size_set", NULL); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_int_funcs(prop, NULL, "rna_Light_buffer_size_set", NULL); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_buffer_clip_start", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "clipsta"); RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_ui_text(prop, "Shadow Buffer Clip Start", "Shadow map clip start, below which objects will not generate shadows"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "shadow_buffer_clip_end", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "clipend"); RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_ui_text(prop, "Shadow Buffer Clip End", "Shadow map clip end, beyond which objects will not generate shadows"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "shadow_buffer_bias", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bias"); RNA_def_property_range(prop, 0.001f, 9999.0f); RNA_def_property_ui_range(prop, 0.001f, 5.0f, 1.0, 3); RNA_def_property_ui_text(prop, "Shadow Buffer Bias", "Bias for reducing self shadowing"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_buffer_bleed_bias", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bleedbias"); RNA_def_property_range(prop, 0.f, 1.f); RNA_def_property_ui_text(prop, "Shadow Buffer Bleed Bias", "Bias for reducing light-bleed on variance shadow maps"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_buffer_exp", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bleedexp"); RNA_def_property_range(prop, 1.0f, 9999.0f); RNA_def_property_ui_text(prop, "Shadow Buffer Exponent", "Bias for reducing light-bleed on exponential shadow maps"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_buffer_soft", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "soft"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Shadow Buffer Soft", "Size of shadow buffer sampling area"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_buffer_samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "samp"); RNA_def_property_range(prop, 1, 16); RNA_def_property_ui_text(prop, "Samples", "Number of shadow buffer samples"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shdwr"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Shadow Color", "Color of shadows cast by the lamp"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_ui_text(prop, "Shadow Color", "Color of shadows cast by the light"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_soft_size", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "area_size"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0, 100, 0.1, 3); RNA_def_property_ui_text(prop, "Shadow Soft Size", "Light size for ray shadow sampling (Raytraced shadows)"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); /* Eevee */ prop = RNA_def_property(srna, "use_contact_shadow", PROP_BOOLEAN, PROP_NONE); @@ -317,76 +318,76 @@ static void rna_def_lamp_shadow(StructRNA *srna, int sun) RNA_def_property_ui_text(prop, "Contact Shadow", "Use screen space raytracing to have correct shadowing " "near occluder, or for small features that does not appear " "in shadow maps"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "contact_shadow_distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "contact_dist"); RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_ui_text(prop, "Contact Shadow Distance", "World space distance in which to search for " "screen space occluder"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "contact_shadow_bias", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "contact_bias"); RNA_def_property_range(prop, 0.001f, 9999.0f); RNA_def_property_ui_range(prop, 0.001f, 5.0f, 1.0, 3); RNA_def_property_ui_text(prop, "Contact Shadow Bias", "Bias to avoid self shadowing"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "contact_shadow_soft_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "contact_spread"); RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_ui_text(prop, "Contact Shadow Soft", "Control how soft the contact shadows will be"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "contact_shadow_thickness", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "contact_thickness"); RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_ui_range(prop, 0, 100, 0.1, 3); RNA_def_property_ui_text(prop, "Contact Shadow Thickness", "Pixel thickness used to detect occlusion"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); if (sun) { prop = RNA_def_property(srna, "shadow_cascade_max_distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "cascade_max_dist"); RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_ui_text(prop, "Cascade Max Distance", "End distance of the cascaded shadow map (only in perspective view)"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_cascade_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "cascade_count"); RNA_def_property_range(prop, 1, 4); RNA_def_property_ui_text(prop, "Cascade Count", "Number of texture used by the cascaded shadow map"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_cascade_exponent", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "cascade_exponent"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Exponential Distribution", "Higher value increase resolution towards the viewpoint"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); prop = RNA_def_property(srna, "shadow_cascade_fade", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "cascade_fade"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Cascade Fade", "How smooth is the transition between each cascade"); - RNA_def_property_update(prop, 0, "rna_Lamp_update"); + RNA_def_property_update(prop, 0, "rna_Light_update"); } } -static void rna_def_point_lamp(BlenderRNA *brna) +static void rna_def_point_light(BlenderRNA *brna) { StructRNA *srna; - srna = RNA_def_struct(brna, "PointLamp", "Lamp"); + srna = RNA_def_struct(brna, "PointLight", "Light"); RNA_def_struct_sdna(srna, "Lamp"); - RNA_def_struct_ui_text(srna, "Point Lamp", "Omnidirectional point lamp"); - RNA_def_struct_ui_icon(srna, ICON_LAMP_POINT); + RNA_def_struct_ui_text(srna, "Point Light", "Omnidirectional point Light"); + RNA_def_struct_ui_icon(srna, ICON_LIGHT_POINT); - rna_def_lamp_falloff(srna); - rna_def_lamp_shadow(srna, 0); + rna_def_light_falloff(srna); + rna_def_light_shadow(srna, 0); } -static void rna_def_area_lamp(BlenderRNA *brna) +static void rna_def_area_light(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -399,103 +400,103 @@ static void rna_def_area_lamp(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; - srna = RNA_def_struct(brna, "AreaLamp", "Lamp"); + srna = RNA_def_struct(brna, "AreaLight", "Light"); RNA_def_struct_sdna(srna, "Lamp"); - RNA_def_struct_ui_text(srna, "Area Lamp", "Directional area lamp"); - RNA_def_struct_ui_icon(srna, ICON_LAMP_AREA); + RNA_def_struct_ui_text(srna, "Area Light", "Directional area Light"); + RNA_def_struct_ui_icon(srna, ICON_LIGHT_AREA); - rna_def_lamp_shadow(srna, 0); - rna_def_lamp_falloff(srna); + rna_def_light_shadow(srna, 0); + rna_def_light_falloff(srna); prop = RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "area_shape"); RNA_def_property_enum_items(prop, prop_areashape_items); - RNA_def_property_ui_text(prop, "Shape", "Shape of the area lamp"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_ui_text(prop, "Shape", "Shape of the area Light"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "area_size"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0, 100, 0.1, 3); - RNA_def_property_ui_text(prop, "Size", "Size of the area of the area Lamp, X direction size for Rectangle shapes"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_ui_text(prop, "Size", "Size of the area of the area light, X direction size for rectangle shapes"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_float_sdna(prop, NULL, "area_sizey"); RNA_def_property_ui_range(prop, 0, 100, 0.1, 3); RNA_def_property_ui_text(prop, "Size Y", - "Size of the area of the area Lamp in the Y direction for Rectangle shapes"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + "Size of the area of the area light in the Y direction for rectangle shapes"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); } -static void rna_def_spot_lamp(BlenderRNA *brna) +static void rna_def_spot_light(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - srna = RNA_def_struct(brna, "SpotLamp", "Lamp"); + srna = RNA_def_struct(brna, "SpotLight", "Light"); RNA_def_struct_sdna(srna, "Lamp"); - RNA_def_struct_ui_text(srna, "Spot Lamp", "Directional cone lamp"); - RNA_def_struct_ui_icon(srna, ICON_LAMP_SPOT); + RNA_def_struct_ui_text(srna, "Spot Light", "Directional cone Light"); + RNA_def_struct_ui_icon(srna, ICON_LIGHT_SPOT); - rna_def_lamp_falloff(srna); - rna_def_lamp_shadow(srna, 0); + rna_def_light_falloff(srna); + rna_def_light_shadow(srna, 0); prop = RNA_def_property(srna, "use_square", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SQUARE); RNA_def_property_ui_text(prop, "Square", "Cast a square spot light shape"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "spot_blend", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "spotblend"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Spot Blend", "The softness of the spotlight edge"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "spotsize"); RNA_def_property_range(prop, DEG2RADF(1.0f), DEG2RADF(180.0f)); RNA_def_property_ui_text(prop, "Spot Size", "Angle of the spotlight beam"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); prop = RNA_def_property(srna, "show_cone", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SHOW_CONE); RNA_def_property_ui_text(prop, "Show Cone", "Draw transparent cone in 3D view to visualize which objects are contained in it"); - RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); } -static void rna_def_sun_lamp(BlenderRNA *brna) +static void rna_def_sun_light(BlenderRNA *brna) { StructRNA *srna; - srna = RNA_def_struct(brna, "SunLamp", "Lamp"); + srna = RNA_def_struct(brna, "SunLight", "Light"); RNA_def_struct_sdna(srna, "Lamp"); - RNA_def_struct_ui_text(srna, "Sun Lamp", "Constant direction parallel ray lamp"); - RNA_def_struct_ui_icon(srna, ICON_LAMP_SUN); + RNA_def_struct_ui_text(srna, "Sun Light", "Constant direction parallel ray Light"); + RNA_def_struct_ui_icon(srna, ICON_LIGHT_SUN); - rna_def_lamp_shadow(srna, 1); + rna_def_light_shadow(srna, 1); } -static void rna_def_hemi_lamp(BlenderRNA *brna) +static void rna_def_hemi_light(BlenderRNA *brna) { StructRNA *srna; - srna = RNA_def_struct(brna, "HemiLamp", "Lamp"); + srna = RNA_def_struct(brna, "HemiLight", "Light"); RNA_def_struct_sdna(srna, "Lamp"); - RNA_def_struct_ui_text(srna, "Hemi Lamp", "180 degree constant lamp"); - RNA_def_struct_ui_icon(srna, ICON_LAMP_HEMI); + RNA_def_struct_ui_text(srna, "Hemi Light", "180 degree constant Light"); + RNA_def_struct_ui_icon(srna, ICON_LIGHT_HEMI); } -void RNA_def_lamp(BlenderRNA *brna) +void RNA_def_light(BlenderRNA *brna) { - rna_def_lamp(brna); - rna_def_point_lamp(brna); - rna_def_area_lamp(brna); - rna_def_spot_lamp(brna); - rna_def_sun_lamp(brna); - rna_def_hemi_lamp(brna); + rna_def_light(brna); + rna_def_point_light(brna); + rna_def_area_light(brna); + rna_def_spot_light(brna); + rna_def_sun_light(brna); + rna_def_hemi_light(brna); } #endif diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index f3921545ac5..5e05d37dc8c 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -107,7 +107,7 @@ static void rna_Main_object_begin(CollectionPropertyIterator *iter, PointerRNA * rna_iterator_listbase_begin(iter, &bmain->object, NULL); } -static void rna_Main_lamp_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_light_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->lamp, NULL); @@ -353,7 +353,7 @@ void RNA_def_main(BlenderRNA *brna) {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material data-blocks", RNA_def_main_materials}, {"node_groups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group data-blocks", RNA_def_main_node_groups}, {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh data-blocks", RNA_def_main_meshes}, - {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp data-blocks", RNA_def_main_lamps}, + {"lights", "Light", "rna_Main_light_begin", "Lights", "Light data-blocks", RNA_def_main_lights}, {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library data-blocks", RNA_def_main_libraries}, {"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen data-blocks", RNA_def_main_screens}, {"window_managers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager data-blocks", RNA_def_main_window_managers}, diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 5fca91064b6..febe74f63c9 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -319,7 +319,7 @@ Mesh *rna_Main_meshes_new_from_object( return BKE_mesh_new_from_object(depsgraph, bmain, sce, ob, apply_modifiers, calc_tessface, calc_undeformed); } -static Lamp *rna_Main_lamps_new(Main *bmain, const char *name, int type) +static Lamp *rna_Main_lights_new(Main *bmain, const char *name, int type) { char safe_name[MAX_ID_NAME - 2]; rna_idname_validate(name, safe_name); @@ -603,7 +603,7 @@ RNA_MAIN_ID_TAG_FUNCS_DEF(objects, object, ID_OB) RNA_MAIN_ID_TAG_FUNCS_DEF(materials, mat, ID_MA) RNA_MAIN_ID_TAG_FUNCS_DEF(node_groups, nodetree, ID_NT) RNA_MAIN_ID_TAG_FUNCS_DEF(meshes, mesh, ID_ME) -RNA_MAIN_ID_TAG_FUNCS_DEF(lamps, lamp, ID_LA) +RNA_MAIN_ID_TAG_FUNCS_DEF(lights, lamp, ID_LA) RNA_MAIN_ID_TAG_FUNCS_DEF(libraries, library, ID_LI) RNA_MAIN_ID_TAG_FUNCS_DEF(screens, screen, ID_SCR) RNA_MAIN_ID_TAG_FUNCS_DEF(window_managers, wm, ID_WM) @@ -894,42 +894,43 @@ void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop) parm = RNA_def_boolean(func, "value", 0, "Value", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); } -void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop) + +void RNA_def_main_lights(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; FunctionRNA *func; PropertyRNA *parm; - RNA_def_property_srna(cprop, "BlendDataLamps"); - srna = RNA_def_struct(brna, "BlendDataLamps", NULL); + RNA_def_property_srna(cprop, "BlendDataLights"); + srna = RNA_def_struct(brna, "BlendDataLights", NULL); RNA_def_struct_sdna(srna, "Main"); - RNA_def_struct_ui_text(srna, "Main Lamps", "Collection of lamps"); + RNA_def_struct_ui_text(srna, "Main Lights", "Collection of lights"); - func = RNA_def_function(srna, "new", "rna_Main_lamps_new"); - RNA_def_function_ui_description(func, "Add a new lamp to the main database"); - parm = RNA_def_string(func, "name", "Lamp", 0, "", "New name for the data-block"); + func = RNA_def_function(srna, "new", "rna_Main_lights_new"); + RNA_def_function_ui_description(func, "Add a new light to the main database"); + parm = RNA_def_string(func, "name", "Light", 0, "", "New name for the data-block"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - parm = RNA_def_enum(func, "type", rna_enum_lamp_type_items, 0, "Type", "The type of texture to add"); + parm = RNA_def_enum(func, "type", rna_enum_light_type_items, 0, "Type", "The type of texture to add"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); /* return type */ - parm = RNA_def_pointer(func, "lamp", "Lamp", "", "New lamp data-block"); + parm = RNA_def_pointer(func, "light", "Light", "", "New light data-block"); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "remove", "rna_Main_ID_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a lamp from the current blendfile"); - parm = RNA_def_pointer(func, "lamp", "Lamp", "", "Lamp to remove"); + RNA_def_function_ui_description(func, "Remove a light from the current blendfile"); + parm = RNA_def_pointer(func, "light", "Light", "", "Light to remove"); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); RNA_def_boolean(func, "do_unlink", true, "", - "Unlink all usages of this lamp before deleting it " - "(WARNING: will also delete objects instancing that lamp data)"); + "Unlink all usages of this Light before deleting it " + "(WARNING: will also delete objects instancing that light data)"); RNA_def_boolean(func, "do_id_user", true, "", - "Decrement user counter of all datablocks used by this lamp data"); + "Decrement user counter of all datablocks used by this light data"); RNA_def_boolean(func, "do_ui_user", true, "", - "Make sure interface does not reference this lamp data"); + "Make sure interface does not reference this light data"); - func = RNA_def_function(srna, "tag", "rna_Main_lamps_tag"); + func = RNA_def_function(srna, "tag", "rna_Main_lights_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); } diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 46022511f8e..50246c3f9ac 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1309,7 +1309,7 @@ static void rna_def_modifier_warp(BlenderRNA *brna) prop = RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "curfalloff"); - RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve"); + RNA_def_property_ui_text(prop, "Falloff Curve", "Custom falloff curve"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "use_volume_preserve", PROP_BOOLEAN, PROP_NONE); @@ -1900,7 +1900,7 @@ static void rna_def_modifier_hook(BlenderRNA *brna) prop = RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "curfalloff"); - RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve"); + RNA_def_property_ui_text(prop, "Falloff Curve", "Custom falloff curve"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "center", PROP_FLOAT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 04f4c41659d..2bdfbade53a 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -146,7 +146,7 @@ const EnumPropertyItem rna_enum_object_type_items[] = { {OB_EMPTY, "EMPTY", 0, "Empty", ""}, {0, "", 0, NULL, NULL}, {OB_CAMERA, "CAMERA", 0, "Camera", ""}, - {OB_LAMP, "LAMP", 0, "Lamp", ""}, + {OB_LAMP, "LIGHT", 0, "Light", ""}, {OB_SPEAKER, "SPEAKER", 0, "Speaker", ""}, {OB_LIGHTPROBE, "LIGHT_PROBE", 0, "Probe", ""}, {0, NULL, 0, NULL, NULL} @@ -375,7 +375,7 @@ static StructRNA *rna_Object_data_typef(PointerRNA *ptr) case OB_SURF: return &RNA_Curve; case OB_FONT: return &RNA_Curve; case OB_MBALL: return &RNA_MetaBall; - case OB_LAMP: return &RNA_Lamp; + case OB_LAMP: return &RNA_Light; case OB_CAMERA: return &RNA_Camera; case OB_LATTICE: return &RNA_Lattice; case OB_ARMATURE: return &RNA_Armature; @@ -1446,7 +1446,7 @@ bool rna_Camera_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) return ((Object *)value.id.data)->type == OB_CAMERA; } -bool rna_Lamp_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) +bool rna_Light_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) { return ((Object *)value.id.data)->type == OB_LAMP; } diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index b902fa73334..1a2b3854668 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -517,7 +517,7 @@ void RNA_api_object(StructRNA *srna) /* Camera-related operations */ func = RNA_def_function(srna, "calc_matrix_camera", "rna_Object_calc_matrix_camera"); RNA_def_function_ui_description(func, "Generate the camera projection matrix of this object " - "(mostly useful for Camera and Lamp types)"); + "(mostly useful for Camera and Light types)"); parm = RNA_def_pointer(func, "depsgraph", "Depsgraph", "", "Depsgraph to get evaluated data from"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 72245e8feb9..5b7377eed17 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -5952,7 +5952,7 @@ static void rna_def_scene_eevee(BlenderRNA *brna) prop = RNA_def_property(srna, "use_volumetric_lights", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_VOLUMETRIC_LIGHTS); RNA_def_property_boolean_default(prop, 1); - RNA_def_property_ui_text(prop, "Volumetric Lighting", "Enable scene lamps interactions with volumetrics"); + RNA_def_property_ui_text(prop, "Volumetric Lighting", "Enable scene light interactions with volumetrics"); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); prop = RNA_def_property(srna, "volumetric_light_clamp", PROP_FLOAT, PROP_NONE); @@ -6116,13 +6116,13 @@ static void rna_def_scene_eevee(BlenderRNA *brna) prop = RNA_def_property(srna, "shadow_cube_size", PROP_ENUM, PROP_NONE); RNA_def_property_enum_default(prop, 512); RNA_def_property_enum_items(prop, eevee_shadow_size_items); - RNA_def_property_ui_text(prop, "Cube Shadows Resolution", "Size of point and area lamps shadow maps"); + RNA_def_property_ui_text(prop, "Cube Shadows Resolution", "Size of point and area light shadow maps"); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); prop = RNA_def_property(srna, "shadow_cascade_size", PROP_ENUM, PROP_NONE); RNA_def_property_enum_default(prop, 1024); RNA_def_property_enum_items(prop, eevee_shadow_size_items); - RNA_def_property_ui_text(prop, "Directional Shadows Resolution", "Size of sun lamps shadow maps"); + RNA_def_property_ui_text(prop, "Directional Shadows Resolution", "Size of sun light shadow maps"); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); prop = RNA_def_property(srna, "use_shadow_high_bitdepth", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 13978f3f5ee..4d85d845081 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1320,7 +1320,7 @@ static const EnumPropertyItem *rna_SpaceProperties_context_itemf( static void rna_SpaceProperties_context_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { SpaceButs *sbuts = (SpaceButs *)(ptr->data); - /* XXX BCONTEXT_DATA is ugly, but required for lamps... See T51318. */ + /* XXX BCONTEXT_DATA is ugly, but required for lights... See T51318. */ if (ELEM(sbuts->mainb, BCONTEXT_WORLD, BCONTEXT_MATERIAL, BCONTEXT_TEXTURE, BCONTEXT_DATA)) { sbuts->preview = 1; } @@ -2339,9 +2339,9 @@ static void rna_def_space_outliner(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Show Empties", "Show empty objects"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); - prop = RNA_def_property(srna, "use_filter_object_lamp", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "use_filter_object_light", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_LAMP); - RNA_def_property_ui_text(prop, "Show Lamps", "Show lamps objects"); + RNA_def_property_ui_text(prop, "Show Lights", "Show light objects"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); prop = RNA_def_property(srna, "use_filter_object_camera", PROP_BOOLEAN, PROP_NONE); @@ -2482,7 +2482,7 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna) prop = RNA_def_property(srna, "use_scene_light", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shading.flag", V3D_SHADING_SCENE_LIGHT); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_ui_text(prop, "Scene Light", "Render lamps and light probes of the scene"); + RNA_def_property_ui_text(prop, "Scene Light", "Render lights and light probes of the scene"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); prop = RNA_def_property(srna, "show_specular_highlight", PROP_BOOLEAN, PROP_NONE); @@ -4085,7 +4085,7 @@ static void rna_def_fileselect_params(BlenderRNA *brna) {FILTER_ID_GD, "GREASE_PENCIL", ICON_GREASEPENCIL, "Grease Pencil", "Show/hide Grease pencil data-blocks"}, {FILTER_ID_GR, "GROUP", ICON_GROUP, "Groups", "Show/hide Group data-blocks"}, {FILTER_ID_IM, "IMAGE", ICON_IMAGE_DATA, "Images", "Show/hide Image data-blocks"}, - {FILTER_ID_LA, "LAMP", ICON_LAMP_DATA, "Lamps", "Show/hide Lamp data-blocks"}, + {FILTER_ID_LA, "LIGHT", ICON_LIGHT_DATA, "Lights", "Show/hide Light data-blocks"}, {FILTER_ID_LS, "LINESTYLE", ICON_LINE_DATA, "Freestyle Linestyles", "Show/hide Freestyle's Line Style data-blocks"}, {FILTER_ID_LT, "LATTICE", ICON_LATTICE_DATA, "Lattices", "Show/hide Lattice data-blocks"}, @@ -4127,7 +4127,7 @@ static void rna_def_fileselect_params(BlenderRNA *brna) {FILTER_ID_IM | FILTER_ID_MC | FILTER_ID_MSK | FILTER_ID_SO, "IMAGE", ICON_IMAGE_DATA, "Images & Sounds", "Show/hide images, movie clips, sounds and masks"}, {FILTER_ID_CA | FILTER_ID_LA | FILTER_ID_SPK | FILTER_ID_WO | FILTER_ID_WS, - "ENVIRONMENT", ICON_WORLD_DATA, "Environment", "Show/hide worlds, lamps, cameras and speakers"}, + "ENVIRONMENT", ICON_WORLD_DATA, "Environment", "Show/hide worlds, lights, cameras and speakers"}, {FILTER_ID_BR | FILTER_ID_GD | FILTER_ID_PA | FILTER_ID_PAL | FILTER_ID_PC | FILTER_ID_TXT | FILTER_ID_VF | FILTER_ID_CF, "MISC", ICON_GREASEPENCIL, "Miscellaneous", "Show/hide other data types"}, {0, NULL, 0, NULL, NULL} diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 0026344e460..07fd20c6fc5 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -1435,7 +1435,7 @@ static void rna_def_texture(BlenderRNA *brna) srna = RNA_def_struct(brna, "Texture", "ID"); RNA_def_struct_sdna(srna, "Tex"); - RNA_def_struct_ui_text(srna, "Texture", "Texture data-block used by materials, lamps, worlds and brushes"); + RNA_def_struct_ui_text(srna, "Texture", "Texture data-block used by materials, lights, worlds and brushes"); RNA_def_struct_ui_icon(srna, ICON_TEXTURE_DATA); RNA_def_struct_refine_func(srna, "rna_Texture_refine"); diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index be8bce61910..74117b43d91 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -844,7 +844,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_function_return(func, parm); func = RNA_def_function(srna, "template_preview", "uiTemplatePreview"); - RNA_def_function_ui_description(func, "Item. A preview window for materials, textures, lamps or worlds"); + RNA_def_function_ui_description(func, "Item. A preview window for materials, textures, lights or worlds"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); parm = RNA_def_pointer(func, "id", "ID", "", "ID data-block"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); @@ -856,7 +856,7 @@ void RNA_api_ui_layout(StructRNA *srna) "(i.e. all previews of materials without explicit ID will have the same size...)"); func = RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping"); - RNA_def_function_ui_description(func, "Item. A curve mapping widget used for e.g falloff curves for lamps"); + RNA_def_function_ui_description(func, "Item. A curve mapping widget used for e.g falloff curves for lights"); api_ui_item_rna_common(func); RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display"); RNA_def_boolean(func, "levels", false, "", "Show black/white levels"); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 9cde04c560e..9ac93efe347 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -1805,9 +1805,10 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Empty", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "lamp", PROP_FLOAT, PROP_COLOR_GAMMA); + prop = RNA_def_property(srna, "light", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "lamp"); RNA_def_property_array(prop, 4); - RNA_def_property_ui_text(prop, "Lamp", ""); + RNA_def_property_ui_text(prop, "Light", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); prop = RNA_def_property(srna, "speaker", PROP_FLOAT, PROP_COLOR_GAMMA); @@ -3803,7 +3804,7 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop = RNA_def_property(srna, "object_origin_size", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "obcenter_dia"); RNA_def_property_range(prop, 4, 10); - RNA_def_property_ui_text(prop, "Object Origin Size", "Diameter in Pixels for Object/Lamp origin display"); + RNA_def_property_ui_text(prop, "Object Origin Size", "Diameter in Pixels for Object/Light origin display"); RNA_def_property_update(prop, 0, "rna_userdef_update"); /* View2D Grid Displays */ @@ -4038,9 +4039,9 @@ static void rna_def_userdef_edit(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ARM); RNA_def_property_ui_text(prop, "Duplicate Armature", "Causes armature data to be duplicated with the object"); - prop = RNA_def_property(srna, "use_duplicate_lamp", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "use_duplicate_light", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_LAMP); - RNA_def_property_ui_text(prop, "Duplicate Lamp", "Causes lamp data to be duplicated with the object"); + RNA_def_property_ui_text(prop, "Duplicate Light", "Causes light data to be duplicated with the object"); prop = RNA_def_property(srna, "use_duplicate_material", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MAT); diff --git a/source/blender/nodes/NOD_static_types.h b/source/blender/nodes/NOD_static_types.h index ec4e88768de..cf974132961 100644 --- a/source/blender/nodes/NOD_static_types.h +++ b/source/blender/nodes/NOD_static_types.h @@ -62,8 +62,8 @@ DefNode( ShaderNode, SH_NODE_COMBRGB, 0, "COMBR DefNode( ShaderNode, SH_NODE_HUE_SAT, 0, "HUE_SAT", HueSaturation, "Hue/Saturation", "" ) DefNode( ShaderNode, SH_NODE_OUTPUT_MATERIAL, def_sh_output, "OUTPUT_MATERIAL", OutputMaterial, "Material Output", "" ) -DefNode( ShaderNode, SH_NODE_EEVEE_SPECULAR, 0, "EEVEE_SPECULAR", EeveeSpecular, "Specular", "") -DefNode( ShaderNode, SH_NODE_OUTPUT_LAMP, def_sh_output, "OUTPUT_LAMP", OutputLamp, "Lamp Output", "" ) +DefNode( ShaderNode, SH_NODE_EEVEE_SPECULAR, 0, "EEVEE_SPECULAR", EeveeSpecular, "Specular", "" ) +DefNode( ShaderNode, SH_NODE_OUTPUT_LIGHT, def_sh_output, "OUTPUT_LIGHT", OutputLight, "Light Output", "" ) DefNode( ShaderNode, SH_NODE_OUTPUT_WORLD, def_sh_output, "OUTPUT_WORLD", OutputWorld, "World Output", "" ) DefNode( ShaderNode, SH_NODE_OUTPUT_LINESTYLE, def_sh_output_linestyle,"OUTPUT_LINESTYLE", OutputLineStyle, "Line Style Output", "" ) DefNode( ShaderNode, SH_NODE_FRESNEL, 0, "FRESNEL", Fresnel, "Fresnel", "" ) diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c index 8db88f13ea6..32c9244735d 100644 --- a/source/blender/nodes/shader/node_shader_tree.c +++ b/source/blender/nodes/shader/node_shader_tree.c @@ -222,7 +222,7 @@ bNode *ntreeShaderOutputNode(bNodeTree *ntree, int target) for (bNode *node = ntree->nodes.first; node; node = node->next) { if (!ELEM(node->type, SH_NODE_OUTPUT_MATERIAL, SH_NODE_OUTPUT_WORLD, - SH_NODE_OUTPUT_LAMP)) + SH_NODE_OUTPUT_LIGHT)) { continue; } diff --git a/source/blender/nodes/shader/nodes/node_shader_output_lamp.c b/source/blender/nodes/shader/nodes/node_shader_output_lamp.c index b08a4b4ff57..4eb81f4cb5e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output_lamp.c +++ b/source/blender/nodes/shader/nodes/node_shader_output_lamp.c @@ -39,7 +39,7 @@ void register_node_type_sh_output_lamp(void) { static bNodeType ntype; - sh_node_type_base(&ntype, SH_NODE_OUTPUT_LAMP, "Lamp Output", NODE_CLASS_OUTPUT, 0); + sh_node_type_base(&ntype, SH_NODE_OUTPUT_LAMP, "Light Output", NODE_CLASS_OUTPUT, 0); node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_output_lamp_in, NULL); node_type_init(&ntype, NULL); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 1983c0e6b84..d7210c4ee29 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -3558,7 +3558,7 @@ static const EnumPropertyItem preview_id_type_items[] = { {FILTER_ID_GR, "GROUP", 0, "Groups", ""}, {FILTER_ID_OB, "OBJECT", 0, "Objects", ""}, {FILTER_ID_MA, "MATERIAL", 0, "Materials", ""}, - {FILTER_ID_LA, "LAMP", 0, "Lamps", ""}, + {FILTER_ID_LA, "LIGHT", 0, "Lights", ""}, {FILTER_ID_WO, "WORLD", 0, "Worlds", ""}, {FILTER_ID_TE, "TEXTURE", 0, "Textures", ""}, {FILTER_ID_IM, "IMAGE", 0, "Images", ""}, diff --git a/tests/python/bl_mesh_modifiers.py b/tests/python/bl_mesh_modifiers.py index d553a2e2c27..f2ab6b406bd 100644 --- a/tests/python/bl_mesh_modifiers.py +++ b/tests/python/bl_mesh_modifiers.py @@ -127,7 +127,7 @@ def ctx_clear_scene(): # copied from batch_import.py # remove obdata, for now only worry about the startup scene for bpy_data_iter in (bpy.data.objects, bpy.data.meshes, - bpy.data.lamps, + bpy.data.lights, bpy.data.cameras, ): diff --git a/tests/python/bl_pyapi_idprop_datablock.py b/tests/python/bl_pyapi_idprop_datablock.py index 4b46bea7c00..8ff597dda31 100644 --- a/tests/python/bl_pyapi_idprop_datablock.py +++ b/tests/python/bl_pyapi_idprop_datablock.py @@ -90,10 +90,10 @@ def make_lib(): # datablock pointer to the Camera object bpy.data.objects["Cube"].prop = bpy.data.objects['Camera'] - # array of datablock pointers to the Lamp object + # array of datablock pointers to the Light object for i in range(0, arr_len): a = bpy.data.objects["Cube"].prop_array.add() - a.test_prop = bpy.data.objects['Lamp'] + a.test_prop = bpy.data.objects['Light'] a.name = a.test_prop.name # make unique named copy of the cube @@ -124,7 +124,7 @@ def check_lib(): # check array of pointers in duplicated object for i in range(0, arr_len): abort_if_false(bpy.data.objects["Cube.001"].prop_array[i].test_prop == - bpy.data.objects['Lamp']) + bpy.data.objects['Light']) def check_lib_linking(): @@ -137,7 +137,7 @@ def check_lib_linking(): o = bpy.data.scenes["Scene_lib"].objects['Unique_Cube'] - abort_if_false(o.prop_array[0].test_prop == bpy.data.scenes["Scene_lib"].objects['Lamp']) + abort_if_false(o.prop_array[0].test_prop == bpy.data.scenes["Scene_lib"].objects['Light']) abort_if_false(o.prop == bpy.data.scenes["Scene_lib"].objects['Camera']) abort_if_false(o.prop.library == o.library) @@ -187,15 +187,15 @@ def check_scene_copying(): # count users def test_users_counting(): bpy.ops.wm.read_factory_settings() - lamp_us = bpy.data.objects["Lamp"].data.users + Light_us = bpy.data.objects["Light"].data.users n = 1000 for i in range(0, n): - bpy.data.objects["Cube"]["a%s" % i] = bpy.data.objects["Lamp"].data - abort_if_false(bpy.data.objects["Lamp"].data.users == lamp_us + n) + bpy.data.objects["Cube"]["a%s" % i] = bpy.data.objects["Light"].data + abort_if_false(bpy.data.objects["Light"].data.users == Light_us + n) for i in range(0, int(n / 2)): bpy.data.objects["Cube"]["a%s" % i] = 1 - abort_if_false(bpy.data.objects["Lamp"].data.users == lamp_us + int(n / 2)) + abort_if_false(bpy.data.objects["Light"].data.users == Light_us + int(n / 2)) # linking @@ -259,13 +259,13 @@ def test_restrictions1(): bpy.types.Scene.prop2 = bpy.props.PointerProperty(type=bpy.types.NodeTree, poll=poll1) # check poll effect on UI (poll returns false => red alert) - bpy.context.scene.prop = bpy.data.objects["Lamp.001"] - bpy.context.scene.prop1 = bpy.data.objects["Lamp.001"] + bpy.context.scene.prop = bpy.data.objects["Light.001"] + bpy.context.scene.prop1 = bpy.data.objects["Light.001"] # check incorrect type assignment def sub_test(): # NodeTree id_prop - bpy.context.scene.prop2 = bpy.data.objects["Lamp.001"] + bpy.context.scene.prop2 = bpy.data.objects["Light.001"] check_crash(sub_test) diff --git a/tests/python/bl_rna_defaults.py b/tests/python/bl_rna_defaults.py index 6038ef34d78..fc895dbddfc 100644 --- a/tests/python/bl_rna_defaults.py +++ b/tests/python/bl_rna_defaults.py @@ -125,8 +125,8 @@ test_World = _test_id_gen("worlds") ns = globals() for t in bpy.data.curves.bl_rna.functions["new"].parameters["type"].enum_items.keys(): ns["test_Curve_%s" % t] = _test_id_gen("curves", args_create=(DUMMY_NAME, t)) -for t in bpy.data.lamps.bl_rna.functions["new"].parameters["type"].enum_items.keys(): - ns["test_Lamp_%s" % t] = _test_id_gen("lamps", args_create=(DUMMY_NAME, t)) +for t in bpy.data.lights.bl_rna.functions["new"].parameters["type"].enum_items.keys(): + ns["test_Light_%s" % t] = _test_id_gen("lights", args_create=(DUMMY_NAME, t)) # types are a dynamic enum, have to hard-code. for t in "ShaderNodeTree", "CompositorNodeTree", "TextureNodeTree": ns["test_NodeGroup_%s" % t] = _test_id_gen("node_groups", args_create=(DUMMY_NAME, t)) |