diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-07-10 00:03:21 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-07-10 00:03:21 +0300 |
commit | 05517c9bedfdd6afbae0a7d99dbbaba54563303b (patch) | |
tree | 8227f5feb22217e7278a65f4b6c1d1f0b7a29eeb | |
parent | ff11750ee9925d2c75193e1e7cbaccec86855fa8 (diff) | |
parent | 07e368cb5f6a4f73164a70794e884970d171d909 (diff) |
Merge remote-tracking branch 'origin/blender2.8' into temp-eeveelightcachetemp-eeveelightcache
# Conflicts:
# source/blender/draw/engines/eevee/eevee_lightprobes.c
315 files changed, 14121 insertions, 6394 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..679c3e6a437 100644 --- a/intern/cycles/blender/addon/version_update.py +++ b/intern/cycles/blender/addon/version_update.py @@ -22,45 +22,6 @@ import math from bpy.app.handlers import persistent -def check_is_new_shading_ntree(node_tree): - for node in node_tree.nodes: - # If material has any node with ONLY new shading system - # compatibility then it's considered a Cycles material - # and versioning code would need to perform on it. - # - # We can not check for whether NEW_SHADING in compatibility - # because some nodes could have compatibility with both old - # and new shading system and they can't be used for any - # decision here. - if node.shading_compatibility == {'NEW_SHADING'}: - return True - - # If node is only compatible with old shading system - # then material can not be Cycles material and we - # can stopiterating nodes now. - if node.shading_compatibility == {'OLD_SHADING'}: - return False - return False - - -def check_is_new_shading_material(material): - if not material.node_tree: - return False - return check_is_new_shading_ntree(material.node_tree) - - -def check_is_new_shading_world(world): - if not world.node_tree: - return False - return check_is_new_shading_ntree(world.node_tree) - - -def check_is_new_shading_lamp(lamp): - if not lamp.node_tree: - return False - return check_is_new_shading_ntree(lamp.node_tree) - - def foreach_notree_node(nodetree, callback, traversed): if nodetree in traversed: return @@ -74,20 +35,20 @@ def foreach_notree_node(nodetree, callback, traversed): def foreach_cycles_node(callback): traversed = set() for material in bpy.data.materials: - if check_is_new_shading_material(material): - foreach_notree_node(material.node_tree, - callback, - traversed) + if material.node_tree: + foreach_notree_node(material.node_tree, + callback, + traversed) for world in bpy.data.worlds: - if check_is_new_shading_world(world): - 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, - callback, - traversed) + if world.node_tree: + foreach_notree_node(world.node_tree, + callback, + traversed) + for light in bpy.data.lights: + if light.node_tree: + foreach_notree_node(light.node_tree, + callback, + traversed) def displacement_node_insert(material, nodetree, traversed): @@ -128,7 +89,7 @@ def displacement_node_insert(material, nodetree, traversed): def displacement_nodes_insert(): traversed = set() for material in bpy.data.materials: - if check_is_new_shading_material(material): + if material.node_tree: displacement_node_insert(material, material.node_tree, traversed) def displacement_principled_nodes(node): @@ -186,7 +147,7 @@ def square_roughness_node_insert(material, nodetree, traversed): def square_roughness_nodes_insert(): traversed = set() for material in bpy.data.materials: - if check_is_new_shading_material(material): + if material.node_tree: square_roughness_node_insert(material, material.node_tree, traversed) @@ -301,7 +262,7 @@ def ambient_occlusion_node_relink(material, nodetree, traversed): def ambient_occlusion_nodes_relink(): traversed = set() for material in bpy.data.materials: - if check_is_new_shading_material(material): + if material.node_tree: ambient_occlusion_node_relink(material, material.node_tree, traversed) @@ -393,12 +354,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/intern/gawain/gawain/gwn_batch.h b/intern/gawain/gawain/gwn_batch.h index e0cf66637f6..cf7b0c9f1b5 100644 --- a/intern/gawain/gawain/gwn_batch.h +++ b/intern/gawain/gawain/gwn_batch.h @@ -149,9 +149,9 @@ typedef struct BatchWithOwnVertexBufferAndElementList { Gwn_VertBuf verts; // link batch.verts to this } BatchWithOwnVertexBufferAndElementList; -Gwn_Batch* create_BatchWithOwnVertexBuffer(Gwn_PrimType, Gwn_VertFormat*, unsigned v_ct, Gwn_IndexBuf*); -Gwn_Batch* create_BatchWithOwnElementList(Gwn_PrimType, Gwn_VertBuf*, unsigned prim_ct); -Gwn_Batch* create_BatchWithOwnVertexBufferAndElementList(Gwn_PrimType, Gwn_VertFormat*, unsigned v_ct, unsigned prim_ct); +Gwn_Batch* create_BatchWithOwnVertexBuffer(Gwn_PrimType, Gwn_VertFormat*, unsigned v_len, Gwn_IndexBuf*); +Gwn_Batch* create_BatchWithOwnElementList(Gwn_PrimType, Gwn_VertBuf*, unsigned prim_len); +Gwn_Batch* create_BatchWithOwnVertexBufferAndElementList(Gwn_PrimType, Gwn_VertFormat*, unsigned v_len, unsigned prim_len); // verts: shared, own // elem: none, shared, own Gwn_Batch* create_BatchInGeneral(Gwn_PrimType, VertexBufferStuff, ElementListStuff); diff --git a/intern/gawain/gawain/gwn_element.h b/intern/gawain/gawain/gwn_element.h index 4bd0c34675a..53a54cdfd76 100644 --- a/intern/gawain/gawain/gwn_element.h +++ b/intern/gawain/gawain/gwn_element.h @@ -24,7 +24,7 @@ typedef enum { } Gwn_IndexBufType; typedef struct Gwn_IndexBuf { - unsigned index_ct; + unsigned index_len; #if GWN_TRACK_INDEX_RANGE Gwn_IndexBufType index_type; uint32_t gl_index_type; @@ -41,8 +41,8 @@ unsigned GWN_indexbuf_size_get(const Gwn_IndexBuf*); typedef struct Gwn_IndexBufBuilder { unsigned max_allowed_index; - unsigned max_index_ct; - unsigned index_ct; + unsigned max_index_len; + unsigned index_len; Gwn_PrimType prim_type; unsigned* data; bool use_prim_restart; @@ -50,10 +50,10 @@ typedef struct Gwn_IndexBufBuilder { // supports all primitive types. -void GWN_indexbuf_init_ex(Gwn_IndexBufBuilder*, Gwn_PrimType, unsigned index_ct, unsigned vertex_ct, bool use_prim_restart); +void GWN_indexbuf_init_ex(Gwn_IndexBufBuilder*, Gwn_PrimType, unsigned index_len, unsigned vertex_len, bool use_prim_restart); // supports only GWN_PRIM_POINTS, GWN_PRIM_LINES and GWN_PRIM_TRIS. -void GWN_indexbuf_init(Gwn_IndexBufBuilder*, Gwn_PrimType, unsigned prim_ct, unsigned vertex_ct); +void GWN_indexbuf_init(Gwn_IndexBufBuilder*, Gwn_PrimType, unsigned prim_len, unsigned vertex_len); void GWN_indexbuf_add_generic_vert(Gwn_IndexBufBuilder*, unsigned v); void GWN_indexbuf_add_primitive_restart(Gwn_IndexBufBuilder*); diff --git a/intern/gawain/gawain/gwn_immediate.h b/intern/gawain/gawain/gwn_immediate.h index 35f9c9d9e2c..c3ea2b911a0 100644 --- a/intern/gawain/gawain/gwn_immediate.h +++ b/intern/gawain/gawain/gwn_immediate.h @@ -23,8 +23,8 @@ Gwn_VertFormat* immVertexFormat(void); // returns a cleared vertex format, ready void immBindProgram(uint32_t program, const Gwn_ShaderInterface*); // every immBegin must have a program bound first void immUnbindProgram(void); // call after your last immEnd, or before binding another program -void immBegin(Gwn_PrimType, unsigned vertex_ct); // must supply exactly vertex_ct vertices -void immBeginAtMost(Gwn_PrimType, unsigned max_vertex_ct); // can supply fewer vertices +void immBegin(Gwn_PrimType, unsigned vertex_len); // must supply exactly vertex_len vertices +void immBeginAtMost(Gwn_PrimType, unsigned max_vertex_len); // can supply fewer vertices void immEnd(void); // finishes and draws #if IMM_BATCH_COMBO @@ -32,8 +32,8 @@ void immEnd(void); // finishes and draws // immBegin a batch, then use standard immFunctions as usual. // immEnd will finalize the batch instead of drawing. // Then you can draw it as many times as you like! Partially replaces the need for display lists. -Gwn_Batch* immBeginBatch(Gwn_PrimType, unsigned vertex_ct); -Gwn_Batch* immBeginBatchAtMost(Gwn_PrimType, unsigned vertex_ct); +Gwn_Batch* immBeginBatch(Gwn_PrimType, unsigned vertex_len); +Gwn_Batch* immBeginBatchAtMost(Gwn_PrimType, unsigned vertex_len); #endif diff --git a/intern/gawain/gawain/gwn_shader_interface.h b/intern/gawain/gawain/gwn_shader_interface.h index ee3d51fb3cc..b27b12c18d8 100644 --- a/intern/gawain/gawain/gwn_shader_interface.h +++ b/intern/gawain/gawain/gwn_shader_interface.h @@ -65,7 +65,7 @@ typedef struct Gwn_ShaderInterface { Gwn_ShaderInput* builtin_uniforms[GWN_NUM_UNIFORMS]; char* name_buffer; struct Gwn_Batch** batches; // references to batches using this interface - unsigned batches_ct; + unsigned batches_len; } Gwn_ShaderInterface; Gwn_ShaderInterface* GWN_shaderinterface_create(int32_t program_id); diff --git a/intern/gawain/gawain/gwn_vertex_buffer.h b/intern/gawain/gawain/gwn_vertex_buffer.h index b92e4a87698..0eac4838e65 100644 --- a/intern/gawain/gawain/gwn_vertex_buffer.h +++ b/intern/gawain/gawain/gwn_vertex_buffer.h @@ -17,7 +17,7 @@ // How to create a Gwn_VertBuf: // 1) verts = GWN_vertbuf_create() or GWN_vertbuf_init(verts) // 2) GWN_vertformat_attr_add(verts->format, ...) -// 3) GWN_vertbuf_data_alloc(verts, vertex_ct) <-- finalizes/packs vertex format +// 3) GWN_vertbuf_data_alloc(verts, vertex_len) <-- finalizes/packs vertex format // 4) GWN_vertbuf_attr_fill(verts, pos, application_pos_buffer) // Is Gwn_VertBuf always used as part of a Gwn_Batch? @@ -31,8 +31,8 @@ typedef enum { typedef struct Gwn_VertBuf { Gwn_VertFormat format; - unsigned vertex_ct; // number of verts we want to draw - unsigned vertex_alloc; // number of verts data + unsigned vertex_len; /* number of verts we want to draw */ + unsigned vertex_alloc; /* number of verts data */ bool dirty; unsigned char* data; // NULL indicates data in VRAM (unmapped) uint32_t vbo_id; // 0 indicates not yet allocated @@ -54,9 +54,9 @@ void GWN_vertbuf_init_with_format_ex(Gwn_VertBuf*, const Gwn_VertFormat*, Gwn_Us GWN_vertbuf_init_with_format_ex(verts, format, GWN_USAGE_STATIC) unsigned GWN_vertbuf_size_get(const Gwn_VertBuf*); -void GWN_vertbuf_data_alloc(Gwn_VertBuf*, unsigned v_ct); -void GWN_vertbuf_data_resize(Gwn_VertBuf*, unsigned v_ct); -void GWN_vertbuf_vertex_count_set(Gwn_VertBuf*, unsigned v_ct); +void GWN_vertbuf_data_alloc(Gwn_VertBuf*, unsigned v_len); +void GWN_vertbuf_data_resize(Gwn_VertBuf*, unsigned v_len); +void GWN_vertbuf_vertex_count_set(Gwn_VertBuf*, unsigned v_len); // The most important set_attrib variant is the untyped one. Get it right first. // It takes a void* so the app developer is responsible for matching their app data types diff --git a/intern/gawain/gawain/gwn_vertex_format.h b/intern/gawain/gawain/gwn_vertex_format.h index 503c2d03c42..a4593e4615b 100644 --- a/intern/gawain/gawain/gwn_vertex_format.h +++ b/intern/gawain/gawain/gwn_vertex_format.h @@ -42,16 +42,16 @@ typedef struct Gwn_VertAttr { Gwn_VertFetchMode fetch_mode; Gwn_VertCompType comp_type; unsigned gl_comp_type; - unsigned comp_ct; // 1 to 4 or 8 or 12 or 16 + unsigned comp_len; // 1 to 4 or 8 or 12 or 16 unsigned sz; // size in bytes, 1 to 64 unsigned offset; // from beginning of vertex, in bytes - unsigned name_ct; // up to GWN_VERT_ATTR_MAX_NAMES + unsigned name_len; // up to GWN_VERT_ATTR_MAX_NAMES const char* name[GWN_VERT_ATTR_MAX_NAMES]; } Gwn_VertAttr; typedef struct Gwn_VertFormat { - unsigned attrib_ct; // 0 to 16 (GWN_VERT_ATTR_MAX_LEN) - unsigned name_ct; // total count of active vertex attrib + unsigned attr_len; // 0 to 16 (GWN_VERT_ATTR_MAX_LEN) + unsigned name_len; // total count of active vertex attrib unsigned stride; // stride in bytes, 1 to 256 unsigned name_offset; bool packed; @@ -62,7 +62,7 @@ typedef struct Gwn_VertFormat { void GWN_vertformat_clear(Gwn_VertFormat*); void GWN_vertformat_copy(Gwn_VertFormat* dest, const Gwn_VertFormat* src); -unsigned GWN_vertformat_attr_add(Gwn_VertFormat*, const char* name, Gwn_VertCompType, unsigned comp_ct, Gwn_VertFetchMode); +unsigned GWN_vertformat_attr_add(Gwn_VertFormat*, const char* name, Gwn_VertCompType, unsigned comp_len, Gwn_VertFetchMode); void GWN_vertformat_alias_add(Gwn_VertFormat*, const char* alias); // format conversion diff --git a/intern/gawain/gawain/gwn_vertex_format_private.h b/intern/gawain/gawain/gwn_vertex_format_private.h index c1a0f734eda..90cd8412e53 100644 --- a/intern/gawain/gawain/gwn_vertex_format_private.h +++ b/intern/gawain/gawain/gwn_vertex_format_private.h @@ -13,4 +13,4 @@ void VertexFormat_pack(Gwn_VertFormat*); unsigned padding(unsigned offset, unsigned alignment); -unsigned vertex_buffer_size(const Gwn_VertFormat*, unsigned vertex_ct); +unsigned vertex_buffer_size(const Gwn_VertFormat*, unsigned vertex_len); diff --git a/intern/gawain/src/gwn_attr_binding.c b/intern/gawain/src/gwn_attr_binding.c index 7647a927b1e..c702a0ae99d 100644 --- a/intern/gawain/src/gwn_attr_binding.c +++ b/intern/gawain/src/gwn_attr_binding.c @@ -52,10 +52,10 @@ void get_attrib_locations(const Gwn_VertFormat* format, Gwn_AttrBinding* binding { AttribBinding_clear(binding); - for (unsigned a_idx = 0; a_idx < format->attrib_ct; ++a_idx) + for (unsigned a_idx = 0; a_idx < format->attr_len; ++a_idx) { const Gwn_VertAttr* a = format->attribs + a_idx; - for (unsigned n_idx = 0; n_idx < a->name_ct; ++n_idx) + for (unsigned n_idx = 0; n_idx < a->name_len; ++n_idx) { const Gwn_ShaderInput* input = GWN_shaderinterface_attr(shaderface, a->name[n_idx]); diff --git a/intern/gawain/src/gwn_batch.c b/intern/gawain/src/gwn_batch.c index adc72e171c0..62342cfc42f 100644 --- a/intern/gawain/src/gwn_batch.c +++ b/intern/gawain/src/gwn_batch.c @@ -168,9 +168,9 @@ int GWN_batch_vertbuf_add_ex( if (batch->verts[v] == NULL) { #if TRUST_NO_ONE - // for now all VertexBuffers must have same vertex_ct - assert(verts->vertex_ct == batch->verts[0]->vertex_ct); - // in the near future we will enable instanced attribs which have their own vertex_ct + // for now all VertexBuffers must have same vertex_len + assert(verts->vertex_len == batch->verts[0]->vertex_len); + // in the near future we will enable instanced attribs which have their own vertex_len #endif batch->verts[v] = verts; // TODO: mark dirty so we can keep attrib bindings up-to-date @@ -336,30 +336,30 @@ static void create_bindings(Gwn_VertBuf* verts, const Gwn_ShaderInterface* inter { const Gwn_VertFormat* format = &verts->format; - const unsigned attrib_ct = format->attrib_ct; + const unsigned attr_len = format->attr_len; const unsigned stride = format->stride; GWN_vertbuf_use(verts); - for (unsigned a_idx = 0; a_idx < attrib_ct; ++a_idx) + for (unsigned a_idx = 0; a_idx < attr_len; ++a_idx) { const Gwn_VertAttr* a = format->attribs + a_idx; const GLvoid* pointer = (const GLubyte*)0 + a->offset + v_first * stride; - for (unsigned n_idx = 0; n_idx < a->name_ct; ++n_idx) + for (unsigned n_idx = 0; n_idx < a->name_len; ++n_idx) { const Gwn_ShaderInput* input = GWN_shaderinterface_attr(interface, a->name[n_idx]); if (input == NULL) continue; - if (a->comp_ct == 16 || a->comp_ct == 12 || a->comp_ct == 8) + if (a->comp_len == 16 || a->comp_len == 12 || a->comp_len == 8) { #if TRUST_NO_ONE assert(a->fetch_mode == GWN_FETCH_FLOAT); assert(a->gl_comp_type == GL_FLOAT); #endif - for (int i = 0; i < a->comp_ct / 4; ++i) + for (int i = 0; i < a->comp_len / 4; ++i) { glEnableVertexAttribArray(input->location + i); glVertexAttribDivisor(input->location + i, (use_instancing) ? 1 : 0); @@ -376,13 +376,13 @@ static void create_bindings(Gwn_VertBuf* verts, const Gwn_ShaderInterface* inter { case GWN_FETCH_FLOAT: case GWN_FETCH_INT_TO_FLOAT: - glVertexAttribPointer(input->location, a->comp_ct, a->gl_comp_type, GL_FALSE, stride, pointer); + glVertexAttribPointer(input->location, a->comp_len, a->gl_comp_type, GL_FALSE, stride, pointer); break; case GWN_FETCH_INT_TO_FLOAT_UNIT: - glVertexAttribPointer(input->location, a->comp_ct, a->gl_comp_type, GL_TRUE, stride, pointer); + glVertexAttribPointer(input->location, a->comp_len, a->gl_comp_type, GL_TRUE, stride, pointer); break; case GWN_FETCH_INT: - glVertexAttribIPointer(input->location, a->comp_ct, a->gl_comp_type, stride, pointer); + glVertexAttribIPointer(input->location, a->comp_len, a->gl_comp_type, stride, pointer); } } } @@ -564,7 +564,7 @@ void GWN_batch_draw_range_ex(Gwn_Batch* batch, int v_first, int v_count, bool fo { // Infer length if vertex count is not given if (v_count == 0) - v_count = batch->inst->vertex_ct; + v_count = batch->inst->vertex_len; if (batch->elem) { @@ -574,21 +574,21 @@ void GWN_batch_draw_range_ex(Gwn_Batch* batch, int v_first, int v_count, bool fo primitive_restart_enable(el); #if GWN_TRACK_INDEX_RANGE - glDrawElementsInstancedBaseVertex(batch->gl_prim_type, el->index_ct, el->gl_index_type, 0, v_count, el->base_index); + glDrawElementsInstancedBaseVertex(batch->gl_prim_type, el->index_len, el->gl_index_type, 0, v_count, el->base_index); #else - glDrawElementsInstanced(batch->gl_prim_type, el->index_ct, GL_UNSIGNED_INT, 0, v_count); + glDrawElementsInstanced(batch->gl_prim_type, el->index_len, GL_UNSIGNED_INT, 0, v_count); #endif if (el->use_prim_restart) primitive_restart_disable(); } else - glDrawArraysInstanced(batch->gl_prim_type, 0, batch->verts[0]->vertex_ct, v_count); + glDrawArraysInstanced(batch->gl_prim_type, 0, batch->verts[0]->vertex_len, v_count); } else { // Infer length if vertex count is not given if (v_count == 0) - v_count = (batch->elem) ? batch->elem->index_ct : batch->verts[0]->vertex_ct; + v_count = (batch->elem) ? batch->elem->index_len : batch->verts[0]->vertex_len; if (batch->elem) { diff --git a/intern/gawain/src/gwn_buffer_id.cpp b/intern/gawain/src/gwn_buffer_id.cpp index 64bad855ca7..13473f1f28d 100644 --- a/intern/gawain/src/gwn_buffer_id.cpp +++ b/intern/gawain/src/gwn_buffer_id.cpp @@ -39,11 +39,11 @@ GLuint GWN_buf_id_alloc() orphan_mutex.lock(); if (!orphaned_buffer_ids.empty()) { - const auto orphaned_buffer_ct = (unsigned)orphaned_buffer_ids.size(); + const auto orphaned_buffer_len = (unsigned)orphaned_buffer_ids.size(); #if ORPHAN_DEBUG - printf("deleting %u orphaned VBO%s\n", orphaned_buffer_ct, orphaned_buffer_ct == 1 ? "" : "s"); + printf("deleting %u orphaned VBO%s\n", orphaned_buffer_len, orphaned_buffer_len == 1 ? "" : "s"); #endif - glDeleteBuffers(orphaned_buffer_ct, orphaned_buffer_ids.data()); + glDeleteBuffers(orphaned_buffer_len, orphaned_buffer_ids.data()); orphaned_buffer_ids.clear(); } orphan_mutex.unlock(); diff --git a/intern/gawain/src/gwn_element.c b/intern/gawain/src/gwn_element.c index e2fbb657c78..257338fe089 100644 --- a/intern/gawain/src/gwn_element.c +++ b/intern/gawain/src/gwn_element.c @@ -33,23 +33,23 @@ unsigned GWN_indexbuf_size_get(const Gwn_IndexBuf* elem) [GWN_INDEX_U16] = sizeof(GLushort), [GWN_INDEX_U32] = sizeof(GLuint) }; - return elem->index_ct * table[elem->index_type]; + return elem->index_len * table[elem->index_type]; #else - return elem->index_ct * sizeof(GLuint); + return elem->index_len * sizeof(GLuint); #endif } -void GWN_indexbuf_init_ex(Gwn_IndexBufBuilder* builder, Gwn_PrimType prim_type, unsigned index_ct, unsigned vertex_ct, bool use_prim_restart) +void GWN_indexbuf_init_ex(Gwn_IndexBufBuilder* builder, Gwn_PrimType prim_type, unsigned index_len, unsigned vertex_len, bool use_prim_restart) { builder->use_prim_restart = use_prim_restart; - builder->max_allowed_index = vertex_ct - 1; - builder->max_index_ct = index_ct; - builder->index_ct = 0; // start empty + builder->max_allowed_index = vertex_len - 1; + builder->max_index_len = index_len; + builder->index_len = 0; // start empty builder->prim_type = prim_type; - builder->data = calloc(builder->max_index_ct, sizeof(unsigned)); + builder->data = calloc(builder->max_index_len, sizeof(unsigned)); } -void GWN_indexbuf_init(Gwn_IndexBufBuilder* builder, Gwn_PrimType prim_type, unsigned prim_ct, unsigned vertex_ct) +void GWN_indexbuf_init(Gwn_IndexBufBuilder* builder, Gwn_PrimType prim_type, unsigned prim_len, unsigned vertex_len) { unsigned verts_per_prim = 0; switch (prim_type) @@ -73,29 +73,29 @@ void GWN_indexbuf_init(Gwn_IndexBufBuilder* builder, Gwn_PrimType prim_type, uns return; } - GWN_indexbuf_init_ex(builder, prim_type, prim_ct * verts_per_prim, vertex_ct, false); + GWN_indexbuf_init_ex(builder, prim_type, prim_len * verts_per_prim, vertex_len, false); } void GWN_indexbuf_add_generic_vert(Gwn_IndexBufBuilder* builder, unsigned v) { #if TRUST_NO_ONE assert(builder->data != NULL); - assert(builder->index_ct < builder->max_index_ct); + assert(builder->index_len < builder->max_index_len); assert(v <= builder->max_allowed_index); #endif - builder->data[builder->index_ct++] = v; + builder->data[builder->index_len++] = v; } void GWN_indexbuf_add_primitive_restart(Gwn_IndexBufBuilder* builder) { #if TRUST_NO_ONE assert(builder->data != NULL); - assert(builder->index_ct < builder->max_index_ct); + assert(builder->index_len < builder->max_index_len); assert(builder->use_prim_restart); #endif - builder->data[builder->index_ct++] = GWN_PRIM_RESTART; + builder->data[builder->index_len++] = GWN_PRIM_RESTART; } void GWN_indexbuf_add_point_vert(Gwn_IndexBufBuilder* builder, unsigned v) @@ -147,9 +147,9 @@ void GWN_indexbuf_add_line_adj_verts(Gwn_IndexBufBuilder* builder, unsigned v1, // Everything remains 32 bit while building to keep things simple. // Find min/max after, then convert to smallest index type possible. -static unsigned index_range(const unsigned values[], unsigned value_ct, unsigned* min_out, unsigned* max_out) +static unsigned index_range(const unsigned values[], unsigned value_len, unsigned* min_out, unsigned* max_out) { - if (value_ct == 0) + if (value_len == 0) { *min_out = 0; *max_out = 0; @@ -157,7 +157,7 @@ static unsigned index_range(const unsigned values[], unsigned value_ct, unsigned } unsigned min_value = values[0]; unsigned max_value = values[0]; - for (unsigned i = 1; i < value_ct; ++i) + for (unsigned i = 1; i < value_len; ++i) { const unsigned value = values[i]; if (value == GWN_PRIM_RESTART) @@ -175,7 +175,7 @@ static unsigned index_range(const unsigned values[], unsigned value_ct, unsigned static void squeeze_indices_byte(Gwn_IndexBufBuilder *builder, Gwn_IndexBuf* elem) { const unsigned *values = builder->data; - const unsigned index_ct = elem->index_ct; + const unsigned index_len = elem->index_len; // data will never be *larger* than builder->data... // converting in place to avoid extra allocation @@ -189,14 +189,14 @@ static void squeeze_indices_byte(Gwn_IndexBufBuilder *builder, Gwn_IndexBuf* ele elem->min_index = 0; elem->max_index -= base; - for (unsigned i = 0; i < index_ct; ++i) + for (unsigned i = 0; i < index_len; ++i) data[i] = (values[i] == GWN_PRIM_RESTART) ? 0xFF : (GLubyte)(values[i] - base); } else { elem->base_index = 0; - for (unsigned i = 0; i < index_ct; ++i) + for (unsigned i = 0; i < index_len; ++i) data[i] = (GLubyte)(values[i]); } } @@ -204,7 +204,7 @@ static void squeeze_indices_byte(Gwn_IndexBufBuilder *builder, Gwn_IndexBuf* ele static void squeeze_indices_short(Gwn_IndexBufBuilder *builder, Gwn_IndexBuf* elem) { const unsigned *values = builder->data; - const unsigned index_ct = elem->index_ct; + const unsigned index_len = elem->index_len; // data will never be *larger* than builder->data... // converting in place to avoid extra allocation @@ -218,14 +218,14 @@ static void squeeze_indices_short(Gwn_IndexBufBuilder *builder, Gwn_IndexBuf* el elem->min_index = 0; elem->max_index -= base; - for (unsigned i = 0; i < index_ct; ++i) + for (unsigned i = 0; i < index_len; ++i) data[i] = (values[i] == GWN_PRIM_RESTART) ? 0xFFFF : (GLushort)(values[i] - base); } else { elem->base_index = 0; - for (unsigned i = 0; i < index_ct; ++i) + for (unsigned i = 0; i < index_len; ++i) data[i] = (GLushort)(values[i]); } } @@ -245,11 +245,11 @@ void GWN_indexbuf_build_in_place(Gwn_IndexBufBuilder* builder, Gwn_IndexBuf* ele assert(builder->data != NULL); #endif - elem->index_ct = builder->index_ct; + elem->index_len = builder->index_len; elem->use_prim_restart = builder->use_prim_restart; #if GWN_TRACK_INDEX_RANGE - unsigned range = index_range(builder->data, builder->index_ct, &elem->min_index, &elem->max_index); + unsigned range = index_range(builder->data, builder->index_len, &elem->min_index, &elem->max_index); // count the primitive restart index. if (elem->use_prim_restart) diff --git a/intern/gawain/src/gwn_immediate.c b/intern/gawain/src/gwn_immediate.c index b0b587d1b8c..c57564fce06 100644 --- a/intern/gawain/src/gwn_immediate.c +++ b/intern/gawain/src/gwn_immediate.c @@ -34,8 +34,8 @@ typedef struct { GLubyte* buffer_data; unsigned buffer_offset; unsigned buffer_bytes_mapped; - unsigned vertex_ct; - bool strict_vertex_ct; + unsigned vertex_len; + bool strict_vertex_len; Gwn_PrimType prim_type; Gwn_VertFormat vertex_format; @@ -73,7 +73,7 @@ void immInit(void) glBufferData(GL_ARRAY_BUFFER, IMM_BUFFER_SIZE, NULL, GL_DYNAMIC_DRAW); imm.prim_type = GWN_PRIM_NONE; - imm.strict_vertex_ct = true; + imm.strict_vertex_len = true; glBindBuffer(GL_ARRAY_BUFFER, 0); initialized = true; @@ -147,10 +147,10 @@ void immUnbindProgram(void) } #if TRUST_NO_ONE -static bool vertex_count_makes_sense_for_primitive(unsigned vertex_ct, Gwn_PrimType prim_type) +static bool vertex_count_makes_sense_for_primitive(unsigned vertex_len, Gwn_PrimType prim_type) { - // does vertex_ct make sense for this primitive type? - if (vertex_ct == 0) + // does vertex_len make sense for this primitive type? + if (vertex_len == 0) return false; switch (prim_type) @@ -158,38 +158,38 @@ static bool vertex_count_makes_sense_for_primitive(unsigned vertex_ct, Gwn_PrimT case GWN_PRIM_POINTS: return true; case GWN_PRIM_LINES: - return vertex_ct % 2 == 0; + return vertex_len % 2 == 0; case GWN_PRIM_LINE_STRIP: case GWN_PRIM_LINE_LOOP: - return vertex_ct >= 2; + return vertex_len >= 2; case GWN_PRIM_LINE_STRIP_ADJ: - return vertex_ct >= 4; + return vertex_len >= 4; case GWN_PRIM_TRIS: - return vertex_ct % 3 == 0; + return vertex_len % 3 == 0; case GWN_PRIM_TRI_STRIP: case GWN_PRIM_TRI_FAN: - return vertex_ct >= 3; + return vertex_len >= 3; default: return false; } } #endif -void immBegin(Gwn_PrimType prim_type, unsigned vertex_ct) +void immBegin(Gwn_PrimType prim_type, unsigned vertex_len) { #if TRUST_NO_ONE assert(initialized); assert(imm.prim_type == GWN_PRIM_NONE); // make sure we haven't already begun - assert(vertex_count_makes_sense_for_primitive(vertex_ct, prim_type)); + assert(vertex_count_makes_sense_for_primitive(vertex_len, prim_type)); #endif imm.prim_type = prim_type; - imm.vertex_ct = vertex_ct; + imm.vertex_len = vertex_len; imm.vertex_idx = 0; imm.unassigned_attrib_bits = imm.attrib_binding.enabled_bits; // how many bytes do we need for this draw call? - const unsigned bytes_needed = vertex_buffer_size(&imm.vertex_format, vertex_ct); + const unsigned bytes_needed = vertex_buffer_size(&imm.vertex_format, vertex_len); #if TRUST_NO_ONE assert(bytes_needed <= IMM_BUFFER_SIZE); @@ -234,7 +234,7 @@ void immBegin(Gwn_PrimType prim_type, unsigned vertex_ct) // printf("mapping %u to %u\n", imm.buffer_offset, imm.buffer_offset + bytes_needed - 1); imm.buffer_data = glMapBufferRange(GL_ARRAY_BUFFER, imm.buffer_offset, bytes_needed, - GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT | (imm.strict_vertex_ct ? 0 : GL_MAP_FLUSH_EXPLICIT_BIT)); + GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT | (imm.strict_vertex_len ? 0 : GL_MAP_FLUSH_EXPLICIT_BIT)); #if TRUST_NO_ONE assert(imm.buffer_data != NULL); @@ -244,33 +244,33 @@ void immBegin(Gwn_PrimType prim_type, unsigned vertex_ct) imm.vertex_data = imm.buffer_data; } -void immBeginAtMost(Gwn_PrimType prim_type, unsigned vertex_ct) +void immBeginAtMost(Gwn_PrimType prim_type, unsigned vertex_len) { #if TRUST_NO_ONE - assert(vertex_ct > 0); + assert(vertex_len > 0); #endif - imm.strict_vertex_ct = false; - immBegin(prim_type, vertex_ct); + imm.strict_vertex_len = false; + immBegin(prim_type, vertex_len); } #if IMM_BATCH_COMBO -Gwn_Batch* immBeginBatch(Gwn_PrimType prim_type, unsigned vertex_ct) +Gwn_Batch* immBeginBatch(Gwn_PrimType prim_type, unsigned vertex_len) { #if TRUST_NO_ONE assert(initialized); assert(imm.prim_type == GWN_PRIM_NONE); // make sure we haven't already begun - assert(vertex_count_makes_sense_for_primitive(vertex_ct, prim_type)); + assert(vertex_count_makes_sense_for_primitive(vertex_len, prim_type)); #endif imm.prim_type = prim_type; - imm.vertex_ct = vertex_ct; + imm.vertex_len = vertex_len; imm.vertex_idx = 0; imm.unassigned_attrib_bits = imm.attrib_binding.enabled_bits; Gwn_VertBuf* verts = GWN_vertbuf_create_with_format(&imm.vertex_format); - GWN_vertbuf_data_alloc(verts, vertex_ct); + GWN_vertbuf_data_alloc(verts, vertex_len); imm.buffer_bytes_mapped = GWN_vertbuf_size_get(verts); imm.vertex_data = verts->data; @@ -281,10 +281,10 @@ Gwn_Batch* immBeginBatch(Gwn_PrimType prim_type, unsigned vertex_ct) return imm.batch; } -Gwn_Batch* immBeginBatchAtMost(Gwn_PrimType prim_type, unsigned vertex_ct) +Gwn_Batch* immBeginBatchAtMost(Gwn_PrimType prim_type, unsigned vertex_len) { - imm.strict_vertex_ct = false; - return immBeginBatch(prim_type, vertex_ct); + imm.strict_vertex_len = false; + return immBeginBatch(prim_type, vertex_len); } #endif // IMM_BATCH_COMBO @@ -319,7 +319,7 @@ static void immDrawSetup(void) const unsigned stride = imm.vertex_format.stride; - for (unsigned a_idx = 0; a_idx < imm.vertex_format.attrib_ct; ++a_idx) + for (unsigned a_idx = 0; a_idx < imm.vertex_format.attr_len; ++a_idx) { const Gwn_VertAttr* a = imm.vertex_format.attribs + a_idx; @@ -334,13 +334,13 @@ static void immDrawSetup(void) { case GWN_FETCH_FLOAT: case GWN_FETCH_INT_TO_FLOAT: - glVertexAttribPointer(loc, a->comp_ct, a->gl_comp_type, GL_FALSE, stride, pointer); + glVertexAttribPointer(loc, a->comp_len, a->gl_comp_type, GL_FALSE, stride, pointer); break; case GWN_FETCH_INT_TO_FLOAT_UNIT: - glVertexAttribPointer(loc, a->comp_ct, a->gl_comp_type, GL_TRUE, stride, pointer); + glVertexAttribPointer(loc, a->comp_len, a->gl_comp_type, GL_TRUE, stride, pointer); break; case GWN_FETCH_INT: - glVertexAttribIPointer(loc, a->comp_ct, a->gl_comp_type, stride, pointer); + glVertexAttribIPointer(loc, a->comp_len, a->gl_comp_type, stride, pointer); } } @@ -355,20 +355,20 @@ void immEnd(void) #endif unsigned buffer_bytes_used; - if (imm.strict_vertex_ct) + if (imm.strict_vertex_len) { #if TRUST_NO_ONE - assert(imm.vertex_idx == imm.vertex_ct); // with all vertices defined + assert(imm.vertex_idx == imm.vertex_len); // with all vertices defined #endif buffer_bytes_used = imm.buffer_bytes_mapped; } else { #if TRUST_NO_ONE - assert(imm.vertex_idx <= imm.vertex_ct); + assert(imm.vertex_idx <= imm.vertex_len); #endif - // printf("used %u of %u verts,", imm.vertex_idx, imm.vertex_ct); - if (imm.vertex_idx == imm.vertex_ct) + // printf("used %u of %u verts,", imm.vertex_idx, imm.vertex_len); + if (imm.vertex_idx == imm.vertex_len) { buffer_bytes_used = imm.buffer_bytes_mapped; } @@ -377,8 +377,8 @@ void immEnd(void) #if TRUST_NO_ONE assert(imm.vertex_idx == 0 || vertex_count_makes_sense_for_primitive(imm.vertex_idx, imm.prim_type)); #endif - imm.vertex_ct = imm.vertex_idx; - buffer_bytes_used = vertex_buffer_size(&imm.vertex_format, imm.vertex_ct); + imm.vertex_len = imm.vertex_idx; + buffer_bytes_used = vertex_buffer_size(&imm.vertex_format, imm.vertex_len); // unused buffer bytes are available to the next immBegin // printf(" %u of %u bytes\n", buffer_bytes_used, imm.buffer_bytes_mapped); } @@ -393,7 +393,7 @@ void immEnd(void) { if (buffer_bytes_used != imm.buffer_bytes_mapped) { - GWN_vertbuf_data_resize(imm.batch->verts[0], imm.vertex_ct); + GWN_vertbuf_data_resize(imm.batch->verts[0], imm.vertex_len); // TODO: resize only if vertex count is much smaller } @@ -406,10 +406,10 @@ void immEnd(void) { glUnmapBuffer(GL_ARRAY_BUFFER); - if (imm.vertex_ct > 0) + if (imm.vertex_len > 0) { immDrawSetup(); - glDrawArrays(convert_prim_type_to_gl(imm.prim_type), 0, imm.vertex_ct); + glDrawArrays(convert_prim_type_to_gl(imm.prim_type), 0, imm.vertex_len); } glBindBuffer(GL_ARRAY_BUFFER, 0); @@ -421,7 +421,7 @@ void immEnd(void) // prep for next immBegin imm.prim_type = GWN_PRIM_NONE; - imm.strict_vertex_ct = true; + imm.strict_vertex_len = true; } static void setAttribValueBit(unsigned attrib_id) @@ -443,10 +443,10 @@ void immAttrib1f(unsigned attrib_id, float x) Gwn_VertAttr* attrib = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE - assert(attrib_id < imm.vertex_format.attrib_ct); + assert(attrib_id < imm.vertex_format.attr_len); assert(attrib->comp_type == GWN_COMP_F32); - assert(attrib->comp_ct == 1); - assert(imm.vertex_idx < imm.vertex_ct); + assert(attrib->comp_len == 1); + assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GWN_PRIM_NONE); // make sure we're between a Begin/End pair #endif @@ -463,10 +463,10 @@ void immAttrib2f(unsigned attrib_id, float x, float y) Gwn_VertAttr* attrib = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE - assert(attrib_id < imm.vertex_format.attrib_ct); + assert(attrib_id < imm.vertex_format.attr_len); assert(attrib->comp_type == GWN_COMP_F32); - assert(attrib->comp_ct == 2); - assert(imm.vertex_idx < imm.vertex_ct); + assert(attrib->comp_len == 2); + assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GWN_PRIM_NONE); // make sure we're between a Begin/End pair #endif @@ -484,10 +484,10 @@ void immAttrib3f(unsigned attrib_id, float x, float y, float z) Gwn_VertAttr* attrib = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE - assert(attrib_id < imm.vertex_format.attrib_ct); + assert(attrib_id < imm.vertex_format.attr_len); assert(attrib->comp_type == GWN_COMP_F32); - assert(attrib->comp_ct == 3); - assert(imm.vertex_idx < imm.vertex_ct); + assert(attrib->comp_len == 3); + assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GWN_PRIM_NONE); // make sure we're between a Begin/End pair #endif @@ -506,10 +506,10 @@ void immAttrib4f(unsigned attrib_id, float x, float y, float z, float w) Gwn_VertAttr* attrib = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE - assert(attrib_id < imm.vertex_format.attrib_ct); + assert(attrib_id < imm.vertex_format.attr_len); assert(attrib->comp_type == GWN_COMP_F32); - assert(attrib->comp_ct == 4); - assert(imm.vertex_idx < imm.vertex_ct); + assert(attrib->comp_len == 4); + assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GWN_PRIM_NONE); // make sure we're between a Begin/End pair #endif @@ -529,10 +529,10 @@ void immAttrib1u(unsigned attrib_id, unsigned x) Gwn_VertAttr* attrib = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE - assert(attrib_id < imm.vertex_format.attrib_ct); + assert(attrib_id < imm.vertex_format.attr_len); assert(attrib->comp_type == GWN_COMP_U32); - assert(attrib->comp_ct == 1); - assert(imm.vertex_idx < imm.vertex_ct); + assert(attrib->comp_len == 1); + assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GWN_PRIM_NONE); // make sure we're between a Begin/End pair #endif @@ -548,10 +548,10 @@ void immAttrib2i(unsigned attrib_id, int x, int y) Gwn_VertAttr* attrib = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE - assert(attrib_id < imm.vertex_format.attrib_ct); + assert(attrib_id < imm.vertex_format.attr_len); assert(attrib->comp_type == GWN_COMP_I32); - assert(attrib->comp_ct == 2); - assert(imm.vertex_idx < imm.vertex_ct); + assert(attrib->comp_len == 2); + assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GWN_PRIM_NONE); // make sure we're between a Begin/End pair #endif @@ -568,10 +568,10 @@ void immAttrib2s(unsigned attrib_id, short x, short y) Gwn_VertAttr* attrib = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE - assert(attrib_id < imm.vertex_format.attrib_ct); + assert(attrib_id < imm.vertex_format.attr_len); assert(attrib->comp_type == GWN_COMP_I16); - assert(attrib->comp_ct == 2); - assert(imm.vertex_idx < imm.vertex_ct); + assert(attrib->comp_len == 2); + assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GWN_PRIM_NONE); // make sure we're between a Begin/End pair #endif @@ -603,10 +603,10 @@ void immAttrib3ub(unsigned attrib_id, unsigned char r, unsigned char g, unsigned Gwn_VertAttr* attrib = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE - assert(attrib_id < imm.vertex_format.attrib_ct); + assert(attrib_id < imm.vertex_format.attr_len); assert(attrib->comp_type == GWN_COMP_U8); - assert(attrib->comp_ct == 3); - assert(imm.vertex_idx < imm.vertex_ct); + assert(attrib->comp_len == 3); + assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GWN_PRIM_NONE); // make sure we're between a Begin/End pair #endif @@ -625,10 +625,10 @@ void immAttrib4ub(unsigned attrib_id, unsigned char r, unsigned char g, unsigned Gwn_VertAttr* attrib = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE - assert(attrib_id < imm.vertex_format.attrib_ct); + assert(attrib_id < imm.vertex_format.attr_len); assert(attrib->comp_type == GWN_COMP_U8); - assert(attrib->comp_ct == 4); - assert(imm.vertex_idx < imm.vertex_ct); + assert(attrib->comp_len == 4); + assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GWN_PRIM_NONE); // make sure we're between a Begin/End pair #endif @@ -656,8 +656,8 @@ void immAttrib4ubv(unsigned attrib_id, const unsigned char data[4]) void immSkipAttrib(unsigned attrib_id) { #if TRUST_NO_ONE - assert(attrib_id < imm.vertex_format.attrib_ct); - assert(imm.vertex_idx < imm.vertex_ct); + assert(attrib_id < imm.vertex_format.attr_len); + assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GWN_PRIM_NONE); // make sure we're between a Begin/End pair #endif @@ -668,7 +668,7 @@ static void immEndVertex(void) // and move on to the next vertex { #if TRUST_NO_ONE assert(imm.prim_type != GWN_PRIM_NONE); // make sure we're between a Begin/End pair - assert(imm.vertex_idx < imm.vertex_ct); + assert(imm.vertex_idx < imm.vertex_len); #endif // have all attribs been assigned values? @@ -679,7 +679,7 @@ static void immEndVertex(void) // and move on to the next vertex assert(imm.vertex_idx > 0); // first vertex must have all attribs specified #endif - for (unsigned a_idx = 0; a_idx < imm.vertex_format.attrib_ct; ++a_idx) + for (unsigned a_idx = 0; a_idx < imm.vertex_format.attr_len; ++a_idx) { if ((imm.unassigned_attrib_bits >> a_idx) & 1) { diff --git a/intern/gawain/src/gwn_shader_interface.c b/intern/gawain/src/gwn_shader_interface.c index 16451573bba..d18af234fb0 100644 --- a/intern/gawain/src/gwn_shader_interface.c +++ b/intern/gawain/src/gwn_shader_interface.c @@ -203,19 +203,19 @@ Gwn_ShaderInterface* GWN_shaderinterface_create(int32_t program) printf("Gwn_ShaderInterface %p, program %d\n", shaderface, program); #endif - GLint max_attrib_name_len, attrib_ct; + GLint max_attrib_name_len, attr_len; glGetProgramiv(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &max_attrib_name_len); - glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, &attrib_ct); + glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, &attr_len); - GLint max_ubo_name_len, ubo_ct; + GLint max_ubo_name_len, ubo_len; glGetProgramiv(program, GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH, &max_ubo_name_len); - glGetProgramiv(program, GL_ACTIVE_UNIFORM_BLOCKS, &ubo_ct); + glGetProgramiv(program, GL_ACTIVE_UNIFORM_BLOCKS, &ubo_len); - const uint32_t name_buffer_len = attrib_ct * max_attrib_name_len + ubo_ct * max_ubo_name_len; + const uint32_t name_buffer_len = attr_len * max_attrib_name_len + ubo_len * max_ubo_name_len; shaderface->name_buffer = malloc(name_buffer_len); // Attributes - for (uint32_t i = 0; i < attrib_ct; ++i) + for (uint32_t i = 0; i < attr_len; ++i) { Gwn_ShaderInput* input = malloc(sizeof(Gwn_ShaderInput)); GLsizei remaining_buffer = name_buffer_len - shaderface->name_buffer_offset; @@ -245,7 +245,7 @@ Gwn_ShaderInterface* GWN_shaderinterface_create(int32_t program) } // Uniform Blocks - for (uint32_t i = 0; i < ubo_ct; ++i) + for (uint32_t i = 0; i < ubo_len; ++i) { Gwn_ShaderInput* input = malloc(sizeof(Gwn_ShaderInput)); GLsizei remaining_buffer = name_buffer_len - shaderface->name_buffer_offset; @@ -274,8 +274,8 @@ Gwn_ShaderInterface* GWN_shaderinterface_create(int32_t program) } // Batches ref buffer - shaderface->batches_ct = GWN_SHADERINTERFACE_REF_ALLOC_COUNT; - shaderface->batches = calloc(shaderface->batches_ct, sizeof(Gwn_Batch*)); + shaderface->batches_len = GWN_SHADERINTERFACE_REF_ALLOC_COUNT; + shaderface->batches = calloc(shaderface->batches_len, sizeof(Gwn_Batch*)); return shaderface; } @@ -289,7 +289,7 @@ void GWN_shaderinterface_discard(Gwn_ShaderInterface* shaderface) // Free memory used by name_buffer. free(shaderface->name_buffer); // Remove this interface from all linked Batches vao cache. - for (int i = 0; i < shaderface->batches_ct; ++i) + for (int i = 0; i < shaderface->batches_len; ++i) if (shaderface->batches[i] != NULL) gwn_batch_remove_interface_ref(shaderface->batches[i], shaderface); @@ -333,16 +333,16 @@ const Gwn_ShaderInput* GWN_shaderinterface_attr(const Gwn_ShaderInterface* shade void GWN_shaderinterface_add_batch_ref(Gwn_ShaderInterface* shaderface, Gwn_Batch* batch) { int i; // find first unused slot - for (i = 0; i < shaderface->batches_ct; ++i) + for (i = 0; i < shaderface->batches_len; ++i) if (shaderface->batches[i] == NULL) break; - if (i == shaderface->batches_ct) + if (i == shaderface->batches_len) { // Not enough place, realloc the array. - i = shaderface->batches_ct; - shaderface->batches_ct += GWN_SHADERINTERFACE_REF_ALLOC_COUNT; - shaderface->batches = realloc(shaderface->batches, sizeof(Gwn_Batch*) * shaderface->batches_ct); + i = shaderface->batches_len; + shaderface->batches_len += GWN_SHADERINTERFACE_REF_ALLOC_COUNT; + shaderface->batches = realloc(shaderface->batches, sizeof(Gwn_Batch*) * shaderface->batches_len); memset(shaderface->batches + i, 0, sizeof(Gwn_Batch*) * GWN_SHADERINTERFACE_REF_ALLOC_COUNT); } @@ -351,7 +351,7 @@ void GWN_shaderinterface_add_batch_ref(Gwn_ShaderInterface* shaderface, Gwn_Batc void GWN_shaderinterface_remove_batch_ref(Gwn_ShaderInterface* shaderface, Gwn_Batch* batch) { - for (int i = 0; i < shaderface->batches_ct; ++i) + for (int i = 0; i < shaderface->batches_len; ++i) { if (shaderface->batches[i] == batch) { diff --git a/intern/gawain/src/gwn_vertex_array_id.cpp b/intern/gawain/src/gwn_vertex_array_id.cpp index d4b89a0f62b..70294565e6a 100644 --- a/intern/gawain/src/gwn_vertex_array_id.cpp +++ b/intern/gawain/src/gwn_vertex_array_id.cpp @@ -60,8 +60,8 @@ static void clear_orphans(Gwn_Context* ctx) ctx->orphans_mutex.lock(); if (!ctx->orphaned_vertarray_ids.empty()) { - unsigned orphan_ct = (unsigned)ctx->orphaned_vertarray_ids.size(); - glDeleteVertexArrays(orphan_ct, ctx->orphaned_vertarray_ids.data()); + unsigned orphan_len = (unsigned)ctx->orphaned_vertarray_ids.size(); + glDeleteVertexArrays(orphan_len, ctx->orphaned_vertarray_ids.data()); ctx->orphaned_vertarray_ids.clear(); } ctx->orphans_mutex.unlock(); diff --git a/intern/gawain/src/gwn_vertex_buffer.c b/intern/gawain/src/gwn_vertex_buffer.c index f621b4c01b9..a372c62bd0a 100644 --- a/intern/gawain/src/gwn_vertex_buffer.c +++ b/intern/gawain/src/gwn_vertex_buffer.c @@ -81,11 +81,11 @@ void GWN_vertbuf_discard(Gwn_VertBuf* verts) unsigned GWN_vertbuf_size_get(const Gwn_VertBuf* verts) { - return vertex_buffer_size(&verts->format, verts->vertex_ct); + return vertex_buffer_size(&verts->format, verts->vertex_len); } // create a new allocation, discarding any existing data -void GWN_vertbuf_data_alloc(Gwn_VertBuf* verts, unsigned v_ct) +void GWN_vertbuf_data_alloc(Gwn_VertBuf* verts, unsigned v_len) { Gwn_VertFormat* format = &verts->format; if (!format->packed) @@ -93,7 +93,7 @@ void GWN_vertbuf_data_alloc(Gwn_VertBuf* verts, unsigned v_ct) #if TRUST_NO_ONE // catch any unnecessary use - assert(verts->vertex_alloc != v_ct || verts->data == NULL); + assert(verts->vertex_alloc != v_len || verts->data == NULL); #endif // only create the buffer the 1st time @@ -105,49 +105,49 @@ void GWN_vertbuf_data_alloc(Gwn_VertBuf* verts, unsigned v_ct) free(verts->data); #if VRAM_USAGE - unsigned new_size = vertex_buffer_size(&verts->format, v_ct); + unsigned new_size = vertex_buffer_size(&verts->format, v_len); vbo_memory_usage += new_size - GWN_vertbuf_size_get(verts); #endif verts->dirty = true; - verts->vertex_ct = verts->vertex_alloc = v_ct; + verts->vertex_len = verts->vertex_alloc = v_len; verts->data = malloc(sizeof(GLubyte) * GWN_vertbuf_size_get(verts)); } // resize buffer keeping existing data -void GWN_vertbuf_data_resize(Gwn_VertBuf* verts, unsigned v_ct) +void GWN_vertbuf_data_resize(Gwn_VertBuf* verts, unsigned v_len) { #if TRUST_NO_ONE assert(verts->data != NULL); - assert(verts->vertex_alloc != v_ct); + assert(verts->vertex_alloc != v_len); #endif #if VRAM_USAGE - unsigned new_size = vertex_buffer_size(&verts->format, v_ct); + unsigned new_size = vertex_buffer_size(&verts->format, v_len); vbo_memory_usage += new_size - GWN_vertbuf_size_get(verts); #endif verts->dirty = true; - verts->vertex_ct = verts->vertex_alloc = v_ct; + verts->vertex_len = verts->vertex_alloc = v_len; verts->data = realloc(verts->data, sizeof(GLubyte) * GWN_vertbuf_size_get(verts)); } // set vertex count but does not change allocation // only this many verts will be uploaded to the GPU and rendered // this is usefull for streaming data -void GWN_vertbuf_vertex_count_set(Gwn_VertBuf* verts, unsigned v_ct) +void GWN_vertbuf_vertex_count_set(Gwn_VertBuf* verts, unsigned v_len) { #if TRUST_NO_ONE assert(verts->data != NULL); // only for dynamic data - assert(v_ct <= verts->vertex_alloc); + assert(v_len <= verts->vertex_alloc); #endif #if VRAM_USAGE - unsigned new_size = vertex_buffer_size(&verts->format, v_ct); + unsigned new_size = vertex_buffer_size(&verts->format, v_len); vbo_memory_usage += new_size - GWN_vertbuf_size_get(verts); #endif - verts->vertex_ct = v_ct; + verts->vertex_len = v_len; } void GWN_vertbuf_attr_set(Gwn_VertBuf* verts, unsigned a_idx, unsigned v_idx, const void* data) @@ -156,7 +156,7 @@ void GWN_vertbuf_attr_set(Gwn_VertBuf* verts, unsigned a_idx, unsigned v_idx, co const Gwn_VertAttr* a = format->attribs + a_idx; #if TRUST_NO_ONE - assert(a_idx < format->attrib_ct); + assert(a_idx < format->attr_len); assert(v_idx < verts->vertex_alloc); assert(verts->data != NULL); #endif @@ -171,7 +171,7 @@ void GWN_vertbuf_attr_fill(Gwn_VertBuf* verts, unsigned a_idx, const void* data) const Gwn_VertAttr* a = format->attribs + a_idx; #if TRUST_NO_ONE - assert(a_idx < format->attrib_ct); + assert(a_idx < format->attr_len); #endif const unsigned stride = a->sz; // tightly packed input data @@ -185,22 +185,22 @@ void GWN_vertbuf_attr_fill_stride(Gwn_VertBuf* verts, unsigned a_idx, unsigned s const Gwn_VertAttr* a = format->attribs + a_idx; #if TRUST_NO_ONE - assert(a_idx < format->attrib_ct); + assert(a_idx < format->attr_len); assert(verts->data != NULL); #endif verts->dirty = true; - const unsigned vertex_ct = verts->vertex_ct; + const unsigned vertex_len = verts->vertex_len; - if (format->attrib_ct == 1 && stride == format->stride) + if (format->attr_len == 1 && stride == format->stride) { // we can copy it all at once - memcpy(verts->data, data, vertex_ct * a->sz); + memcpy(verts->data, data, vertex_len * a->sz); } else { // we must copy it per vertex - for (unsigned v = 0; v < vertex_ct; ++v) + for (unsigned v = 0; v < vertex_len; ++v) memcpy((GLubyte*)verts->data + a->offset + v * format->stride, (const GLubyte*)data + v * stride, a->sz); } } @@ -211,7 +211,7 @@ void GWN_vertbuf_attr_get_raw_data(Gwn_VertBuf* verts, unsigned a_idx, Gwn_VertB const Gwn_VertAttr* a = format->attribs + a_idx; #if TRUST_NO_ONE - assert(a_idx < format->attrib_ct); + assert(a_idx < format->attr_len); assert(verts->data != NULL); #endif diff --git a/intern/gawain/src/gwn_vertex_format.c b/intern/gawain/src/gwn_vertex_format.c index c180c304d28..122de12ec6e 100644 --- a/intern/gawain/src/gwn_vertex_format.c +++ b/intern/gawain/src/gwn_vertex_format.c @@ -25,13 +25,13 @@ void GWN_vertformat_clear(Gwn_VertFormat* format) #if TRUST_NO_ONE memset(format, 0, sizeof(Gwn_VertFormat)); #else - format->attrib_ct = 0; + format->attr_len = 0; format->packed = false; format->name_offset = 0; - format->name_ct = 0; + format->name_len = 0; for (unsigned i = 0; i < GWN_VERT_ATTR_MAX_LEN; i++) - format->attribs[i].name_ct = 0; + format->attribs[i].name_len = 0; #endif } @@ -40,8 +40,8 @@ void GWN_vertformat_copy(Gwn_VertFormat* dest, const Gwn_VertFormat* src) // copy regular struct fields memcpy(dest, src, sizeof(Gwn_VertFormat)); - for (unsigned i = 0; i < dest->attrib_ct; i++) - for (unsigned j = 0; j < dest->attribs[i].name_ct; j++) + for (unsigned i = 0; i < dest->attr_len; i++) + for (unsigned j = 0; j < dest->attribs[i].name_len; j++) dest->attribs[i].name[j] = (char *)dest + (src->attribs[i].name[j] - ((char *)src)); } @@ -77,7 +77,7 @@ static unsigned attrib_sz(const Gwn_VertAttr *a) if (a->comp_type == GWN_COMP_I10) return 4; // always packed as 10_10_10_2 - return a->comp_ct * comp_sz(a->comp_type); + return a->comp_len * comp_sz(a->comp_type); } static unsigned attrib_align(const Gwn_VertAttr *a) @@ -86,19 +86,19 @@ static unsigned attrib_align(const Gwn_VertAttr *a) return 4; // always packed as 10_10_10_2 unsigned c = comp_sz(a->comp_type); - if (a->comp_ct == 3 && c <= 2) + if (a->comp_len == 3 && c <= 2) return 4 * c; // AMD HW can't fetch these well, so pad it out (other vendors too?) else return c; // most fetches are ok if components are naturally aligned } -unsigned vertex_buffer_size(const Gwn_VertFormat* format, unsigned vertex_ct) +unsigned vertex_buffer_size(const Gwn_VertFormat* format, unsigned vertex_len) { #if TRUST_NO_ONE assert(format->packed && format->stride > 0); #endif - return format->stride * vertex_ct; + return format->stride * vertex_len; } static const char* copy_attrib_name(Gwn_VertFormat* format, const char* name) @@ -130,13 +130,13 @@ static const char* copy_attrib_name(Gwn_VertFormat* format, const char* name) return name_copy; } -unsigned GWN_vertformat_attr_add(Gwn_VertFormat* format, const char* name, Gwn_VertCompType comp_type, unsigned comp_ct, Gwn_VertFetchMode fetch_mode) +unsigned GWN_vertformat_attr_add(Gwn_VertFormat* format, const char* name, Gwn_VertCompType comp_type, unsigned comp_len, Gwn_VertFetchMode fetch_mode) { #if TRUST_NO_ONE - assert(format->name_ct < GWN_VERT_ATTR_MAX_LEN); // there's room for more - assert(format->attrib_ct < GWN_VERT_ATTR_MAX_LEN); // there's room for more + assert(format->name_len < GWN_VERT_ATTR_MAX_LEN); // there's room for more + assert(format->attr_len < GWN_VERT_ATTR_MAX_LEN); // there's room for more assert(!format->packed); // packed means frozen/locked - assert((comp_ct >= 1 && comp_ct <= 4) || comp_ct == 8 || comp_ct == 12 || comp_ct == 16); + assert((comp_len >= 1 && comp_len <= 4) || comp_len == 8 || comp_len == 12 || comp_len == 16); switch (comp_type) { case GWN_COMP_F32: @@ -146,25 +146,25 @@ unsigned GWN_vertformat_attr_add(Gwn_VertFormat* format, const char* name, Gwn_V case GWN_COMP_I10: // 10_10_10 format intended for normals (xyz) or colors (rgb) // extra component packed.w can be manually set to { -2, -1, 0, 1 } - assert(comp_ct == 3 || comp_ct == 4); + assert(comp_len == 3 || comp_len == 4); assert(fetch_mode == GWN_FETCH_INT_TO_FLOAT_UNIT); // not strictly required, may relax later break; default: // integer types can be kept as int or converted/normalized to float assert(fetch_mode != GWN_FETCH_FLOAT); // only support float matrices (see Batch_update_program_bindings) - assert(comp_ct != 8 && comp_ct != 12 && comp_ct != 16); + assert(comp_len != 8 && comp_len != 12 && comp_len != 16); } #endif - format->name_ct++; // multiname support + format->name_len++; // multiname support - const unsigned attrib_id = format->attrib_ct++; + const unsigned attrib_id = format->attr_len++; Gwn_VertAttr* attrib = format->attribs + attrib_id; - attrib->name[attrib->name_ct++] = copy_attrib_name(format, name); + attrib->name[attrib->name_len++] = copy_attrib_name(format, name); attrib->comp_type = comp_type; attrib->gl_comp_type = convert_comp_type_to_gl(comp_type); - attrib->comp_ct = (comp_type == GWN_COMP_I10) ? 4 : comp_ct; // system needs 10_10_10_2 to be 4 or BGRA + attrib->comp_len = (comp_type == GWN_COMP_I10) ? 4 : comp_len; // system needs 10_10_10_2 to be 4 or BGRA attrib->sz = attrib_sz(attrib); attrib->offset = 0; // offsets & stride are calculated later (during pack) attrib->fetch_mode = fetch_mode; @@ -174,13 +174,13 @@ unsigned GWN_vertformat_attr_add(Gwn_VertFormat* format, const char* name, Gwn_V void GWN_vertformat_alias_add(Gwn_VertFormat* format, const char* alias) { - Gwn_VertAttr* attrib = format->attribs + (format->attrib_ct - 1); + Gwn_VertAttr* attrib = format->attribs + (format->attr_len - 1); #if TRUST_NO_ONE - assert(format->name_ct < GWN_VERT_ATTR_MAX_LEN); // there's room for more - assert(attrib->name_ct < GWN_VERT_ATTR_MAX_NAMES); + assert(format->name_len < GWN_VERT_ATTR_MAX_LEN); // there's room for more + assert(attrib->name_len < GWN_VERT_ATTR_MAX_NAMES); #endif - format->name_ct++; // multiname support - attrib->name[attrib->name_ct++] = copy_attrib_name(format, alias); + format->name_len++; // multiname support + attrib->name[attrib->name_len++] = copy_attrib_name(format, alias); } unsigned padding(unsigned offset, unsigned alignment) @@ -220,7 +220,7 @@ void VertexFormat_pack(Gwn_VertFormat* format) show_pack(0, a0->sz, 0); #endif - for (unsigned a_idx = 1; a_idx < format->attrib_ct; ++a_idx) + for (unsigned a_idx = 1; a_idx < format->attr_len; ++a_idx) { Gwn_VertAttr* a = format->attribs + a_idx; unsigned mid_padding = padding(offset, attrib_align(a)); diff --git a/release/datafiles/studiolights/world/sl02.jpg b/release/datafiles/studiolights/world/sl02.jpg Binary files differdeleted file mode 100644 index 1c9ce99a0d8..00000000000 --- a/release/datafiles/studiolights/world/sl02.jpg +++ /dev/null diff --git a/release/datafiles/userdef/userdef_default_theme.c b/release/datafiles/userdef/userdef_default_theme.c index f7a4bd157e0..2b84585b8a5 100644 --- a/release/datafiles/userdef/userdef_default_theme.c +++ b/release/datafiles/userdef/userdef_default_theme.c @@ -46,7 +46,7 @@ const bTheme U_theme_default = { .item = RGBA(0xffffff8f), .text = RGBA(0xffffffff), .text_sel = RGBA(0xffffffff), - .roundness = 0.25f, + .roundness = 0.2f, }, .wcol_text = { .outline = RGBA(0x444444ff), @@ -57,12 +57,12 @@ const bTheme U_theme_default = { .text_sel = RGBA(0xffffffff), .shaded = 1, .shadetop = -3, - .roundness = 0.1f, + .roundness = 0.2f, }, .wcol_radio = { .outline = RGBA(0x373737ff), .inner = RGBA(0x595959ff), - .inner_sel = RGBA(0x5680c2e6), + .inner_sel = RGBA(0x597cb3e6), .item = RGBA(0xffffffff), .text = RGBA(0xeeeeeeff), .text_sel = RGBA(0xffffffff), @@ -78,7 +78,7 @@ const bTheme U_theme_default = { .text = RGBA(0xeeeeeeff), .text_sel = RGBA(0xffffffff), .shadedown = -15, - .roundness = 0.25f, + .roundness = 0.2f, }, .wcol_toggle = { .outline = RGBA(0x373737ff), @@ -87,7 +87,7 @@ const bTheme U_theme_default = { .item = RGBA(0x191919ff), .text = RGBA(0xeeeeeeff), .text_sel = RGBA(0xffffffff), - .roundness = 0.25f, + .roundness = 0.4f, }, .wcol_num = { .outline = RGBA(0x444444ff), @@ -96,7 +96,7 @@ const bTheme U_theme_default = { .item = RGBA(0x333333ff), .text = RGBA(0xeeeeeeff), .text_sel = RGBA(0xffffffff), - .roundness = 0.3f, + .roundness = 0.2f, }, .wcol_numslider = { .outline = RGBA(0x444444ff), @@ -107,7 +107,7 @@ const bTheme U_theme_default = { .text_sel = RGBA(0xffffffff), .shaded = 1, .shadetop = -4, - .roundness = 0.4f, + .roundness = 0.2f, }, .wcol_tab = { .outline = RGBA(0x2d2d2dff), @@ -116,7 +116,7 @@ const bTheme U_theme_default = { .item = RGBA(0x2d2d2dff), .text = RGBA(0xa4a4a4ff), .text_sel = RGBA(0xffffffff), - .roundness = 0.15f, + .roundness = 0.2f, }, .wcol_menu = { .outline = RGBA(0x444444ff), @@ -149,15 +149,15 @@ const bTheme U_theme_default = { .text_sel = RGBA(0xffffffff), .shadetop = 25, .shadedown = -20, - .roundness = 0.25f, + .roundness = 0.2f, }, .wcol_menu_item = { - .inner_sel = RGBA(0x5680c2ff), + .inner_sel = RGBA(0x597cb3e6), .item = RGBA(0xffffff8f), .text = RGBA(0xeeeeeeff), .text_sel = RGBA(0xffffffff), .shadetop = 38, - .roundness = 0.25f, + .roundness = 0.2f, }, .wcol_tooltip = { .outline = RGBA(0x19191aff), @@ -168,7 +168,7 @@ const bTheme U_theme_default = { .text_sel = RGBA(0xffffffff), .shadetop = 25, .shadedown = -20, - .roundness = 0.4f, + .roundness = 0.2f, }, .wcol_box = { .outline = RGBA(0x444444ff), @@ -197,7 +197,7 @@ const bTheme U_theme_default = { .item = RGBA(0x5680c2ff), .text = RGBA(0xeeeeeeff), .text_sel = RGBA(0xffffffff), - .roundness = 0.25f, + .roundness = 0.2f, }, .wcol_list_item = { .outline = RGBA(0x2d2d2dff), @@ -209,22 +209,22 @@ const bTheme U_theme_default = { .roundness = 0.2f, }, .wcol_pie_menu = { - .outline = RGBA(0x2e2e2eff), - .inner = RGBA(0x212121ff), + .outline = RGBA(0x212121ff), + .inner = RGBA(0x212121ef), .inner_sel = RGBA(0x585858ff), - .item = RGBA(0x5680c2ff), + .item = RGBA(0x597cb3ff), .text = RGBA(0xeeeeeeff), .text_sel = RGBA(0xffffffff), .shadetop = 10, .shadedown = -10, - .roundness = 0.5f, + .roundness = 0.2f, }, .wcol_state = { - .inner_anim = RGBA(0x73be4cff), + .inner_anim = RGBA(0x53992eff), .inner_anim_sel = RGBA(0x5aa633ff), - .inner_key = RGBA(0xf0eb64ff), + .inner_key = RGBA(0xb3ae36ff), .inner_key_sel = RGBA(0xd7d34bff), - .inner_driven = RGBA(0xb400ffff), + .inner_driven = RGBA(0x9000ccff), .inner_driven_sel = RGBA(0x9900e6ff), .inner_overridden = RGBA(0x19c3c300), .inner_overridden_sel = RGBA(0x118f8f00), @@ -288,8 +288,8 @@ const bTheme U_theme_default = { .button_text = RGBA(0xe5e5e5ff), .button_text_hi = RGBA(0xffffffff), .panelcolors = { - .header = RGBA(0x424242cc), - .back = RGBA(0x333333b3), + .header = RGBA(0x424242e6), + .back = RGBA(0x333333f0), .sub_back = RGBA(0x0000003e), .show_header = 1, .show_back = 1, @@ -387,13 +387,13 @@ const bTheme U_theme_default = { .show_header = 1, .show_back = 1, }, - .hilite = RGBA(0x5b8199ff), + .hilite = RGBA(0x4f76b3ff), .vertex_size = 3, .outline_width = 1, .facedot_size = 4, }, .tipo = { - .back = RGBA(0x35353500), + .back = RGBA(0x42424200), .title = RGBA(0xffffffff), .text = RGBA(0xffffffff), .text_hi = RGBA(0xffffffff), @@ -421,12 +421,12 @@ const bTheme U_theme_default = { }, .shade1 = RGBA(0x96969600), .shade2 = RGBA(0x2e2e2e64), - .grid = RGBA(0x1a1a1aff), + .grid = RGBA(0x2a2a2aff), .group = RGBA(0x44992eff), .group_active = RGBA(0x5ccd3eff), .vertex = RGBA(0x000000ff), .vertex_select = RGBA(0xff8500ff), - .cframe = RGBA(0x308837ff), + .cframe = RGBA(0x5680c2ff), .lastsel_point = RGBA(0xffffffff), .handle_auto = RGBA(0x909000ff), .handle_vect = RGBA(0x409030ff), @@ -510,12 +510,12 @@ const bTheme U_theme_default = { .shade1 = RGBA(0xc0c0c000), .shade2 = RGBA(0x70707064), .hilite = RGBA(0x60c040ff), - .grid = RGBA(0x272727ff), + .grid = RGBA(0x2a2a2aff), .group = RGBA(0x44992eff), .group_active = RGBA(0x5ccd3eff), .strip = RGBA(0x1a151580), .strip_select = RGBA(0xff8c00ff), - .cframe = RGBA(0x308837ff), + .cframe = RGBA(0x5680c2ff), .ds_channel = RGBA(0x5a85b2ff), .ds_subchannel = RGBA(0x7d98b3ff), .keytype_keyframe = RGBA(0xe8e8e8ff), @@ -566,7 +566,7 @@ const bTheme U_theme_default = { .grid = RGBA(0x5e5e5eff), .strip = RGBA(0x0c0a0a80), .strip_select = RGBA(0xff8c00ff), - .cframe = RGBA(0x308837ff), + .cframe = RGBA(0x5680c2ff), .keyborder = RGBA(0x000000ff), .keyborder_select = RGBA(0x000000ff), .vertex_size = 3, @@ -611,7 +611,7 @@ const bTheme U_theme_default = { .grid = RGBA(0x404040ff), .vertex_select = RGBA(0xff8500ff), .bone_pose = RGBA(0x50c8ff50), - .cframe = RGBA(0x308837ff), + .cframe = RGBA(0x5680c2ff), .vertex_size = 3, .outline_width = 1, .facedot_size = 4, @@ -900,7 +900,7 @@ const bTheme U_theme_default = { }, .strip = RGBA(0x0c0a0a80), .strip_select = RGBA(0xff8c00ff), - .cframe = RGBA(0x308837ff), + .cframe = RGBA(0x5680c2ff), .handle_auto = RGBA(0x909000ff), .handle_align = RGBA(0x803060ff), .handle_sel_auto = RGBA(0xf0ff40ff), 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..b395aab7772 100644 --- a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py +++ b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py @@ -120,8 +120,11 @@ def check(check_ctxt, msgs, key, msgsrc, settings): key[1][0].isalpha() and not key[1][0].isupper()): not_capitalized.add(key) if end_point is not None: - if (key[1].strip().endswith('.') and not key[1].strip().endswith('...') and - key[1] not in settings.WARN_MSGID_END_POINT_ALLOWED): + if ( + key[1].strip().endswith('.') and + (not key[1].strip().endswith('...')) and + key[1] not in settings.WARN_MSGID_END_POINT_ALLOWED + ): end_point.add(key) if undoc_ops is not None: if key[1] == settings.UNDOC_OPS_STR: @@ -183,8 +186,10 @@ def print_info(reports, pot): # if py_in_rna and key in py_in_rna: # _print("\t\t-> RNA message also used in py UI code!") if spell_errors and spell_errors.get(key): - lines = ["\t\t-> {}: misspelled, suggestions are ({})".format(w, "'" + "', '".join(errs) + "'") - for w, errs in spell_errors[key]] + lines = [ + "\t\t-> {}: misspelled, suggestions are ({})".format(w, "'" + "', '".join(errs) + "'") + for w, errs in spell_errors[key] + ] _print("\n".join(lines)) _print("\t\t{}".format("\n\t\t".join(pot.msgs[key].sources))) @@ -215,13 +220,13 @@ def dump_rna_messages(msgs, reports, settings, verbose=False): """ def class_blacklist(): blacklist_rna_class = {getattr(bpy.types, cls_id) for cls_id in ( - # core classes - "Context", "Event", "Function", "UILayout", "UnknownType", "Property", "Struct", - # registerable classes - "Panel", "Menu", "Header", "RenderEngine", "Operator", "OperatorMacro", "Macro", "KeyingSetInfo", - # window classes - "Window", - ) + # core classes + "Context", "Event", "Function", "UILayout", "UnknownType", "Property", "Struct", + # registerable classes + "Panel", "Menu", "Header", "RenderEngine", "Operator", "OperatorMacro", "Macro", "KeyingSetInfo", + # window classes + "Window", + ) } # More builtin classes we don't need to parse. @@ -380,12 +385,13 @@ def dump_rna_messages(msgs, reports, settings, verbose=False): # Dump Messages operator_categories = {} + def process_cls_list(cls_list): if not cls_list: 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: @@ -447,6 +453,7 @@ def dump_py_messages_from_files(msgs, reports, files, settings): i18n_contexts = bpy.app.translations.contexts root_paths = tuple(bpy.utils.resource_path(t) for t in ('USER', 'LOCAL', 'SYSTEM')) + def make_rel(path): for rp in root_paths: if path.startswith(rp): @@ -510,6 +517,7 @@ def dump_py_messages_from_files(msgs, reports, files, settings): return [_extract_string_merge(estr_ls, nds_ls) for estr_ls, nds_ls in bag] i18n_ctxt_ids = {v for v in bpy.app.translations.contexts_C_to_py.values()} + def _ctxt_to_ctxt(node): # We must try, to some extend, to get contexts from vars instead of only literal strings... ctxt = extract_strings(node)[0] @@ -561,9 +569,9 @@ def dump_py_messages_from_files(msgs, reports, files, settings): translate_kw = { "text": ((("text_ctxt",), _ctxt_to_ctxt), (("operator",), _op_to_ctxt), - ), - "msgid": ((("msgctxt",), _ctxt_to_ctxt), ), + "msgid": ((("msgctxt",), _ctxt_to_ctxt), + ), "message": (), } @@ -611,7 +619,7 @@ def dump_py_messages_from_files(msgs, reports, files, settings): func_translate_args[func_id] = pgettext_variants_args for func_id in func_ids: func_translate_args[func_id] = pgettext_variants_args - #print(func_translate_args) + # print(func_translate_args) # Break recursive nodes look up on some kind of nodes. # E.g. we don't want to get strings inside subscripts (blah["foo"])! @@ -666,7 +674,7 @@ def dump_py_messages_from_files(msgs, reports, files, settings): if kw.arg == arg_kw: context_elements[arg_kw] = kw.value break - #print(context_elements) + # print(context_elements) for kws, proc in translate_kw[msgid]: if set(kws) <= context_elements.keys(): args = tuple(context_elements[k] for k in kws) @@ -676,7 +684,7 @@ def dump_py_messages_from_files(msgs, reports, files, settings): msgctxts[msgid] = ctxt break - #print(translate_args) + # print(translate_args) # do nothing if not found for arg_kw, (arg_pos, _) in func_args.items(): msgctxt = msgctxts[arg_kw] @@ -706,7 +714,7 @@ def dump_py_messages(msgs, reports, addons, settings, addons_only=False): return [] if os.path.isdir(path): return [os.path.join(dpath, fn) for dpath, _, fnames in os.walk(path) for fn in fnames - if not fn.startswith("_") and fn.endswith(".py")] + if not fn.startswith("_") and fn.endswith(".py")] return [path] files = [] @@ -738,7 +746,9 @@ def dump_src_messages(msgs, reports, settings): pygettexts = tuple(re.compile(r).search for r in settings.PYGETTEXT_KEYWORDS) _clean_str = re.compile(settings.str_clean_re).finditer - clean_str = lambda s: "".join(m.group("clean") for m in _clean_str(s)) + + def clean_str(s): + return "".join(m.group("clean") for m in _clean_str(s)) def dump_src_file(path, rel_path, msgs, reports, settings): def process_entry(_msgctxt, _msgid): @@ -873,10 +883,10 @@ def dump_messages(do_messages, do_checks, settings): process_msg(msgs, settings.DEFAULT_CONTEXT, cat[1], "Language categories’ labels from bl_i18n_utils/settings.py", reports, None, settings) - #pot.check() + # pot.check() pot.unescape() # Strings gathered in py/C source code may contain escaped chars... print_info(reports, pot) - #pot.check() + # pot.check() if do_messages: print("Writing messages…") diff --git a/release/scripts/modules/bl_i18n_utils/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py index 5fdb6b88cbf..880721176e0 100644 --- a/release/scripts/modules/bl_i18n_utils/utils.py +++ b/release/scripts/modules/bl_i18n_utils/utils.py @@ -32,9 +32,9 @@ import tempfile #import time from bl_i18n_utils import ( - settings, - utils_rtl, - ) + settings, + utils_rtl, +) import bpy @@ -44,6 +44,8 @@ from bpy.app.translations import locale_explode _valid_po_path_re = re.compile(r"^\S+:[0-9]+$") + + def is_valid_po_path(path): return bool(_valid_po_path_re.match(path)) @@ -57,9 +59,10 @@ def get_best_similar(data): # We also consider to never make a match when len differs more than -len_key / 2, +len_key * 2 (which is valid # as long as use_similar is not below ~0.7). # Gives an overall ~20% of improvement! - #tmp = difflib.get_close_matches(key[1], similar_pool, n=1, cutoff=use_similar) - #if tmp: - #tmp = tmp[0] + + # tmp = difflib.get_close_matches(key[1], similar_pool, n=1, cutoff=use_similar) + # if tmp: + # tmp = tmp[0] tmp = None s = difflib.SequenceMatcher() s.set_seq2(key[1]) @@ -178,9 +181,11 @@ def enable_addons(addons=None, support=None, disable=False, check_only=False): userpref = bpy.context.user_preferences used_ext = {ext.module for ext in userpref.addons} - ret = [mod for mod in addon_utils.modules() - if ((addons and mod.__name__ in addons) or - (not addons and addon_utils.module_bl_info(mod)["support"] in support))] + ret = [ + mod for mod in addon_utils.modules() + if ((addons and mod.__name__ in addons) or + (not addons and addon_utils.module_bl_info(mod)["support"] in support)) + ] if not check_only: for mod in ret: @@ -229,18 +234,21 @@ class I18nMessage: def _get_msgctxt(self): return "".join(self.msgctxt_lines) + def _set_msgctxt(self, ctxt): self.msgctxt_lines = [ctxt] msgctxt = property(_get_msgctxt, _set_msgctxt) def _get_msgid(self): return "".join(self.msgid_lines) + def _set_msgid(self, msgid): self.msgid_lines = [msgid] msgid = property(_get_msgid, _set_msgid) def _get_msgstr(self): return "".join(self.msgstr_lines) + def _set_msgstr(self, msgstr): self.msgstr_lines = [msgstr] msgstr = property(_get_msgstr, _set_msgstr) @@ -250,12 +258,15 @@ class I18nMessage: lstrip2 = len(self.settings.PO_COMMENT_PREFIX_SOURCE_CUSTOM) return ([l[lstrip1:] for l in self.comment_lines if l.startswith(self.settings.PO_COMMENT_PREFIX_SOURCE)] + [l[lstrip2:] for l in self.comment_lines - if l.startswith(self.settings.PO_COMMENT_PREFIX_SOURCE_CUSTOM)]) + if l.startswith(self.settings.PO_COMMENT_PREFIX_SOURCE_CUSTOM)]) + def _set_sources(self, sources): cmmlines = self.comment_lines.copy() for l in cmmlines: - if (l.startswith(self.settings.PO_COMMENT_PREFIX_SOURCE) or - l.startswith(self.settings.PO_COMMENT_PREFIX_SOURCE_CUSTOM)): + if ( + l.startswith(self.settings.PO_COMMENT_PREFIX_SOURCE) or + l.startswith(self.settings.PO_COMMENT_PREFIX_SOURCE_CUSTOM) + ): self.comment_lines.remove(l) lines_src = [] lines_src_custom = [] @@ -791,7 +802,7 @@ class I18nMessages: if len(k) > 1 and src_rna in src_to_msg: k &= src_to_msg[src_rna] msgmap["rna_tip"]["key"] = k - #print(k) + # print(k) btip = getattr(msgs, msgmap["but_tip"]["msgstr"]) #print("button tip: " + btip) if btip and btip not in {rtip, etip}: @@ -1051,12 +1062,13 @@ class I18nMessages: import subprocess with tempfile.NamedTemporaryFile(mode='w+', encoding="utf-8") as tmp_po_f: self.write_messages_to_po(tmp_po_f) - cmd = (self.settings.GETTEXT_MSGFMT_EXECUTABLE, - "--statistics", # show stats - tmp_po_f.name, - "-o", - fname, - ) + cmd = ( + self.settings.GETTEXT_MSGFMT_EXECUTABLE, + "--statistics", # show stats + tmp_po_f.name, + "-o", + fname, + ) print("Running ", " ".join(cmd)) ret = subprocess.call(cmd) print("Finished.") @@ -1081,6 +1093,7 @@ class I18nMessages: EOT = b"0x04" # Used to concatenate context and msgid _msgid_offset = 0 _msgstr_offset = 0 + def _gen(v): nonlocal _msgid_offset, _msgstr_offset msgid = v.msgid.encode("utf-8") @@ -1188,6 +1201,7 @@ class I18n: def _py_file_get(self): return self.src.get(self.settings.PARSER_PY_ID) + def _py_file_set(self, value): self.src[self.settings.PARSER_PY_ID] = value py_file = property(_py_file_get, _py_file_set) @@ -1252,7 +1266,8 @@ class I18n: _ctx_txt = "s are" else: _ctx_txt = " is" - lines = (("", + lines = (( + "", "Average stats for all {} translations:\n".format(self.nbr_trans), " {:>6.1%} done!\n".format(self.lvl / self.nbr_trans), " {:>6.1%} of messages are tooltips.\n".format(self.lvl_ttips / self.nbr_trans), @@ -1350,10 +1365,10 @@ class I18n: comment_lines = [self.settings.PO_COMMENT_PREFIX + c for c in user_comments] + common_comment_lines self.trans[uid].msgs[key] = I18nMessage(ctxt, [key[1]], [msgstr], comment_lines, False, is_fuzzy, settings=self.settings) - #key = self.settings.PO_HEADER_KEY - #for uid, trans in self.trans.items(): - #if key not in trans.msgs: - #trans.msgs[key] + # key = self.settings.PO_HEADER_KEY + # for uid, trans in self.trans.items(): + # if key not in trans.msgs: + # trans.msgs[key] self.unescape() def write(self, kind, langs=set()): 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..16b0b107927 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,26 +117,14 @@ 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) - - if engine == 'BLENDER_RENDER': - scene.render.engine = 'BLENDER_RENDER' - scene.render.alpha_mode = 'TRANSPARENT' - - world.use_sky_blend = True - world.horizon_color = 0.9, 0.9, 0.9 - world.zenith_color = 0.5, 0.5, 0.5 - world.ambient_color = 0.1, 0.1, 0.1 - world.light_settings.use_environment_light = True - world.light_settings.environment_energy = 1.0 - world.light_settings.environment_color = 'SKY_COLOR' - elif engine == 'CYCLES': - scene.render.engine = 'CYCLES' - scene.cycles.film_transparent = True - # TODO: define Cycles world? + 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) + + scene.render.engine = 'CYCLES' + scene.cycles.film_transparent = True + # TODO: define Cycles world? scene.render.image_settings.file_format = 'PNG' scene.render.image_settings.color_depth = '8' @@ -154,9 +142,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 +159,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 +201,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 @@ -239,17 +227,6 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): return success - def objects_render_engine_guess(obs): - for obname, libpath in obs: - ob = bpy.data.objects[obname, libpath] - for matslot in ob.material_slots: - mat = matslot.material - if mat and mat.use_nodes and mat.node_tree: - for nd in mat.node_tree.nodes: - if nd.shading_compatibility == {'NEW_SHADING'}: - return 'CYCLES' - return 'BLENDER_RENDER' - def object_bbox_merge(bbox, ob, ob_space, offset_matrix): # Take collections instances into account (including linked one in this case). if ob.type == 'EMPTY' and ob.dupli_type == 'COLLECTION': @@ -305,7 +282,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 +297,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) @@ -360,11 +337,10 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): continue objects = ((root.name, None),) - render_engine = objects_render_engine_guess(objects) - render_context = render_contexts.get(render_engine, None) + render_context = render_contexts.get('CYCLES', None) if render_context is None: - render_context = render_context_create(render_engine, objects_ignored) - render_contexts[render_engine] = render_context + render_context = render_context_create('CYCLES', objects_ignored) + render_contexts['CYCLES'] = render_context scene = bpy.data.scenes[render_context.scene, None] bpy.context.screen.scene = scene @@ -405,11 +381,10 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): # Here too, we do want to keep linked objects members of local collection... objects = tuple((ob.name, ob.library.filepath if ob.library else None) for ob in grp.objects) - render_engine = objects_render_engine_guess(objects) - render_context = render_contexts.get(render_engine, None) + render_context = render_contexts.get('CYCLES', None) if render_context is None: - render_context = render_context_create(render_engine, objects_ignored) - render_contexts[render_engine] = render_context + render_context = render_context_create('CYCLES', objects_ignored) + render_contexts['CYCLES'] = render_context scene = bpy.data.scenes[render_context.scene, None] bpy.context.screen.scene = scene diff --git a/release/scripts/modules/bpy/utils/__init__.py b/release/scripts/modules/bpy/utils/__init__.py index 5e5a35b9518..b3257c30a97 100644 --- a/release/scripts/modules/bpy/utils/__init__.py +++ b/release/scripts/modules/bpy/utils/__init__.py @@ -581,8 +581,13 @@ def keyconfig_set(filepath, report=None): try: error_msg = "" with open(filepath, 'r', encoding='utf-8') as keyfile: - exec(compile(keyfile.read(), filepath, "exec"), - {"__file__": filepath}) + exec( + compile(keyfile.read(), filepath, "exec"), + { + "__file__": filepath, + "__name__": "__main__", + } + ) except: import traceback error_msg = traceback.format_exc() diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils.py b/release/scripts/modules/bpy_extras/keyconfig_utils.py index bf2c102458b..a078da2ff2f 100644 --- a/release/scripts/modules/bpy_extras/keyconfig_utils.py +++ b/release/scripts/modules/bpy_extras/keyconfig_utils.py @@ -239,9 +239,9 @@ def _export_properties(prefix, properties, kmi_id, lines=None): lines = [] def string_value(value): - if isinstance(value, str) or isinstance(value, bool) or isinstance(value, float) or isinstance(value, int): + if isinstance(value, (str, bool, float, int)): return repr(value) - elif getattr(value, '__len__', False): + elif hasattr(value, "__len__"): return repr(list(value)) print("Export key configuration: can't write ", value) @@ -405,3 +405,10 @@ def keyconfig_test(kc): if testEntry(kc, entry): result = True return result + +# Note, we may eventually replace existing logic with this +# so key configs are always data. +from .keyconfig_utils_experimental import ( + keyconfig_export_as_data, + keyconfig_import_from_data, +) diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils_experimental.py b/release/scripts/modules/bpy_extras/keyconfig_utils_experimental.py new file mode 100644 index 00000000000..a0ea87d1c93 --- /dev/null +++ b/release/scripts/modules/bpy_extras/keyconfig_utils_experimental.py @@ -0,0 +1,244 @@ +# ##### 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> + +__all__ = ( + "keyconfig_export_as_data", + "keyconfig_import_from_data", +) + + +def indent(levels): + return levels * " " + + +def round_float_32(f): + from struct import pack, unpack + return unpack("f", pack("f", f))[0] + + +def repr_f32(f): + f_round = round_float_32(f) + f_str = repr(f) + f_str_frac = f_str.partition(".")[2] + if not f_str_frac: + return f_str + for i in range(1, len(f_str_frac)): + f_test = round(f, i) + f_test_round = round_float_32(f_test) + if f_test_round == f_round: + return "%.*f" % (i, f_test) + return f_str + + +def kmi_args_as_data(kmi): + s = [ + f"\"type\": '{kmi.type}'", + f"\"value\": '{kmi.value}'" + ] + + if kmi.any: + s.append("\"any\": True") + else: + if kmi.shift: + s.append("\"shift\": True") + if kmi.ctrl: + s.append("\"ctrl\": True") + if kmi.alt: + s.append("\"alt\": True") + if kmi.oskey: + s.append("\"oskey\": True") + if kmi.key_modifier and kmi.key_modifier != 'NONE': + s.append(f"\"key_modifier\": '{kmi.key_modifier}'") + + return "{" + ", ".join(s) + "}" + + +def _kmi_properties_to_lines_recursive(level, properties, lines): + from bpy.types import OperatorProperties + + def string_value(value): + if isinstance(value, (str, bool, int)): + return repr(value) + elif isinstance(value, float): + return repr_f32(value) + elif getattr(value, '__len__', False): + return repr(tuple(value)) + raise Exception(f"Export key configuration: can't write {value!r}") + + for pname in properties.bl_rna.properties.keys(): + if pname != "rna_type": + value = getattr(properties, pname) + if isinstance(value, OperatorProperties): + lines_test = [] + _kmi_properties_to_lines_recursive(level + 2, value, lines_test) + if lines_test: + lines.append(f"{indent(level)}(\n") + lines.append(f"{indent(level + 1)}\"{pname}\",\n") + lines.append(f"{indent(level + 1)}" "[\n") + lines.extend(lines_test) + lines.append(f"{indent(level + 1)}" "],\n") + lines.append(f"{indent(level)}" "),\n") + del lines_test + elif properties.is_property_set(pname): + value = string_value(value) + lines.append((f"{indent(level)}(\"{pname}\", {value:s}),\n")) + + +def _kmi_properties_to_lines(level, kmi_props, lines): + if kmi_props is None: + return + + lines_test = [f"{indent(level)}\"properties\": " "[\n"] + _kmi_properties_to_lines_recursive(level + 1, kmi_props, lines_test) + if len(lines_test) > 1: + lines_test.append(f"{indent(level)}" "],\n") + lines.extend(lines_test) + + +def _kmi_attrs_or_none(level, kmi): + lines = [] + _kmi_properties_to_lines(level + 1, kmi.properties, lines) + if kmi.active is False: + lines.append(f"{indent(level)}\"active\":" "False,\n") + if not lines: + return None + return "".join(lines) + + +def keyconfig_export_as_data(wm, kc, filepath): + # Alternate foramt + + # Generate a list of keymaps to export: + # + # First add all user_modified keymaps (found in keyconfigs.user.keymaps list), + # then add all remaining keymaps from the currently active custom keyconfig. + # + # This will create a final list of keymaps that can be used as a "diff" against + # the default blender keyconfig, recreating the current setup from a fresh blender + # without needing to export keymaps which haven't been edited. + + from .keyconfig_utils import keyconfig_merge + + class FakeKeyConfig: + keymaps = [] + edited_kc = FakeKeyConfig() + for km in wm.keyconfigs.user.keymaps: + if km.is_user_modified: + edited_kc.keymaps.append(km) + # merge edited keymaps with non-default keyconfig, if it exists + if kc != wm.keyconfigs.default: + export_keymaps = keyconfig_merge(edited_kc, kc) + else: + export_keymaps = keyconfig_merge(edited_kc, edited_kc) + + with open(filepath, "w") as fh: + fw = fh.write + fw("keyconfig_data = [\n") + + for km, kc_x in export_keymaps: + km = km.active() + fw(f"{indent(1)}" "(\n") + fw(f"{indent(2)}" f"\"{km.name:s}\",\n") + fw(f"{indent(2)}" "{") + fw(f"\"space_type\": '{km.space_type:s}'") + fw(f", \"region_type\": '{km.region_type:s}'") + # We can detect from the kind of items. + if km.is_modal: + fw(", \"modal\": True") + fw("},\n") + fw(f"{indent(2)}" "{\n") + is_modal = km.is_modal + fw(f"{indent(3)}" "\"items\": [\n") + for kmi in km.keymap_items: + if is_modal: + kmi_id = kmi.propvalue + else: + kmi_id = kmi.idname + + fw(f"{indent(4)}" "(") + kmi_args = kmi_args_as_data(kmi) + kmi_data = _kmi_attrs_or_none(5, kmi) + if kmi_data is not None: + fw("\n" f"{indent(5)}") + fw(f"\"{kmi_id:s}\"") + if kmi_data is None: + fw(f", ") + else: + fw(",\n" f"{indent(5)}") + + fw(kmi_args) + if kmi_data is None: + fw(", None),\n") + else: + fw(",\n") + fw(f"{indent(5)}" "{\n") + fw(kmi_data) + fw(f"{indent(5)}" "}\n") + fw(f"{indent(4)}" "),\n") + + fw(f"{indent(3)}" "],\n") + fw(f"{indent(2)}" "},\n") + fw(f"{indent(1)}" "),\n") + fw("]\n") + fw("\n\n") + fw("if __name__ == \"__main__\":\n") + fw(" import os\n") + fw(" from bpy_extras.keyconfig_utils import keyconfig_import_from_data\n") + fw(" keyconfig_import_from_data(os.path.splitext(os.path.basename(__file__))[0], keyconfig_data)\n") + + +def keyconfig_import_from_data(name, keyconfig_data): + # Load data in the format defined above. + # + # Runs at load time, keep this fast! + + def kmi_props_setattr(kmi_props, attr, value): + if type(value) is list: + kmi_subprop = getattr(kmi_props, attr) + for subattr, subvalue in value: + kmi_props_setattr(kmi_subprop, subattr, subvalue) + return + + try: + setattr(kmi_props, attr, value) + except AttributeError: + print(f"Warning: property '{attr}' not found in keymap item '{kmi_props.__class__.__name__}'") + except Exception as ex: + print(f"Warning: {ex!r}") + + import bpy + wm = bpy.context.window_manager + kc = wm.keyconfigs.new(name) + del name + + for (km_name, km_args, km_content) in keyconfig_data: + km = kc.keymaps.new(km_name, **km_args) + is_modal = km_args.get("modal", False) + new_fn = getattr(km.keymap_items, "new_modal" if is_modal else "new") + for (kmi_idname, kmi_args, kmi_data) in km_content["items"]: + kmi = new_fn(kmi_idname, **kmi_args) + if kmi_data is not None: + if not kmi_data.get("active", True): + kmi.active = False + kmi_props_data = kmi_data.get("properties", None) + if kmi_props_data is not None: + kmi_props = kmi.properties + for attr, value in kmi_props_data: + kmi_props_setattr(kmi_props, attr, value) 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/keyconfig/blender_27x.py b/release/scripts/presets/keyconfig/blender_27x.py index e2a4c37cdad..c6a9c00c901 100644 --- a/release/scripts/presets/keyconfig/blender_27x.py +++ b/release/scripts/presets/keyconfig/blender_27x.py @@ -1,3955 +1,10764 @@ -import bpy -from sys import platform - -def kmi_props_setattr(kmi_props, attr, value): - try: - setattr(kmi_props, attr, value) - except AttributeError: - print("Warning: property '%s' not found in keymap item '%s'" % - (attr, kmi_props.__class__.__name__)) - except Exception as e: - print("Warning: %r" % e) - -import os -wm = bpy.context.window_manager -kc = wm.keyconfigs.new(os.path.splitext(os.path.basename(__file__))[0]) -del os - -# Map Image Editor Tool: VIEW, Select Border -km = kc.keymaps.new('Image Editor Tool: VIEW, Select Border', space_type='IMAGE_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('uv.select_border', 'EVT_TWEAK_A', 'ANY') -kmi_props_setattr(kmi.properties, 'deselect', False) - -# Map Image Editor Tool: VIEW, Select Circle -km = kc.keymaps.new('Image Editor Tool: VIEW, Select Circle', space_type='IMAGE_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('uv.select_circle', 'ACTIONMOUSE', 'PRESS') - -# Map Image Editor Tool: VIEW, Select Lasso -km = kc.keymaps.new('Image Editor Tool: VIEW, Select Lasso', space_type='IMAGE_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('uv.select_lasso', 'EVT_TWEAK_A', 'ANY') -kmi_props_setattr(kmi.properties, 'deselect', False) - -# Map 3D View Tool: All, Cursor -km = kc.keymaps.new('3D View Tool: All, Cursor', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('view3d.cursor3d', 'ACTIONMOUSE', 'PRESS') -kmi = km.keymap_items.new('transform.translate', 'EVT_TWEAK_A', 'ANY') -kmi_props_setattr(kmi.properties, 'cursor_transform', True) -kmi_props_setattr(kmi.properties, 'release_confirm', True) - -# Map 3D View Tool: OBJECT, Select Border -km = kc.keymaps.new('3D View Tool: OBJECT, Select Border', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('view3d.select_border', 'EVT_TWEAK_A', 'ANY') -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('view3d.select_border', 'EVT_TWEAK_A', 'ANY', ctrl=True) -kmi_props_setattr(kmi.properties, 'deselect', True) - -# Map 3D View Tool: OBJECT, Select Circle -km = kc.keymaps.new('3D View Tool: OBJECT, Select Circle', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('view3d.select_circle', 'ACTIONMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('view3d.select_circle', 'ACTIONMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'deselect', True) - -# Map 3D View Tool: OBJECT, Select Lasso -km = kc.keymaps.new('3D View Tool: OBJECT, Select Lasso', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('view3d.select_lasso', 'EVT_TWEAK_A', 'ANY') -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('view3d.select_lasso', 'EVT_TWEAK_A', 'ANY', ctrl=True) -kmi_props_setattr(kmi.properties, 'deselect', True) - -# Map 3D View Tool: OBJECT, Move -km = kc.keymaps.new('3D View Tool: OBJECT, Move', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('transform.translate', 'EVT_TWEAK_A', 'ANY') -kmi_props_setattr(kmi.properties, 'release_confirm', True) - -# Map 3D View Tool: OBJECT, Rotate -km = kc.keymaps.new('3D View Tool: OBJECT, Rotate', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('transform.rotate', 'EVT_TWEAK_A', 'ANY') -kmi_props_setattr(kmi.properties, 'release_confirm', True) - -# Map 3D View Tool: OBJECT, Scale -km = kc.keymaps.new('3D View Tool: OBJECT, Scale', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('transform.resize', 'EVT_TWEAK_A', 'ANY') -kmi_props_setattr(kmi.properties, 'release_confirm', True) - -# Map 3D View Tool: OBJECT, Ruler/Protractor -km = kc.keymaps.new('3D View Tool: OBJECT, Ruler/Protractor', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('view3d.ruler_add', 'EVT_TWEAK_A', 'ANY') - -# Map 3D View Tool: POSE, Breakdowner -km = kc.keymaps.new('3D View Tool: POSE, Breakdowner', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('pose.breakdown', 'ACTIONMOUSE', 'PRESS') - -# Map 3D View Tool: POSE, Push -km = kc.keymaps.new('3D View Tool: POSE, Push', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('pose.push', 'ACTIONMOUSE', 'PRESS') - -# Map 3D View Tool: POSE, Relax -km = kc.keymaps.new('3D View Tool: POSE, Relax', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('pose.relax', 'ACTIONMOUSE', 'PRESS') - -# Map 3D View Tool: EDIT_ARMATURE, Roll -km = kc.keymaps.new('3D View Tool: EDIT_ARMATURE, Roll', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('transform.transform', 'EVT_TWEAK_A', 'ANY') -kmi_props_setattr(kmi.properties, 'mode', 'BONE_ROLL') -kmi_props_setattr(kmi.properties, 'release_confirm', True) - -# Map 3D View Tool: EDIT_ARMATURE, Bone Size -km = kc.keymaps.new('3D View Tool: EDIT_ARMATURE, Bone Size', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('transform.transform', 'ACTIONMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'BONE_SIZE') -kmi_props_setattr(kmi.properties, 'release_confirm', True) - -# Map 3D View Tool: EDIT_ARMATURE, Bone Envelope -km = kc.keymaps.new('3D View Tool: EDIT_ARMATURE, Bone Envelope', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('transform.transform', 'ACTIONMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'BONE_ENVELOPE') -kmi_props_setattr(kmi.properties, 'release_confirm', True) - -# Map 3D View Tool: EDIT_ARMATURE, Extrude -km = kc.keymaps.new('3D View Tool: EDIT_ARMATURE, Extrude', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('armature.click_extrude', 'ACTIONMOUSE', 'PRESS') - -# Map 3D View Tool: EDIT_ARMATURE, Extrude to Cursor -km = kc.keymaps.new('3D View Tool: EDIT_ARMATURE, Extrude to Cursor', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('armature.click_extrude', 'ACTIONMOUSE', 'PRESS') - -# Map 3D View Tool: EDIT_MESH, Add Cube -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Add Cube', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('view3d.cursor3d', 'ACTIONMOUSE', 'CLICK') -kmi = km.keymap_items.new('mesh.primitive_cube_add_manipulator', 'EVT_TWEAK_A', 'ANY') - -# Map 3D View Tool: EDIT_MESH, Extrude Region -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Extrude Region', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('mesh.extrude_context_move', 'EVT_TWEAK_A', 'ANY') -kmi_props_setattr(kmi.properties.TRANSFORM_OT_translate, 'release_confirm', True) - -# Map 3D View Tool: EDIT_MESH, Extrude Individual -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Extrude Individual', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('mesh.extrude_faces_move', 'EVT_TWEAK_A', 'ANY') -kmi_props_setattr(kmi.properties.TRANSFORM_OT_shrink_fatten, 'release_confirm', True) - -# Map 3D View Tool: EDIT_MESH, Extrude to Cursor -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Extrude to Cursor', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('mesh.dupli_extrude_cursor', 'ACTIONMOUSE', 'PRESS') - -# Map 3D View Tool: EDIT_MESH, Inset Faces -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Inset Faces', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('mesh.inset', 'ACTIONMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'release_confirm', True) - -# Map 3D View Tool: EDIT_MESH, Bevel -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Bevel', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('mesh.bevel', 'ACTIONMOUSE', 'PRESS') - -# Map 3D View Tool: EDIT_MESH, Loop Cut -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Loop Cut', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('mesh.loopcut_slide', 'ACTIONMOUSE', 'PRESS') - -# Map 3D View Tool: EDIT_MESH, Offset Edge Loop Cut -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Offset Edge Loop Cut', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('mesh.offset_edge_loops_slide', 'ACTIONMOUSE', 'PRESS') - -# Map 3D View Tool: EDIT_MESH, Knife -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Knife', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('mesh.knife_tool', 'ACTIONMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'wait_for_input', False) - -# Map 3D View Tool: EDIT_MESH, Bisect -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Bisect', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('mesh.bisect', 'EVT_TWEAK_A', 'ANY') - -# Map 3D View Tool: EDIT_MESH, Poly Build -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Poly Build', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('mesh.polybuild_face_at_cursor_move', 'ACTIONMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties.TRANSFORM_OT_translate, 'release_confirm', True) -kmi = km.keymap_items.new('mesh.polybuild_split_at_cursor_move', 'ACTIONMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties.TRANSFORM_OT_translate, 'release_confirm', True) -kmi = km.keymap_items.new('mesh.polybuild_dissolve_at_cursor', 'ACTIONMOUSE', 'CLICK', alt=True) -kmi = km.keymap_items.new('mesh.polybuild_hover', 'MOUSEMOVE', 'ANY', alt=True) -kmi_props_setattr(kmi.properties, 'use_boundary', False) -kmi = km.keymap_items.new('mesh.polybuild_hover', 'MOUSEMOVE', 'ANY', any=True) -kmi_props_setattr(kmi.properties, 'use_boundary', True) - -# Map 3D View Tool: EDIT_MESH, Spin -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Spin', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('mesh.spin', 'ACTIONMOUSE', 'PRESS') - -# Map 3D View Tool: EDIT_MESH, Spin (Duplicate) -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Spin (Duplicate)', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('mesh.spin', 'ACTIONMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'dupli', True) - -# Map 3D View Tool: EDIT_MESH, Smooth -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Smooth', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('mesh.vertices_smooth', 'ACTIONMOUSE', 'PRESS') - -# Map 3D View Tool: EDIT_MESH, Randomize -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Randomize', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('transform.vertex_random', 'ACTIONMOUSE', 'PRESS') - -# Map 3D View Tool: EDIT_MESH, Edge Slide -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Edge Slide', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('transform.edge_slide', 'ACTIONMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'release_confirm', True) - -# Map 3D View Tool: EDIT_MESH, Vertex Slide -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Vertex Slide', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('transform.vert_slide', 'ACTIONMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'release_confirm', True) - -# Map 3D View Tool: EDIT_MESH, Shrink/Fatten -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Shrink/Fatten', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('transform.shrink_fatten', 'ACTIONMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'release_confirm', True) - -# Map 3D View Tool: EDIT_MESH, Push/Pull -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Push/Pull', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('transform.push_pull', 'ACTIONMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'release_confirm', True) - -# Map 3D View Tool: EDIT_MESH, Rip Region -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Rip Region', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('mesh.rip_move', 'ACTIONMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties.TRANSFORM_OT_translate, 'release_confirm', True) - -# Map 3D View Tool: EDIT_MESH, Rip Edge -km = kc.keymaps.new('3D View Tool: EDIT_MESH, Rip Edge', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('mesh.rip_edge_edge_move', 'ACTIONMOUSE', 'PRESS') - -# Map 3D View Tool: EDIT_CURVE, Draw -km = kc.keymaps.new('3D View Tool: EDIT_CURVE, Draw', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('curve.draw', 'ACTIONMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'wait_for_input', False) - -# Map 3D View Tool: EDIT_CURVE, Extrude Cursor -km = kc.keymaps.new('3D View Tool: EDIT_CURVE, Extrude Cursor', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('curve.vertex_add', 'ACTIONMOUSE', 'PRESS') - -# Map 3D View Tool: PARTICLE, Cursor Click -km = kc.keymaps.new('3D View Tool: PARTICLE, Cursor Click', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('view3d.cursor3d', 'ACTIONMOUSE', 'CLICK') - -# Map 3D View Tool: PAINT_WEIGHT, Sample Weight -km = kc.keymaps.new('3D View Tool: PAINT_WEIGHT, Sample Weight', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('paint.weight_sample', 'ACTIONMOUSE', 'PRESS') - -# Map 3D View Tool: PAINT_WEIGHT, Sample Vertex Group -km = kc.keymaps.new('3D View Tool: PAINT_WEIGHT, Sample Vertex Group', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('paint.weight_sample_group', 'ACTIONMOUSE', 'PRESS') - -# Map 3D View Tool: PAINT_WEIGHT, Gradient -km = kc.keymaps.new('3D View Tool: PAINT_WEIGHT, Gradient', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('paint.weight_gradient', 'EVT_TWEAK_A', 'ANY') - -# Map Window -km = kc.keymaps.new('Window', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('wm.window_new', 'W', 'PRESS', ctrl=True, alt=True) -if platform == "darwin": - kmi = km.keymap_items.new('wm.read_homefile', 'N', 'PRESS', oskey=True) - kmi = km.keymap_items.new('wm.call_menu', 'O', 'PRESS', shift=True, oskey=True) - kmi_props_setattr(kmi.properties, 'name', 'INFO_MT_file_open_recent') - kmi = km.keymap_items.new('wm.open_mainfile', 'O', 'PRESS', oskey=True) - kmi = km.keymap_items.new('wm.save_mainfile', 'S', 'PRESS', oskey=True) - kmi = km.keymap_items.new('wm.save_as_mainfile', 'S', 'PRESS', shift=True, oskey=True) - kmi = km.keymap_items.new('wm.quit_blender', 'Q', 'PRESS', oskey=True) -kmi = km.keymap_items.new('wm.read_homefile', 'N', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('wm.save_homefile', 'U', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('wm.call_menu', 'O', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'name', 'INFO_MT_file_open_recent') -kmi = km.keymap_items.new('wm.open_mainfile', 'O', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('wm.open_mainfile', 'F1', 'PRESS') -kmi = km.keymap_items.new('wm.link', 'O', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('wm.append', 'F1', 'PRESS', shift=True) -kmi = km.keymap_items.new('wm.save_mainfile', 'S', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('wm.save_mainfile', 'W', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('wm.save_as_mainfile', 'S', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('wm.save_as_mainfile', 'F2', 'PRESS') -kmi = km.keymap_items.new('wm.save_as_mainfile', 'S', 'PRESS', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'copy', True) -kmi = km.keymap_items.new('wm.window_fullscreen_toggle', 'F11', 'PRESS', alt=True) -kmi = km.keymap_items.new('wm.quit_blender', 'Q', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('wm.doc_view_manual_ui_context', 'F1', 'PRESS', alt=True) -kmi = km.keymap_items.new('wm.redraw_timer', 'T', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('wm.debug_menu', 'D', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('wm.call_menu', 'NDOF_BUTTON_MENU', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'USERPREF_MT_ndof_settings') -kmi = km.keymap_items.new('wm.search_menu', 'SPACE', 'PRESS') -kmi = km.keymap_items.new('wm.context_set_enum', 'F3', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'area.type') -kmi_props_setattr(kmi.properties, 'value', 'NODE_EDITOR') -kmi = km.keymap_items.new('wm.context_set_enum', 'F4', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'area.type') -kmi_props_setattr(kmi.properties, 'value', 'CONSOLE') -kmi = km.keymap_items.new('wm.context_set_enum', 'F5', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'area.type') -kmi_props_setattr(kmi.properties, 'value', 'VIEW_3D') -kmi = km.keymap_items.new('wm.context_set_enum', 'F6', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'area.type') -kmi_props_setattr(kmi.properties, 'value', 'GRAPH_EDITOR') -kmi = km.keymap_items.new('wm.context_set_enum', 'F7', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'area.type') -kmi_props_setattr(kmi.properties, 'value', 'PROPERTIES') -kmi = km.keymap_items.new('wm.context_set_enum', 'F8', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'area.type') -kmi_props_setattr(kmi.properties, 'value', 'SEQUENCE_EDITOR') -kmi = km.keymap_items.new('wm.context_set_enum', 'F9', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'area.type') -kmi_props_setattr(kmi.properties, 'value', 'OUTLINER') -kmi = km.keymap_items.new('wm.context_set_enum', 'F10', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'area.type') -kmi_props_setattr(kmi.properties, 'value', 'IMAGE_EDITOR') -kmi = km.keymap_items.new('wm.context_set_enum', 'F11', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'area.type') -kmi_props_setattr(kmi.properties, 'value', 'TEXT_EDITOR') -kmi = km.keymap_items.new('wm.context_set_enum', 'F12', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'area.type') -kmi_props_setattr(kmi.properties, 'value', 'DOPESHEET_EDITOR') -kmi = km.keymap_items.new('wm.context_scale_float', 'NDOF_BUTTON_PLUS', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'user_preferences.inputs.ndof_sensitivity') -kmi_props_setattr(kmi.properties, 'value', 1.1) -kmi = km.keymap_items.new('wm.context_scale_float', 'NDOF_BUTTON_MINUS', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'user_preferences.inputs.ndof_sensitivity') -kmi_props_setattr(kmi.properties, 'value', 1.0 / 1.0) -kmi = km.keymap_items.new('wm.context_scale_float', 'NDOF_BUTTON_PLUS', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'user_preferences.inputs.ndof_sensitivity') -kmi_props_setattr(kmi.properties, 'value', 1.5) -kmi = km.keymap_items.new('wm.context_scale_float', 'NDOF_BUTTON_MINUS', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'user_preferences.inputs.ndof_sensitivity') -kmi_props_setattr(kmi.properties, 'value', 2.0 / 3.0) -kmi = km.keymap_items.new('info.reports_display_update', 'TIMER_REPORT', 'ANY', any=True) - -# Map Screen -km = kc.keymaps.new('Screen', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('screen.animation_step', 'TIMER0', 'ANY', any=True) -kmi = km.keymap_items.new('screen.region_blend', 'TIMERREGION', 'ANY', any=True) -kmi = km.keymap_items.new('screen.screen_set', 'RIGHT_ARROW', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'delta', 1) -kmi = km.keymap_items.new('screen.screen_set', 'LEFT_ARROW', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'delta', -1) -kmi = km.keymap_items.new('screen.screen_full_area', 'SPACE', 'PRESS', shift=True) -kmi = km.keymap_items.new('screen.screen_full_area', 'SPACE', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'use_hide_panels', True) -kmi = km.keymap_items.new('screen.screenshot', 'F3', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('screen.screencast', 'F3', 'PRESS', alt=True) -kmi = km.keymap_items.new('screen.space_context_cycle', 'TAB', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'direction', 'NEXT') -kmi = km.keymap_items.new('screen.space_context_cycle', 'TAB', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'direction', 'PREV') -kmi = km.keymap_items.new('screen.region_quadview', 'Q', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('screen.repeat_history', 'F3', 'PRESS') -kmi = km.keymap_items.new('screen.repeat_last', 'R', 'PRESS', shift=True) -kmi = km.keymap_items.new('screen.region_flip', 'F5', 'PRESS') -kmi = km.keymap_items.new('screen.redo_last', 'F6', 'PRESS') -kmi = km.keymap_items.new('script.reload', 'F8', 'PRESS') -kmi = km.keymap_items.new('file.execute', 'RET', 'PRESS') -kmi = km.keymap_items.new('file.execute', 'NUMPAD_ENTER', 'PRESS') -kmi = km.keymap_items.new('file.cancel', 'ESC', 'PRESS') -if platform == "darwin": - kmi = km.keymap_items.new('ed.undo', 'Z', 'PRESS', oskey=True) - kmi = km.keymap_items.new('ed.redo', 'Z', 'PRESS', shift=True, oskey=True) - kmi = km.keymap_items.new('ed.undo_history', 'Z', 'PRESS', alt=True, oskey=True) -kmi = km.keymap_items.new('ed.undo', 'Z', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('ed.redo', 'Z', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('ed.undo_history', 'Z', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('render.render', 'F12', 'PRESS') -kmi_props_setattr(kmi.properties, 'use_viewport', True) -kmi = km.keymap_items.new('render.render', 'F12', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'animation', True) -kmi_props_setattr(kmi.properties, 'use_viewport', True) -kmi = km.keymap_items.new('render.view_cancel', 'ESC', 'PRESS') -kmi = km.keymap_items.new('render.view_show', 'F11', 'PRESS') -kmi = km.keymap_items.new('render.play_rendered_anim', 'F11', 'PRESS', ctrl=True) -if platform == "darwin": - kmi = km.keymap_items.new('screen.userpref_show', 'COMMA', 'PRESS', oskey=True) -kmi = km.keymap_items.new('screen.userpref_show', 'U', 'PRESS', ctrl=True, alt=True) - -# Map User Interface -km = kc.keymaps.new('User Interface', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('ui.eyedropper_color', 'E', 'PRESS') -kmi = km.keymap_items.new('ui.eyedropper_colorband', 'E', 'PRESS') -kmi = km.keymap_items.new('ui.eyedropper_colorband_point', 'E', 'PRESS', alt=True) -kmi = km.keymap_items.new('ui.eyedropper_id', 'E', 'PRESS') -kmi = km.keymap_items.new('ui.eyedropper_depth', 'E', 'PRESS') -kmi = km.keymap_items.new('ui.copy_data_path_button', 'C', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('ui.copy_data_path_button', 'C', 'PRESS', shift=True, ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'full_path', True) -kmi = km.keymap_items.new('anim.keyframe_insert_button', 'I', 'PRESS') -kmi = km.keymap_items.new('anim.keyframe_delete_button', 'I', 'PRESS', alt=True) -kmi = km.keymap_items.new('anim.keyframe_clear_button', 'I', 'PRESS', shift=True, alt=True) -kmi = km.keymap_items.new('anim.driver_button_add', 'D', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('anim.driver_button_remove', 'D', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('anim.keyingset_button_add', 'K', 'PRESS') -kmi = km.keymap_items.new('anim.keyingset_button_remove', 'K', 'PRESS', alt=True) - -# Map View2D -km = kc.keymaps.new('View2D', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('view2d.scroller_activate', 'LEFTMOUSE', 'PRESS') -kmi = km.keymap_items.new('view2d.scroller_activate', 'MIDDLEMOUSE', 'PRESS') -kmi = km.keymap_items.new('view2d.pan', 'MIDDLEMOUSE', 'PRESS') -kmi = km.keymap_items.new('view2d.pan', 'MIDDLEMOUSE', 'PRESS', shift=True) -kmi = km.keymap_items.new('view2d.pan', 'TRACKPADPAN', 'ANY') -kmi = km.keymap_items.new('view2d.scroll_right', 'WHEELDOWNMOUSE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('view2d.scroll_left', 'WHEELUPMOUSE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('view2d.scroll_down', 'WHEELDOWNMOUSE', 'PRESS', shift=True) -kmi = km.keymap_items.new('view2d.scroll_up', 'WHEELUPMOUSE', 'PRESS', shift=True) -kmi = km.keymap_items.new('view2d.ndof', 'NDOF_MOTION', 'ANY') -kmi = km.keymap_items.new('view2d.zoom_out', 'WHEELOUTMOUSE', 'PRESS') -kmi = km.keymap_items.new('view2d.zoom_in', 'WHEELINMOUSE', 'PRESS') -kmi = km.keymap_items.new('view2d.zoom_out', 'NUMPAD_MINUS', 'PRESS') -kmi = km.keymap_items.new('view2d.zoom_in', 'NUMPAD_PLUS', 'PRESS') -kmi = km.keymap_items.new('view2d.zoom', 'TRACKPADPAN', 'ANY', ctrl=True) -kmi = km.keymap_items.new('view2d.smoothview', 'TIMER1', 'ANY', any=True) -kmi = km.keymap_items.new('view2d.scroll_down', 'WHEELDOWNMOUSE', 'PRESS') -kmi = km.keymap_items.new('view2d.scroll_up', 'WHEELUPMOUSE', 'PRESS') -kmi = km.keymap_items.new('view2d.scroll_right', 'WHEELDOWNMOUSE', 'PRESS') -kmi = km.keymap_items.new('view2d.scroll_left', 'WHEELUPMOUSE', 'PRESS') -kmi = km.keymap_items.new('view2d.zoom', 'MIDDLEMOUSE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('view2d.zoom', 'TRACKPADZOOM', 'ANY') -kmi = km.keymap_items.new('view2d.zoom_border', 'B', 'PRESS', shift=True) - -# Map Header -km = kc.keymaps.new('Header', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('screen.header_toolbox', 'RIGHTMOUSE', 'PRESS') - -# Map View2D Buttons List -km = kc.keymaps.new('View2D Buttons List', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('view2d.scroller_activate', 'LEFTMOUSE', 'PRESS') -kmi = km.keymap_items.new('view2d.scroller_activate', 'MIDDLEMOUSE', 'PRESS') -kmi = km.keymap_items.new('view2d.pan', 'MIDDLEMOUSE', 'PRESS') -kmi = km.keymap_items.new('view2d.pan', 'TRACKPADPAN', 'ANY') -kmi = km.keymap_items.new('view2d.scroll_down', 'WHEELDOWNMOUSE', 'PRESS') -kmi = km.keymap_items.new('view2d.scroll_up', 'WHEELUPMOUSE', 'PRESS') -kmi = km.keymap_items.new('view2d.scroll_down', 'PAGE_DOWN', 'PRESS') -kmi_props_setattr(kmi.properties, 'page', True) -kmi = km.keymap_items.new('view2d.scroll_up', 'PAGE_UP', 'PRESS') -kmi_props_setattr(kmi.properties, 'page', True) -kmi = km.keymap_items.new('view2d.zoom', 'MIDDLEMOUSE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('view2d.zoom', 'TRACKPADZOOM', 'ANY') -kmi = km.keymap_items.new('view2d.zoom', 'TRACKPADPAN', 'ANY', ctrl=True) -kmi = km.keymap_items.new('view2d.zoom_out', 'NUMPAD_MINUS', 'PRESS') -kmi = km.keymap_items.new('view2d.zoom_in', 'NUMPAD_PLUS', 'PRESS') -kmi = km.keymap_items.new('view2d.reset', 'HOME', 'PRESS') - -# Map Frames -km = kc.keymaps.new('Frames', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('screen.frame_offset', 'UP_ARROW', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'delta', 10) -kmi = km.keymap_items.new('screen.frame_offset', 'DOWN_ARROW', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'delta', -10) -kmi = km.keymap_items.new('screen.frame_offset', 'LEFT_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'delta', -1) -kmi = km.keymap_items.new('screen.frame_offset', 'RIGHT_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'delta', 1) -kmi = km.keymap_items.new('screen.frame_offset', 'WHEELDOWNMOUSE', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'delta', 1) -kmi = km.keymap_items.new('screen.frame_offset', 'WHEELUPMOUSE', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'delta', -1) -kmi = km.keymap_items.new('screen.frame_jump', 'UP_ARROW', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'end', True) -kmi = km.keymap_items.new('screen.frame_jump', 'DOWN_ARROW', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'end', False) -kmi = km.keymap_items.new('screen.frame_jump', 'RIGHT_ARROW', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'end', True) -kmi = km.keymap_items.new('screen.frame_jump', 'LEFT_ARROW', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'end', False) -kmi = km.keymap_items.new('screen.keyframe_jump', 'UP_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'next', True) -kmi = km.keymap_items.new('screen.keyframe_jump', 'DOWN_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'next', False) -kmi = km.keymap_items.new('screen.keyframe_jump', 'MEDIA_LAST', 'PRESS') -kmi_props_setattr(kmi.properties, 'next', True) -kmi = km.keymap_items.new('screen.keyframe_jump', 'MEDIA_FIRST', 'PRESS') -kmi_props_setattr(kmi.properties, 'next', False) -kmi = km.keymap_items.new('screen.animation_play', 'A', 'PRESS', alt=True) -kmi = km.keymap_items.new('screen.animation_play', 'A', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'reverse', True) -kmi = km.keymap_items.new('screen.animation_cancel', 'ESC', 'PRESS') -kmi = km.keymap_items.new('screen.animation_play', 'MEDIA_PLAY', 'PRESS') -kmi = km.keymap_items.new('screen.animation_cancel', 'MEDIA_STOP', 'PRESS') - -# Map Property Editor -km = kc.keymaps.new('Property Editor', space_type='PROPERTIES', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('buttons.toolbox', 'RIGHTMOUSE', 'PRESS') - -# Map Markers -km = kc.keymaps.new('Markers', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('marker.add', 'M', 'PRESS') -kmi = km.keymap_items.new('marker.move', 'EVT_TWEAK_S', 'ANY') -kmi = km.keymap_items.new('marker.duplicate', 'D', 'PRESS', shift=True) -kmi = km.keymap_items.new('marker.select', 'SELECTMOUSE', 'PRESS') -kmi = km.keymap_items.new('marker.select', 'SELECTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('marker.select', 'SELECTMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'camera', True) -kmi = km.keymap_items.new('marker.select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'camera', True) -kmi = km.keymap_items.new('marker.select_border', 'B', 'PRESS') -kmi = km.keymap_items.new('marker.select_all', 'A', 'PRESS') -kmi = km.keymap_items.new('marker.delete', 'X', 'PRESS') -kmi = km.keymap_items.new('marker.delete', 'DEL', 'PRESS') -kmi = km.keymap_items.new('marker.rename', 'M', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('marker.move', 'G', 'PRESS') -kmi = km.keymap_items.new('marker.camera_bind', 'B', 'PRESS', ctrl=True) - -# Map Animation -km = kc.keymaps.new('Animation', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('anim.change_frame', 'ACTIONMOUSE', 'PRESS') -kmi = km.keymap_items.new('wm.context_toggle', 'T', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.show_seconds') -kmi = km.keymap_items.new('anim.previewrange_set', 'P', 'PRESS') -kmi = km.keymap_items.new('anim.previewrange_clear', 'P', 'PRESS', alt=True) - -# Map Dopesheet -km = kc.keymaps.new('Dopesheet', space_type='DOPESHEET_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('action.clickselect', 'SELECTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'column', False) -kmi_props_setattr(kmi.properties, 'channel', False) -kmi = km.keymap_items.new('action.clickselect', 'SELECTMOUSE', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'column', True) -kmi_props_setattr(kmi.properties, 'channel', False) -kmi = km.keymap_items.new('action.clickselect', 'SELECTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'column', False) -kmi_props_setattr(kmi.properties, 'channel', False) -kmi = km.keymap_items.new('action.clickselect', 'SELECTMOUSE', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'column', True) -kmi_props_setattr(kmi.properties, 'channel', False) -kmi = km.keymap_items.new('action.clickselect', 'SELECTMOUSE', 'PRESS', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'column', False) -kmi_props_setattr(kmi.properties, 'channel', True) -kmi = km.keymap_items.new('action.clickselect', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'column', False) -kmi_props_setattr(kmi.properties, 'channel', True) -kmi = km.keymap_items.new('action.select_leftright', 'SELECTMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'mode', 'CHECK') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('action.select_leftright', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'mode', 'CHECK') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('action.select_leftright', 'LEFT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'LEFT') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('action.select_leftright', 'RIGHT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'RIGHT') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('action.select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('action.select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('action.select_border', 'B', 'PRESS') -kmi_props_setattr(kmi.properties, 'axis_range', False) -kmi = km.keymap_items.new('action.select_border', 'B', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'axis_range', True) -kmi = km.keymap_items.new('action.select_lasso', 'EVT_TWEAK_A', 'ANY', ctrl=True) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('action.select_lasso', 'EVT_TWEAK_A', 'ANY', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'deselect', True) -kmi = km.keymap_items.new('action.select_circle', 'C', 'PRESS') -kmi = km.keymap_items.new('action.select_column', 'K', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'KEYS') -kmi = km.keymap_items.new('action.select_column', 'K', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'mode', 'CFRA') -kmi = km.keymap_items.new('action.select_column', 'K', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'MARKERS_COLUMN') -kmi = km.keymap_items.new('action.select_column', 'K', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'mode', 'MARKERS_BETWEEN') -kmi = km.keymap_items.new('action.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('action.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('action.select_linked', 'L', 'PRESS') -kmi = km.keymap_items.new('action.frame_jump', 'G', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('action.snap', 'S', 'PRESS', shift=True) -kmi = km.keymap_items.new('action.mirror', 'M', 'PRESS', shift=True) -kmi = km.keymap_items.new('action.handle_type', 'V', 'PRESS') -kmi = km.keymap_items.new('action.interpolation_type', 'T', 'PRESS') -kmi = km.keymap_items.new('action.extrapolation_type', 'E', 'PRESS', shift=True) -kmi = km.keymap_items.new('action.keyframe_type', 'R', 'PRESS') -kmi = km.keymap_items.new('action.sample', 'O', 'PRESS', shift=True) -kmi = km.keymap_items.new('wm.call_menu', 'X', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'DOPESHEET_MT_delete') -kmi = km.keymap_items.new('wm.call_menu', 'DEL', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'DOPESHEET_MT_delete') -kmi = km.keymap_items.new('action.duplicate_move', 'D', 'PRESS', shift=True) -kmi = km.keymap_items.new('action.keyframe_insert', 'I', 'PRESS') -kmi = km.keymap_items.new('action.copy', 'C', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('action.paste', 'V', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('action.paste', 'V', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'flipped', True) -if platform == "darwin": - kmi = km.keymap_items.new('action.copy', 'C', 'PRESS', oskey=True) - kmi = km.keymap_items.new('action.paste', 'V', 'PRESS', oskey=True) - kmi = km.keymap_items.new('action.paste', 'V', 'PRESS', shift=True, oskey=True) - kmi_props_setattr(kmi.properties, 'flipped', True) -kmi = km.keymap_items.new('action.previewrange_set', 'P', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('action.view_all', 'HOME', 'PRESS') -kmi = km.keymap_items.new('action.view_all', 'NDOF_BUTTON_FIT', 'PRESS') -kmi = km.keymap_items.new('action.view_selected', 'NUMPAD_PERIOD', 'PRESS') -kmi = km.keymap_items.new('action.view_frame', 'NUMPAD_0', 'PRESS') -kmi = km.keymap_items.new('anim.channels_editable_toggle', 'TAB', 'PRESS') -kmi = km.keymap_items.new('anim.channels_find', 'F', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('transform.transform', 'G', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'TIME_TRANSLATE') -kmi = km.keymap_items.new('transform.transform', 'EVT_TWEAK_S', 'ANY') -kmi_props_setattr(kmi.properties, 'mode', 'TIME_TRANSLATE') -kmi = km.keymap_items.new('transform.transform', 'E', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'TIME_EXTEND') -kmi = km.keymap_items.new('transform.transform', 'S', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'TIME_SCALE') -kmi = km.keymap_items.new('transform.transform', 'T', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'TIME_SLIDE') -kmi = km.keymap_items.new('wm.context_toggle', 'O', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.use_proportional_action') -kmi = km.keymap_items.new('marker.add', 'M', 'PRESS') -kmi = km.keymap_items.new('marker.rename', 'M', 'PRESS', ctrl=True) - -# Map Dopesheet Generic -km = kc.keymaps.new('Dopesheet Generic', space_type='DOPESHEET_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('action.properties', 'N', 'PRESS') - -# Map Outliner -km = kc.keymaps.new('Outliner', space_type='OUTLINER', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('outliner.highlight_update', 'MOUSEMOVE', 'ANY', any=True) -kmi = km.keymap_items.new('outliner.item_rename', 'LEFTMOUSE', 'DOUBLE_CLICK') -kmi = km.keymap_items.new('outliner.item_activate', 'LEFTMOUSE', 'CLICK') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'recursive', False) -kmi = km.keymap_items.new('outliner.item_activate', 'LEFTMOUSE', 'CLICK', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'recursive', False) -kmi = km.keymap_items.new('outliner.item_activate', 'LEFTMOUSE', 'CLICK', ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'recursive', True) -kmi = km.keymap_items.new('outliner.item_activate', 'LEFTMOUSE', 'CLICK', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'recursive', True) -kmi = km.keymap_items.new('outliner.select_border', 'B', 'PRESS') -kmi = km.keymap_items.new('outliner.item_openclose', 'RET', 'PRESS') -kmi_props_setattr(kmi.properties, 'all', False) -kmi = km.keymap_items.new('outliner.item_openclose', 'RET', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'all', True) -kmi = km.keymap_items.new('outliner.item_rename', 'LEFTMOUSE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('outliner.operation', 'RIGHTMOUSE', 'PRESS') -kmi = km.keymap_items.new('outliner.item_drag_drop', 'EVT_TWEAK_L', 'ANY') -kmi = km.keymap_items.new('outliner.show_hierarchy', 'HOME', 'PRESS') -kmi = km.keymap_items.new('outliner.show_active', 'PERIOD', 'PRESS') -kmi = km.keymap_items.new('outliner.show_active', 'NUMPAD_PERIOD', 'PRESS') -kmi = km.keymap_items.new('outliner.scroll_page', 'PAGE_DOWN', 'PRESS') -kmi_props_setattr(kmi.properties, 'up', False) -kmi = km.keymap_items.new('outliner.scroll_page', 'PAGE_UP', 'PRESS') -kmi_props_setattr(kmi.properties, 'up', True) -kmi = km.keymap_items.new('outliner.show_one_level', 'NUMPAD_PLUS', 'PRESS') -kmi = km.keymap_items.new('outliner.show_one_level', 'NUMPAD_MINUS', 'PRESS') -kmi_props_setattr(kmi.properties, 'open', False) -kmi = km.keymap_items.new('outliner.selected_toggle', 'A', 'PRESS') -kmi = km.keymap_items.new('outliner.expanded_toggle', 'A', 'PRESS', shift=True) -kmi = km.keymap_items.new('outliner.keyingset_add_selected', 'K', 'PRESS') -kmi = km.keymap_items.new('outliner.keyingset_remove_selected', 'K', 'PRESS', alt=True) -kmi = km.keymap_items.new('anim.keyframe_insert', 'I', 'PRESS') -kmi = km.keymap_items.new('anim.keyframe_delete', 'I', 'PRESS', alt=True) -kmi = km.keymap_items.new('outliner.drivers_add_selected', 'D', 'PRESS') -kmi = km.keymap_items.new('outliner.drivers_delete_selected', 'D', 'PRESS', alt=True) -kmi = km.keymap_items.new('outliner.collection_new', 'C', 'PRESS') -kmi = km.keymap_items.new('outliner.collection_delete', 'X', 'PRESS') - -# Map 3D View Generic -km = kc.keymaps.new('3D View Generic', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('view3d.properties', 'N', 'PRESS') -kmi = km.keymap_items.new('view3d.toolshelf', 'T', 'PRESS') - -# Map Grease Pencil -km = kc.keymaps.new('Grease Pencil', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('gpencil.draw', 'LEFTMOUSE', 'PRESS', key_modifier='D') -kmi_props_setattr(kmi.properties, 'mode', 'DRAW') -kmi_props_setattr(kmi.properties, 'wait_for_input', False) -kmi = km.keymap_items.new('gpencil.draw', 'LEFTMOUSE', 'PRESS', ctrl=True, key_modifier='D') -kmi_props_setattr(kmi.properties, 'mode', 'DRAW_STRAIGHT') -kmi_props_setattr(kmi.properties, 'wait_for_input', False) -kmi = km.keymap_items.new('gpencil.draw', 'RIGHTMOUSE', 'PRESS', ctrl=True, key_modifier='D') -kmi_props_setattr(kmi.properties, 'mode', 'DRAW_POLY') -kmi_props_setattr(kmi.properties, 'wait_for_input', False) -kmi = km.keymap_items.new('gpencil.draw', 'RIGHTMOUSE', 'PRESS', key_modifier='D') -kmi_props_setattr(kmi.properties, 'mode', 'ERASER') -kmi_props_setattr(kmi.properties, 'wait_for_input', False) -kmi = km.keymap_items.new('gpencil.draw', 'ERASER', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'ERASER') -kmi_props_setattr(kmi.properties, 'wait_for_input', False) -kmi = km.keymap_items.new('gpencil.editmode_toggle', 'TAB', 'PRESS', key_modifier='D') -kmi = km.keymap_items.new('wm.call_menu_pie', 'Q', 'PRESS', key_modifier='D') -kmi_props_setattr(kmi.properties, 'name', 'GPENCIL_MT_pie_tool_palette') -kmi = km.keymap_items.new('wm.call_menu_pie', 'W', 'PRESS', key_modifier='D') -kmi_props_setattr(kmi.properties, 'name', 'GPENCIL_MT_pie_settings_palette') -kmi = km.keymap_items.new('gpencil.blank_frame_add', 'B', 'PRESS', key_modifier='D') -kmi = km.keymap_items.new('gpencil.active_frames_delete_all', 'X', 'PRESS', key_modifier='D') - -# Map Grease Pencil Stroke Edit Mode -km = kc.keymaps.new('Grease Pencil Stroke Edit Mode', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('gpencil.editmode_toggle', 'TAB', 'PRESS') -kmi = km.keymap_items.new('wm.call_menu_pie', 'E', 'PRESS', key_modifier='D') -kmi_props_setattr(kmi.properties, 'name', 'GPENCIL_MT_pie_sculpt') -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path_primary', 'user_preferences.edit.grease_pencil_eraser_radius') -kmi = km.keymap_items.new('gpencil.interpolate', 'E', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('gpencil.interpolate_sequence', 'E', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('gpencil.brush_paint', 'LEFTMOUSE', 'PRESS', key_modifier='E') -kmi_props_setattr(kmi.properties, 'wait_for_input', False) -kmi = km.keymap_items.new('gpencil.brush_paint', 'LEFTMOUSE', 'PRESS', ctrl=True, key_modifier='E') -kmi_props_setattr(kmi.properties, 'wait_for_input', False) -kmi = km.keymap_items.new('gpencil.brush_paint', 'LEFTMOUSE', 'PRESS', shift=True, key_modifier='E') -kmi_props_setattr(kmi.properties, 'wait_for_input', False) -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.gpencil_sculpt.brush.strength') -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.gpencil_sculpt.brush.size') -kmi = km.keymap_items.new('gpencil.select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('gpencil.select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('gpencil.select_circle', 'C', 'PRESS') -kmi = km.keymap_items.new('gpencil.select_border', 'B', 'PRESS') -kmi = km.keymap_items.new('gpencil.select_lasso', 'EVT_TWEAK_A', 'ANY', ctrl=True) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('gpencil.select_lasso', 'EVT_TWEAK_A', 'ANY', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'deselect', True) -kmi = km.keymap_items.new('gpencil.select_lasso', 'EVT_TWEAK_A', 'ANY', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('gpencil.select_lasso', 'EVT_TWEAK_A', 'ANY', shift=True, ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'deselect', True) -kmi = km.keymap_items.new('gpencil.select', 'SELECTMOUSE', 'PRESS') -kmi = km.keymap_items.new('gpencil.select', 'SELECTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'toggle', True) -kmi = km.keymap_items.new('gpencil.select', 'SELECTMOUSE', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'entire_strokes', True) -kmi = km.keymap_items.new('gpencil.select_linked', 'L', 'PRESS') -kmi = km.keymap_items.new('gpencil.select_linked', 'L', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('gpencil.select_grouped', 'G', 'PRESS', shift=True) -kmi = km.keymap_items.new('gpencil.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('gpencil.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('gpencil.duplicate_move', 'D', 'PRESS', shift=True) -kmi = km.keymap_items.new('wm.call_menu', 'X', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_gpencil_delete') -kmi = km.keymap_items.new('wm.call_menu', 'DEL', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_gpencil_delete') -kmi = km.keymap_items.new('gpencil.dissolve', 'X', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('gpencil.dissolve', 'DEL', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('gpencil.active_frames_delete_all', 'X', 'PRESS', shift=True) -kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'GPENCIL_MT_gpencil_edit_specials') -kmi = km.keymap_items.new('gpencil.stroke_join', 'J', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('gpencil.stroke_join', 'J', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'JOINCOPY') -kmi = km.keymap_items.new('gpencil.copy', 'C', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('gpencil.paste', 'V', 'PRESS', ctrl=True) -if platform == "darwin": - kmi = km.keymap_items.new('gpencil.copy', 'C', 'PRESS', oskey=True) - kmi = km.keymap_items.new('gpencil.paste', 'V', 'PRESS', oskey=True) -kmi = km.keymap_items.new('wm.call_menu', 'S', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'name', 'GPENCIL_MT_snap') -kmi = km.keymap_items.new('gpencil.convert', 'C', 'PRESS', alt=True) -kmi = km.keymap_items.new('gpencil.reveal', 'H', 'PRESS', alt=True) -kmi = km.keymap_items.new('gpencil.hide', 'H', 'PRESS') -kmi_props_setattr(kmi.properties, 'unselected', False) -kmi = km.keymap_items.new('gpencil.hide', 'H', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'unselected', True) -kmi = km.keymap_items.new('gpencil.selection_opacity_toggle', 'H', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('gpencil.layer_isolate', 'NUMPAD_ASTERIX', 'PRESS') -kmi = km.keymap_items.new('gpencil.move_to_layer', 'M', 'PRESS') -kmi = km.keymap_items.new('gpencil.brush_select', 'ONE', 'PRESS') -kmi_props_setattr(kmi.properties, 'index', 0) -kmi = km.keymap_items.new('gpencil.brush_select', 'TWO', 'PRESS') -kmi_props_setattr(kmi.properties, 'index', 1) -kmi = km.keymap_items.new('gpencil.brush_select', 'THREE', 'PRESS') -kmi_props_setattr(kmi.properties, 'index', 2) -kmi = km.keymap_items.new('gpencil.brush_select', 'FOUR', 'PRESS') -kmi_props_setattr(kmi.properties, 'index', 3) -kmi = km.keymap_items.new('gpencil.brush_select', 'FIVE', 'PRESS') -kmi_props_setattr(kmi.properties, 'index', 4) -kmi = km.keymap_items.new('gpencil.brush_select', 'SIX', 'PRESS') -kmi_props_setattr(kmi.properties, 'index', 5) -kmi = km.keymap_items.new('gpencil.brush_select', 'SEVEN', 'PRESS') -kmi_props_setattr(kmi.properties, 'index', 6) -kmi = km.keymap_items.new('gpencil.brush_select', 'EIGHT', 'PRESS') -kmi_props_setattr(kmi.properties, 'index', 7) -kmi = km.keymap_items.new('gpencil.brush_select', 'NINE', 'PRESS') -kmi_props_setattr(kmi.properties, 'index', 8) -kmi = km.keymap_items.new('gpencil.brush_select', 'ZERO', 'PRESS') -kmi_props_setattr(kmi.properties, 'index', 9) -kmi = km.keymap_items.new('transform.translate', 'G', 'PRESS') -kmi = km.keymap_items.new('transform.translate', 'EVT_TWEAK_S', 'ANY') -kmi = km.keymap_items.new('transform.rotate', 'R', 'PRESS') -kmi = km.keymap_items.new('transform.resize', 'S', 'PRESS') -kmi = km.keymap_items.new('transform.mirror', 'M', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('transform.bend', 'W', 'PRESS', shift=True) -kmi = km.keymap_items.new('transform.tosphere', 'S', 'PRESS', shift=True, alt=True) -kmi = km.keymap_items.new('transform.shear', 'S', 'PRESS', shift=True, ctrl=True, alt=True) -kmi = km.keymap_items.new('transform.transform', 'S', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'mode', 'GPENCIL_SHRINKFATTEN') -kmi = km.keymap_items.new('wm.context_cycle_enum', 'O', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit_falloff') -kmi_props_setattr(kmi.properties, 'wrap', True) -kmi = km.keymap_items.new('wm.context_toggle_enum', 'O', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit') -kmi_props_setattr(kmi.properties, 'value_1', 'DISABLED') -kmi_props_setattr(kmi.properties, 'value_2', 'ENABLED') -kmi = km.keymap_items.new('wm.context_toggle_enum', 'O', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit') -kmi_props_setattr(kmi.properties, 'value_1', 'DISABLED') -kmi_props_setattr(kmi.properties, 'value_2', 'CONNECTED') - -# Map Face Mask -km = kc.keymaps.new('Face Mask', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('paint.face_select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('paint.face_select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('paint.face_select_hide', 'H', 'PRESS') -kmi_props_setattr(kmi.properties, 'unselected', False) -kmi = km.keymap_items.new('paint.face_select_hide', 'H', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'unselected', True) -kmi = km.keymap_items.new('paint.face_select_reveal', 'H', 'PRESS', alt=True) -kmi = km.keymap_items.new('paint.face_select_linked', 'L', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('paint.face_select_linked_pick', 'L', 'PRESS') -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('paint.face_select_linked_pick', 'L', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'deselect', True) - -# Map Weight Paint Vertex Selection -km = kc.keymaps.new('Weight Paint Vertex Selection', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('paint.vert_select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('paint.vert_select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('view3d.select_border', 'B', 'PRESS') -kmi = km.keymap_items.new('view3d.select_lasso', 'EVT_TWEAK_A', 'ANY', ctrl=True) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('view3d.select_lasso', 'EVT_TWEAK_A', 'ANY', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'deselect', True) -kmi = km.keymap_items.new('view3d.select_circle', 'C', 'PRESS') - -# Map Pose -km = kc.keymaps.new('Pose', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('object.parent_set', 'P', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'name', 'INFO_MT_add') -kmi = km.keymap_items.new('pose.hide', 'H', 'PRESS') -kmi_props_setattr(kmi.properties, 'unselected', False) -kmi = km.keymap_items.new('pose.hide', 'H', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'unselected', True) -kmi = km.keymap_items.new('pose.reveal', 'H', 'PRESS', alt=True) -kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_pose_apply') -kmi = km.keymap_items.new('pose.rot_clear', 'R', 'PRESS', alt=True) -kmi = km.keymap_items.new('pose.loc_clear', 'G', 'PRESS', alt=True) -kmi = km.keymap_items.new('pose.scale_clear', 'S', 'PRESS', alt=True) -kmi = km.keymap_items.new('pose.quaternions_flip', 'F', 'PRESS', alt=True) -kmi = km.keymap_items.new('pose.rotation_mode_set', 'R', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('pose.copy', 'C', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('pose.paste', 'V', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'flipped', False) -kmi = km.keymap_items.new('pose.paste', 'V', 'PRESS', shift=True, ctrl=True) -if platform == "darwin": - kmi_props_setattr(kmi.properties, 'flipped', True) - kmi = km.keymap_items.new('pose.copy', 'C', 'PRESS', oskey=True) - kmi = km.keymap_items.new('pose.paste', 'V', 'PRESS', oskey=True) - kmi_props_setattr(kmi.properties, 'flipped', False) - kmi = km.keymap_items.new('pose.paste', 'V', 'PRESS', shift=True, oskey=True) -kmi_props_setattr(kmi.properties, 'flipped', True) -kmi = km.keymap_items.new('pose.select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('pose.select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('pose.select_parent', 'P', 'PRESS', shift=True) -kmi = km.keymap_items.new('pose.select_hierarchy', 'LEFT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'direction', 'PARENT') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('pose.select_hierarchy', 'LEFT_BRACKET', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'direction', 'PARENT') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('pose.select_hierarchy', 'RIGHT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'direction', 'CHILD') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('pose.select_hierarchy', 'RIGHT_BRACKET', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'direction', 'CHILD') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('pose.select_linked', 'L', 'PRESS') -kmi = km.keymap_items.new('pose.select_grouped', 'G', 'PRESS', shift=True) -kmi = km.keymap_items.new('pose.select_mirror', 'F', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('pose.constraint_add_with_targets', 'C', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('pose.constraints_clear', 'C', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('pose.ik_add', 'I', 'PRESS', shift=True) -kmi = km.keymap_items.new('pose.ik_clear', 'I', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('wm.call_menu', 'G', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_pose_group') -kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_bone_options_toggle') -kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_bone_options_enable') -kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_bone_options_disable') -kmi = km.keymap_items.new('armature.layers_show_all', 'ACCENT_GRAVE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('armature.armature_layers', 'M', 'PRESS', shift=True) -kmi = km.keymap_items.new('pose.bone_layers', 'M', 'PRESS') -kmi = km.keymap_items.new('pose.toggle_bone_selection_overlay', 'Z', 'PRESS') -kmi = km.keymap_items.new('transform.transform', 'S', 'PRESS', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'mode', 'BONE_SIZE') -kmi = km.keymap_items.new('anim.keyframe_insert_menu', 'I', 'PRESS') -kmi = km.keymap_items.new('anim.keyframe_delete_v3d', 'I', 'PRESS', alt=True) -kmi = km.keymap_items.new('anim.keying_set_active_set', 'I', 'PRESS', shift=True, ctrl=True, alt=True) -kmi = km.keymap_items.new('poselib.browse_interactive', 'L', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('poselib.pose_add', 'L', 'PRESS', shift=True) -kmi = km.keymap_items.new('poselib.pose_remove', 'L', 'PRESS', alt=True) -kmi = km.keymap_items.new('poselib.pose_rename', 'L', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('pose.push', 'E', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('pose.relax', 'E', 'PRESS', alt=True) -kmi = km.keymap_items.new('pose.breakdown', 'E', 'PRESS', shift=True) -kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_pose_specials') -kmi = km.keymap_items.new('wm.call_menu', 'P', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_pose_propagate') - -# Map Object Mode -km = kc.keymaps.new('Object Mode', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('wm.context_cycle_enum', 'O', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit_falloff') -kmi_props_setattr(kmi.properties, 'wrap', True) -kmi = km.keymap_items.new('wm.context_toggle', 'O', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.use_proportional_edit_objects') -kmi = km.keymap_items.new('object.select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('object.select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('object.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('object.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('object.select_linked', 'L', 'PRESS', shift=True) -kmi = km.keymap_items.new('object.select_grouped', 'G', 'PRESS', shift=True) -kmi = km.keymap_items.new('object.select_mirror', 'M', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('object.select_hierarchy', 'LEFT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'direction', 'PARENT') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('object.select_hierarchy', 'LEFT_BRACKET', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'direction', 'PARENT') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('object.select_hierarchy', 'RIGHT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'direction', 'CHILD') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('object.select_hierarchy', 'RIGHT_BRACKET', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'direction', 'CHILD') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('object.parent_set', 'P', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('object.parent_no_inverse_set', 'P', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('object.parent_clear', 'P', 'PRESS', alt=True) -kmi = km.keymap_items.new('object.track_set', 'T', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('object.track_clear', 'T', 'PRESS', alt=True) -kmi = km.keymap_items.new('object.constraint_add_with_targets', 'C', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('object.constraints_clear', 'C', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('object.location_clear', 'G', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'clear_delta', False) -kmi = km.keymap_items.new('object.rotation_clear', 'R', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'clear_delta', False) -kmi = km.keymap_items.new('object.scale_clear', 'S', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'clear_delta', False) -kmi = km.keymap_items.new('object.origin_clear', 'O', 'PRESS', alt=True) -kmi = km.keymap_items.new('object.delete', 'X', 'PRESS') -kmi_props_setattr(kmi.properties, 'use_global', False) -kmi = km.keymap_items.new('object.delete', 'X', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'use_global', True) -kmi = km.keymap_items.new('object.delete', 'DEL', 'PRESS') -kmi_props_setattr(kmi.properties, 'use_global', False) -kmi = km.keymap_items.new('object.delete', 'DEL', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'use_global', True) -kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'name', 'INFO_MT_add') -kmi = km.keymap_items.new('object.duplicates_make_real', 'A', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_object_apply') -kmi = km.keymap_items.new('wm.call_menu', 'U', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_make_single_user') -kmi = km.keymap_items.new('wm.call_menu', 'L', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_make_links') -kmi = km.keymap_items.new('object.duplicate_move', 'D', 'PRESS', shift=True) -kmi = km.keymap_items.new('object.duplicate_move_linked', 'D', 'PRESS', alt=True) -kmi = km.keymap_items.new('object.join', 'J', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('object.convert', 'C', 'PRESS', alt=True) -kmi = km.keymap_items.new('object.proxy_make', 'P', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('object.make_local', 'L', 'PRESS') -kmi = km.keymap_items.new('anim.keyframe_insert_menu', 'I', 'PRESS') -kmi = km.keymap_items.new('anim.keyframe_delete_v3d', 'I', 'PRESS', alt=True) -kmi = km.keymap_items.new('anim.keying_set_active_set', 'I', 'PRESS', shift=True, ctrl=True, alt=True) -kmi = km.keymap_items.new('collection.create', 'G', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('collection.objects_remove', 'G', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('collection.objects_remove_all', 'G', 'PRESS', shift=True, ctrl=True, alt=True) -kmi = km.keymap_items.new('collection.objects_add_active', 'G', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('collection.objects_remove_active', 'G', 'PRESS', shift=True, alt=True) -kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_object_specials') -kmi = km.keymap_items.new('object.data_transfer', 'T', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('object.subdivision_set', 'ZERO', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'level', 0) -kmi = km.keymap_items.new('object.subdivision_set', 'ONE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'level', 1) -kmi = km.keymap_items.new('object.subdivision_set', 'TWO', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'level', 2) -kmi = km.keymap_items.new('object.subdivision_set', 'THREE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'level', 3) -kmi = km.keymap_items.new('object.subdivision_set', 'FOUR', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'level', 4) -kmi = km.keymap_items.new('object.subdivision_set', 'FIVE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'level', 5) -kmi = km.keymap_items.new('object.move_to_collection', 'M', 'PRESS') - -# Map Paint Curve -km = kc.keymaps.new('Paint Curve', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('paintcurve.add_point_slide', 'ACTIONMOUSE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('paintcurve.select', 'SELECTMOUSE', 'PRESS') -kmi = km.keymap_items.new('paintcurve.select', 'SELECTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('paintcurve.slide', 'ACTIONMOUSE', 'PRESS') -kmi = km.keymap_items.new('paintcurve.slide', 'ACTIONMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'align', True) -kmi = km.keymap_items.new('paintcurve.select', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'toggle', True) -kmi = km.keymap_items.new('paintcurve.cursor', 'ACTIONMOUSE', 'PRESS') -kmi = km.keymap_items.new('paintcurve.delete_point', 'X', 'PRESS') -kmi = km.keymap_items.new('paintcurve.delete_point', 'DEL', 'PRESS') -kmi = km.keymap_items.new('paintcurve.draw', 'RET', 'PRESS') -kmi = km.keymap_items.new('paintcurve.draw', 'NUMPAD_ENTER', 'PRESS') -kmi = km.keymap_items.new('transform.translate', 'G', 'PRESS') -kmi = km.keymap_items.new('transform.translate', 'EVT_TWEAK_S', 'ANY') -kmi = km.keymap_items.new('transform.rotate', 'R', 'PRESS') -kmi = km.keymap_items.new('transform.resize', 'S', 'PRESS') - -# Map Curve -km = kc.keymaps.new('Curve', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'name', 'INFO_MT_edit_curve_add') -kmi = km.keymap_items.new('curve.handle_type_set', 'V', 'PRESS') -kmi = km.keymap_items.new('curve.vertex_add', 'ACTIONMOUSE', 'CLICK', ctrl=True) -kmi = km.keymap_items.new('curve.draw', 'ACTIONMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'wait_for_input', False) -kmi = km.keymap_items.new('curve.draw', 'PEN', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'wait_for_input', False) -kmi = km.keymap_items.new('curve.select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('curve.select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('curve.select_row', 'R', 'PRESS', shift=True) -kmi = km.keymap_items.new('curve.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('curve.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('curve.select_linked', 'L', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('curve.select_similar', 'G', 'PRESS', shift=True) -kmi = km.keymap_items.new('curve.select_linked_pick', 'L', 'PRESS') -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('curve.select_linked_pick', 'L', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'deselect', True) -kmi = km.keymap_items.new('curve.shortest_path_pick', 'SELECTMOUSE', 'CLICK', ctrl=True) -kmi = km.keymap_items.new('curve.separate', 'P', 'PRESS') -kmi = km.keymap_items.new('curve.split', 'Y', 'PRESS') -kmi = km.keymap_items.new('curve.extrude_move', 'E', 'PRESS') -kmi = km.keymap_items.new('curve.duplicate_move', 'D', 'PRESS', shift=True) -kmi = km.keymap_items.new('curve.make_segment', 'F', 'PRESS') -kmi = km.keymap_items.new('curve.cyclic_toggle', 'C', 'PRESS', alt=True) -kmi = km.keymap_items.new('wm.call_menu', 'X', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_curve_delete') -kmi = km.keymap_items.new('wm.call_menu', 'DEL', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_curve_delete') -kmi = km.keymap_items.new('curve.dissolve_verts', 'X', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('curve.dissolve_verts', 'DEL', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('curve.tilt_clear', 'T', 'PRESS', alt=True) -kmi = km.keymap_items.new('transform.tilt', 'T', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('transform.transform', 'S', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'mode', 'CURVE_SHRINKFATTEN') -kmi = km.keymap_items.new('curve.reveal', 'H', 'PRESS', alt=True) -kmi = km.keymap_items.new('curve.hide', 'H', 'PRESS') -kmi_props_setattr(kmi.properties, 'unselected', False) -kmi = km.keymap_items.new('curve.hide', 'H', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'unselected', True) -kmi = km.keymap_items.new('curve.normals_make_consistent', 'N', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('object.vertex_parent_set', 'P', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_curve_specials') -kmi = km.keymap_items.new('wm.call_menu', 'H', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_hook') -kmi = km.keymap_items.new('wm.context_cycle_enum', 'O', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit_falloff') -kmi_props_setattr(kmi.properties, 'wrap', True) -kmi = km.keymap_items.new('wm.context_toggle_enum', 'O', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit') -kmi_props_setattr(kmi.properties, 'value_1', 'DISABLED') -kmi_props_setattr(kmi.properties, 'value_2', 'ENABLED') -kmi = km.keymap_items.new('wm.context_toggle_enum', 'O', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit') -kmi_props_setattr(kmi.properties, 'value_1', 'DISABLED') -kmi_props_setattr(kmi.properties, 'value_2', 'CONNECTED') - -# Map Image Paint -km = kc.keymaps.new('Image Paint', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('paint.image_paint', 'LEFTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'NORMAL') -kmi = km.keymap_items.new('paint.image_paint', 'LEFTMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'mode', 'INVERT') -kmi = km.keymap_items.new('paint.brush_colors_flip', 'X', 'PRESS') -kmi = km.keymap_items.new('paint.grab_clone', 'RIGHTMOUSE', 'PRESS') -kmi = km.keymap_items.new('paint.sample_color', 'S', 'PRESS') -kmi = km.keymap_items.new('brush.active_index_set', 'ONE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 0) -kmi = km.keymap_items.new('brush.active_index_set', 'TWO', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 1) -kmi = km.keymap_items.new('brush.active_index_set', 'THREE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 2) -kmi = km.keymap_items.new('brush.active_index_set', 'FOUR', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 3) -kmi = km.keymap_items.new('brush.active_index_set', 'FIVE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 4) -kmi = km.keymap_items.new('brush.active_index_set', 'SIX', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 5) -kmi = km.keymap_items.new('brush.active_index_set', 'SEVEN', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 6) -kmi = km.keymap_items.new('brush.active_index_set', 'EIGHT', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 7) -kmi = km.keymap_items.new('brush.active_index_set', 'NINE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 8) -kmi = km.keymap_items.new('brush.active_index_set', 'ZERO', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 9) -kmi = km.keymap_items.new('brush.active_index_set', 'ONE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 10) -kmi = km.keymap_items.new('brush.active_index_set', 'TWO', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 11) -kmi = km.keymap_items.new('brush.active_index_set', 'THREE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 12) -kmi = km.keymap_items.new('brush.active_index_set', 'FOUR', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 13) -kmi = km.keymap_items.new('brush.active_index_set', 'FIVE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 14) -kmi = km.keymap_items.new('brush.active_index_set', 'SIX', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 15) -kmi = km.keymap_items.new('brush.active_index_set', 'SEVEN', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 16) -kmi = km.keymap_items.new('brush.active_index_set', 'EIGHT', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 17) -kmi = km.keymap_items.new('brush.active_index_set', 'NINE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 18) -kmi = km.keymap_items.new('brush.active_index_set', 'ZERO', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'image_paint') -kmi_props_setattr(kmi.properties, 'index', 19) -kmi = km.keymap_items.new('brush.scale_size', 'LEFT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'scalar', 0.9) -kmi = km.keymap_items.new('brush.scale_size', 'RIGHT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'scalar', 1.0 / 0.9) -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.image_paint.brush.size') -kmi_props_setattr(kmi.properties, 'data_path_secondary', 'tool_settings.unified_paint_settings.size') -kmi_props_setattr(kmi.properties, 'use_secondary', 'tool_settings.unified_paint_settings.use_unified_size') -kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.image_paint.brush.mask_texture_slot.angle') -kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.image_paint.brush.cursor_color_add') -kmi_props_setattr(kmi.properties, 'fill_color_path', 'tool_settings.image_paint.brush.color') -kmi_props_setattr(kmi.properties, 'fill_color_override_path', 'tool_settings.unified_paint_settings.color') -kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', 'tool_settings.unified_paint_settings.use_unified_color') -kmi_props_setattr(kmi.properties, 'zoom_path', 'space_data.zoom') -kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.image_paint.brush') -kmi_props_setattr(kmi.properties, 'secondary_tex', True) -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.image_paint.brush.strength') -kmi_props_setattr(kmi.properties, 'data_path_secondary', 'tool_settings.unified_paint_settings.strength') -kmi_props_setattr(kmi.properties, 'use_secondary', 'tool_settings.unified_paint_settings.use_unified_strength') -kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.image_paint.brush.mask_texture_slot.angle') -kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.image_paint.brush.cursor_color_add') -kmi_props_setattr(kmi.properties, 'fill_color_path', 'tool_settings.image_paint.brush.color') -kmi_props_setattr(kmi.properties, 'fill_color_override_path', 'tool_settings.unified_paint_settings.color') -kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', 'tool_settings.unified_paint_settings.use_unified_color') -kmi_props_setattr(kmi.properties, 'zoom_path', '') -kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.image_paint.brush') -kmi_props_setattr(kmi.properties, 'secondary_tex', True) -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.image_paint.brush.texture_slot.angle') -kmi_props_setattr(kmi.properties, 'data_path_secondary', '') -kmi_props_setattr(kmi.properties, 'use_secondary', '') -kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.image_paint.brush.texture_slot.angle') -kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.image_paint.brush.cursor_color_add') -kmi_props_setattr(kmi.properties, 'fill_color_path', 'tool_settings.image_paint.brush.color') -kmi_props_setattr(kmi.properties, 'fill_color_override_path', 'tool_settings.unified_paint_settings.color') -kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', 'tool_settings.unified_paint_settings.use_unified_color') -kmi_props_setattr(kmi.properties, 'zoom_path', '') -kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.image_paint.brush') -kmi_props_setattr(kmi.properties, 'secondary_tex', False) -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.image_paint.brush.mask_texture_slot.angle') -kmi_props_setattr(kmi.properties, 'data_path_secondary', '') -kmi_props_setattr(kmi.properties, 'use_secondary', '') -kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.image_paint.brush.mask_texture_slot.angle') -kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.image_paint.brush.cursor_color_add') -kmi_props_setattr(kmi.properties, 'fill_color_path', 'tool_settings.image_paint.brush.color') -kmi_props_setattr(kmi.properties, 'fill_color_override_path', 'tool_settings.unified_paint_settings.color') -kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', 'tool_settings.unified_paint_settings.use_unified_color') -kmi_props_setattr(kmi.properties, 'zoom_path', '') -kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.image_paint.brush') -kmi_props_setattr(kmi.properties, 'secondary_tex', True) -kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'TRANSLATION') -kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'SCALE') -kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'mode', 'ROTATION') -kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'mode', 'TRANSLATION') -kmi_props_setattr(kmi.properties, 'texmode', 'SECONDARY') -kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'mode', 'SCALE') -kmi_props_setattr(kmi.properties, 'texmode', 'SECONDARY') -kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'mode', 'ROTATION') -kmi_props_setattr(kmi.properties, 'texmode', 'SECONDARY') -kmi = km.keymap_items.new('wm.context_toggle', 'M', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'image_paint_object.data.use_paint_mask') -kmi = km.keymap_items.new('wm.context_toggle', 'S', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.image_paint.brush.use_smooth_stroke') -kmi = km.keymap_items.new('wm.call_menu', 'R', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_angle_control') -kmi = km.keymap_items.new('wm.context_menu_enum', 'E', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.image_paint.brush.stroke_method') - -# Map Vertex Paint -km = kc.keymaps.new('Vertex Paint', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('paint.vertex_paint', 'LEFTMOUSE', 'PRESS') -kmi = km.keymap_items.new('paint.brush_colors_flip', 'X', 'PRESS') -kmi = km.keymap_items.new('paint.sample_color', 'S', 'PRESS') -kmi = km.keymap_items.new('paint.vertex_color_set', 'K', 'PRESS', shift=True) -kmi = km.keymap_items.new('brush.active_index_set', 'ONE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 0) -kmi = km.keymap_items.new('brush.active_index_set', 'TWO', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 1) -kmi = km.keymap_items.new('brush.active_index_set', 'THREE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 2) -kmi = km.keymap_items.new('brush.active_index_set', 'FOUR', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 3) -kmi = km.keymap_items.new('brush.active_index_set', 'FIVE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 4) -kmi = km.keymap_items.new('brush.active_index_set', 'SIX', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 5) -kmi = km.keymap_items.new('brush.active_index_set', 'SEVEN', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 6) -kmi = km.keymap_items.new('brush.active_index_set', 'EIGHT', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 7) -kmi = km.keymap_items.new('brush.active_index_set', 'NINE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 8) -kmi = km.keymap_items.new('brush.active_index_set', 'ZERO', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 9) -kmi = km.keymap_items.new('brush.active_index_set', 'ONE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 10) -kmi = km.keymap_items.new('brush.active_index_set', 'TWO', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 11) -kmi = km.keymap_items.new('brush.active_index_set', 'THREE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 12) -kmi = km.keymap_items.new('brush.active_index_set', 'FOUR', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 13) -kmi = km.keymap_items.new('brush.active_index_set', 'FIVE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 14) -kmi = km.keymap_items.new('brush.active_index_set', 'SIX', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 15) -kmi = km.keymap_items.new('brush.active_index_set', 'SEVEN', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 16) -kmi = km.keymap_items.new('brush.active_index_set', 'EIGHT', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 17) -kmi = km.keymap_items.new('brush.active_index_set', 'NINE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 18) -kmi = km.keymap_items.new('brush.active_index_set', 'ZERO', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'vertex_paint') -kmi_props_setattr(kmi.properties, 'index', 19) -kmi = km.keymap_items.new('brush.scale_size', 'LEFT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'scalar', 0.9) -kmi = km.keymap_items.new('brush.scale_size', 'RIGHT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'scalar', 1.0 / 0.9) -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.vertex_paint.brush.size') -kmi_props_setattr(kmi.properties, 'data_path_secondary', 'tool_settings.unified_paint_settings.size') -kmi_props_setattr(kmi.properties, 'use_secondary', 'tool_settings.unified_paint_settings.use_unified_size') -kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.vertex_paint.brush.texture_slot.angle') -kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.vertex_paint.brush.cursor_color_add') -kmi_props_setattr(kmi.properties, 'fill_color_path', 'tool_settings.vertex_paint.brush.color') -kmi_props_setattr(kmi.properties, 'fill_color_override_path', 'tool_settings.unified_paint_settings.color') -kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', 'tool_settings.unified_paint_settings.use_unified_color') -kmi_props_setattr(kmi.properties, 'zoom_path', '') -kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.vertex_paint.brush') -kmi_props_setattr(kmi.properties, 'secondary_tex', False) -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.vertex_paint.brush.strength') -kmi_props_setattr(kmi.properties, 'data_path_secondary', 'tool_settings.unified_paint_settings.strength') -kmi_props_setattr(kmi.properties, 'use_secondary', 'tool_settings.unified_paint_settings.use_unified_strength') -kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.vertex_paint.brush.texture_slot.angle') -kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.vertex_paint.brush.cursor_color_add') -kmi_props_setattr(kmi.properties, 'fill_color_path', 'tool_settings.vertex_paint.brush.color') -kmi_props_setattr(kmi.properties, 'fill_color_override_path', 'tool_settings.unified_paint_settings.color') -kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', 'tool_settings.unified_paint_settings.use_unified_color') -kmi_props_setattr(kmi.properties, 'zoom_path', '') -kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.vertex_paint.brush') -kmi_props_setattr(kmi.properties, 'secondary_tex', False) -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.vertex_paint.brush.texture_slot.angle') -kmi_props_setattr(kmi.properties, 'data_path_secondary', '') -kmi_props_setattr(kmi.properties, 'use_secondary', '') -kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.vertex_paint.brush.texture_slot.angle') -kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.vertex_paint.brush.cursor_color_add') -kmi_props_setattr(kmi.properties, 'fill_color_path', 'tool_settings.vertex_paint.brush.color') -kmi_props_setattr(kmi.properties, 'fill_color_override_path', 'tool_settings.unified_paint_settings.color') -kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', 'tool_settings.unified_paint_settings.use_unified_color') -kmi_props_setattr(kmi.properties, 'zoom_path', '') -kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.vertex_paint.brush') -kmi_props_setattr(kmi.properties, 'secondary_tex', False) -kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'TRANSLATION') -kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'SCALE') -kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'mode', 'ROTATION') -kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'mode', 'TRANSLATION') -kmi_props_setattr(kmi.properties, 'texmode', 'SECONDARY') -kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'mode', 'SCALE') -kmi_props_setattr(kmi.properties, 'texmode', 'SECONDARY') -kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'mode', 'ROTATION') -kmi_props_setattr(kmi.properties, 'texmode', 'SECONDARY') -kmi = km.keymap_items.new('wm.context_toggle', 'M', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'vertex_paint_object.data.use_paint_mask') -kmi = km.keymap_items.new('wm.context_toggle', 'S', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.vertex_paint.brush.use_smooth_stroke') -kmi = km.keymap_items.new('wm.call_menu', 'R', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_angle_control') -kmi = km.keymap_items.new('wm.context_menu_enum', 'E', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.vertex_paint.brush.stroke_method') - -# Map Weight Paint -km = kc.keymaps.new('Weight Paint', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('paint.weight_paint', 'LEFTMOUSE', 'PRESS') -kmi = km.keymap_items.new('paint.weight_sample', 'ACTIONMOUSE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('paint.weight_sample_group', 'ACTIONMOUSE', 'PRESS', shift=True) -kmi = km.keymap_items.new('paint.weight_gradient', 'LEFTMOUSE', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'type', 'LINEAR') -kmi = km.keymap_items.new('paint.weight_gradient', 'LEFTMOUSE', 'PRESS', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'type', 'RADIAL') -kmi = km.keymap_items.new('paint.weight_set', 'K', 'PRESS', shift=True) -kmi = km.keymap_items.new('brush.active_index_set', 'ONE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 0) -kmi = km.keymap_items.new('brush.active_index_set', 'TWO', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 1) -kmi = km.keymap_items.new('brush.active_index_set', 'THREE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 2) -kmi = km.keymap_items.new('brush.active_index_set', 'FOUR', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 3) -kmi = km.keymap_items.new('brush.active_index_set', 'FIVE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 4) -kmi = km.keymap_items.new('brush.active_index_set', 'SIX', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 5) -kmi = km.keymap_items.new('brush.active_index_set', 'SEVEN', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 6) -kmi = km.keymap_items.new('brush.active_index_set', 'EIGHT', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 7) -kmi = km.keymap_items.new('brush.active_index_set', 'NINE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 8) -kmi = km.keymap_items.new('brush.active_index_set', 'ZERO', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 9) -kmi = km.keymap_items.new('brush.active_index_set', 'ONE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 10) -kmi = km.keymap_items.new('brush.active_index_set', 'TWO', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 11) -kmi = km.keymap_items.new('brush.active_index_set', 'THREE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 12) -kmi = km.keymap_items.new('brush.active_index_set', 'FOUR', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 13) -kmi = km.keymap_items.new('brush.active_index_set', 'FIVE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 14) -kmi = km.keymap_items.new('brush.active_index_set', 'SIX', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 15) -kmi = km.keymap_items.new('brush.active_index_set', 'SEVEN', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 16) -kmi = km.keymap_items.new('brush.active_index_set', 'EIGHT', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 17) -kmi = km.keymap_items.new('brush.active_index_set', 'NINE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 18) -kmi = km.keymap_items.new('brush.active_index_set', 'ZERO', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'weight_paint') -kmi_props_setattr(kmi.properties, 'index', 19) -kmi = km.keymap_items.new('brush.scale_size', 'LEFT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'scalar', 0.9) -kmi = km.keymap_items.new('brush.scale_size', 'RIGHT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'scalar', 1.0 / 0.9) -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.weight_paint.brush.size') -kmi_props_setattr(kmi.properties, 'data_path_secondary', 'tool_settings.unified_paint_settings.size') -kmi_props_setattr(kmi.properties, 'use_secondary', 'tool_settings.unified_paint_settings.use_unified_size') -kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.weight_paint.brush.texture_slot.angle') -kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.weight_paint.brush.cursor_color_add') -kmi_props_setattr(kmi.properties, 'fill_color_path', '') -kmi_props_setattr(kmi.properties, 'fill_color_override_path', '') -kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', '') -kmi_props_setattr(kmi.properties, 'zoom_path', '') -kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.weight_paint.brush') -kmi_props_setattr(kmi.properties, 'secondary_tex', False) -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.weight_paint.brush.strength') -kmi_props_setattr(kmi.properties, 'data_path_secondary', 'tool_settings.unified_paint_settings.strength') -kmi_props_setattr(kmi.properties, 'use_secondary', 'tool_settings.unified_paint_settings.use_unified_strength') -kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.weight_paint.brush.texture_slot.angle') -kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.weight_paint.brush.cursor_color_add') -kmi_props_setattr(kmi.properties, 'fill_color_path', '') -kmi_props_setattr(kmi.properties, 'fill_color_override_path', '') -kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', '') -kmi_props_setattr(kmi.properties, 'zoom_path', '') -kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.weight_paint.brush') -kmi_props_setattr(kmi.properties, 'secondary_tex', False) -kmi = km.keymap_items.new('wm.radial_control', 'W', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.weight_paint.brush.weight') -kmi_props_setattr(kmi.properties, 'data_path_secondary', 'tool_settings.unified_paint_settings.weight') -kmi_props_setattr(kmi.properties, 'use_secondary', 'tool_settings.unified_paint_settings.use_unified_weight') -kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.weight_paint.brush.texture_slot.angle') -kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.weight_paint.brush.cursor_color_add') -kmi_props_setattr(kmi.properties, 'fill_color_path', '') -kmi_props_setattr(kmi.properties, 'fill_color_override_path', '') -kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', '') -kmi_props_setattr(kmi.properties, 'zoom_path', '') -kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.weight_paint.brush') -kmi_props_setattr(kmi.properties, 'secondary_tex', False) -kmi = km.keymap_items.new('wm.context_menu_enum', 'E', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.vertex_paint.brush.stroke_method') -kmi = km.keymap_items.new('wm.context_toggle', 'M', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'weight_paint_object.data.use_paint_mask') -kmi = km.keymap_items.new('wm.context_toggle', 'V', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'weight_paint_object.data.use_paint_mask_vertex') -kmi = km.keymap_items.new('wm.context_toggle', 'S', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.weight_paint.brush.use_smooth_stroke') - -# Map Sculpt -km = kc.keymaps.new('Sculpt', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('sculpt.brush_stroke', 'LEFTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'NORMAL') -kmi = km.keymap_items.new('sculpt.brush_stroke', 'LEFTMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'mode', 'INVERT') -kmi = km.keymap_items.new('sculpt.brush_stroke', 'LEFTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'SMOOTH') -kmi = km.keymap_items.new('paint.hide_show', 'H', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'action', 'SHOW') -kmi_props_setattr(kmi.properties, 'area', 'INSIDE') -kmi = km.keymap_items.new('paint.hide_show', 'H', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'HIDE') -kmi_props_setattr(kmi.properties, 'area', 'INSIDE') -kmi = km.keymap_items.new('paint.hide_show', 'H', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'action', 'SHOW') -kmi_props_setattr(kmi.properties, 'area', 'ALL') -kmi = km.keymap_items.new('object.subdivision_set', 'ZERO', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'level', 0) -kmi = km.keymap_items.new('object.subdivision_set', 'ONE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'level', 1) -kmi = km.keymap_items.new('object.subdivision_set', 'TWO', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'level', 2) -kmi = km.keymap_items.new('object.subdivision_set', 'THREE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'level', 3) -kmi = km.keymap_items.new('object.subdivision_set', 'FOUR', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'level', 4) -kmi = km.keymap_items.new('object.subdivision_set', 'FIVE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'level', 5) -kmi = km.keymap_items.new('paint.mask_flood_fill', 'M', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'mode', 'VALUE') -kmi_props_setattr(kmi.properties, 'value', 0.0) -kmi = km.keymap_items.new('paint.mask_flood_fill', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'mode', 'INVERT') -kmi = km.keymap_items.new('paint.mask_lasso_gesture', 'LEFTMOUSE', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('wm.context_toggle', 'M', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'scene.tool_settings.sculpt.show_mask') -kmi = km.keymap_items.new('sculpt.dynamic_topology_toggle', 'D', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('sculpt.set_detail_size', 'D', 'PRESS', shift=True) -kmi = km.keymap_items.new('object.subdivision_set', 'PAGE_UP', 'PRESS') -kmi_props_setattr(kmi.properties, 'level', 1) -kmi_props_setattr(kmi.properties, 'relative', True) -kmi = km.keymap_items.new('object.subdivision_set', 'PAGE_DOWN', 'PRESS') -kmi_props_setattr(kmi.properties, 'level', -1) -kmi_props_setattr(kmi.properties, 'relative', True) -kmi = km.keymap_items.new('brush.active_index_set', 'ONE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 0) -kmi = km.keymap_items.new('brush.active_index_set', 'TWO', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 1) -kmi = km.keymap_items.new('brush.active_index_set', 'THREE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 2) -kmi = km.keymap_items.new('brush.active_index_set', 'FOUR', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 3) -kmi = km.keymap_items.new('brush.active_index_set', 'FIVE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 4) -kmi = km.keymap_items.new('brush.active_index_set', 'SIX', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 5) -kmi = km.keymap_items.new('brush.active_index_set', 'SEVEN', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 6) -kmi = km.keymap_items.new('brush.active_index_set', 'EIGHT', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 7) -kmi = km.keymap_items.new('brush.active_index_set', 'NINE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 8) -kmi = km.keymap_items.new('brush.active_index_set', 'ZERO', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 9) -kmi = km.keymap_items.new('brush.active_index_set', 'ONE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 10) -kmi = km.keymap_items.new('brush.active_index_set', 'TWO', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 11) -kmi = km.keymap_items.new('brush.active_index_set', 'THREE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 12) -kmi = km.keymap_items.new('brush.active_index_set', 'FOUR', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 13) -kmi = km.keymap_items.new('brush.active_index_set', 'FIVE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 14) -kmi = km.keymap_items.new('brush.active_index_set', 'SIX', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 15) -kmi = km.keymap_items.new('brush.active_index_set', 'SEVEN', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 16) -kmi = km.keymap_items.new('brush.active_index_set', 'EIGHT', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 17) -kmi = km.keymap_items.new('brush.active_index_set', 'NINE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 18) -kmi = km.keymap_items.new('brush.active_index_set', 'ZERO', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'sculpt') -kmi_props_setattr(kmi.properties, 'index', 19) -kmi = km.keymap_items.new('brush.scale_size', 'LEFT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'scalar', 0.9) -kmi = km.keymap_items.new('brush.scale_size', 'RIGHT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'scalar', 1.0 / 0.9) -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.sculpt.brush.size') -kmi_props_setattr(kmi.properties, 'data_path_secondary', 'tool_settings.unified_paint_settings.size') -kmi_props_setattr(kmi.properties, 'use_secondary', 'tool_settings.unified_paint_settings.use_unified_size') -kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.sculpt.brush.texture_slot.angle') -kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.sculpt.brush.cursor_color_add') -kmi_props_setattr(kmi.properties, 'fill_color_path', '') -kmi_props_setattr(kmi.properties, 'fill_color_override_path', '') -kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', '') -kmi_props_setattr(kmi.properties, 'zoom_path', '') -kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.sculpt.brush') -kmi_props_setattr(kmi.properties, 'secondary_tex', False) -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.sculpt.brush.strength') -kmi_props_setattr(kmi.properties, 'data_path_secondary', 'tool_settings.unified_paint_settings.strength') -kmi_props_setattr(kmi.properties, 'use_secondary', 'tool_settings.unified_paint_settings.use_unified_strength') -kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.sculpt.brush.texture_slot.angle') -kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.sculpt.brush.cursor_color_add') -kmi_props_setattr(kmi.properties, 'fill_color_path', '') -kmi_props_setattr(kmi.properties, 'fill_color_override_path', '') -kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', '') -kmi_props_setattr(kmi.properties, 'zoom_path', '') -kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.sculpt.brush') -kmi_props_setattr(kmi.properties, 'secondary_tex', False) -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.sculpt.brush.texture_slot.angle') -kmi_props_setattr(kmi.properties, 'data_path_secondary', '') -kmi_props_setattr(kmi.properties, 'use_secondary', '') -kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.sculpt.brush.texture_slot.angle') -kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.sculpt.brush.cursor_color_add') -kmi_props_setattr(kmi.properties, 'fill_color_path', '') -kmi_props_setattr(kmi.properties, 'fill_color_override_path', '') -kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', '') -kmi_props_setattr(kmi.properties, 'zoom_path', '') -kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.sculpt.brush') -kmi_props_setattr(kmi.properties, 'secondary_tex', False) -kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'TRANSLATION') -kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'SCALE') -kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'mode', 'ROTATION') -kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'mode', 'TRANSLATION') -kmi_props_setattr(kmi.properties, 'texmode', 'SECONDARY') -kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'mode', 'SCALE') -kmi_props_setattr(kmi.properties, 'texmode', 'SECONDARY') -kmi = km.keymap_items.new('brush.stencil_control', 'RIGHTMOUSE', 'PRESS', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'mode', 'ROTATION') -kmi_props_setattr(kmi.properties, 'texmode', 'SECONDARY') -kmi = km.keymap_items.new('paint.brush_select', 'X', 'PRESS') -kmi_props_setattr(kmi.properties, 'paint_mode', 'SCULPT') -kmi_props_setattr(kmi.properties, 'sculpt_tool', 'DRAW') -kmi = km.keymap_items.new('paint.brush_select', 'S', 'PRESS') -kmi_props_setattr(kmi.properties, 'paint_mode', 'SCULPT') -kmi_props_setattr(kmi.properties, 'sculpt_tool', 'SMOOTH') -kmi = km.keymap_items.new('paint.brush_select', 'P', 'PRESS') -kmi_props_setattr(kmi.properties, 'paint_mode', 'SCULPT') -kmi_props_setattr(kmi.properties, 'sculpt_tool', 'PINCH') -kmi = km.keymap_items.new('paint.brush_select', 'I', 'PRESS') -kmi_props_setattr(kmi.properties, 'paint_mode', 'SCULPT') -kmi_props_setattr(kmi.properties, 'sculpt_tool', 'INFLATE') -kmi = km.keymap_items.new('paint.brush_select', 'G', 'PRESS') -kmi_props_setattr(kmi.properties, 'paint_mode', 'SCULPT') -kmi_props_setattr(kmi.properties, 'sculpt_tool', 'GRAB') -kmi = km.keymap_items.new('paint.brush_select', 'L', 'PRESS') -kmi_props_setattr(kmi.properties, 'paint_mode', 'SCULPT') -kmi_props_setattr(kmi.properties, 'sculpt_tool', 'LAYER') -kmi = km.keymap_items.new('paint.brush_select', 'T', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'paint_mode', 'SCULPT') -kmi_props_setattr(kmi.properties, 'sculpt_tool', 'FLATTEN') -kmi = km.keymap_items.new('paint.brush_select', 'C', 'PRESS') -kmi_props_setattr(kmi.properties, 'paint_mode', 'SCULPT') -kmi_props_setattr(kmi.properties, 'sculpt_tool', 'CLAY') -kmi = km.keymap_items.new('paint.brush_select', 'C', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'paint_mode', 'SCULPT') -kmi_props_setattr(kmi.properties, 'sculpt_tool', 'CREASE') -kmi = km.keymap_items.new('paint.brush_select', 'K', 'PRESS') -kmi_props_setattr(kmi.properties, 'paint_mode', 'SCULPT') -kmi_props_setattr(kmi.properties, 'sculpt_tool', 'SNAKE_HOOK') -kmi = km.keymap_items.new('paint.brush_select', 'M', 'PRESS') -kmi_props_setattr(kmi.properties, 'paint_mode', 'SCULPT') -kmi_props_setattr(kmi.properties, 'sculpt_tool', 'MASK') -kmi_props_setattr(kmi.properties, 'toggle', True) -kmi_props_setattr(kmi.properties, 'create_missing', True) -kmi = km.keymap_items.new('wm.context_menu_enum', 'E', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.sculpt.brush.stroke_method') -kmi = km.keymap_items.new('wm.context_toggle', 'S', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.sculpt.brush.use_smooth_stroke') -kmi = km.keymap_items.new('wm.call_menu', 'R', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_angle_control') - -# Map Mesh -km = kc.keymaps.new('Mesh', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('mesh.loopcut_slide', 'R', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('mesh.offset_edge_loops_slide', 'R', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('mesh.inset', 'I', 'PRESS') -kmi = km.keymap_items.new('mesh.poke', 'P', 'PRESS', alt=True) -kmi = km.keymap_items.new('mesh.bevel', 'B', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'vertex_only', False) -kmi = km.keymap_items.new('mesh.bevel', 'B', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'vertex_only', True) -kmi = km.keymap_items.new('mesh.loop_select', 'SELECTMOUSE', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi_props_setattr(kmi.properties, 'toggle', False) -kmi = km.keymap_items.new('mesh.loop_select', 'SELECTMOUSE', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi_props_setattr(kmi.properties, 'toggle', True) -kmi = km.keymap_items.new('mesh.edgering_select', 'SELECTMOUSE', 'PRESS', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi_props_setattr(kmi.properties, 'toggle', False) -kmi = km.keymap_items.new('mesh.edgering_select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi_props_setattr(kmi.properties, 'toggle', True) -kmi = km.keymap_items.new('mesh.shortest_path_pick', 'SELECTMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'use_fill', False) -kmi = km.keymap_items.new('mesh.shortest_path_pick', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'use_fill', True) -kmi = km.keymap_items.new('mesh.select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('mesh.select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('mesh.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('mesh.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('mesh.select_next_item', 'NUMPAD_PLUS', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('mesh.select_prev_item', 'NUMPAD_MINUS', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('mesh.select_non_manifold', 'M', 'PRESS', shift=True, ctrl=True, alt=True) -kmi = km.keymap_items.new('mesh.select_linked', 'L', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('mesh.select_linked_pick', 'L', 'PRESS') -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('mesh.select_linked_pick', 'L', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'deselect', True) -kmi = km.keymap_items.new('mesh.faces_select_linked_flat', 'F', 'PRESS', shift=True, ctrl=True, alt=True) -kmi = km.keymap_items.new('wm.call_menu', 'G', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_select_similar') -kmi = km.keymap_items.new('wm.call_menu', 'TAB', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_select_mode') -kmi = km.keymap_items.new('mesh.hide', 'H', 'PRESS') -kmi_props_setattr(kmi.properties, 'unselected', False) -kmi = km.keymap_items.new('mesh.hide', 'H', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'unselected', True) -kmi = km.keymap_items.new('mesh.reveal', 'H', 'PRESS', alt=True) -kmi = km.keymap_items.new('mesh.normals_make_consistent', 'N', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'inside', False) -kmi = km.keymap_items.new('mesh.normals_make_consistent', 'N', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'inside', True) -kmi = km.keymap_items.new('view3d.edit_mesh_extrude_move_normal', 'E', 'PRESS') -kmi = km.keymap_items.new('wm.call_menu', 'E', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_extrude') -kmi = km.keymap_items.new('transform.edge_crease', 'E', 'PRESS', shift=True) -kmi = km.keymap_items.new('mesh.spin', 'R', 'PRESS', alt=True) -kmi = km.keymap_items.new('mesh.fill', 'F', 'PRESS', alt=True) -kmi = km.keymap_items.new('mesh.beautify_fill', 'F', 'PRESS', shift=True, alt=True) -kmi = km.keymap_items.new('mesh.quads_convert_to_tris', 'T', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'quad_method', 'BEAUTY') -kmi_props_setattr(kmi.properties, 'ngon_method', 'BEAUTY') -kmi = km.keymap_items.new('mesh.quads_convert_to_tris', 'T', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'quad_method', 'FIXED') -kmi_props_setattr(kmi.properties, 'ngon_method', 'CLIP') -kmi = km.keymap_items.new('mesh.tris_convert_to_quads', 'J', 'PRESS', alt=True) -kmi = km.keymap_items.new('mesh.rip_move', 'V', 'PRESS') -kmi_props_setattr(kmi.properties.MESH_OT_rip, 'use_fill', False) -kmi = km.keymap_items.new('mesh.rip_move', 'V', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties.MESH_OT_rip, 'use_fill', True) -kmi = km.keymap_items.new('mesh.rip_edge_move', 'D', 'PRESS', alt=True) -kmi = km.keymap_items.new('mesh.merge', 'M', 'PRESS', alt=True) -kmi = km.keymap_items.new('transform.shrink_fatten', 'S', 'PRESS', alt=True) -kmi = km.keymap_items.new('mesh.edge_face_add', 'F', 'PRESS') -kmi = km.keymap_items.new('mesh.duplicate_move', 'D', 'PRESS', shift=True) -kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'name', 'INFO_MT_mesh_add') -kmi = km.keymap_items.new('mesh.separate', 'P', 'PRESS') -kmi = km.keymap_items.new('mesh.split', 'Y', 'PRESS') -kmi = km.keymap_items.new('mesh.vert_connect_path', 'J', 'PRESS') -kmi = km.keymap_items.new('transform.vert_slide', 'V', 'PRESS', shift=True) -kmi = km.keymap_items.new('mesh.dupli_extrude_cursor', 'ACTIONMOUSE', 'CLICK', ctrl=True) -kmi_props_setattr(kmi.properties, 'rotate_source', True) -kmi = km.keymap_items.new('mesh.dupli_extrude_cursor', 'ACTIONMOUSE', 'CLICK', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'rotate_source', False) -kmi = km.keymap_items.new('wm.call_menu', 'X', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_delete') -kmi = km.keymap_items.new('wm.call_menu', 'DEL', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_delete') -kmi = km.keymap_items.new('mesh.dissolve_mode', 'X', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('mesh.dissolve_mode', 'DEL', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('mesh.knife_tool', 'K', 'PRESS') -kmi_props_setattr(kmi.properties, 'use_occlude_geometry', True) -kmi_props_setattr(kmi.properties, 'only_selected', False) -kmi = km.keymap_items.new('mesh.knife_tool', 'K', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'use_occlude_geometry', False) -kmi_props_setattr(kmi.properties, 'only_selected', True) -kmi = km.keymap_items.new('object.vertex_parent_set', 'P', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_specials') -kmi = km.keymap_items.new('wm.call_menu', 'F', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_faces') -kmi = km.keymap_items.new('wm.call_menu', 'E', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_edges') -kmi = km.keymap_items.new('wm.call_menu', 'V', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_mesh_vertices') -kmi = km.keymap_items.new('wm.call_menu', 'H', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_hook') -kmi = km.keymap_items.new('wm.call_menu', 'U', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_uv_map') -kmi = km.keymap_items.new('wm.call_menu', 'G', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_vertex_group') -kmi = km.keymap_items.new('object.subdivision_set', 'ZERO', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'level', 0) -kmi = km.keymap_items.new('object.subdivision_set', 'ONE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'level', 1) -kmi = km.keymap_items.new('object.subdivision_set', 'TWO', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'level', 2) -kmi = km.keymap_items.new('object.subdivision_set', 'THREE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'level', 3) -kmi = km.keymap_items.new('object.subdivision_set', 'FOUR', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'level', 4) -kmi = km.keymap_items.new('object.subdivision_set', 'FIVE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'level', 5) -kmi = km.keymap_items.new('wm.context_cycle_enum', 'O', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit_falloff') -kmi_props_setattr(kmi.properties, 'wrap', True) -kmi = km.keymap_items.new('wm.context_toggle_enum', 'O', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit') -kmi_props_setattr(kmi.properties, 'value_1', 'DISABLED') -kmi_props_setattr(kmi.properties, 'value_2', 'ENABLED') -kmi = km.keymap_items.new('wm.context_toggle_enum', 'O', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit') -kmi_props_setattr(kmi.properties, 'value_1', 'DISABLED') -kmi_props_setattr(kmi.properties, 'value_2', 'CONNECTED') - -# Map Armature -km = kc.keymaps.new('Armature', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('armature.hide', 'H', 'PRESS') -kmi_props_setattr(kmi.properties, 'unselected', False) -kmi = km.keymap_items.new('armature.hide', 'H', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'unselected', True) -kmi = km.keymap_items.new('armature.reveal', 'H', 'PRESS', alt=True) -kmi = km.keymap_items.new('armature.align', 'A', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('armature.calculate_roll', 'N', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('armature.roll_clear', 'R', 'PRESS', alt=True) -kmi = km.keymap_items.new('armature.switch_direction', 'F', 'PRESS', alt=True) -kmi = km.keymap_items.new('armature.bone_primitive_add', 'A', 'PRESS', shift=True) -kmi = km.keymap_items.new('armature.parent_set', 'P', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('armature.parent_clear', 'P', 'PRESS', alt=True) -kmi = km.keymap_items.new('armature.select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('armature.select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('armature.select_mirror', 'M', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('armature.select_hierarchy', 'LEFT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'direction', 'PARENT') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('armature.select_hierarchy', 'LEFT_BRACKET', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'direction', 'PARENT') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('armature.select_hierarchy', 'RIGHT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'direction', 'CHILD') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('armature.select_hierarchy', 'RIGHT_BRACKET', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'direction', 'CHILD') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('armature.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('armature.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('armature.select_similar', 'G', 'PRESS', shift=True) -kmi = km.keymap_items.new('armature.select_linked', 'L', 'PRESS') -kmi = km.keymap_items.new('armature.shortest_path_pick', 'SELECTMOUSE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('wm.call_menu', 'X', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_armature_delete') -kmi = km.keymap_items.new('wm.call_menu', 'DEL', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_edit_armature_delete') -kmi = km.keymap_items.new('armature.dissolve', 'X', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('armature.duplicate_move', 'D', 'PRESS', shift=True) -kmi = km.keymap_items.new('armature.extrude_move', 'E', 'PRESS') -kmi = km.keymap_items.new('armature.extrude_forked', 'E', 'PRESS', shift=True) -kmi = km.keymap_items.new('armature.click_extrude', 'ACTIONMOUSE', 'CLICK', ctrl=True) -kmi = km.keymap_items.new('armature.fill', 'F', 'PRESS') -kmi = km.keymap_items.new('armature.merge', 'M', 'PRESS', alt=True) -kmi = km.keymap_items.new('armature.split', 'Y', 'PRESS') -kmi = km.keymap_items.new('armature.separate', 'P', 'PRESS') -kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_bone_options_toggle') -kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_bone_options_enable') -kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_bone_options_disable') -kmi = km.keymap_items.new('armature.layers_show_all', 'ACCENT_GRAVE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('armature.armature_layers', 'M', 'PRESS', shift=True) -kmi = km.keymap_items.new('armature.bone_layers', 'M', 'PRESS') -kmi = km.keymap_items.new('transform.transform', 'S', 'PRESS', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'mode', 'BONE_SIZE') -kmi = km.keymap_items.new('transform.transform', 'S', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'mode', 'BONE_ENVELOPE') -kmi = km.keymap_items.new('transform.transform', 'R', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'mode', 'BONE_ROLL') -kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_armature_specials') - -# Map Metaball -km = kc.keymaps.new('Metaball', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('object.metaball_add', 'A', 'PRESS', shift=True) -kmi = km.keymap_items.new('mball.reveal_metaelems', 'H', 'PRESS', alt=True) -kmi = km.keymap_items.new('mball.hide_metaelems', 'H', 'PRESS') -kmi_props_setattr(kmi.properties, 'unselected', False) -kmi = km.keymap_items.new('mball.hide_metaelems', 'H', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'unselected', True) -kmi = km.keymap_items.new('mball.delete_metaelems', 'X', 'PRESS') -kmi = km.keymap_items.new('mball.delete_metaelems', 'DEL', 'PRESS') -kmi = km.keymap_items.new('mball.duplicate_move', 'D', 'PRESS', shift=True) -kmi = km.keymap_items.new('mball.select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('mball.select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('mball.select_similar', 'G', 'PRESS', shift=True) -kmi = km.keymap_items.new('wm.context_cycle_enum', 'O', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit_falloff') -kmi_props_setattr(kmi.properties, 'wrap', True) -kmi = km.keymap_items.new('wm.context_toggle_enum', 'O', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit') -kmi_props_setattr(kmi.properties, 'value_1', 'DISABLED') -kmi_props_setattr(kmi.properties, 'value_2', 'ENABLED') -kmi = km.keymap_items.new('wm.context_toggle_enum', 'O', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit') -kmi_props_setattr(kmi.properties, 'value_1', 'DISABLED') -kmi_props_setattr(kmi.properties, 'value_2', 'CONNECTED') - -# Map Lattice -km = kc.keymaps.new('Lattice', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('lattice.select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('lattice.select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('lattice.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('lattice.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('object.vertex_parent_set', 'P', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('lattice.flip', 'F', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('wm.call_menu', 'H', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_hook') -kmi = km.keymap_items.new('wm.context_cycle_enum', 'O', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit_falloff') -kmi_props_setattr(kmi.properties, 'wrap', True) -kmi = km.keymap_items.new('wm.context_toggle_enum', 'O', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit') -kmi_props_setattr(kmi.properties, 'value_1', 'DISABLED') -kmi_props_setattr(kmi.properties, 'value_2', 'ENABLED') - -# Map Particle -km = kc.keymaps.new('Particle', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('particle.select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('particle.select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('particle.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('particle.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('particle.select_linked', 'L', 'PRESS') -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('particle.select_linked', 'L', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'deselect', True) -kmi = km.keymap_items.new('particle.delete', 'X', 'PRESS') -kmi = km.keymap_items.new('particle.delete', 'DEL', 'PRESS') -kmi = km.keymap_items.new('particle.reveal', 'H', 'PRESS', alt=True) -kmi = km.keymap_items.new('particle.hide', 'H', 'PRESS') -kmi_props_setattr(kmi.properties, 'unselected', False) -kmi = km.keymap_items.new('particle.hide', 'H', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'unselected', True) -kmi = km.keymap_items.new('particle.brush_edit', 'LEFTMOUSE', 'PRESS') -kmi = km.keymap_items.new('particle.brush_edit', 'LEFTMOUSE', 'PRESS', shift=True) -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.particle_edit.brush.size') -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.particle_edit.brush.strength') -kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_particle_specials') -kmi = km.keymap_items.new('particle.weight_set', 'K', 'PRESS', shift=True) -kmi = km.keymap_items.new('wm.context_cycle_enum', 'O', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit_falloff') -kmi_props_setattr(kmi.properties, 'wrap', True) -kmi = km.keymap_items.new('wm.context_toggle_enum', 'O', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit') -kmi_props_setattr(kmi.properties, 'value_1', 'DISABLED') -kmi_props_setattr(kmi.properties, 'value_2', 'ENABLED') - -# Map Font -km = kc.keymaps.new('Font', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('font.style_toggle', 'B', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'style', 'BOLD') -kmi = km.keymap_items.new('font.style_toggle', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'style', 'ITALIC') -kmi = km.keymap_items.new('font.style_toggle', 'U', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'style', 'UNDERLINE') -kmi = km.keymap_items.new('font.style_toggle', 'P', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'style', 'SMALL_CAPS') -kmi = km.keymap_items.new('font.delete', 'DEL', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'NEXT_OR_SELECTION') -kmi = km.keymap_items.new('font.delete', 'DEL', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'NEXT_WORD') -kmi = km.keymap_items.new('font.delete', 'BACK_SPACE', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_OR_SELECTION') -kmi = km.keymap_items.new('font.delete', 'BACK_SPACE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_OR_SELECTION') -kmi = km.keymap_items.new('font.delete', 'BACK_SPACE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_WORD') -kmi = km.keymap_items.new('font.move', 'HOME', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'LINE_BEGIN') -kmi = km.keymap_items.new('font.move', 'END', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'LINE_END') -kmi = km.keymap_items.new('font.move', 'LEFT_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_CHARACTER') -kmi = km.keymap_items.new('font.move', 'RIGHT_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'NEXT_CHARACTER') -kmi = km.keymap_items.new('font.move', 'LEFT_ARROW', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_WORD') -kmi = km.keymap_items.new('font.move', 'RIGHT_ARROW', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'NEXT_WORD') -kmi = km.keymap_items.new('font.move', 'UP_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_LINE') -kmi = km.keymap_items.new('font.move', 'DOWN_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'NEXT_LINE') -kmi = km.keymap_items.new('font.move', 'PAGE_UP', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_PAGE') -kmi = km.keymap_items.new('font.move', 'PAGE_DOWN', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'NEXT_PAGE') -kmi = km.keymap_items.new('font.move_select', 'HOME', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'LINE_BEGIN') -kmi = km.keymap_items.new('font.move_select', 'END', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'LINE_END') -kmi = km.keymap_items.new('font.move_select', 'LEFT_ARROW', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_CHARACTER') -kmi = km.keymap_items.new('font.move_select', 'RIGHT_ARROW', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'NEXT_CHARACTER') -kmi = km.keymap_items.new('font.move_select', 'LEFT_ARROW', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_WORD') -kmi = km.keymap_items.new('font.move_select', 'RIGHT_ARROW', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'NEXT_WORD') -kmi = km.keymap_items.new('font.move_select', 'UP_ARROW', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_LINE') -kmi = km.keymap_items.new('font.move_select', 'DOWN_ARROW', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'NEXT_LINE') -kmi = km.keymap_items.new('font.move_select', 'PAGE_UP', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_PAGE') -kmi = km.keymap_items.new('font.move_select', 'PAGE_DOWN', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'NEXT_PAGE') -kmi = km.keymap_items.new('font.change_spacing', 'LEFT_ARROW', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'delta', -1) -kmi = km.keymap_items.new('font.change_spacing', 'RIGHT_ARROW', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'delta', 1) -kmi = km.keymap_items.new('font.change_character', 'UP_ARROW', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'delta', 1) -kmi = km.keymap_items.new('font.change_character', 'DOWN_ARROW', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'delta', -1) -kmi = km.keymap_items.new('font.select_all', 'A', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('font.text_copy', 'C', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('font.text_cut', 'X', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('font.text_paste', 'V', 'PRESS', ctrl=True) -if platform == "darwin": - kmi = km.keymap_items.new('font.select_all', 'A', 'PRESS', oskey=True) - kmi = km.keymap_items.new('font.text_copy', 'C', 'PRESS', oskey=True) - kmi = km.keymap_items.new('font.text_cut', 'X', 'PRESS', oskey=True) - kmi = km.keymap_items.new('font.text_paste', 'V', 'PRESS', oskey=True) -kmi = km.keymap_items.new('font.line_break', 'RET', 'PRESS') -kmi = km.keymap_items.new('font.text_insert', 'TEXTINPUT', 'ANY', any=True) -kmi = km.keymap_items.new('font.text_insert', 'BACK_SPACE', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'accent', True) - -# Map Object Non-modal -km = kc.keymaps.new('Object Non-modal', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('object.mode_set', 'TAB', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'EDIT') -kmi_props_setattr(kmi.properties, 'toggle', True) -kmi = km.keymap_items.new('object.mode_set', 'TAB', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'mode', 'POSE') -kmi_props_setattr(kmi.properties, 'toggle', True) -kmi = km.keymap_items.new('object.mode_set', 'V', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'VERTEX_PAINT') -kmi_props_setattr(kmi.properties, 'toggle', True) -kmi = km.keymap_items.new('object.mode_set', 'TAB', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'mode', 'WEIGHT_PAINT') -kmi_props_setattr(kmi.properties, 'toggle', True) -kmi = km.keymap_items.new('object.origin_set', 'C', 'PRESS', shift=True, ctrl=True, alt=True) - -# Map 3D View -km = kc.keymaps.new('3D View', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('view3d.cursor3d', 'ACTIONMOUSE', 'CLICK') -kmi = km.keymap_items.new('view3d.rotate', 'MIDDLEMOUSE', 'PRESS') -kmi = km.keymap_items.new('view3d.move', 'MIDDLEMOUSE', 'PRESS', shift=True) -kmi = km.keymap_items.new('view3d.zoom', 'MIDDLEMOUSE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('view3d.dolly', 'MIDDLEMOUSE', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('view3d.view_selected', 'NUMPAD_PERIOD', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'use_all_regions', True) -kmi = km.keymap_items.new('view3d.view_selected', 'NUMPAD_PERIOD', 'PRESS') -kmi_props_setattr(kmi.properties, 'use_all_regions', False) -kmi = km.keymap_items.new('view3d.view_lock_to_active', 'NUMPAD_PERIOD', 'PRESS', shift=True) -kmi = km.keymap_items.new('view3d.view_lock_clear', 'NUMPAD_PERIOD', 'PRESS', alt=True) -kmi = km.keymap_items.new('view3d.navigate', 'F', 'PRESS', shift=True) -kmi = km.keymap_items.new('view3d.smoothview', 'TIMER1', 'ANY', any=True) -kmi = km.keymap_items.new('view3d.rotate', 'TRACKPADPAN', 'ANY') -kmi = km.keymap_items.new('view3d.rotate', 'MOUSEROTATE', 'ANY') -kmi = km.keymap_items.new('view3d.move', 'TRACKPADPAN', 'ANY', shift=True) -kmi = km.keymap_items.new('view3d.zoom', 'TRACKPADZOOM', 'ANY') -kmi = km.keymap_items.new('view3d.zoom', 'TRACKPADPAN', 'ANY', ctrl=True) -kmi = km.keymap_items.new('view3d.zoom', 'NUMPAD_PLUS', 'PRESS') -kmi_props_setattr(kmi.properties, 'delta', 1) -kmi = km.keymap_items.new('view3d.zoom', 'NUMPAD_MINUS', 'PRESS') -kmi_props_setattr(kmi.properties, 'delta', -1) -kmi = km.keymap_items.new('view3d.zoom', 'EQUAL', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'delta', 1) -kmi = km.keymap_items.new('view3d.zoom', 'MINUS', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'delta', -1) -kmi = km.keymap_items.new('view3d.zoom', 'WHEELINMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'delta', 1) -kmi = km.keymap_items.new('view3d.zoom', 'WHEELOUTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'delta', -1) -kmi = km.keymap_items.new('view3d.dolly', 'NUMPAD_PLUS', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'delta', 1) -kmi = km.keymap_items.new('view3d.dolly', 'NUMPAD_MINUS', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'delta', -1) -kmi = km.keymap_items.new('view3d.dolly', 'EQUAL', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'delta', 1) -kmi = km.keymap_items.new('view3d.dolly', 'MINUS', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'delta', -1) -kmi = km.keymap_items.new('view3d.zoom_camera_1_to_1', 'NUMPAD_ENTER', 'PRESS', shift=True) -kmi = km.keymap_items.new('view3d.view_center_camera', 'HOME', 'PRESS') -kmi = km.keymap_items.new('view3d.view_center_lock', 'HOME', 'PRESS') -kmi = km.keymap_items.new('view3d.view_center_cursor', 'HOME', 'PRESS', alt=True) -kmi = km.keymap_items.new('view3d.view_center_pick', 'F', 'PRESS', alt=True) -kmi = km.keymap_items.new('view3d.view_all', 'HOME', 'PRESS') -kmi_props_setattr(kmi.properties, 'center', False) -kmi = km.keymap_items.new('view3d.view_all', 'HOME', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'use_all_regions', True) -kmi_props_setattr(kmi.properties, 'center', False) -kmi = km.keymap_items.new('view3d.view_all', 'C', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'center', True) -kmi = km.keymap_items.new('view3d.view_camera', 'NUMPAD_0', 'PRESS') -kmi = km.keymap_items.new('view3d.view_axis', 'NUMPAD_1', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'FRONT') -kmi = km.keymap_items.new('view3d.view_orbit', 'NUMPAD_2', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'ORBITDOWN') -kmi = km.keymap_items.new('view3d.view_axis', 'NUMPAD_3', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'RIGHT') -kmi = km.keymap_items.new('view3d.view_orbit', 'NUMPAD_4', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'ORBITLEFT') -kmi = km.keymap_items.new('view3d.view_persportho', 'NUMPAD_5', 'PRESS') -kmi = km.keymap_items.new('view3d.view_orbit', 'NUMPAD_6', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'ORBITRIGHT') -kmi = km.keymap_items.new('view3d.view_axis', 'NUMPAD_7', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'TOP') -kmi = km.keymap_items.new('view3d.view_orbit', 'NUMPAD_8', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'ORBITUP') -kmi = km.keymap_items.new('view3d.view_axis', 'NUMPAD_1', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'BACK') -kmi = km.keymap_items.new('view3d.view_axis', 'NUMPAD_3', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'LEFT') -kmi = km.keymap_items.new('view3d.view_axis', 'NUMPAD_7', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'BOTTOM') -kmi = km.keymap_items.new('view3d.view_pan', 'NUMPAD_2', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'PANDOWN') -kmi = km.keymap_items.new('view3d.view_pan', 'NUMPAD_4', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'PANLEFT') -kmi = km.keymap_items.new('view3d.view_pan', 'NUMPAD_6', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'PANRIGHT') -kmi = km.keymap_items.new('view3d.view_pan', 'NUMPAD_8', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'PANUP') -kmi = km.keymap_items.new('view3d.view_roll', 'NUMPAD_4', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'LEFT') -kmi = km.keymap_items.new('view3d.view_roll', 'NUMPAD_6', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'RIGHT') -kmi = km.keymap_items.new('view3d.view_orbit', 'NUMPAD_9', 'PRESS') -kmi_props_setattr(kmi.properties, 'angle', 3.1415927410125732) -kmi_props_setattr(kmi.properties, 'type', 'ORBITRIGHT') -kmi = km.keymap_items.new('view3d.view_pan', 'WHEELUPMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'PANRIGHT') -kmi = km.keymap_items.new('view3d.view_pan', 'WHEELDOWNMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'PANLEFT') -kmi = km.keymap_items.new('view3d.view_pan', 'WHEELUPMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'PANUP') -kmi = km.keymap_items.new('view3d.view_pan', 'WHEELDOWNMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'PANDOWN') -kmi = km.keymap_items.new('view3d.view_orbit', 'WHEELUPMOUSE', 'PRESS', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'type', 'ORBITLEFT') -kmi = km.keymap_items.new('view3d.view_orbit', 'WHEELDOWNMOUSE', 'PRESS', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'type', 'ORBITRIGHT') -kmi = km.keymap_items.new('view3d.view_orbit', 'WHEELUPMOUSE', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'type', 'ORBITUP') -kmi = km.keymap_items.new('view3d.view_orbit', 'WHEELDOWNMOUSE', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'type', 'ORBITDOWN') -kmi = km.keymap_items.new('view3d.view_roll', 'WHEELUPMOUSE', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'LEFT') -kmi = km.keymap_items.new('view3d.view_roll', 'WHEELDOWNMOUSE', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'RIGHT') -kmi = km.keymap_items.new('view3d.view_axis', 'NUMPAD_1', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'FRONT') -kmi_props_setattr(kmi.properties, 'align_active', True) -kmi = km.keymap_items.new('view3d.view_axis', 'NUMPAD_3', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'RIGHT') -kmi_props_setattr(kmi.properties, 'align_active', True) -kmi = km.keymap_items.new('view3d.view_axis', 'NUMPAD_7', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'TOP') -kmi_props_setattr(kmi.properties, 'align_active', True) -kmi = km.keymap_items.new('view3d.view_axis', 'NUMPAD_1', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'BACK') -kmi_props_setattr(kmi.properties, 'align_active', True) -kmi = km.keymap_items.new('view3d.view_axis', 'NUMPAD_3', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'LEFT') -kmi_props_setattr(kmi.properties, 'align_active', True) -kmi = km.keymap_items.new('view3d.view_axis', 'NUMPAD_7', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'BOTTOM') -kmi_props_setattr(kmi.properties, 'align_active', True) -kmi = km.keymap_items.new('view3d.ndof_orbit_zoom', 'NDOF_MOTION', 'ANY') -kmi = km.keymap_items.new('view3d.ndof_orbit', 'NDOF_MOTION', 'ANY', ctrl=True) -kmi = km.keymap_items.new('view3d.ndof_pan', 'NDOF_MOTION', 'ANY', shift=True) -kmi = km.keymap_items.new('view3d.ndof_all', 'NDOF_MOTION', 'ANY', shift=True, ctrl=True) -kmi = km.keymap_items.new('view3d.view_selected', 'NDOF_BUTTON_FIT', 'PRESS') -kmi_props_setattr(kmi.properties, 'use_all_regions', False) -kmi = km.keymap_items.new('view3d.view_roll', 'NDOF_BUTTON_ROLL_CCW', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'LEFT') -kmi = km.keymap_items.new('view3d.view_roll', 'NDOF_BUTTON_ROLL_CCW', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'RIGHT') -kmi = km.keymap_items.new('view3d.view_axis', 'NDOF_BUTTON_FRONT', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'FRONT') -kmi = km.keymap_items.new('view3d.view_axis', 'NDOF_BUTTON_BACK', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'BACK') -kmi = km.keymap_items.new('view3d.view_axis', 'NDOF_BUTTON_LEFT', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'LEFT') -kmi = km.keymap_items.new('view3d.view_axis', 'NDOF_BUTTON_RIGHT', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'RIGHT') -kmi = km.keymap_items.new('view3d.view_axis', 'NDOF_BUTTON_TOP', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'TOP') -kmi = km.keymap_items.new('view3d.view_axis', 'NDOF_BUTTON_BOTTOM', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'BOTTOM') -kmi = km.keymap_items.new('view3d.view_axis', 'NDOF_BUTTON_FRONT', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'FRONT') -kmi_props_setattr(kmi.properties, 'align_active', True) -kmi = km.keymap_items.new('view3d.view_axis', 'NDOF_BUTTON_RIGHT', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'RIGHT') -kmi_props_setattr(kmi.properties, 'align_active', True) -kmi = km.keymap_items.new('view3d.view_axis', 'NDOF_BUTTON_TOP', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'TOP') -kmi_props_setattr(kmi.properties, 'align_active', True) -kmi = km.keymap_items.new('view3d.layers', 'ACCENT_GRAVE', 'PRESS') -kmi_props_setattr(kmi.properties, 'nr', 0) -kmi = km.keymap_items.new('view3d.layers', 'ONE', 'PRESS', any=True) -kmi_props_setattr(kmi.properties, 'nr', 1) -kmi = km.keymap_items.new('view3d.layers', 'TWO', 'PRESS', any=True) -kmi_props_setattr(kmi.properties, 'nr', 2) -kmi = km.keymap_items.new('view3d.layers', 'THREE', 'PRESS', any=True) -kmi_props_setattr(kmi.properties, 'nr', 3) -kmi = km.keymap_items.new('view3d.layers', 'FOUR', 'PRESS', any=True) -kmi_props_setattr(kmi.properties, 'nr', 4) -kmi = km.keymap_items.new('view3d.layers', 'FIVE', 'PRESS', any=True) -kmi_props_setattr(kmi.properties, 'nr', 5) -kmi = km.keymap_items.new('view3d.layers', 'SIX', 'PRESS', any=True) -kmi_props_setattr(kmi.properties, 'nr', 6) -kmi = km.keymap_items.new('view3d.layers', 'SEVEN', 'PRESS', any=True) -kmi_props_setattr(kmi.properties, 'nr', 7) -kmi = km.keymap_items.new('view3d.layers', 'EIGHT', 'PRESS', any=True) -kmi_props_setattr(kmi.properties, 'nr', 8) -kmi = km.keymap_items.new('view3d.layers', 'NINE', 'PRESS', any=True) -kmi_props_setattr(kmi.properties, 'nr', 9) -kmi = km.keymap_items.new('view3d.layers', 'ZERO', 'PRESS', any=True) -kmi_props_setattr(kmi.properties, 'nr', 10) -kmi = km.keymap_items.new('wm.context_toggle_enum', 'Z', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.shading.type') -kmi_props_setattr(kmi.properties, 'value_1', 'SOLID') -kmi_props_setattr(kmi.properties, 'value_2', 'TEXTURED') -kmi = km.keymap_items.new('view3d.toggle_render', 'Z', 'PRESS', shift=True) -kmi = km.keymap_items.new('view3d.toggle_xray_draw_option', 'Z', 'PRESS') -kmi = km.keymap_items.new('wm.context_toggle', 'Z', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.use_occlude_geometry') -kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi_props_setattr(kmi.properties, 'toggle', False) -kmi_props_setattr(kmi.properties, 'center', False) -kmi_props_setattr(kmi.properties, 'enumerate', False) -kmi_props_setattr(kmi.properties, 'object', False) -kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi_props_setattr(kmi.properties, 'toggle', True) -kmi_props_setattr(kmi.properties, 'center', False) -kmi_props_setattr(kmi.properties, 'enumerate', False) -kmi_props_setattr(kmi.properties, 'object', False) -kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi_props_setattr(kmi.properties, 'toggle', False) -kmi_props_setattr(kmi.properties, 'center', True) -kmi_props_setattr(kmi.properties, 'enumerate', False) -kmi_props_setattr(kmi.properties, 'object', True) -kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi_props_setattr(kmi.properties, 'toggle', False) -kmi_props_setattr(kmi.properties, 'center', False) -kmi_props_setattr(kmi.properties, 'enumerate', True) -kmi_props_setattr(kmi.properties, 'object', False) -kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi_props_setattr(kmi.properties, 'toggle', True) -kmi_props_setattr(kmi.properties, 'center', True) -kmi_props_setattr(kmi.properties, 'enumerate', False) -kmi_props_setattr(kmi.properties, 'object', False) -kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'PRESS', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi_props_setattr(kmi.properties, 'toggle', False) -kmi_props_setattr(kmi.properties, 'center', True) -kmi_props_setattr(kmi.properties, 'enumerate', True) -kmi_props_setattr(kmi.properties, 'object', False) -kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi_props_setattr(kmi.properties, 'toggle', True) -kmi_props_setattr(kmi.properties, 'center', False) -kmi_props_setattr(kmi.properties, 'enumerate', True) -kmi_props_setattr(kmi.properties, 'object', False) -kmi = km.keymap_items.new('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi_props_setattr(kmi.properties, 'toggle', True) -kmi_props_setattr(kmi.properties, 'center', True) -kmi_props_setattr(kmi.properties, 'enumerate', True) -kmi_props_setattr(kmi.properties, 'object', False) -kmi = km.keymap_items.new('view3d.select_border', 'B', 'PRESS') -kmi = km.keymap_items.new('view3d.select_lasso', 'EVT_TWEAK_A', 'ANY', ctrl=True) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('view3d.select_lasso', 'EVT_TWEAK_A', 'ANY', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'deselect', True) -kmi = km.keymap_items.new('view3d.select_circle', 'C', 'PRESS') -kmi = km.keymap_items.new('view3d.clip_border', 'B', 'PRESS', alt=True) -kmi = km.keymap_items.new('view3d.zoom_border', 'B', 'PRESS', shift=True) -kmi = km.keymap_items.new('view3d.render_border', 'B', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'camera_only', True) -kmi = km.keymap_items.new('view3d.render_border', 'B', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'camera_only', False) -kmi = km.keymap_items.new('view3d.clear_render_border', 'B', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('view3d.camera_to_view', 'NUMPAD_0', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('view3d.object_as_camera', 'NUMPAD_0', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('wm.call_menu', 'S', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_snap') -if platform == "darwin": - kmi = km.keymap_items.new('view3d.copybuffer', 'C', 'PRESS', oskey=True) - kmi = km.keymap_items.new('view3d.pastebuffer', 'V', 'PRESS', oskey=True) -kmi = km.keymap_items.new('view3d.copybuffer', 'C', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('view3d.pastebuffer', 'V', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('wm.context_set_enum', 'COMMA', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.transform_pivot_point') -kmi_props_setattr(kmi.properties, 'value', 'BOUNDING_BOX_CENTER') -kmi = km.keymap_items.new('wm.context_set_enum', 'COMMA', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.transform_pivot_point') -kmi_props_setattr(kmi.properties, 'value', 'MEDIAN_POINT') -kmi = km.keymap_items.new('wm.context_toggle', 'COMMA', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.use_transform_pivot_point_align') -kmi = km.keymap_items.new('wm.context_set_enum', 'PERIOD', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.transform_pivot_point') -kmi_props_setattr(kmi.properties, 'value', 'CURSOR') -kmi = km.keymap_items.new('wm.context_set_enum', 'PERIOD', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.transform_pivot_point') -kmi_props_setattr(kmi.properties, 'value', 'INDIVIDUAL_ORIGINS') -kmi = km.keymap_items.new('wm.context_set_enum', 'PERIOD', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.transform_pivot_point') -kmi_props_setattr(kmi.properties, 'value', 'ACTIVE_ELEMENT') -kmi = km.keymap_items.new('wm.context_toggle', 'SPACE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.show_manipulator') -kmi = km.keymap_items.new('transform.translate', 'G', 'PRESS') -kmi = km.keymap_items.new('transform.translate', 'EVT_TWEAK_S', 'ANY') -kmi = km.keymap_items.new('transform.rotate', 'R', 'PRESS') -kmi = km.keymap_items.new('transform.resize', 'S', 'PRESS') -kmi = km.keymap_items.new('transform.bend', 'W', 'PRESS', shift=True) -kmi = km.keymap_items.new('transform.tosphere', 'S', 'PRESS', shift=True, alt=True) -kmi = km.keymap_items.new('transform.shear', 'S', 'PRESS', shift=True, ctrl=True, alt=True) -kmi = km.keymap_items.new('transform.select_orientation', 'SPACE', 'PRESS', alt=True) -kmi = km.keymap_items.new('transform.create_orientation', 'SPACE', 'PRESS', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'use', True) -kmi = km.keymap_items.new('transform.mirror', 'M', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('wm.context_toggle', 'TAB', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.use_snap') -kmi = km.keymap_items.new('wm.context_menu_enum', 'TAB', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.snap_element') -kmi = km.keymap_items.new('object.transform_axis_target', 'T', 'PRESS', shift=True) -kmi = km.keymap_items.new('transform.translate', 'T', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'texture_space', True) -kmi = km.keymap_items.new('transform.resize', 'T', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'texture_space', True) -kmi = km.keymap_items.new('transform.skin_resize', 'A', 'PRESS', ctrl=True) - -# Map Manipulators -km = kc.keymaps.new('Manipulators', space_type='EMPTY', region_type='WINDOW', modal=False) - - -# Map Backdrop Transform Widget -km = kc.keymaps.new('Backdrop Transform Widget', space_type='NODE_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('manipulatorgroup.manipulator_tweak', 'LEFTMOUSE', 'PRESS', any=True) - -# Map Backdrop Crop Widget -km = kc.keymaps.new('Backdrop Crop Widget', space_type='NODE_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('manipulatorgroup.manipulator_tweak', 'LEFTMOUSE', 'PRESS', any=True) - -# Map Sun Beams Widget -km = kc.keymaps.new('Sun Beams Widget', space_type='NODE_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('manipulatorgroup.manipulator_tweak', 'LEFTMOUSE', 'PRESS', any=True) - -# Map Corner Pin Widget -km = kc.keymaps.new('Corner Pin Widget', space_type='NODE_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('manipulatorgroup.manipulator_tweak', 'LEFTMOUSE', 'PRESS', any=True) - -# Map UV Transform Manipulator -km = kc.keymaps.new('UV Transform Manipulator', space_type='IMAGE_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('manipulatorgroup.manipulator_tweak', 'LEFTMOUSE', 'PRESS', any=True) - -# Map Spot Lamp Widgets -km = kc.keymaps.new('Spot Lamp Widgets', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('manipulatorgroup.manipulator_tweak', 'LEFTMOUSE', 'PRESS', any=True) - -# Map Area Lamp Widgets -km = kc.keymaps.new('Area Lamp Widgets', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('manipulatorgroup.manipulator_tweak', 'LEFTMOUSE', 'PRESS', any=True) -kmi = km.keymap_items.new('manipulatorgroup.manipulator_tweak', 'LEFTMOUSE', 'PRESS', any=True) - -# Map Target Lamp Widgets -km = kc.keymaps.new('Target Lamp Widgets', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('manipulatorgroup.manipulator_tweak', 'LEFTMOUSE', 'PRESS', any=True) - -# Map Force Field Widgets -km = kc.keymaps.new('Force Field Widgets', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('manipulatorgroup.manipulator_tweak', 'LEFTMOUSE', 'PRESS', any=True) - -# Map Camera Widgets -km = kc.keymaps.new('Camera Widgets', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('manipulatorgroup.manipulator_tweak', 'LEFTMOUSE', 'PRESS', any=True) - -# Map Camera View Widgets -km = kc.keymaps.new('Camera View Widgets', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('manipulatorgroup.manipulator_tweak', 'LEFTMOUSE', 'PRESS', any=True) - -# Map Armature Spline Widgets -km = kc.keymaps.new('Armature Spline Widgets', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('manipulatorgroup.manipulator_tweak', 'LEFTMOUSE', 'PRESS', any=True) - -# Map View3D Navigate -km = kc.keymaps.new('View3D Navigate', space_type='VIEW_3D', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('manipulatorgroup.manipulator_tweak', 'LEFTMOUSE', 'PRESS', any=True) - -# Map Animation Channels -km = kc.keymaps.new('Animation Channels', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('anim.channels_click', 'LEFTMOUSE', 'PRESS') -kmi = km.keymap_items.new('anim.channels_click', 'LEFTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('anim.channels_click', 'LEFTMOUSE', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'children_only', True) -kmi = km.keymap_items.new('anim.channels_rename', 'LEFTMOUSE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('anim.channels_rename', 'LEFTMOUSE', 'DOUBLE_CLICK') -kmi = km.keymap_items.new('anim.channel_select_keys', 'LEFTMOUSE', 'DOUBLE_CLICK') -kmi = km.keymap_items.new('anim.channel_select_keys', 'LEFTMOUSE', 'DOUBLE_CLICK', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('anim.channels_find', 'F', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('anim.channels_select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('anim.channels_select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('anim.channels_select_border', 'B', 'PRESS') -kmi = km.keymap_items.new('anim.channels_select_border', 'EVT_TWEAK_L', 'ANY') -kmi = km.keymap_items.new('anim.channels_delete', 'X', 'PRESS') -kmi = km.keymap_items.new('anim.channels_delete', 'DEL', 'PRESS') -kmi = km.keymap_items.new('anim.channels_setting_toggle', 'W', 'PRESS', shift=True) -kmi = km.keymap_items.new('anim.channels_setting_enable', 'W', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('anim.channels_setting_disable', 'W', 'PRESS', alt=True) -kmi = km.keymap_items.new('anim.channels_editable_toggle', 'TAB', 'PRESS') -kmi = km.keymap_items.new('anim.channels_expand', 'NUMPAD_PLUS', 'PRESS') -kmi = km.keymap_items.new('anim.channels_collapse', 'NUMPAD_MINUS', 'PRESS') -kmi = km.keymap_items.new('anim.channels_expand', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'all', False) -kmi = km.keymap_items.new('anim.channels_collapse', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'all', False) -kmi = km.keymap_items.new('anim.channels_move', 'PAGE_UP', 'PRESS') -kmi_props_setattr(kmi.properties, 'direction', 'UP') -kmi = km.keymap_items.new('anim.channels_move', 'PAGE_DOWN', 'PRESS') -kmi_props_setattr(kmi.properties, 'direction', 'DOWN') -kmi = km.keymap_items.new('anim.channels_move', 'PAGE_UP', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'direction', 'TOP') -kmi = km.keymap_items.new('anim.channels_move', 'PAGE_DOWN', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'direction', 'BOTTOM') -kmi = km.keymap_items.new('anim.channels_group', 'G', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('anim.channels_ungroup', 'G', 'PRESS', alt=True) - -# Map UV Editor -km = kc.keymaps.new('UV Editor', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('wm.context_toggle', 'Q', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.use_uv_sculpt') -kmi = km.keymap_items.new('uv.mark_seam', 'E', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('uv.select', 'SELECTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('uv.select', 'SELECTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('uv.select_loop', 'SELECTMOUSE', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('uv.select_loop', 'SELECTMOUSE', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('uv.select_split', 'Y', 'PRESS') -kmi = km.keymap_items.new('uv.select_border', 'B', 'PRESS') -kmi_props_setattr(kmi.properties, 'pinned', False) -kmi = km.keymap_items.new('uv.select_border', 'B', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'pinned', True) -kmi = km.keymap_items.new('uv.circle_select', 'C', 'PRESS') -kmi = km.keymap_items.new('uv.select_lasso', 'EVT_TWEAK_A', 'ANY', ctrl=True) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('uv.select_lasso', 'EVT_TWEAK_A', 'ANY', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'deselect', True) -kmi = km.keymap_items.new('uv.select_linked', 'L', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('uv.select_linked_pick', 'L', 'PRESS') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('uv.select_linked', 'L', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'deselect', True) -kmi = km.keymap_items.new('uv.select_linked_pick', 'L', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'deselect', True) -kmi = km.keymap_items.new('uv.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('uv.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('uv.select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('uv.select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('uv.select_pinned', 'P', 'PRESS', shift=True) -kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'IMAGE_MT_uvs_weldalign') -kmi = km.keymap_items.new('uv.stitch', 'V', 'PRESS') -kmi = km.keymap_items.new('uv.pin', 'P', 'PRESS') -kmi_props_setattr(kmi.properties, 'clear', False) -kmi = km.keymap_items.new('uv.pin', 'P', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'clear', True) -kmi = km.keymap_items.new('uv.unwrap', 'E', 'PRESS') -kmi = km.keymap_items.new('uv.minimize_stretch', 'V', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('uv.pack_islands', 'P', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('uv.average_islands_scale', 'A', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('uv.hide', 'H', 'PRESS') -kmi_props_setattr(kmi.properties, 'unselected', False) -kmi = km.keymap_items.new('uv.hide', 'H', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'unselected', True) -kmi = km.keymap_items.new('uv.reveal', 'H', 'PRESS', alt=True) -kmi = km.keymap_items.new('uv.cursor_set', 'ACTIONMOUSE', 'PRESS') -kmi = km.keymap_items.new('wm.call_menu', 'S', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'name', 'IMAGE_MT_uvs_snap') -kmi = km.keymap_items.new('wm.call_menu', 'TAB', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'name', 'IMAGE_MT_uvs_select_mode') -kmi = km.keymap_items.new('wm.context_cycle_enum', 'O', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit_falloff') -kmi_props_setattr(kmi.properties, 'wrap', True) -kmi = km.keymap_items.new('wm.context_toggle_enum', 'O', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit') -kmi_props_setattr(kmi.properties, 'value_1', 'DISABLED') -kmi_props_setattr(kmi.properties, 'value_2', 'ENABLED') -kmi = km.keymap_items.new('transform.translate', 'G', 'PRESS') -kmi = km.keymap_items.new('transform.translate', 'EVT_TWEAK_S', 'ANY') -kmi = km.keymap_items.new('transform.rotate', 'R', 'PRESS') -kmi = km.keymap_items.new('transform.resize', 'S', 'PRESS') -kmi = km.keymap_items.new('transform.shear', 'S', 'PRESS', shift=True, ctrl=True, alt=True) -kmi = km.keymap_items.new('transform.mirror', 'M', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('wm.context_toggle', 'TAB', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.use_snap') -kmi = km.keymap_items.new('wm.context_menu_enum', 'TAB', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.snap_uv_element') - -# Map UV Sculpt -km = kc.keymaps.new('UV Sculpt', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('wm.context_toggle', 'Q', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.use_uv_sculpt') -kmi = km.keymap_items.new('sculpt.uv_sculpt_stroke', 'LEFTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'NORMAL') -kmi = km.keymap_items.new('sculpt.uv_sculpt_stroke', 'LEFTMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'mode', 'INVERT') -kmi = km.keymap_items.new('sculpt.uv_sculpt_stroke', 'LEFTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'RELAX') -kmi = km.keymap_items.new('brush.scale_size', 'LEFT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'scalar', 0.9) -kmi = km.keymap_items.new('brush.scale_size', 'RIGHT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'scalar', 1.0 / 0.9) -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.uv_sculpt.brush.size') -kmi_props_setattr(kmi.properties, 'data_path_secondary', 'tool_settings.unified_paint_settings.size') -kmi_props_setattr(kmi.properties, 'use_secondary', 'tool_settings.unified_paint_settings.use_unified_size') -kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.uv_sculpt.brush.texture_slot.angle') -kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.uv_sculpt.brush.cursor_color_add') -kmi_props_setattr(kmi.properties, 'fill_color_path', '') -kmi_props_setattr(kmi.properties, 'fill_color_override_path', '') -kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', '') -kmi_props_setattr(kmi.properties, 'zoom_path', '') -kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.uv_sculpt.brush') -kmi_props_setattr(kmi.properties, 'secondary_tex', False) -kmi = km.keymap_items.new('wm.radial_control', 'F', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path_primary', 'tool_settings.uv_sculpt.brush.strength') -kmi_props_setattr(kmi.properties, 'data_path_secondary', 'tool_settings.unified_paint_settings.strength') -kmi_props_setattr(kmi.properties, 'use_secondary', 'tool_settings.unified_paint_settings.use_unified_strength') -kmi_props_setattr(kmi.properties, 'rotation_path', 'tool_settings.uv_sculpt.brush.texture_slot.angle') -kmi_props_setattr(kmi.properties, 'color_path', 'tool_settings.uv_sculpt.brush.cursor_color_add') -kmi_props_setattr(kmi.properties, 'fill_color_path', '') -kmi_props_setattr(kmi.properties, 'fill_color_override_path', '') -kmi_props_setattr(kmi.properties, 'fill_color_override_test_path', '') -kmi_props_setattr(kmi.properties, 'zoom_path', '') -kmi_props_setattr(kmi.properties, 'image_id', 'tool_settings.uv_sculpt.brush') -kmi_props_setattr(kmi.properties, 'secondary_tex', False) -kmi = km.keymap_items.new('brush.uv_sculpt_tool_set', 'S', 'PRESS') -kmi_props_setattr(kmi.properties, 'tool', 'RELAX') -kmi = km.keymap_items.new('brush.uv_sculpt_tool_set', 'P', 'PRESS') -kmi_props_setattr(kmi.properties, 'tool', 'PINCH') -kmi = km.keymap_items.new('brush.uv_sculpt_tool_set', 'G', 'PRESS') -kmi_props_setattr(kmi.properties, 'tool', 'GRAB') - -# Map Mask Editing -km = kc.keymaps.new('Mask Editing', space_type='EMPTY', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('mask.new', 'N', 'PRESS', alt=True) -kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'name', 'MASK_MT_add') -kmi = km.keymap_items.new('wm.context_cycle_enum', 'O', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.proportional_edit_falloff') -kmi_props_setattr(kmi.properties, 'wrap', True) -kmi = km.keymap_items.new('wm.context_toggle', 'O', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.use_proportional_edit_mask') -kmi = km.keymap_items.new('mask.add_vertex_slide', 'ACTIONMOUSE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('mask.add_feather_vertex_slide', 'ACTIONMOUSE', 'PRESS', shift=True) -kmi = km.keymap_items.new('mask.delete', 'X', 'PRESS') -kmi = km.keymap_items.new('mask.delete', 'DEL', 'PRESS') -kmi = km.keymap_items.new('mask.select', 'SELECTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi_props_setattr(kmi.properties, 'toggle', False) -kmi = km.keymap_items.new('mask.select', 'SELECTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi_props_setattr(kmi.properties, 'toggle', True) -kmi = km.keymap_items.new('mask.select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('mask.select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('mask.select_linked', 'L', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('mask.select_linked_pick', 'L', 'PRESS') -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('mask.select_linked_pick', 'L', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'deselect', True) -kmi = km.keymap_items.new('mask.select_border', 'B', 'PRESS') -kmi = km.keymap_items.new('mask.select_circle', 'C', 'PRESS') -kmi = km.keymap_items.new('mask.select_lasso', 'EVT_TWEAK_A', 'ANY', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('mask.select_lasso', 'EVT_TWEAK_A', 'ANY', shift=True, ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'deselect', True) -kmi = km.keymap_items.new('mask.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('mask.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('mask.hide_view_clear', 'H', 'PRESS', alt=True) -kmi = km.keymap_items.new('mask.hide_view_set', 'H', 'PRESS') -kmi_props_setattr(kmi.properties, 'unselected', False) -kmi = km.keymap_items.new('mask.hide_view_set', 'H', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'unselected', True) -kmi = km.keymap_items.new('clip.select', 'SELECTMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('mask.cyclic_toggle', 'C', 'PRESS', alt=True) -kmi = km.keymap_items.new('mask.slide_point', 'ACTIONMOUSE', 'PRESS') -kmi = km.keymap_items.new('mask.slide_spline_curvature', 'ACTIONMOUSE', 'PRESS') -kmi = km.keymap_items.new('mask.handle_type_set', 'V', 'PRESS') -kmi = km.keymap_items.new('mask.normals_make_consistent', 'N', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('mask.parent_set', 'P', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('mask.parent_clear', 'P', 'PRESS', alt=True) -kmi = km.keymap_items.new('mask.shape_key_insert', 'I', 'PRESS') -kmi = km.keymap_items.new('mask.shape_key_clear', 'I', 'PRESS', alt=True) -kmi = km.keymap_items.new('mask.duplicate_move', 'D', 'PRESS', shift=True) -kmi = km.keymap_items.new('mask.copy_splines', 'C', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('mask.paste_splines', 'V', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('uv.cursor_set', 'ACTIONMOUSE', 'PRESS') -kmi = km.keymap_items.new('transform.translate', 'G', 'PRESS') -kmi = km.keymap_items.new('transform.translate', 'EVT_TWEAK_S', 'ANY') -kmi = km.keymap_items.new('transform.resize', 'S', 'PRESS') -kmi = km.keymap_items.new('transform.rotate', 'R', 'PRESS') -kmi = km.keymap_items.new('transform.transform', 'S', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'mode', 'MASK_SHRINKFATTEN') - -# Map Graph Editor Generic -km = kc.keymaps.new('Graph Editor Generic', space_type='GRAPH_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('graph.properties', 'N', 'PRESS') -kmi = km.keymap_items.new('graph.extrapolation_type', 'E', 'PRESS', shift=True) -kmi = km.keymap_items.new('anim.channels_find', 'F', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('graph.hide', 'H', 'PRESS') -kmi_props_setattr(kmi.properties, 'unselected', False) -kmi = km.keymap_items.new('graph.hide', 'H', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'unselected', True) -kmi = km.keymap_items.new('graph.reveal', 'H', 'PRESS', alt=True) - -# Map Graph Editor -km = kc.keymaps.new('Graph Editor', space_type='GRAPH_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('wm.context_toggle', 'H', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.show_handles') -kmi = km.keymap_items.new('graph.cursor_set', 'ACTIONMOUSE', 'PRESS') -kmi = km.keymap_items.new('graph.clickselect', 'SELECTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'column', False) -kmi_props_setattr(kmi.properties, 'curves', False) -kmi = km.keymap_items.new('graph.clickselect', 'SELECTMOUSE', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'column', True) -kmi_props_setattr(kmi.properties, 'curves', False) -kmi = km.keymap_items.new('graph.clickselect', 'SELECTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'column', False) -kmi_props_setattr(kmi.properties, 'curves', False) -kmi = km.keymap_items.new('graph.clickselect', 'SELECTMOUSE', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'column', True) -kmi_props_setattr(kmi.properties, 'curves', False) -kmi = km.keymap_items.new('graph.clickselect', 'SELECTMOUSE', 'PRESS', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'column', False) -kmi_props_setattr(kmi.properties, 'curves', True) -kmi = km.keymap_items.new('graph.clickselect', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'column', False) -kmi_props_setattr(kmi.properties, 'curves', True) -kmi = km.keymap_items.new('graph.select_leftright', 'SELECTMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'mode', 'CHECK') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('graph.select_leftright', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'mode', 'CHECK') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('graph.select_leftright', 'LEFT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'LEFT') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('graph.select_leftright', 'RIGHT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'RIGHT') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('graph.select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('graph.select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('graph.select_border', 'B', 'PRESS') -kmi_props_setattr(kmi.properties, 'axis_range', False) -kmi_props_setattr(kmi.properties, 'include_handles', False) -kmi = km.keymap_items.new('graph.select_border', 'B', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'axis_range', True) -kmi_props_setattr(kmi.properties, 'include_handles', False) -kmi = km.keymap_items.new('graph.select_border', 'B', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'axis_range', False) -kmi_props_setattr(kmi.properties, 'include_handles', True) -kmi = km.keymap_items.new('graph.select_border', 'B', 'PRESS', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'axis_range', True) -kmi_props_setattr(kmi.properties, 'include_handles', True) -kmi = km.keymap_items.new('graph.select_lasso', 'EVT_TWEAK_A', 'ANY', ctrl=True) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('graph.select_lasso', 'EVT_TWEAK_A', 'ANY', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'deselect', True) -kmi = km.keymap_items.new('graph.select_circle', 'C', 'PRESS') -kmi = km.keymap_items.new('graph.select_column', 'K', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'KEYS') -kmi = km.keymap_items.new('graph.select_column', 'K', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'mode', 'CFRA') -kmi = km.keymap_items.new('graph.select_column', 'K', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'mode', 'MARKERS_COLUMN') -kmi = km.keymap_items.new('graph.select_column', 'K', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'mode', 'MARKERS_BETWEEN') -kmi = km.keymap_items.new('graph.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('graph.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('graph.select_linked', 'L', 'PRESS') -kmi = km.keymap_items.new('graph.frame_jump', 'G', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('graph.snap', 'S', 'PRESS', shift=True) -kmi = km.keymap_items.new('graph.mirror', 'M', 'PRESS', shift=True) -kmi = km.keymap_items.new('graph.handle_type', 'V', 'PRESS') -kmi = km.keymap_items.new('graph.interpolation_type', 'T', 'PRESS') -kmi = km.keymap_items.new('graph.easing_type', 'E', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('graph.smooth', 'O', 'PRESS', alt=True) -kmi = km.keymap_items.new('graph.sample', 'O', 'PRESS', shift=True) -kmi = km.keymap_items.new('graph.bake', 'C', 'PRESS', alt=True) -kmi = km.keymap_items.new('wm.call_menu', 'X', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'GRAPH_MT_delete') -kmi = km.keymap_items.new('wm.call_menu', 'DEL', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'GRAPH_MT_delete') -kmi = km.keymap_items.new('graph.duplicate_move', 'D', 'PRESS', shift=True) -kmi = km.keymap_items.new('graph.keyframe_insert', 'I', 'PRESS') -kmi = km.keymap_items.new('graph.click_insert', 'ACTIONMOUSE', 'CLICK', ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('graph.click_insert', 'ACTIONMOUSE', 'CLICK', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('graph.copy', 'C', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('graph.paste', 'V', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('graph.paste', 'V', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'flipped', True) -if platform == "darwin": - kmi = km.keymap_items.new('graph.copy', 'C', 'PRESS', oskey=True) - kmi = km.keymap_items.new('graph.paste', 'V', 'PRESS', oskey=True) - kmi = km.keymap_items.new('graph.paste', 'V', 'PRESS', shift=True, oskey=True) - kmi_props_setattr(kmi.properties, 'flipped', True) -kmi = km.keymap_items.new('graph.previewrange_set', 'P', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('graph.view_all', 'HOME', 'PRESS') -kmi = km.keymap_items.new('graph.view_all', 'NDOF_BUTTON_FIT', 'PRESS') -kmi = km.keymap_items.new('graph.view_selected', 'NUMPAD_PERIOD', 'PRESS') -kmi = km.keymap_items.new('graph.view_frame', 'NUMPAD_0', 'PRESS') -kmi = km.keymap_items.new('graph.fmodifier_add', 'M', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'only_active', False) -kmi = km.keymap_items.new('anim.channels_editable_toggle', 'TAB', 'PRESS') -kmi = km.keymap_items.new('transform.translate', 'G', 'PRESS') -kmi = km.keymap_items.new('transform.translate', 'EVT_TWEAK_S', 'ANY') -kmi = km.keymap_items.new('transform.transform', 'E', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'TIME_EXTEND') -kmi = km.keymap_items.new('transform.rotate', 'R', 'PRESS') -kmi = km.keymap_items.new('transform.resize', 'S', 'PRESS') -kmi = km.keymap_items.new('wm.context_toggle', 'O', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.use_proportional_fcurve') -kmi = km.keymap_items.new('wm.context_set_enum', 'COMMA', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.pivot_point') -kmi_props_setattr(kmi.properties, 'value', 'BOUNDING_BOX_CENTER') -kmi = km.keymap_items.new('wm.context_set_enum', 'PERIOD', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.pivot_point') -kmi_props_setattr(kmi.properties, 'value', 'CURSOR') -kmi = km.keymap_items.new('wm.context_set_enum', 'PERIOD', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.pivot_point') -kmi_props_setattr(kmi.properties, 'value', 'INDIVIDUAL_ORIGINS') -kmi = km.keymap_items.new('marker.add', 'M', 'PRESS') -kmi = km.keymap_items.new('marker.rename', 'M', 'PRESS', ctrl=True) - -# Map Image Generic -km = kc.keymaps.new('Image Generic', space_type='IMAGE_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('image.new', 'N', 'PRESS', alt=True) -kmi = km.keymap_items.new('image.open', 'O', 'PRESS', alt=True) -kmi = km.keymap_items.new('image.reload', 'R', 'PRESS', alt=True) -kmi = km.keymap_items.new('image.read_viewlayers', 'R', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('image.save', 'S', 'PRESS', alt=True) -kmi = km.keymap_items.new('image.save_as', 'F3', 'PRESS') -kmi = km.keymap_items.new('image.properties', 'N', 'PRESS') -kmi = km.keymap_items.new('image.toolshelf', 'T', 'PRESS') -kmi = km.keymap_items.new('image.cycle_render_slot', 'J', 'PRESS') -kmi = km.keymap_items.new('image.cycle_render_slot', 'J', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'reverse', True) - -# Map Image -km = kc.keymaps.new('Image', space_type='IMAGE_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('image.view_all', 'HOME', 'PRESS') -kmi = km.keymap_items.new('image.view_all', 'HOME', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'fit_view', True) -kmi = km.keymap_items.new('image.view_selected', 'NUMPAD_PERIOD', 'PRESS') -kmi = km.keymap_items.new('image.view_pan', 'MIDDLEMOUSE', 'PRESS') -kmi = km.keymap_items.new('image.view_pan', 'MIDDLEMOUSE', 'PRESS', shift=True) -kmi = km.keymap_items.new('image.view_pan', 'TRACKPADPAN', 'ANY') -kmi = km.keymap_items.new('image.view_all', 'NDOF_BUTTON_FIT', 'PRESS') -kmi = km.keymap_items.new('image.view_ndof', 'NDOF_MOTION', 'ANY') -kmi = km.keymap_items.new('image.view_zoom_in', 'WHEELINMOUSE', 'PRESS') -kmi = km.keymap_items.new('image.view_zoom_out', 'WHEELOUTMOUSE', 'PRESS') -kmi = km.keymap_items.new('image.view_zoom_in', 'NUMPAD_PLUS', 'PRESS') -kmi = km.keymap_items.new('image.view_zoom_out', 'NUMPAD_MINUS', 'PRESS') -kmi = km.keymap_items.new('image.view_zoom', 'MIDDLEMOUSE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('image.view_zoom', 'TRACKPADZOOM', 'ANY') -kmi = km.keymap_items.new('image.view_zoom', 'TRACKPADPAN', 'ANY', ctrl=True) -kmi = km.keymap_items.new('image.view_zoom_border', 'B', 'PRESS', shift=True) -kmi = km.keymap_items.new('image.view_zoom_ratio', 'NUMPAD_8', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'ratio', 8.0) -kmi = km.keymap_items.new('image.view_zoom_ratio', 'NUMPAD_4', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'ratio', 4.0) -kmi = km.keymap_items.new('image.view_zoom_ratio', 'NUMPAD_2', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'ratio', 2.0) -kmi = km.keymap_items.new('image.view_zoom_ratio', 'NUMPAD_8', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'ratio', 8.0) -kmi = km.keymap_items.new('image.view_zoom_ratio', 'NUMPAD_4', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'ratio', 4.0) -kmi = km.keymap_items.new('image.view_zoom_ratio', 'NUMPAD_2', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'ratio', 2.0) -kmi = km.keymap_items.new('image.view_zoom_ratio', 'NUMPAD_1', 'PRESS') -kmi_props_setattr(kmi.properties, 'ratio', 1.0) -kmi = km.keymap_items.new('image.view_zoom_ratio', 'NUMPAD_2', 'PRESS') -kmi_props_setattr(kmi.properties, 'ratio', 0.5) -kmi = km.keymap_items.new('image.view_zoom_ratio', 'NUMPAD_4', 'PRESS') -kmi_props_setattr(kmi.properties, 'ratio', 0.25) -kmi = km.keymap_items.new('image.view_zoom_ratio', 'NUMPAD_8', 'PRESS') -kmi_props_setattr(kmi.properties, 'ratio', 0.125) -kmi = km.keymap_items.new('image.change_frame', 'LEFTMOUSE', 'PRESS') -kmi = km.keymap_items.new('image.sample', 'ACTIONMOUSE', 'PRESS') -kmi = km.keymap_items.new('image.curves_point_set', 'ACTIONMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'point', 'BLACK_POINT') -kmi = km.keymap_items.new('image.curves_point_set', 'ACTIONMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'point', 'WHITE_POINT') -kmi = km.keymap_items.new('object.mode_set', 'TAB', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'EDIT') -kmi_props_setattr(kmi.properties, 'toggle', True) -kmi = km.keymap_items.new('wm.context_set_int', 'ONE', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.image.render_slots.active_index') -kmi_props_setattr(kmi.properties, 'value', 0) -kmi = km.keymap_items.new('wm.context_set_int', 'TWO', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.image.render_slots.active_index') -kmi_props_setattr(kmi.properties, 'value', 1) -kmi = km.keymap_items.new('wm.context_set_int', 'THREE', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.image.render_slots.active_index') -kmi_props_setattr(kmi.properties, 'value', 2) -kmi = km.keymap_items.new('wm.context_set_int', 'FOUR', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.image.render_slots.active_index') -kmi_props_setattr(kmi.properties, 'value', 3) -kmi = km.keymap_items.new('wm.context_set_int', 'FIVE', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.image.render_slots.active_index') -kmi_props_setattr(kmi.properties, 'value', 4) -kmi = km.keymap_items.new('wm.context_set_int', 'SIX', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.image.render_slots.active_index') -kmi_props_setattr(kmi.properties, 'value', 5) -kmi = km.keymap_items.new('wm.context_set_int', 'SEVEN', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.image.render_slots.active_index') -kmi_props_setattr(kmi.properties, 'value', 6) -kmi = km.keymap_items.new('wm.context_set_int', 'EIGHT', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.image.render_slots.active_index') -kmi_props_setattr(kmi.properties, 'value', 7) -kmi = km.keymap_items.new('wm.context_set_enum', 'COMMA', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.pivot_point') -kmi_props_setattr(kmi.properties, 'value', 'CENTER') -kmi = km.keymap_items.new('wm.context_set_enum', 'COMMA', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.pivot_point') -kmi_props_setattr(kmi.properties, 'value', 'MEDIAN') -kmi = km.keymap_items.new('wm.context_set_enum', 'PERIOD', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.pivot_point') -kmi_props_setattr(kmi.properties, 'value', 'CURSOR') -kmi = km.keymap_items.new('image.render_border', 'B', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('image.clear_render_border', 'B', 'PRESS', ctrl=True, alt=True) - -# Map Node Generic -km = kc.keymaps.new('Node Generic', space_type='NODE_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('node.properties', 'N', 'PRESS') -kmi = km.keymap_items.new('node.toolbar', 'T', 'PRESS') - -# Map Node Editor -km = kc.keymaps.new('Node Editor', space_type='NODE_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('node.select', 'ACTIONMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('node.select', 'SELECTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('node.select', 'ACTIONMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('node.select', 'SELECTMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('node.select', 'ACTIONMOUSE', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('node.select', 'SELECTMOUSE', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('node.select', 'ACTIONMOUSE', 'PRESS', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('node.select', 'SELECTMOUSE', 'PRESS', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('node.select', 'ACTIONMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('node.select', 'SELECTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('node.select', 'ACTIONMOUSE', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('node.select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('node.select', 'ACTIONMOUSE', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('node.select', 'SELECTMOUSE', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('node.select', 'ACTIONMOUSE', 'PRESS', shift=True, ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('node.select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('node.select_border', 'EVT_TWEAK_S', 'ANY') -kmi_props_setattr(kmi.properties, 'tweak', True) -kmi = km.keymap_items.new('node.select_lasso', 'EVT_TWEAK_A', 'ANY', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('node.select_lasso', 'EVT_TWEAK_A', 'ANY', shift=True, ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'deselect', True) -kmi = km.keymap_items.new('node.select_circle', 'C', 'PRESS') -kmi = km.keymap_items.new('node.link', 'LEFTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'detach', False) -kmi = km.keymap_items.new('node.link', 'LEFTMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'detach', True) -kmi = km.keymap_items.new('node.resize', 'LEFTMOUSE', 'PRESS') -kmi = km.keymap_items.new('node.add_reroute', 'LEFTMOUSE', 'PRESS', shift=True) -kmi = km.keymap_items.new('node.links_cut', 'LEFTMOUSE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('node.select_link_viewer', 'LEFTMOUSE', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('node.backimage_move', 'MIDDLEMOUSE', 'PRESS', alt=True) -kmi = km.keymap_items.new('node.backimage_zoom', 'V', 'PRESS') -kmi_props_setattr(kmi.properties, 'factor', 1.0 / 1.2) -kmi = km.keymap_items.new('node.backimage_zoom', 'V', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'factor', 1.2) -kmi = km.keymap_items.new('node.backimage_fit', 'HOME', 'PRESS', alt=True) -kmi = km.keymap_items.new('node.backimage_sample', 'ACTIONMOUSE', 'PRESS', alt=True) -kmi = km.keymap_items.new('node.link_make', 'F', 'PRESS') -kmi_props_setattr(kmi.properties, 'replace', False) -kmi = km.keymap_items.new('node.link_make', 'F', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'replace', True) -kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'name', 'NODE_MT_add') -kmi = km.keymap_items.new('node.duplicate_move', 'D', 'PRESS', shift=True) -kmi = km.keymap_items.new('node.duplicate_move_keep_inputs', 'D', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('node.parent_set', 'P', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('node.detach', 'P', 'PRESS', alt=True) -kmi = km.keymap_items.new('node.join', 'J', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('node.hide_toggle', 'H', 'PRESS') -kmi = km.keymap_items.new('node.mute_toggle', 'M', 'PRESS') -kmi = km.keymap_items.new('node.preview_toggle', 'H', 'PRESS', shift=True) -kmi = km.keymap_items.new('node.hide_socket_toggle', 'H', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('node.view_all', 'HOME', 'PRESS') -kmi = km.keymap_items.new('node.view_all', 'NDOF_BUTTON_FIT', 'PRESS') -kmi = km.keymap_items.new('node.view_selected', 'NUMPAD_PERIOD', 'PRESS') -kmi = km.keymap_items.new('node.select_border', 'B', 'PRESS') -kmi_props_setattr(kmi.properties, 'tweak', False) -kmi = km.keymap_items.new('node.delete', 'X', 'PRESS') -kmi = km.keymap_items.new('node.delete', 'DEL', 'PRESS') -kmi = km.keymap_items.new('node.delete_reconnect', 'X', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('node.select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('node.select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('node.select_linked_to', 'L', 'PRESS', shift=True) -kmi = km.keymap_items.new('node.select_linked_from', 'L', 'PRESS') -kmi = km.keymap_items.new('node.select_grouped', 'G', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('node.select_grouped', 'G', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('node.select_same_type_step', 'RIGHT_BRACKET', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'prev', False) -kmi = km.keymap_items.new('node.select_same_type_step', 'LEFT_BRACKET', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'prev', True) -kmi = km.keymap_items.new('node.find_node', 'F', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('node.group_make', 'G', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('node.group_ungroup', 'G', 'PRESS', alt=True) -kmi = km.keymap_items.new('node.group_separate', 'P', 'PRESS') -kmi = km.keymap_items.new('node.group_edit', 'TAB', 'PRESS') -kmi_props_setattr(kmi.properties, 'exit', False) -kmi = km.keymap_items.new('node.group_edit', 'TAB', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'exit', True) -kmi = km.keymap_items.new('node.read_viewlayers', 'R', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('node.render_changed', 'Z', 'PRESS') -kmi = km.keymap_items.new('node.clipboard_copy', 'C', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('node.clipboard_paste', 'V', 'PRESS', ctrl=True) -if platform == "darwin": - kmi = km.keymap_items.new('node.clipboard_copy', 'C', 'PRESS', oskey=True) - kmi = km.keymap_items.new('node.clipboard_paste', 'V', 'PRESS', oskey=True) -kmi = km.keymap_items.new('node.viewer_border', 'B', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('node.clear_viewer_border', 'B', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('node.translate_attach', 'G', 'PRESS') -kmi = km.keymap_items.new('node.translate_attach', 'EVT_TWEAK_A', 'ANY') -kmi = km.keymap_items.new('node.translate_attach', 'EVT_TWEAK_S', 'ANY') -kmi = km.keymap_items.new('transform.translate', 'G', 'PRESS') -kmi_props_setattr(kmi.properties, 'release_confirm', True) -kmi = km.keymap_items.new('transform.translate', 'EVT_TWEAK_A', 'ANY') -kmi_props_setattr(kmi.properties, 'release_confirm', True) -kmi = km.keymap_items.new('transform.translate', 'EVT_TWEAK_S', 'ANY') -kmi_props_setattr(kmi.properties, 'release_confirm', True) -kmi = km.keymap_items.new('transform.rotate', 'R', 'PRESS') -kmi = km.keymap_items.new('transform.resize', 'S', 'PRESS') -kmi = km.keymap_items.new('node.move_detach_links', 'D', 'PRESS', alt=True) -kmi = km.keymap_items.new('node.move_detach_links_release', 'EVT_TWEAK_A', 'ANY', alt=True) -kmi = km.keymap_items.new('node.move_detach_links', 'EVT_TWEAK_S', 'ANY', alt=True) -kmi = km.keymap_items.new('wm.context_toggle', 'TAB', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.use_snap') -kmi = km.keymap_items.new('wm.context_menu_enum', 'TAB', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.snap_node_element') - -# Map Info -km = kc.keymaps.new('Info', space_type='INFO', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('info.select_pick', 'SELECTMOUSE', 'PRESS') -kmi = km.keymap_items.new('info.select_all_toggle', 'A', 'PRESS') -kmi = km.keymap_items.new('info.select_border', 'B', 'PRESS') -kmi = km.keymap_items.new('info.report_replay', 'R', 'PRESS') -kmi = km.keymap_items.new('info.report_delete', 'X', 'PRESS') -kmi = km.keymap_items.new('info.report_delete', 'DEL', 'PRESS') -kmi = km.keymap_items.new('info.report_copy', 'C', 'PRESS', ctrl=True) -if platform == "darwin": - kmi = km.keymap_items.new('info.report_copy', 'C', 'PRESS', oskey=True) - -# Map File Browser -km = kc.keymaps.new('File Browser', space_type='FILE_BROWSER', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('file.parent', 'UP_ARROW', 'PRESS', alt=True) -kmi = km.keymap_items.new('file.previous', 'LEFT_ARROW', 'PRESS', alt=True) -kmi = km.keymap_items.new('file.next', 'RIGHT_ARROW', 'PRESS', alt=True) -kmi = km.keymap_items.new('file.refresh', 'R', 'PRESS') -kmi = km.keymap_items.new('file.parent', 'P', 'PRESS') -kmi = km.keymap_items.new('file.previous', 'BACK_SPACE', 'PRESS') -kmi = km.keymap_items.new('file.next', 'BACK_SPACE', 'PRESS', shift=True) -kmi = km.keymap_items.new('wm.context_toggle', 'H', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.params.show_hidden') -kmi = km.keymap_items.new('file.directory_new', 'I', 'PRESS') -kmi = km.keymap_items.new('file.delete', 'X', 'PRESS') -kmi = km.keymap_items.new('file.delete', 'DEL', 'PRESS') -kmi = km.keymap_items.new('file.smoothscroll', 'TIMER1', 'ANY', any=True) -kmi = km.keymap_items.new('file.bookmark_toggle', 'T', 'PRESS') -kmi = km.keymap_items.new('file.bookmark_add', 'B', 'PRESS', ctrl=True) - -# Map File Browser Main -km = kc.keymaps.new('File Browser Main', space_type='FILE_BROWSER', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('file.execute', 'LEFTMOUSE', 'DOUBLE_CLICK') -kmi_props_setattr(kmi.properties, 'need_active', True) -kmi = km.keymap_items.new('file.refresh', 'NUMPAD_PERIOD', 'PRESS') -kmi = km.keymap_items.new('file.select', 'LEFTMOUSE', 'CLICK') -kmi = km.keymap_items.new('file.select', 'LEFTMOUSE', 'CLICK', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('file.select', 'LEFTMOUSE', 'CLICK', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'fill', True) -kmi = km.keymap_items.new('file.select', 'RIGHTMOUSE', 'CLICK') -kmi_props_setattr(kmi.properties, 'open', False) -kmi = km.keymap_items.new('file.select', 'RIGHTMOUSE', 'CLICK', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'open', False) -kmi = km.keymap_items.new('file.select', 'RIGHTMOUSE', 'CLICK', alt=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'fill', True) -kmi_props_setattr(kmi.properties, 'open', False) -kmi = km.keymap_items.new('file.select_walk', 'UP_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'direction', 'UP') -kmi = km.keymap_items.new('file.select_walk', 'UP_ARROW', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'direction', 'UP') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('file.select_walk', 'UP_ARROW', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'direction', 'UP') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'fill', True) -kmi = km.keymap_items.new('file.select_walk', 'DOWN_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'direction', 'DOWN') -kmi = km.keymap_items.new('file.select_walk', 'DOWN_ARROW', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'direction', 'DOWN') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('file.select_walk', 'DOWN_ARROW', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'direction', 'DOWN') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'fill', True) -kmi = km.keymap_items.new('file.select_walk', 'LEFT_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'direction', 'LEFT') -kmi = km.keymap_items.new('file.select_walk', 'LEFT_ARROW', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'direction', 'LEFT') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('file.select_walk', 'LEFT_ARROW', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'direction', 'LEFT') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'fill', True) -kmi = km.keymap_items.new('file.select_walk', 'RIGHT_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'direction', 'RIGHT') -kmi = km.keymap_items.new('file.select_walk', 'RIGHT_ARROW', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'direction', 'RIGHT') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('file.select_walk', 'RIGHT_ARROW', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'direction', 'RIGHT') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'fill', True) -kmi = km.keymap_items.new('file.previous', 'BUTTON4MOUSE', 'CLICK') -kmi = km.keymap_items.new('file.next', 'BUTTON5MOUSE', 'CLICK') -kmi = km.keymap_items.new('file.select_all_toggle', 'A', 'PRESS') -kmi = km.keymap_items.new('file.select_border', 'B', 'PRESS') -kmi = km.keymap_items.new('file.select_border', 'EVT_TWEAK_L', 'ANY') -kmi = km.keymap_items.new('file.rename', 'LEFTMOUSE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('file.highlight', 'MOUSEMOVE', 'ANY', any=True) -kmi = km.keymap_items.new('file.filenum', 'NUMPAD_PLUS', 'PRESS') -kmi_props_setattr(kmi.properties, 'increment', 1) -kmi = km.keymap_items.new('file.filenum', 'NUMPAD_PLUS', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'increment', 10) -kmi = km.keymap_items.new('file.filenum', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'increment', 100) -kmi = km.keymap_items.new('file.filenum', 'NUMPAD_MINUS', 'PRESS') -kmi_props_setattr(kmi.properties, 'increment', -1) -kmi = km.keymap_items.new('file.filenum', 'NUMPAD_MINUS', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'increment', -10) -kmi = km.keymap_items.new('file.filenum', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'increment', -100) - -# Map File Browser Buttons -km = kc.keymaps.new('File Browser Buttons', space_type='FILE_BROWSER', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('file.filenum', 'NUMPAD_PLUS', 'PRESS') -kmi_props_setattr(kmi.properties, 'increment', 1) -kmi = km.keymap_items.new('file.filenum', 'NUMPAD_PLUS', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'increment', 10) -kmi = km.keymap_items.new('file.filenum', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'increment', 100) -kmi = km.keymap_items.new('file.filenum', 'NUMPAD_MINUS', 'PRESS') -kmi_props_setattr(kmi.properties, 'increment', -1) -kmi = km.keymap_items.new('file.filenum', 'NUMPAD_MINUS', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'increment', -10) -kmi = km.keymap_items.new('file.filenum', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'increment', -100) - -# Map NLA Generic -km = kc.keymaps.new('NLA Generic', space_type='NLA_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('nla.properties', 'N', 'PRESS') -kmi = km.keymap_items.new('nla.tweakmode_enter', 'TAB', 'PRESS') -kmi = km.keymap_items.new('nla.tweakmode_exit', 'TAB', 'PRESS') -kmi = km.keymap_items.new('nla.tweakmode_enter', 'TAB', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'isolate_action', True) -kmi = km.keymap_items.new('nla.tweakmode_exit', 'TAB', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'isolate_action', True) -kmi = km.keymap_items.new('anim.channels_find', 'F', 'PRESS', ctrl=True) - -# Map NLA Channels -km = kc.keymaps.new('NLA Channels', space_type='NLA_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('nla.channels_click', 'LEFTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('nla.channels_click', 'LEFTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('nla.tracks_add', 'A', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'above_selected', False) -kmi = km.keymap_items.new('nla.tracks_add', 'A', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'above_selected', True) -kmi = km.keymap_items.new('nla.tracks_delete', 'X', 'PRESS') -kmi = km.keymap_items.new('nla.tracks_delete', 'DEL', 'PRESS') - -# Map NLA Editor -km = kc.keymaps.new('NLA Editor', space_type='NLA_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('nla.click_select', 'SELECTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('nla.click_select', 'SELECTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('nla.select_leftright', 'SELECTMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'mode', 'CHECK') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('nla.select_leftright', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'mode', 'CHECK') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('nla.select_leftright', 'LEFT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'LEFT') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('nla.select_leftright', 'RIGHT_BRACKET', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'RIGHT') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('nla.select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('nla.select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('nla.select_border', 'B', 'PRESS') -kmi_props_setattr(kmi.properties, 'axis_range', False) -kmi = km.keymap_items.new('nla.select_border', 'B', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'axis_range', True) -kmi = km.keymap_items.new('nla.previewrange_set', 'P', 'PRESS', ctrl=True, alt=True) -kmi = km.keymap_items.new('nla.view_all', 'HOME', 'PRESS') -kmi = km.keymap_items.new('nla.view_all', 'NDOF_BUTTON_FIT', 'PRESS') -kmi = km.keymap_items.new('nla.view_selected', 'NUMPAD_PERIOD', 'PRESS') -kmi = km.keymap_items.new('nla.view_frame', 'NUMPAD_0', 'PRESS') -kmi = km.keymap_items.new('nla.actionclip_add', 'A', 'PRESS', shift=True) -kmi = km.keymap_items.new('nla.transition_add', 'T', 'PRESS', shift=True) -kmi = km.keymap_items.new('nla.soundclip_add', 'K', 'PRESS', shift=True) -kmi = km.keymap_items.new('nla.meta_add', 'G', 'PRESS', shift=True) -kmi = km.keymap_items.new('nla.meta_remove', 'G', 'PRESS', alt=True) -kmi = km.keymap_items.new('nla.duplicate', 'D', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'linked', False) -kmi = km.keymap_items.new('nla.duplicate', 'D', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'linked', True) -kmi = km.keymap_items.new('nla.make_single_user', 'U', 'PRESS') -kmi = km.keymap_items.new('nla.delete', 'X', 'PRESS') -kmi = km.keymap_items.new('nla.delete', 'DEL', 'PRESS') -kmi = km.keymap_items.new('nla.split', 'Y', 'PRESS') -kmi = km.keymap_items.new('nla.mute_toggle', 'H', 'PRESS') -kmi = km.keymap_items.new('nla.swap', 'F', 'PRESS', alt=True) -kmi = km.keymap_items.new('nla.move_up', 'PAGE_UP', 'PRESS') -kmi = km.keymap_items.new('nla.move_down', 'PAGE_DOWN', 'PRESS') -kmi = km.keymap_items.new('nla.apply_scale', 'A', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('nla.clear_scale', 'S', 'PRESS', alt=True) -kmi = km.keymap_items.new('nla.snap', 'S', 'PRESS', shift=True) -kmi = km.keymap_items.new('nla.fmodifier_add', 'M', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('transform.transform', 'G', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'TRANSLATION') -kmi = km.keymap_items.new('transform.transform', 'EVT_TWEAK_S', 'ANY') -kmi_props_setattr(kmi.properties, 'mode', 'TRANSLATION') -kmi = km.keymap_items.new('transform.transform', 'E', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'TIME_EXTEND') -kmi = km.keymap_items.new('transform.transform', 'S', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'TIME_SCALE') -kmi = km.keymap_items.new('marker.add', 'M', 'PRESS') -kmi = km.keymap_items.new('marker.rename', 'M', 'PRESS', ctrl=True) - -# Map Text Generic -km = kc.keymaps.new('Text Generic', space_type='TEXT_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('text.start_find', 'F', 'PRESS', ctrl=True) -if platform == "darwin": - kmi = km.keymap_items.new('text.start_find', 'F', 'PRESS', oskey=True) -kmi = km.keymap_items.new('text.jump', 'J', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('text.find', 'G', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('text.replace', 'H', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('text.properties', 'T', 'PRESS', ctrl=True) - -# Map Text -km = kc.keymaps.new('Text', space_type='TEXT_EDITOR', region_type='WINDOW', modal=False) - -if platform == "darwin": - kmi = km.keymap_items.new('text.move', 'LEFT_ARROW', 'PRESS', oskey=True) - kmi_props_setattr(kmi.properties, 'type', 'LINE_BEGIN') - kmi = km.keymap_items.new('text.move', 'RIGHT_ARROW', 'PRESS', oskey=True) - kmi_props_setattr(kmi.properties, 'type', 'LINE_END') - kmi = km.keymap_items.new('text.move', 'LEFT_ARROW', 'PRESS', alt=True) - kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_WORD') - kmi = km.keymap_items.new('text.move', 'RIGHT_ARROW', 'PRESS', alt=True) - kmi_props_setattr(kmi.properties, 'type', 'NEXT_WORD') - kmi = km.keymap_items.new('text.move', 'UP_ARROW', 'PRESS', oskey=True) - kmi_props_setattr(kmi.properties, 'type', 'FILE_TOP') - kmi = km.keymap_items.new('text.move', 'DOWN_ARROW', 'PRESS', oskey=True) - kmi_props_setattr(kmi.properties, 'type', 'FILE_BOTTOM') - kmi = km.keymap_items.new('text.move_select', 'LEFT_ARROW', 'PRESS', shift=True, oskey=True) - kmi_props_setattr(kmi.properties, 'type', 'LINE_BEGIN') - kmi = km.keymap_items.new('text.move_select', 'RIGHT_ARROW', 'PRESS', shift=True, oskey=True) - kmi_props_setattr(kmi.properties, 'type', 'LINE_END') - kmi = km.keymap_items.new('text.move_select', 'LEFT_ARROW', 'PRESS', shift=True, alt=True) - kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_WORD') - kmi = km.keymap_items.new('text.move_select', 'RIGHT_ARROW', 'PRESS', shift=True, alt=True) - kmi_props_setattr(kmi.properties, 'type', 'NEXT_WORD') - kmi = km.keymap_items.new('text.move_select', 'UP_ARROW', 'PRESS', shift=True, oskey=True) - kmi_props_setattr(kmi.properties, 'type', 'FILE_TOP') - kmi = km.keymap_items.new('text.move_select', 'DOWN_ARROW', 'PRESS', shift=True, oskey=True) - kmi_props_setattr(kmi.properties, 'type', 'FILE_BOTTOM') - kmi = km.keymap_items.new('text.delete', 'BACK_SPACE', 'PRESS', alt=True) - kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_WORD') - kmi = km.keymap_items.new('text.save', 'S', 'PRESS', alt=True, oskey=True) - kmi = km.keymap_items.new('text.save_as', 'S', 'PRESS', shift=True, alt=True, oskey=True) - kmi = km.keymap_items.new('text.cut', 'X', 'PRESS', oskey=True) - kmi = km.keymap_items.new('text.copy', 'C', 'PRESS', oskey=True) - kmi = km.keymap_items.new('text.paste', 'V', 'PRESS', oskey=True) - kmi = km.keymap_items.new('text.find_set_selected', 'E', 'PRESS', oskey=True) - kmi = km.keymap_items.new('text.select_all', 'A', 'PRESS', oskey=True) - kmi = km.keymap_items.new('text.select_line', 'A', 'PRESS', shift=True, oskey=True) -kmi = km.keymap_items.new('wm.context_cycle_int', 'WHEELUPMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.font_size') -kmi_props_setattr(kmi.properties, 'reverse', False) -kmi = km.keymap_items.new('wm.context_cycle_int', 'WHEELDOWNMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.font_size') -kmi_props_setattr(kmi.properties, 'reverse', True) -kmi = km.keymap_items.new('wm.context_cycle_int', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.font_size') -kmi_props_setattr(kmi.properties, 'reverse', False) -kmi = km.keymap_items.new('wm.context_cycle_int', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.font_size') -kmi_props_setattr(kmi.properties, 'reverse', True) -kmi = km.keymap_items.new('text.new', 'N', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('text.open', 'O', 'PRESS', alt=True) -kmi = km.keymap_items.new('text.reload', 'R', 'PRESS', alt=True) -kmi = km.keymap_items.new('text.save', 'S', 'PRESS', alt=True) -kmi = km.keymap_items.new('text.save_as', 'S', 'PRESS', shift=True, ctrl=True, alt=True) -kmi = km.keymap_items.new('text.run_script', 'P', 'PRESS', alt=True) -kmi = km.keymap_items.new('text.cut', 'X', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('text.copy', 'C', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('text.paste', 'V', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('text.cut', 'DEL', 'PRESS', shift=True) -kmi = km.keymap_items.new('text.copy', 'INSERT', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('text.paste', 'INSERT', 'PRESS', shift=True) -kmi = km.keymap_items.new('text.duplicate_line', 'D', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('text.select_all', 'A', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('text.select_line', 'A', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('text.select_word', 'LEFTMOUSE', 'DOUBLE_CLICK') -kmi = km.keymap_items.new('text.move_lines', 'UP_ARROW', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'direction', 'UP') -kmi = km.keymap_items.new('text.move_lines', 'DOWN_ARROW', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'direction', 'DOWN') -kmi = km.keymap_items.new('text.indent', 'TAB', 'PRESS') -kmi = km.keymap_items.new('text.unindent', 'TAB', 'PRESS', shift=True) -kmi = km.keymap_items.new('text.uncomment', 'D', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('text.move', 'HOME', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'LINE_BEGIN') -kmi = km.keymap_items.new('text.move', 'END', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'LINE_END') -kmi = km.keymap_items.new('text.move', 'E', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'LINE_END') -kmi = km.keymap_items.new('text.move', 'E', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'LINE_END') -kmi = km.keymap_items.new('text.move', 'LEFT_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_CHARACTER') -kmi = km.keymap_items.new('text.move', 'RIGHT_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'NEXT_CHARACTER') -kmi = km.keymap_items.new('text.move', 'LEFT_ARROW', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_WORD') -kmi = km.keymap_items.new('text.move', 'RIGHT_ARROW', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'NEXT_WORD') -kmi = km.keymap_items.new('text.move', 'UP_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_LINE') -kmi = km.keymap_items.new('text.move', 'DOWN_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'NEXT_LINE') -kmi = km.keymap_items.new('text.move', 'PAGE_UP', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_PAGE') -kmi = km.keymap_items.new('text.move', 'PAGE_DOWN', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'NEXT_PAGE') -kmi = km.keymap_items.new('text.move', 'HOME', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'FILE_TOP') -kmi = km.keymap_items.new('text.move', 'END', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'FILE_BOTTOM') -kmi = km.keymap_items.new('text.move_select', 'HOME', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'LINE_BEGIN') -kmi = km.keymap_items.new('text.move_select', 'END', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'LINE_END') -kmi = km.keymap_items.new('text.move_select', 'LEFT_ARROW', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_CHARACTER') -kmi = km.keymap_items.new('text.move_select', 'RIGHT_ARROW', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'NEXT_CHARACTER') -kmi = km.keymap_items.new('text.move_select', 'LEFT_ARROW', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_WORD') -kmi = km.keymap_items.new('text.move_select', 'RIGHT_ARROW', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'NEXT_WORD') -kmi = km.keymap_items.new('text.move_select', 'UP_ARROW', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_LINE') -kmi = km.keymap_items.new('text.move_select', 'DOWN_ARROW', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'NEXT_LINE') -kmi = km.keymap_items.new('text.move_select', 'PAGE_UP', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_PAGE') -kmi = km.keymap_items.new('text.move_select', 'PAGE_DOWN', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'NEXT_PAGE') -kmi = km.keymap_items.new('text.move_select', 'HOME', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'FILE_TOP') -kmi = km.keymap_items.new('text.move_select', 'END', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'FILE_BOTTOM') -kmi = km.keymap_items.new('text.delete', 'DEL', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'NEXT_CHARACTER') -kmi = km.keymap_items.new('text.delete', 'BACK_SPACE', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_CHARACTER') -kmi = km.keymap_items.new('text.delete', 'BACK_SPACE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_CHARACTER') -kmi = km.keymap_items.new('text.delete', 'DEL', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'NEXT_WORD') -kmi = km.keymap_items.new('text.delete', 'BACK_SPACE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_WORD') -kmi = km.keymap_items.new('text.overwrite_toggle', 'INSERT', 'PRESS') -kmi = km.keymap_items.new('text.scroll_bar', 'LEFTMOUSE', 'PRESS') -kmi = km.keymap_items.new('text.scroll_bar', 'MIDDLEMOUSE', 'PRESS') -kmi = km.keymap_items.new('text.scroll', 'MIDDLEMOUSE', 'PRESS') -kmi = km.keymap_items.new('text.scroll', 'TRACKPADPAN', 'ANY') -kmi = km.keymap_items.new('text.selection_set', 'EVT_TWEAK_L', 'ANY') -kmi = km.keymap_items.new('text.cursor_set', 'LEFTMOUSE', 'PRESS') -kmi = km.keymap_items.new('text.selection_set', 'LEFTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'select', True) -kmi = km.keymap_items.new('text.scroll', 'WHEELUPMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'lines', -1) -kmi = km.keymap_items.new('text.scroll', 'WHEELDOWNMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'lines', 1) -kmi = km.keymap_items.new('text.line_break', 'RET', 'PRESS') -kmi = km.keymap_items.new('text.line_break', 'NUMPAD_ENTER', 'PRESS') -kmi = km.keymap_items.new('wm.call_menu', 'RIGHTMOUSE', 'PRESS', any=True) -kmi_props_setattr(kmi.properties, 'name', 'TEXT_MT_toolbox') -kmi = km.keymap_items.new('text.autocomplete', 'SPACE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('text.line_number', 'TEXTINPUT', 'ANY', any=True) -kmi = km.keymap_items.new('text.insert', 'TEXTINPUT', 'ANY', any=True) - -# Map SequencerCommon -km = kc.keymaps.new('SequencerCommon', space_type='SEQUENCE_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('sequencer.properties', 'N', 'PRESS') -kmi = km.keymap_items.new('wm.context_toggle', 'O', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'data_path', 'scene.sequence_editor.show_overlay') -kmi = km.keymap_items.new('sequencer.view_toggle', 'TAB', 'PRESS', ctrl=True) - -# Map Sequencer -km = kc.keymaps.new('Sequencer', space_type='SEQUENCE_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('sequencer.select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('sequencer.select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('sequencer.cut', 'K', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'SOFT') -kmi = km.keymap_items.new('sequencer.cut', 'K', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'HARD') -kmi = km.keymap_items.new('sequencer.mute', 'H', 'PRESS') -kmi_props_setattr(kmi.properties, 'unselected', False) -kmi = km.keymap_items.new('sequencer.mute', 'H', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'unselected', True) -kmi = km.keymap_items.new('sequencer.unmute', 'H', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'unselected', False) -kmi = km.keymap_items.new('sequencer.unmute', 'H', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'unselected', True) -kmi = km.keymap_items.new('sequencer.lock', 'L', 'PRESS', shift=True) -kmi = km.keymap_items.new('sequencer.unlock', 'L', 'PRESS', shift=True, alt=True) -kmi = km.keymap_items.new('sequencer.reassign_inputs', 'R', 'PRESS') -kmi = km.keymap_items.new('sequencer.reload', 'R', 'PRESS', alt=True) -kmi = km.keymap_items.new('sequencer.reload', 'R', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'adjust_length', True) -kmi = km.keymap_items.new('sequencer.offset_clear', 'O', 'PRESS', alt=True) -kmi = km.keymap_items.new('sequencer.duplicate_move', 'D', 'PRESS', shift=True) -kmi = km.keymap_items.new('sequencer.delete', 'X', 'PRESS') -kmi = km.keymap_items.new('sequencer.delete', 'DEL', 'PRESS') -kmi = km.keymap_items.new('sequencer.copy', 'C', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('sequencer.paste', 'V', 'PRESS', ctrl=True) -if platform == "darwin": - kmi = km.keymap_items.new('sequencer.copy', 'C', 'PRESS', oskey=True) - kmi = km.keymap_items.new('sequencer.paste', 'V', 'PRESS', oskey=True) -kmi = km.keymap_items.new('sequencer.images_separate', 'Y', 'PRESS') -kmi = km.keymap_items.new('sequencer.meta_toggle', 'TAB', 'PRESS') -kmi = km.keymap_items.new('sequencer.meta_make', 'G', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('sequencer.meta_separate', 'G', 'PRESS', alt=True) -kmi = km.keymap_items.new('sequencer.view_all', 'HOME', 'PRESS') -kmi = km.keymap_items.new('sequencer.view_all', 'NDOF_BUTTON_FIT', 'PRESS') -kmi = km.keymap_items.new('sequencer.view_selected', 'NUMPAD_PERIOD', 'PRESS') -kmi = km.keymap_items.new('sequencer.view_frame', 'NUMPAD_0', 'PRESS') -kmi = km.keymap_items.new('sequencer.strip_jump', 'PAGE_UP', 'PRESS') -kmi_props_setattr(kmi.properties, 'next', True) -kmi_props_setattr(kmi.properties, 'center', False) -kmi = km.keymap_items.new('sequencer.strip_jump', 'PAGE_DOWN', 'PRESS') -kmi_props_setattr(kmi.properties, 'next', False) -kmi_props_setattr(kmi.properties, 'center', False) -kmi = km.keymap_items.new('sequencer.strip_jump', 'PAGE_UP', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'next', True) -kmi_props_setattr(kmi.properties, 'center', True) -kmi = km.keymap_items.new('sequencer.strip_jump', 'PAGE_DOWN', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'next', False) -kmi_props_setattr(kmi.properties, 'center', True) -kmi = km.keymap_items.new('sequencer.swap', 'LEFT_ARROW', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'side', 'LEFT') -kmi = km.keymap_items.new('sequencer.swap', 'RIGHT_ARROW', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'side', 'RIGHT') -kmi = km.keymap_items.new('sequencer.gap_remove', 'BACK_SPACE', 'PRESS') -kmi_props_setattr(kmi.properties, 'all', False) -kmi = km.keymap_items.new('sequencer.gap_remove', 'BACK_SPACE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'all', True) -kmi = km.keymap_items.new('sequencer.gap_insert', 'EQUAL', 'PRESS', shift=True) -kmi = km.keymap_items.new('sequencer.snap', 'S', 'PRESS', shift=True) -kmi = km.keymap_items.new('sequencer.swap_inputs', 'S', 'PRESS', alt=True) -kmi = km.keymap_items.new('sequencer.cut_multicam', 'ONE', 'PRESS') -kmi_props_setattr(kmi.properties, 'camera', 1) -kmi = km.keymap_items.new('sequencer.cut_multicam', 'TWO', 'PRESS') -kmi_props_setattr(kmi.properties, 'camera', 2) -kmi = km.keymap_items.new('sequencer.cut_multicam', 'THREE', 'PRESS') -kmi_props_setattr(kmi.properties, 'camera', 3) -kmi = km.keymap_items.new('sequencer.cut_multicam', 'FOUR', 'PRESS') -kmi_props_setattr(kmi.properties, 'camera', 4) -kmi = km.keymap_items.new('sequencer.cut_multicam', 'FIVE', 'PRESS') -kmi_props_setattr(kmi.properties, 'camera', 5) -kmi = km.keymap_items.new('sequencer.cut_multicam', 'SIX', 'PRESS') -kmi_props_setattr(kmi.properties, 'camera', 6) -kmi = km.keymap_items.new('sequencer.cut_multicam', 'SEVEN', 'PRESS') -kmi_props_setattr(kmi.properties, 'camera', 7) -kmi = km.keymap_items.new('sequencer.cut_multicam', 'EIGHT', 'PRESS') -kmi_props_setattr(kmi.properties, 'camera', 8) -kmi = km.keymap_items.new('sequencer.cut_multicam', 'NINE', 'PRESS') -kmi_props_setattr(kmi.properties, 'camera', 9) -kmi = km.keymap_items.new('sequencer.cut_multicam', 'ZERO', 'PRESS') -kmi_props_setattr(kmi.properties, 'camera', 10) -kmi = km.keymap_items.new('sequencer.select', 'SELECTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'linked_handle', False) -kmi_props_setattr(kmi.properties, 'left_right', 'NONE') -kmi_props_setattr(kmi.properties, 'linked_time', False) -kmi = km.keymap_items.new('sequencer.select', 'SELECTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'linked_handle', False) -kmi_props_setattr(kmi.properties, 'left_right', 'NONE') -kmi_props_setattr(kmi.properties, 'linked_time', False) -kmi = km.keymap_items.new('sequencer.select', 'SELECTMOUSE', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'linked_handle', True) -kmi_props_setattr(kmi.properties, 'left_right', 'NONE') -kmi_props_setattr(kmi.properties, 'linked_time', False) -kmi = km.keymap_items.new('sequencer.select', 'SELECTMOUSE', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'linked_handle', True) -kmi_props_setattr(kmi.properties, 'left_right', 'NONE') -kmi_props_setattr(kmi.properties, 'linked_time', False) -kmi = km.keymap_items.new('sequencer.select', 'SELECTMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', False) -kmi_props_setattr(kmi.properties, 'linked_handle', False) -kmi_props_setattr(kmi.properties, 'left_right', 'MOUSE') -kmi_props_setattr(kmi.properties, 'linked_time', True) -kmi = km.keymap_items.new('sequencer.select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi_props_setattr(kmi.properties, 'linked_handle', False) -kmi_props_setattr(kmi.properties, 'left_right', 'NONE') -kmi_props_setattr(kmi.properties, 'linked_time', True) -kmi = km.keymap_items.new('sequencer.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('sequencer.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('sequencer.select_linked_pick', 'L', 'PRESS') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('sequencer.select_linked_pick', 'L', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('sequencer.select_linked', 'L', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('sequencer.select_border', 'B', 'PRESS') -kmi = km.keymap_items.new('sequencer.select_grouped', 'G', 'PRESS', shift=True) -kmi = km.keymap_items.new('wm.call_menu', 'A', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'name', 'SEQUENCER_MT_add') -kmi = km.keymap_items.new('wm.call_menu', 'C', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'SEQUENCER_MT_change') -kmi = km.keymap_items.new('sequencer.slip', 'S', 'PRESS') -kmi = km.keymap_items.new('wm.context_set_int', 'O', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'scene.sequence_editor.overlay_frame') -kmi_props_setattr(kmi.properties, 'value', 0) -kmi = km.keymap_items.new('transform.seq_slide', 'G', 'PRESS') -kmi = km.keymap_items.new('transform.seq_slide', 'EVT_TWEAK_S', 'ANY') -kmi = km.keymap_items.new('transform.transform', 'E', 'PRESS') -kmi_props_setattr(kmi.properties, 'mode', 'TIME_EXTEND') -kmi = km.keymap_items.new('marker.add', 'M', 'PRESS') -kmi = km.keymap_items.new('marker.rename', 'M', 'PRESS', ctrl=True) - -# Map SequencerPreview -km = kc.keymaps.new('SequencerPreview', space_type='SEQUENCE_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('sequencer.view_all_preview', 'HOME', 'PRESS') -kmi = km.keymap_items.new('sequencer.view_all_preview', 'NDOF_BUTTON_FIT', 'PRESS') -kmi = km.keymap_items.new('sequencer.view_ghost_border', 'O', 'PRESS') -kmi = km.keymap_items.new('sequencer.view_zoom_ratio', 'NUMPAD_1', 'PRESS') -kmi_props_setattr(kmi.properties, 'ratio', 1.0) -kmi = km.keymap_items.new('sequencer.sample', 'ACTIONMOUSE', 'PRESS') - -# Map Console -km = kc.keymaps.new('Console', space_type='CONSOLE', region_type='WINDOW', modal=False) - -if platform == "darwin": - kmi = km.keymap_items.new('console.move', 'LEFT_ARROW', 'PRESS', oskey=True) - kmi_props_setattr(kmi.properties, 'type', 'LINE_BEGIN') - kmi = km.keymap_items.new('console.move', 'RIGHT_ARROW', 'PRESS', oskey=True) - kmi_props_setattr(kmi.properties, 'type', 'LINE_END') -kmi = km.keymap_items.new('console.move', 'LEFT_ARROW', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_WORD') -kmi = km.keymap_items.new('console.move', 'RIGHT_ARROW', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'NEXT_WORD') -kmi = km.keymap_items.new('console.move', 'HOME', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'LINE_BEGIN') -kmi = km.keymap_items.new('console.move', 'END', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'LINE_END') -kmi = km.keymap_items.new('wm.context_cycle_int', 'WHEELUPMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.font_size') -kmi_props_setattr(kmi.properties, 'reverse', False) -kmi = km.keymap_items.new('wm.context_cycle_int', 'WHEELDOWNMOUSE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.font_size') -kmi_props_setattr(kmi.properties, 'reverse', True) -kmi = km.keymap_items.new('wm.context_cycle_int', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.font_size') -kmi_props_setattr(kmi.properties, 'reverse', False) -kmi = km.keymap_items.new('wm.context_cycle_int', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.font_size') -kmi_props_setattr(kmi.properties, 'reverse', True) -kmi = km.keymap_items.new('console.move', 'LEFT_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_CHARACTER') -kmi = km.keymap_items.new('console.move', 'RIGHT_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'NEXT_CHARACTER') -kmi = km.keymap_items.new('console.history_cycle', 'UP_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'reverse', True) -kmi = km.keymap_items.new('console.history_cycle', 'DOWN_ARROW', 'PRESS') -kmi_props_setattr(kmi.properties, 'reverse', False) -kmi = km.keymap_items.new('console.delete', 'DEL', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'NEXT_CHARACTER') -kmi = km.keymap_items.new('console.delete', 'BACK_SPACE', 'PRESS') -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_CHARACTER') -kmi = km.keymap_items.new('console.delete', 'BACK_SPACE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_CHARACTER') -kmi = km.keymap_items.new('console.delete', 'DEL', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'NEXT_WORD') -kmi = km.keymap_items.new('console.delete', 'BACK_SPACE', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'type', 'PREVIOUS_WORD') -kmi = km.keymap_items.new('console.clear_line', 'RET', 'PRESS', shift=True) -kmi = km.keymap_items.new('console.clear_line', 'NUMPAD_ENTER', 'PRESS', shift=True) -kmi = km.keymap_items.new('console.execute', 'RET', 'PRESS') -kmi_props_setattr(kmi.properties, 'interactive', True) -kmi = km.keymap_items.new('console.execute', 'NUMPAD_ENTER', 'PRESS') -kmi_props_setattr(kmi.properties, 'interactive', True) -kmi = km.keymap_items.new('console.autocomplete', 'SPACE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('console.copy_as_script', 'C', 'PRESS', shift=True, ctrl=True) -kmi = km.keymap_items.new('console.copy', 'C', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('console.paste', 'V', 'PRESS', ctrl=True) -if platform == "darwin": - kmi = km.keymap_items.new('console.copy', 'C', 'PRESS', oskey=True) - kmi = km.keymap_items.new('console.paste', 'V', 'PRESS', oskey=True) -kmi = km.keymap_items.new('console.select_set', 'LEFTMOUSE', 'PRESS') -kmi = km.keymap_items.new('console.select_word', 'LEFTMOUSE', 'DOUBLE_CLICK') -kmi = km.keymap_items.new('console.insert', 'TAB', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'text', '\t') -kmi = km.keymap_items.new('console.indent', 'TAB', 'PRESS') -kmi = km.keymap_items.new('console.unindent', 'TAB', 'PRESS', shift=True) -kmi = km.keymap_items.new('console.insert', 'TEXTINPUT', 'ANY', any=True) - -# Map Clip -km = kc.keymaps.new('Clip', space_type='CLIP_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('clip.open', 'O', 'PRESS', alt=True) -kmi = km.keymap_items.new('clip.tools', 'T', 'PRESS') -kmi = km.keymap_items.new('clip.properties', 'N', 'PRESS') -kmi = km.keymap_items.new('clip.track_markers', 'LEFT_ARROW', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'backwards', True) -kmi_props_setattr(kmi.properties, 'sequence', False) -kmi = km.keymap_items.new('clip.track_markers', 'RIGHT_ARROW', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'backwards', False) -kmi_props_setattr(kmi.properties, 'sequence', False) -kmi = km.keymap_items.new('clip.track_markers', 'T', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'backwards', False) -kmi_props_setattr(kmi.properties, 'sequence', True) -kmi = km.keymap_items.new('clip.track_markers', 'T', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'backwards', True) -kmi_props_setattr(kmi.properties, 'sequence', True) -kmi = km.keymap_items.new('wm.context_toggle_enum', 'TAB', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.mode') -kmi_props_setattr(kmi.properties, 'value_1', 'TRACKING') -kmi_props_setattr(kmi.properties, 'value_2', 'MASK') -kmi = km.keymap_items.new('clip.solve_camera', 'S', 'PRESS', shift=True) -kmi = km.keymap_items.new('clip.set_solver_keyframe', 'Q', 'PRESS') -kmi_props_setattr(kmi.properties, 'keyframe', 'KEYFRAME_A') -kmi = km.keymap_items.new('clip.set_solver_keyframe', 'E', 'PRESS') -kmi_props_setattr(kmi.properties, 'keyframe', 'KEYFRAME_B') -kmi = km.keymap_items.new('clip.prefetch', 'P', 'PRESS') - -# Map Clip Editor -km = kc.keymaps.new('Clip Editor', space_type='CLIP_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('clip.view_pan', 'MIDDLEMOUSE', 'PRESS') -kmi = km.keymap_items.new('clip.view_pan', 'MIDDLEMOUSE', 'PRESS', shift=True) -kmi = km.keymap_items.new('clip.view_pan', 'TRACKPADPAN', 'ANY') -kmi = km.keymap_items.new('clip.view_zoom', 'MIDDLEMOUSE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('clip.view_zoom', 'TRACKPADZOOM', 'ANY') -kmi = km.keymap_items.new('clip.view_zoom', 'TRACKPADPAN', 'ANY', ctrl=True) -kmi = km.keymap_items.new('clip.view_zoom_in', 'WHEELINMOUSE', 'PRESS') -kmi = km.keymap_items.new('clip.view_zoom_out', 'WHEELOUTMOUSE', 'PRESS') -kmi = km.keymap_items.new('clip.view_zoom_in', 'NUMPAD_PLUS', 'PRESS') -kmi = km.keymap_items.new('clip.view_zoom_out', 'NUMPAD_MINUS', 'PRESS') -kmi = km.keymap_items.new('clip.view_zoom_ratio', 'NUMPAD_8', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'ratio', 8.0) -kmi = km.keymap_items.new('clip.view_zoom_ratio', 'NUMPAD_4', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'ratio', 4.0) -kmi = km.keymap_items.new('clip.view_zoom_ratio', 'NUMPAD_2', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'ratio', 2.0) -kmi = km.keymap_items.new('clip.view_zoom_ratio', 'NUMPAD_8', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'ratio', 8.0) -kmi = km.keymap_items.new('clip.view_zoom_ratio', 'NUMPAD_4', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'ratio', 4.0) -kmi = km.keymap_items.new('clip.view_zoom_ratio', 'NUMPAD_2', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'ratio', 2.0) -kmi = km.keymap_items.new('clip.view_zoom_ratio', 'NUMPAD_1', 'PRESS') -kmi_props_setattr(kmi.properties, 'ratio', 1.0) -kmi = km.keymap_items.new('clip.view_zoom_ratio', 'NUMPAD_2', 'PRESS') -kmi_props_setattr(kmi.properties, 'ratio', 0.5) -kmi = km.keymap_items.new('clip.view_zoom_ratio', 'NUMPAD_4', 'PRESS') -kmi_props_setattr(kmi.properties, 'ratio', 0.25) -kmi = km.keymap_items.new('clip.view_zoom_ratio', 'NUMPAD_8', 'PRESS') -kmi_props_setattr(kmi.properties, 'ratio', 0.125) -kmi = km.keymap_items.new('clip.view_all', 'HOME', 'PRESS') -kmi = km.keymap_items.new('clip.view_all', 'F', 'PRESS') -kmi_props_setattr(kmi.properties, 'fit_view', True) -kmi = km.keymap_items.new('clip.view_selected', 'NUMPAD_PERIOD', 'PRESS') -kmi = km.keymap_items.new('clip.view_all', 'NDOF_BUTTON_FIT', 'PRESS') -kmi = km.keymap_items.new('clip.view_ndof', 'NDOF_MOTION', 'ANY') -kmi = km.keymap_items.new('clip.frame_jump', 'LEFT_ARROW', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'position', 'PATHSTART') -kmi = km.keymap_items.new('clip.frame_jump', 'RIGHT_ARROW', 'PRESS', shift=True, ctrl=True) -kmi_props_setattr(kmi.properties, 'position', 'PATHEND') -kmi = km.keymap_items.new('clip.frame_jump', 'LEFT_ARROW', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'position', 'FAILEDPREV') -kmi = km.keymap_items.new('clip.frame_jump', 'RIGHT_ARROW', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'position', 'PATHSTART') -kmi = km.keymap_items.new('clip.change_frame', 'LEFTMOUSE', 'PRESS') -kmi = km.keymap_items.new('clip.select', 'SELECTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('clip.select', 'SELECTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('clip.select_all', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('clip.select_all', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('clip.select_border', 'B', 'PRESS') -kmi = km.keymap_items.new('clip.select_circle', 'C', 'PRESS') -kmi = km.keymap_items.new('wm.call_menu', 'G', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'name', 'CLIP_MT_select_grouped') -kmi = km.keymap_items.new('clip.select_lasso', 'EVT_TWEAK_A', 'ANY', ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'deselect', False) -kmi = km.keymap_items.new('clip.select_lasso', 'EVT_TWEAK_A', 'ANY', shift=True, ctrl=True, alt=True) -kmi_props_setattr(kmi.properties, 'deselect', True) -kmi = km.keymap_items.new('clip.add_marker_slide', 'LEFTMOUSE', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('clip.delete_marker', 'DEL', 'PRESS', shift=True) -kmi = km.keymap_items.new('clip.delete_marker', 'X', 'PRESS', shift=True) -kmi = km.keymap_items.new('clip.slide_marker', 'LEFTMOUSE', 'PRESS') -kmi = km.keymap_items.new('clip.disable_markers', 'D', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('clip.delete_track', 'DEL', 'PRESS') -kmi = km.keymap_items.new('clip.delete_track', 'X', 'PRESS') -kmi = km.keymap_items.new('clip.lock_tracks', 'L', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'LOCK') -kmi = km.keymap_items.new('clip.lock_tracks', 'L', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'action', 'UNLOCK') -kmi = km.keymap_items.new('clip.hide_tracks', 'H', 'PRESS') -kmi_props_setattr(kmi.properties, 'unselected', False) -kmi = km.keymap_items.new('clip.hide_tracks', 'H', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'unselected', True) -kmi = km.keymap_items.new('clip.hide_tracks_clear', 'H', 'PRESS', alt=True) -kmi = km.keymap_items.new('clip.slide_plane_marker', 'ACTIONMOUSE', 'PRESS') -kmi = km.keymap_items.new('clip.keyframe_insert', 'I', 'PRESS') -kmi = km.keymap_items.new('clip.keyframe_delete', 'I', 'PRESS', alt=True) -kmi = km.keymap_items.new('clip.join_tracks', 'J', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS') -kmi_props_setattr(kmi.properties, 'name', 'CLIP_MT_tracking_specials') -kmi = km.keymap_items.new('wm.context_toggle', 'L', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.lock_selection') -kmi = km.keymap_items.new('wm.context_toggle', 'D', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.show_disabled') -kmi = km.keymap_items.new('wm.context_toggle', 'S', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.show_marker_search') -kmi = km.keymap_items.new('wm.context_toggle', 'M', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.use_mute_footage') -kmi = km.keymap_items.new('transform.translate', 'G', 'PRESS') -kmi = km.keymap_items.new('transform.translate', 'EVT_TWEAK_S', 'ANY') -kmi = km.keymap_items.new('transform.resize', 'S', 'PRESS') -kmi = km.keymap_items.new('transform.rotate', 'R', 'PRESS') -kmi = km.keymap_items.new('clip.clear_track_path', 'T', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'action', 'REMAINED') -kmi_props_setattr(kmi.properties, 'clear_active', False) -kmi = km.keymap_items.new('clip.clear_track_path', 'T', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'action', 'UPTO') -kmi_props_setattr(kmi.properties, 'clear_active', False) -kmi = km.keymap_items.new('clip.clear_track_path', 'T', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'action', 'ALL') -kmi_props_setattr(kmi.properties, 'clear_active', False) -kmi = km.keymap_items.new('clip.cursor_set', 'ACTIONMOUSE', 'PRESS') -kmi = km.keymap_items.new('wm.context_set_enum', 'COMMA', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.pivot_point') -kmi_props_setattr(kmi.properties, 'value', 'BOUNDING_BOX_CENTER') -kmi = km.keymap_items.new('wm.context_set_enum', 'COMMA', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.pivot_point') -kmi_props_setattr(kmi.properties, 'value', 'MEDIAN_POINT') -kmi = km.keymap_items.new('wm.context_set_enum', 'PERIOD', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.pivot_point') -kmi_props_setattr(kmi.properties, 'value', 'CURSOR') -kmi = km.keymap_items.new('wm.context_set_enum', 'PERIOD', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.pivot_point') -kmi_props_setattr(kmi.properties, 'value', 'INDIVIDUAL_ORIGINS') -kmi = km.keymap_items.new('clip.copy_tracks', 'C', 'PRESS', ctrl=True) -kmi = km.keymap_items.new('clip.paste_tracks', 'V', 'PRESS', ctrl=True) - -# Map Clip Graph Editor -km = kc.keymaps.new('Clip Graph Editor', space_type='CLIP_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('clip.change_frame', 'ACTIONMOUSE', 'PRESS') -kmi = km.keymap_items.new('clip.graph_select', 'SELECTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'extend', False) -kmi = km.keymap_items.new('clip.graph_select', 'SELECTMOUSE', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('clip.graph_select_all_markers', 'A', 'PRESS') -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('clip.graph_select_all_markers', 'I', 'PRESS', ctrl=True) -kmi_props_setattr(kmi.properties, 'action', 'INVERT') -kmi = km.keymap_items.new('clip.graph_select_border', 'B', 'PRESS') -kmi = km.keymap_items.new('clip.graph_delete_curve', 'DEL', 'PRESS') -kmi = km.keymap_items.new('clip.graph_delete_curve', 'X', 'PRESS') -kmi = km.keymap_items.new('clip.graph_delete_knot', 'DEL', 'PRESS', shift=True) -kmi = km.keymap_items.new('clip.graph_delete_knot', 'X', 'PRESS', shift=True) -kmi = km.keymap_items.new('clip.graph_view_all', 'HOME', 'PRESS') -kmi = km.keymap_items.new('clip.graph_view_all', 'NDOF_BUTTON_FIT', 'PRESS') -kmi = km.keymap_items.new('clip.graph_center_current_frame', 'NUMPAD_PERIOD', 'PRESS') -kmi = km.keymap_items.new('wm.context_toggle', 'L', 'PRESS') -kmi_props_setattr(kmi.properties, 'data_path', 'space_data.lock_time_cursor') -kmi = km.keymap_items.new('clip.clear_track_path', 'T', 'PRESS', alt=True) -kmi_props_setattr(kmi.properties, 'action', 'REMAINED') -kmi_props_setattr(kmi.properties, 'clear_active', True) -kmi = km.keymap_items.new('clip.clear_track_path', 'T', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'action', 'UPTO') -kmi_props_setattr(kmi.properties, 'clear_active', True) -kmi = km.keymap_items.new('clip.clear_track_path', 'T', 'PRESS', shift=True, alt=True) -kmi_props_setattr(kmi.properties, 'action', 'ALL') -kmi_props_setattr(kmi.properties, 'clear_active', True) -kmi = km.keymap_items.new('clip.graph_disable_markers', 'D', 'PRESS', shift=True) -kmi_props_setattr(kmi.properties, 'action', 'TOGGLE') -kmi = km.keymap_items.new('transform.translate', 'G', 'PRESS') -kmi = km.keymap_items.new('transform.translate', 'EVT_TWEAK_S', 'ANY') -kmi = km.keymap_items.new('transform.resize', 'S', 'PRESS') -kmi = km.keymap_items.new('transform.rotate', 'R', 'PRESS') - -# Map Clip Dopesheet Editor -km = kc.keymaps.new('Clip Dopesheet Editor', space_type='CLIP_EDITOR', region_type='WINDOW', modal=False) - -kmi = km.keymap_items.new('clip.dopesheet_select_channel', 'LEFTMOUSE', 'PRESS') -kmi_props_setattr(kmi.properties, 'extend', True) -kmi = km.keymap_items.new('clip.dopesheet_view_all', 'HOME', 'PRESS') -kmi = km.keymap_items.new('clip.dopesheet_view_all', 'NDOF_BUTTON_FIT', 'PRESS') +keyconfig_data = [ + ( + "Window", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ("wm.window_new", {"type": 'W', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ("wm.read_homefile", {"type": 'N', "value": 'PRESS', "ctrl": True}, None), + ("wm.save_homefile", {"type": 'U', "value": 'PRESS', "ctrl": True}, None), + ( + "wm.call_menu", + {"type": 'O', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("name", 'INFO_MT_file_open_recent'), + ], + } + ), + ("wm.open_mainfile", {"type": 'O', "value": 'PRESS', "ctrl": True}, None), + ("wm.open_mainfile", {"type": 'F1', "value": 'PRESS'}, None), + ("wm.link", {"type": 'O', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ("wm.append", {"type": 'F1', "value": 'PRESS', "shift": True}, None), + ("wm.save_mainfile", {"type": 'S', "value": 'PRESS', "ctrl": True}, None), + ("wm.save_mainfile", {"type": 'W', "value": 'PRESS', "ctrl": True}, None), + ("wm.save_as_mainfile", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ("wm.save_as_mainfile", {"type": 'F2', "value": 'PRESS'}, None), + ( + "wm.save_as_mainfile", + {"type": 'S', "value": 'PRESS', "ctrl": True, "alt": True}, + { + "properties": [ + ("copy", True), + ], + } + ), + ("wm.window_fullscreen_toggle", {"type": 'F11', "value": 'PRESS', "alt": True}, None), + ("wm.quit_blender", {"type": 'Q', "value": 'PRESS', "ctrl": True}, None), + ("wm.doc_view_manual_ui_context", {"type": 'F1', "value": 'PRESS', "alt": True}, None), + ("wm.redraw_timer", {"type": 'T', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ("wm.debug_menu", {"type": 'D', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ( + "wm.call_menu", + {"type": 'NDOF_BUTTON_MENU', "value": 'PRESS'}, + { + "properties": [ + ("name", 'USERPREF_MT_ndof_settings'), + ], + } + ), + ("wm.search_menu", {"type": 'SPACE', "value": 'PRESS'}, None), + ( + "wm.context_set_enum", + {"type": 'F3', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'area.type'), + ("value", 'NODE_EDITOR'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'F4', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'area.type'), + ("value", 'CONSOLE'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'F5', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'area.type'), + ("value", 'VIEW_3D'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'F6', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'area.type'), + ("value", 'GRAPH_EDITOR'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'F7', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'area.type'), + ("value", 'PROPERTIES'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'F8', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'area.type'), + ("value", 'SEQUENCE_EDITOR'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'F9', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'area.type'), + ("value", 'OUTLINER'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'F10', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'area.type'), + ("value", 'IMAGE_EDITOR'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'F11', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'area.type'), + ("value", 'TEXT_EDITOR'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'F12', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'area.type'), + ("value", 'DOPESHEET_EDITOR'), + ], + } + ), + ( + "wm.context_scale_float", + {"type": 'NDOF_BUTTON_PLUS', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'user_preferences.inputs.ndof_sensitivity'), + ("value", 1.1), + ], + } + ), + ( + "wm.context_scale_float", + {"type": 'NDOF_BUTTON_MINUS', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'user_preferences.inputs.ndof_sensitivity'), + ("value", 1.0), + ], + } + ), + ( + "wm.context_scale_float", + {"type": 'NDOF_BUTTON_PLUS', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'user_preferences.inputs.ndof_sensitivity'), + ("value", 1.5), + ], + } + ), + ( + "wm.context_scale_float", + {"type": 'NDOF_BUTTON_MINUS', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'user_preferences.inputs.ndof_sensitivity'), + ("value", 0.6666667), + ], + } + ), + ("info.reports_display_update", {"type": 'TIMER_REPORT', "value": 'ANY', "any": True}, None), + ], + }, + ), + ( + "Screen", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ("screen.animation_step", {"type": 'TIMER0', "value": 'ANY', "any": True}, None), + ("screen.region_blend", {"type": 'TIMERREGION', "value": 'ANY', "any": True}, None), + ( + "screen.screen_set", + {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("delta", 1), + ], + } + ), + ( + "screen.screen_set", + {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("delta", -1), + ], + } + ), + ("screen.screen_full_area", {"type": 'SPACE', "value": 'PRESS', "shift": True}, None), + ( + "screen.screen_full_area", + {"type": 'SPACE', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("use_hide_panels", True), + ], + } + ), + ("screen.screenshot", {"type": 'F3', "value": 'PRESS', "ctrl": True}, None), + ("screen.screencast", {"type": 'F3', "value": 'PRESS', "alt": True}, None), + ( + "screen.space_context_cycle", + {"type": 'TAB', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("direction", 'NEXT'), + ], + } + ), + ( + "screen.space_context_cycle", + {"type": 'TAB', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("direction", 'PREV'), + ], + } + ), + ("screen.region_quadview", {"type": 'Q', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ("screen.repeat_history", {"type": 'F3', "value": 'PRESS'}, None), + ("screen.repeat_last", {"type": 'R', "value": 'PRESS', "shift": True}, None), + ("screen.region_flip", {"type": 'F5', "value": 'PRESS'}, None), + ("screen.redo_last", {"type": 'F6', "value": 'PRESS'}, None), + ("script.reload", {"type": 'F8', "value": 'PRESS'}, None), + ("file.execute", {"type": 'RET', "value": 'PRESS'}, None), + ("file.execute", {"type": 'NUMPAD_ENTER', "value": 'PRESS'}, None), + ("file.cancel", {"type": 'ESC', "value": 'PRESS'}, None), + ("ed.undo", {"type": 'Z', "value": 'PRESS', "ctrl": True}, None), + ("ed.redo", {"type": 'Z', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ("ed.undo_history", {"type": 'Z', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ( + "render.render", + {"type": 'F12', "value": 'PRESS'}, + { + "properties": [ + ("use_viewport", True), + ], + } + ), + ( + "render.render", + {"type": 'F12', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("animation", True), + ("use_viewport", True), + ], + } + ), + ("render.view_cancel", {"type": 'ESC', "value": 'PRESS'}, None), + ("render.view_show", {"type": 'F11', "value": 'PRESS'}, None), + ("render.play_rendered_anim", {"type": 'F11', "value": 'PRESS', "ctrl": True}, None), + ("screen.userpref_show", {"type": 'U', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ], + }, + ), + ( + "User Interface", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ("ui.eyedropper_color", {"type": 'E', "value": 'PRESS'}, None), + ("ui.eyedropper_colorband", {"type": 'E', "value": 'PRESS'}, None), + ("ui.eyedropper_colorband_point", {"type": 'E', "value": 'PRESS', "alt": True}, None), + ("ui.eyedropper_id", {"type": 'E', "value": 'PRESS'}, None), + ("ui.eyedropper_depth", {"type": 'E', "value": 'PRESS'}, None), + ("ui.copy_data_path_button", {"type": 'C', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ( + "ui.copy_data_path_button", + {"type": 'C', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, + { + "properties": [ + ("full_path", True), + ], + } + ), + ("anim.keyframe_insert_button", {"type": 'I', "value": 'PRESS'}, None), + ("anim.keyframe_delete_button", {"type": 'I', "value": 'PRESS', "alt": True}, None), + ("anim.keyframe_clear_button", {"type": 'I', "value": 'PRESS', "shift": True, "alt": True}, None), + ("anim.driver_button_add", {"type": 'D', "value": 'PRESS', "ctrl": True}, None), + ("anim.driver_button_remove", {"type": 'D', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ("anim.keyingset_button_add", {"type": 'K', "value": 'PRESS'}, None), + ("anim.keyingset_button_remove", {"type": 'K', "value": 'PRESS', "alt": True}, None), + ], + }, + ), + ( + "View2D", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ("view2d.scroller_activate", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), + ("view2d.scroller_activate", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None), + ("view2d.pan", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None), + ("view2d.pan", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "shift": True}, None), + ("view2d.pan", {"type": 'TRACKPADPAN', "value": 'ANY'}, None), + ("view2d.scroll_right", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "ctrl": True}, None), + ("view2d.scroll_left", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "ctrl": True}, None), + ("view2d.scroll_down", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "shift": True}, None), + ("view2d.scroll_up", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "shift": True}, None), + ("view2d.ndof", {"type": 'NDOF_MOTION', "value": 'ANY'}, None), + ("view2d.zoom_out", {"type": 'WHEELOUTMOUSE', "value": 'PRESS'}, None), + ("view2d.zoom_in", {"type": 'WHEELINMOUSE', "value": 'PRESS'}, None), + ("view2d.zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, None), + ("view2d.zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, None), + ("view2d.zoom", {"type": 'TRACKPADPAN', "value": 'ANY', "ctrl": True}, None), + ("view2d.smoothview", {"type": 'TIMER1', "value": 'ANY', "any": True}, None), + ("view2d.scroll_down", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'}, None), + ("view2d.scroll_up", {"type": 'WHEELUPMOUSE', "value": 'PRESS'}, None), + ("view2d.scroll_right", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'}, None), + ("view2d.scroll_left", {"type": 'WHEELUPMOUSE', "value": 'PRESS'}, None), + ("view2d.zoom", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "ctrl": True}, None), + ("view2d.zoom", {"type": 'TRACKPADZOOM', "value": 'ANY'}, None), + ("view2d.zoom_border", {"type": 'B', "value": 'PRESS', "shift": True}, None), + ], + }, + ), + ( + "Header", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ("screen.header_toolbox", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, None), + ], + }, + ), + ( + "View2D Buttons List", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ("view2d.scroller_activate", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), + ("view2d.scroller_activate", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None), + ("view2d.pan", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None), + ("view2d.pan", {"type": 'TRACKPADPAN', "value": 'ANY'}, None), + ("view2d.scroll_down", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'}, None), + ("view2d.scroll_up", {"type": 'WHEELUPMOUSE', "value": 'PRESS'}, None), + ( + "view2d.scroll_down", + {"type": 'PAGE_DOWN', "value": 'PRESS'}, + { + "properties": [ + ("page", True), + ], + } + ), + ( + "view2d.scroll_up", + {"type": 'PAGE_UP', "value": 'PRESS'}, + { + "properties": [ + ("page", True), + ], + } + ), + ("view2d.zoom", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "ctrl": True}, None), + ("view2d.zoom", {"type": 'TRACKPADZOOM', "value": 'ANY'}, None), + ("view2d.zoom", {"type": 'TRACKPADPAN', "value": 'ANY', "ctrl": True}, None), + ("view2d.zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, None), + ("view2d.zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, None), + ("view2d.reset", {"type": 'HOME', "value": 'PRESS'}, None), + ], + }, + ), + ( + "Frames", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ( + "screen.frame_offset", + {"type": 'UP_ARROW', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("delta", 10), + ], + } + ), + ( + "screen.frame_offset", + {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("delta", -10), + ], + } + ), + ( + "screen.frame_offset", + {"type": 'LEFT_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("delta", -1), + ], + } + ), + ( + "screen.frame_offset", + {"type": 'RIGHT_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("delta", 1), + ], + } + ), + ( + "screen.frame_offset", + {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("delta", 1), + ], + } + ), + ( + "screen.frame_offset", + {"type": 'WHEELUPMOUSE', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("delta", -1), + ], + } + ), + ( + "screen.frame_jump", + {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("end", True), + ], + } + ), + ( + "screen.frame_jump", + {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("end", False), + ], + } + ), + ( + "screen.frame_jump", + {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("end", True), + ], + } + ), + ( + "screen.frame_jump", + {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("end", False), + ], + } + ), + ( + "screen.keyframe_jump", + {"type": 'UP_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("next", True), + ], + } + ), + ( + "screen.keyframe_jump", + {"type": 'DOWN_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("next", False), + ], + } + ), + ( + "screen.keyframe_jump", + {"type": 'MEDIA_LAST', "value": 'PRESS'}, + { + "properties": [ + ("next", True), + ], + } + ), + ( + "screen.keyframe_jump", + {"type": 'MEDIA_FIRST', "value": 'PRESS'}, + { + "properties": [ + ("next", False), + ], + } + ), + ("screen.animation_play", {"type": 'A', "value": 'PRESS', "alt": True}, None), + ( + "screen.animation_play", + {"type": 'A', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("reverse", True), + ], + } + ), + ("screen.animation_cancel", {"type": 'ESC', "value": 'PRESS'}, None), + ("screen.animation_play", {"type": 'MEDIA_PLAY', "value": 'PRESS'}, None), + ("screen.animation_cancel", {"type": 'MEDIA_STOP', "value": 'PRESS'}, None), + ], + }, + ), + ( + "Property Editor", + {"space_type": 'PROPERTIES', "region_type": 'WINDOW'}, + { + "items": [ + ("buttons.toolbox", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, None), + ], + }, + ), + ( + "Info", + {"space_type": 'INFO', "region_type": 'WINDOW'}, + { + "items": [ + ("info.select_pick", {"type": 'SELECTMOUSE', "value": 'PRESS'}, None), + ("info.select_all_toggle", {"type": 'A', "value": 'PRESS'}, None), + ("info.select_border", {"type": 'B', "value": 'PRESS'}, None), + ("info.report_replay", {"type": 'R', "value": 'PRESS'}, None), + ("info.report_delete", {"type": 'X', "value": 'PRESS'}, None), + ("info.report_delete", {"type": 'DEL', "value": 'PRESS'}, None), + ("info.report_copy", {"type": 'C', "value": 'PRESS', "ctrl": True}, None), + ], + }, + ), + ( + "Outliner", + {"space_type": 'OUTLINER', "region_type": 'WINDOW'}, + { + "items": [ + ("outliner.highlight_update", {"type": 'MOUSEMOVE', "value": 'ANY', "any": True}, None), + ("outliner.item_rename", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, None), + ( + "outliner.item_activate", + {"type": 'LEFTMOUSE', "value": 'CLICK'}, + { + "properties": [ + ("extend", False), + ("recursive", False), + ], + } + ), + ( + "outliner.item_activate", + {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True}, + { + "properties": [ + ("extend", True), + ("recursive", False), + ], + } + ), + ( + "outliner.item_activate", + {"type": 'LEFTMOUSE', "value": 'CLICK', "ctrl": True}, + { + "properties": [ + ("extend", False), + ("recursive", True), + ], + } + ), + ( + "outliner.item_activate", + {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True, "ctrl": True}, + { + "properties": [ + ("extend", True), + ("recursive", True), + ], + } + ), + ("outliner.select_border", {"type": 'B', "value": 'PRESS'}, None), + ( + "outliner.item_openclose", + {"type": 'RET', "value": 'PRESS'}, + { + "properties": [ + ("all", False), + ], + } + ), + ( + "outliner.item_openclose", + {"type": 'RET', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("all", True), + ], + } + ), + ("outliner.item_rename", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, None), + ("outliner.operation", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, None), + ("outliner.item_drag_drop", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, None), + ("outliner.show_hierarchy", {"type": 'HOME', "value": 'PRESS'}, None), + ("outliner.show_active", {"type": 'PERIOD', "value": 'PRESS'}, None), + ("outliner.show_active", {"type": 'NUMPAD_PERIOD', "value": 'PRESS'}, None), + ( + "outliner.scroll_page", + {"type": 'PAGE_DOWN', "value": 'PRESS'}, + { + "properties": [ + ("up", False), + ], + } + ), + ( + "outliner.scroll_page", + {"type": 'PAGE_UP', "value": 'PRESS'}, + { + "properties": [ + ("up", True), + ], + } + ), + ("outliner.show_one_level", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, None), + ( + "outliner.show_one_level", + {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, + { + "properties": [ + ("open", False), + ], + } + ), + ( + "outliner.select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ("outliner.expanded_toggle", {"type": 'A', "value": 'PRESS', "shift": True}, None), + ("outliner.keyingset_add_selected", {"type": 'K', "value": 'PRESS'}, None), + ("outliner.keyingset_remove_selected", {"type": 'K', "value": 'PRESS', "alt": True}, None), + ("anim.keyframe_insert", {"type": 'I', "value": 'PRESS'}, None), + ("anim.keyframe_delete", {"type": 'I', "value": 'PRESS', "alt": True}, None), + ("outliner.drivers_add_selected", {"type": 'D', "value": 'PRESS'}, None), + ("outliner.drivers_delete_selected", {"type": 'D', "value": 'PRESS', "alt": True}, None), + ("outliner.collection_new", {"type": 'C', "value": 'PRESS'}, None), + ("outliner.collection_delete", {"type": 'X', "value": 'PRESS'}, None), + ], + }, + ), + ( + "3D View Generic", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + { + "items": [ + ("view3d.properties", {"type": 'N', "value": 'PRESS'}, None), + ("view3d.toolshelf", {"type": 'T', "value": 'PRESS'}, None), + ], + }, + ), + ( + "Grease Pencil", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ( + "gpencil.draw", + {"type": 'LEFTMOUSE', "value": 'PRESS', "key_modifier": 'D'}, + { + "properties": [ + ("mode", 'DRAW'), + ("wait_for_input", False), + ], + } + ), + ( + "gpencil.draw", + {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True, "key_modifier": 'D'}, + { + "properties": [ + ("mode", 'DRAW_STRAIGHT'), + ("wait_for_input", False), + ], + } + ), + ( + "gpencil.draw", + {"type": 'RIGHTMOUSE', "value": 'PRESS', "ctrl": True, "key_modifier": 'D'}, + { + "properties": [ + ("mode", 'DRAW_POLY'), + ("wait_for_input", False), + ], + } + ), + ( + "gpencil.draw", + {"type": 'RIGHTMOUSE', "value": 'PRESS', "key_modifier": 'D'}, + { + "properties": [ + ("mode", 'ERASER'), + ("wait_for_input", False), + ], + } + ), + ( + "gpencil.draw", + {"type": 'ERASER', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'ERASER'), + ("wait_for_input", False), + ], + } + ), + ("gpencil.editmode_toggle", {"type": 'TAB', "value": 'PRESS', "key_modifier": 'D'}, None), + ( + "wm.call_menu_pie", + {"type": 'Q', "value": 'PRESS', "key_modifier": 'D'}, + { + "properties": [ + ("name", 'GPENCIL_MT_pie_tool_palette'), + ], + } + ), + ( + "wm.call_menu_pie", + {"type": 'W', "value": 'PRESS', "key_modifier": 'D'}, + { + "properties": [ + ("name", 'GPENCIL_MT_pie_settings_palette'), + ], + } + ), + ("gpencil.blank_frame_add", {"type": 'B', "value": 'PRESS', "key_modifier": 'D'}, None), + ("gpencil.active_frames_delete_all", {"type": 'X', "value": 'PRESS', "key_modifier": 'D'}, None), + ], + }, + ), + ( + "Grease Pencil Stroke Edit Mode", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ("gpencil.editmode_toggle", {"type": 'TAB', "value": 'PRESS'}, None), + ( + "wm.call_menu_pie", + {"type": 'E', "value": 'PRESS', "key_modifier": 'D'}, + { + "properties": [ + ("name", 'GPENCIL_MT_pie_sculpt'), + ], + } + ), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path_primary", 'user_preferences.edit.grease_pencil_eraser_radius'), + ], + } + ), + ("gpencil.interpolate", {"type": 'E', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ("gpencil.interpolate_sequence", {"type": 'E', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ( + "gpencil.brush_paint", + {"type": 'LEFTMOUSE', "value": 'PRESS', "key_modifier": 'E'}, + { + "properties": [ + ("wait_for_input", False), + ], + } + ), + ( + "gpencil.brush_paint", + {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True, "key_modifier": 'E'}, + { + "properties": [ + ("wait_for_input", False), + ], + } + ), + ( + "gpencil.brush_paint", + {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "key_modifier": 'E'}, + { + "properties": [ + ("wait_for_input", False), + ], + } + ), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path_primary", 'tool_settings.gpencil_sculpt.brush.strength'), + ], + } + ), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS'}, + { + "properties": [ + ("data_path_primary", 'tool_settings.gpencil_sculpt.brush.size'), + ], + } + ), + ( + "gpencil.select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "gpencil.select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ("gpencil.select_circle", {"type": 'C', "value": 'PRESS'}, None), + ("gpencil.select_border", {"type": 'B', "value": 'PRESS'}, None), + ( + "gpencil.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "ctrl": True}, + { + "properties": [ + ("deselect", False), + ], + } + ), + ( + "gpencil.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "shift": True, "ctrl": True}, + { + "properties": [ + ("deselect", True), + ], + } + ), + ( + "gpencil.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "ctrl": True, "alt": True}, + { + "properties": [ + ("deselect", False), + ], + } + ), + ( + "gpencil.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "shift": True, "ctrl": True, "alt": True}, + { + "properties": [ + ("deselect", True), + ], + } + ), + ("gpencil.select", {"type": 'SELECTMOUSE', "value": 'PRESS'}, None), + ( + "gpencil.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", True), + ("toggle", True), + ], + } + ), + ( + "gpencil.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("entire_strokes", True), + ], + } + ), + ("gpencil.select_linked", {"type": 'L', "value": 'PRESS'}, None), + ("gpencil.select_linked", {"type": 'L', "value": 'PRESS', "ctrl": True}, None), + ("gpencil.select_grouped", {"type": 'G', "value": 'PRESS', "shift": True}, None), + ("gpencil.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None), + ("gpencil.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None), + ("gpencil.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None), + ( + "wm.call_menu", + {"type": 'X', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_edit_gpencil_delete'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'DEL', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_edit_gpencil_delete'), + ], + } + ), + ("gpencil.dissolve", {"type": 'X', "value": 'PRESS', "ctrl": True}, None), + ("gpencil.dissolve", {"type": 'DEL', "value": 'PRESS', "ctrl": True}, None), + ("gpencil.active_frames_delete_all", {"type": 'X', "value": 'PRESS', "shift": True}, None), + ( + "wm.call_menu", + {"type": 'W', "value": 'PRESS'}, + { + "properties": [ + ("name", 'GPENCIL_MT_gpencil_edit_specials'), + ], + } + ), + ("gpencil.stroke_join", {"type": 'J', "value": 'PRESS', "ctrl": True}, None), + ( + "gpencil.stroke_join", + {"type": 'J', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("type", 'JOINCOPY'), + ], + } + ), + ("gpencil.copy", {"type": 'C', "value": 'PRESS', "ctrl": True}, None), + ("gpencil.paste", {"type": 'V', "value": 'PRESS', "ctrl": True}, None), + ( + "wm.call_menu", + {"type": 'S', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("name", 'GPENCIL_MT_snap'), + ], + } + ), + ("gpencil.convert", {"type": 'C', "value": 'PRESS', "alt": True}, None), + ("gpencil.reveal", {"type": 'H', "value": 'PRESS', "alt": True}, None), + ( + "gpencil.hide", + {"type": 'H', "value": 'PRESS'}, + { + "properties": [ + ("unselected", False), + ], + } + ), + ( + "gpencil.hide", + {"type": 'H', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("unselected", True), + ], + } + ), + ("gpencil.selection_opacity_toggle", {"type": 'H', "value": 'PRESS', "ctrl": True}, None), + ("gpencil.layer_isolate", {"type": 'NUMPAD_ASTERIX', "value": 'PRESS'}, None), + ("gpencil.move_to_layer", {"type": 'M', "value": 'PRESS'}, None), + ( + "gpencil.brush_select", + {"type": 'ONE', "value": 'PRESS'}, + { + "properties": [ + ("index", 0), + ], + } + ), + ( + "gpencil.brush_select", + {"type": 'TWO', "value": 'PRESS'}, + { + "properties": [ + ("index", 1), + ], + } + ), + ( + "gpencil.brush_select", + {"type": 'THREE', "value": 'PRESS'}, + { + "properties": [ + ("index", 2), + ], + } + ), + ( + "gpencil.brush_select", + {"type": 'FOUR', "value": 'PRESS'}, + { + "properties": [ + ("index", 3), + ], + } + ), + ( + "gpencil.brush_select", + {"type": 'FIVE', "value": 'PRESS'}, + { + "properties": [ + ("index", 4), + ], + } + ), + ( + "gpencil.brush_select", + {"type": 'SIX', "value": 'PRESS'}, + { + "properties": [ + ("index", 5), + ], + } + ), + ( + "gpencil.brush_select", + {"type": 'SEVEN', "value": 'PRESS'}, + { + "properties": [ + ("index", 6), + ], + } + ), + ( + "gpencil.brush_select", + {"type": 'EIGHT', "value": 'PRESS'}, + { + "properties": [ + ("index", 7), + ], + } + ), + ( + "gpencil.brush_select", + {"type": 'NINE', "value": 'PRESS'}, + { + "properties": [ + ("index", 8), + ], + } + ), + ( + "gpencil.brush_select", + {"type": 'ZERO', "value": 'PRESS'}, + { + "properties": [ + ("index", 9), + ], + } + ), + ("transform.translate", {"type": 'G', "value": 'PRESS'}, None), + ("transform.translate", {"type": 'EVT_TWEAK_S', "value": 'ANY'}, None), + ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None), + ("transform.resize", {"type": 'S', "value": 'PRESS'}, None), + ("transform.mirror", {"type": 'M', "value": 'PRESS', "ctrl": True}, None), + ("transform.bend", {"type": 'W', "value": 'PRESS', "shift": True}, None), + ("transform.tosphere", {"type": 'S', "value": 'PRESS', "shift": True, "alt": True}, None), + ("transform.shear", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None), + ( + "transform.transform", + {"type": 'S', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("mode", 'GPENCIL_SHRINKFATTEN'), + ], + } + ), + ( + "wm.context_cycle_enum", + {"type": 'O', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit_falloff'), + ("wrap", True), + ], + } + ), + ( + "wm.context_toggle_enum", + {"type": 'O', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit'), + ("value_1", 'DISABLED'), + ("value_2", 'ENABLED'), + ], + } + ), + ( + "wm.context_toggle_enum", + {"type": 'O', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit'), + ("value_1", 'DISABLED'), + ("value_2", 'CONNECTED'), + ], + } + ), + ], + }, + ), + ( + "Face Mask", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ( + "paint.face_select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "paint.face_select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ( + "paint.face_select_hide", + {"type": 'H', "value": 'PRESS'}, + { + "properties": [ + ("unselected", False), + ], + } + ), + ( + "paint.face_select_hide", + {"type": 'H', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("unselected", True), + ], + } + ), + ("paint.face_select_reveal", {"type": 'H', "value": 'PRESS', "alt": True}, None), + ("paint.face_select_linked", {"type": 'L', "value": 'PRESS', "ctrl": True}, None), + ( + "paint.face_select_linked_pick", + {"type": 'L', "value": 'PRESS'}, + { + "properties": [ + ("deselect", False), + ], + } + ), + ( + "paint.face_select_linked_pick", + {"type": 'L', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("deselect", True), + ], + } + ), + ], + }, + ), + ( + "Weight Paint Vertex Selection", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ( + "paint.vert_select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "paint.vert_select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ("view3d.select_border", {"type": 'B', "value": 'PRESS'}, None), + ( + "view3d.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "ctrl": True}, + { + "properties": [ + ("deselect", False), + ], + } + ), + ( + "view3d.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "shift": True, "ctrl": True}, + { + "properties": [ + ("deselect", True), + ], + } + ), + ("view3d.select_circle", {"type": 'C', "value": 'PRESS'}, None), + ], + }, + ), + ( + "Pose", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ("object.parent_set", {"type": 'P', "value": 'PRESS', "ctrl": True}, None), + ( + "wm.call_menu", + {"type": 'A', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("name", 'INFO_MT_add'), + ], + } + ), + ( + "pose.hide", + {"type": 'H', "value": 'PRESS'}, + { + "properties": [ + ("unselected", False), + ], + } + ), + ( + "pose.hide", + {"type": 'H', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("unselected", True), + ], + } + ), + ("pose.reveal", {"type": 'H', "value": 'PRESS', "alt": True}, None), + ( + "wm.call_menu", + {"type": 'A', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_pose_apply'), + ], + } + ), + ("pose.rot_clear", {"type": 'R', "value": 'PRESS', "alt": True}, None), + ("pose.loc_clear", {"type": 'G', "value": 'PRESS', "alt": True}, None), + ("pose.scale_clear", {"type": 'S', "value": 'PRESS', "alt": True}, None), + ("pose.quaternions_flip", {"type": 'F', "value": 'PRESS', "alt": True}, None), + ("pose.rotation_mode_set", {"type": 'R', "value": 'PRESS', "ctrl": True}, None), + ("pose.copy", {"type": 'C', "value": 'PRESS', "ctrl": True}, None), + ( + "pose.paste", + {"type": 'V', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("flipped", False), + ], + } + ), + ( + "pose.paste", + {"type": 'V', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("flipped", True), + ], + } + ), + ( + "pose.select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "pose.select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ("pose.select_parent", {"type": 'P', "value": 'PRESS', "shift": True}, None), + ( + "pose.select_hierarchy", + {"type": 'LEFT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("direction", 'PARENT'), + ("extend", False), + ], + } + ), + ( + "pose.select_hierarchy", + {"type": 'LEFT_BRACKET', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("direction", 'PARENT'), + ("extend", True), + ], + } + ), + ( + "pose.select_hierarchy", + {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("direction", 'CHILD'), + ("extend", False), + ], + } + ), + ( + "pose.select_hierarchy", + {"type": 'RIGHT_BRACKET', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("direction", 'CHILD'), + ("extend", True), + ], + } + ), + ("pose.select_linked", {"type": 'L', "value": 'PRESS'}, None), + ("pose.select_grouped", {"type": 'G', "value": 'PRESS', "shift": True}, None), + ("pose.select_mirror", {"type": 'F', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ("pose.constraint_add_with_targets", {"type": 'C', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ("pose.constraints_clear", {"type": 'C', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ("pose.ik_add", {"type": 'I', "value": 'PRESS', "shift": True}, None), + ("pose.ik_clear", {"type": 'I', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ( + "wm.call_menu", + {"type": 'G', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_pose_group'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'W', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_bone_options_toggle'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'W', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_bone_options_enable'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'W', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_bone_options_disable'), + ], + } + ), + ("armature.layers_show_all", {"type": 'ACCENT_GRAVE', "value": 'PRESS', "ctrl": True}, None), + ("armature.armature_layers", {"type": 'M', "value": 'PRESS', "shift": True}, None), + ("pose.bone_layers", {"type": 'M', "value": 'PRESS'}, None), + ("pose.toggle_bone_selection_overlay", {"type": 'Z', "value": 'PRESS'}, None), + ( + "transform.transform", + {"type": 'S', "value": 'PRESS', "ctrl": True, "alt": True}, + { + "properties": [ + ("mode", 'BONE_SIZE'), + ], + } + ), + ("anim.keyframe_insert_menu", {"type": 'I', "value": 'PRESS'}, None), + ("anim.keyframe_delete_v3d", {"type": 'I', "value": 'PRESS', "alt": True}, None), + ("anim.keying_set_active_set", {"type": 'I', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None), + ("poselib.browse_interactive", {"type": 'L', "value": 'PRESS', "ctrl": True}, None), + ("poselib.pose_add", {"type": 'L', "value": 'PRESS', "shift": True}, None), + ("poselib.pose_remove", {"type": 'L', "value": 'PRESS', "alt": True}, None), + ("poselib.pose_rename", {"type": 'L', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ("pose.push", {"type": 'E', "value": 'PRESS', "ctrl": True}, None), + ("pose.relax", {"type": 'E', "value": 'PRESS', "alt": True}, None), + ("pose.breakdown", {"type": 'E', "value": 'PRESS', "shift": True}, None), + ( + "wm.call_menu", + {"type": 'W', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_pose_specials'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'P', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_pose_propagate'), + ], + } + ), + ], + }, + ), + ( + "Object Mode", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ( + "wm.context_cycle_enum", + {"type": 'O', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit_falloff'), + ("wrap", True), + ], + } + ), + ( + "wm.context_toggle", + {"type": 'O', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.use_proportional_edit_objects'), + ], + } + ), + ( + "object.select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "object.select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ("object.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None), + ("object.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None), + ("object.select_linked", {"type": 'L', "value": 'PRESS', "shift": True}, None), + ("object.select_grouped", {"type": 'G', "value": 'PRESS', "shift": True}, None), + ("object.select_mirror", {"type": 'M', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ( + "object.select_hierarchy", + {"type": 'LEFT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("direction", 'PARENT'), + ("extend", False), + ], + } + ), + ( + "object.select_hierarchy", + {"type": 'LEFT_BRACKET', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("direction", 'PARENT'), + ("extend", True), + ], + } + ), + ( + "object.select_hierarchy", + {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("direction", 'CHILD'), + ("extend", False), + ], + } + ), + ( + "object.select_hierarchy", + {"type": 'RIGHT_BRACKET', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("direction", 'CHILD'), + ("extend", True), + ], + } + ), + ("object.parent_set", {"type": 'P', "value": 'PRESS', "ctrl": True}, None), + ("object.parent_no_inverse_set", {"type": 'P', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ("object.parent_clear", {"type": 'P', "value": 'PRESS', "alt": True}, None), + ("object.track_set", {"type": 'T', "value": 'PRESS', "ctrl": True}, None), + ("object.track_clear", {"type": 'T', "value": 'PRESS', "alt": True}, None), + ("object.constraint_add_with_targets", {"type": 'C', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ("object.constraints_clear", {"type": 'C', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ( + "object.location_clear", + {"type": 'G', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("clear_delta", False), + ], + } + ), + ( + "object.rotation_clear", + {"type": 'R', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("clear_delta", False), + ], + } + ), + ( + "object.scale_clear", + {"type": 'S', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("clear_delta", False), + ], + } + ), + ("object.origin_clear", {"type": 'O', "value": 'PRESS', "alt": True}, None), + ( + "object.delete", + {"type": 'X', "value": 'PRESS'}, + { + "properties": [ + ("use_global", False), + ], + } + ), + ( + "object.delete", + {"type": 'X', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("use_global", True), + ], + } + ), + ( + "object.delete", + {"type": 'DEL', "value": 'PRESS'}, + { + "properties": [ + ("use_global", False), + ], + } + ), + ( + "object.delete", + {"type": 'DEL', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("use_global", True), + ], + } + ), + ( + "wm.call_menu", + {"type": 'A', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("name", 'INFO_MT_add'), + ], + } + ), + ("object.duplicates_make_real", {"type": 'A', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ( + "wm.call_menu", + {"type": 'A', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_object_apply'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'U', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_make_single_user'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'L', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_make_links'), + ], + } + ), + ("object.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None), + ("object.duplicate_move_linked", {"type": 'D', "value": 'PRESS', "alt": True}, None), + ("object.join", {"type": 'J', "value": 'PRESS', "ctrl": True}, None), + ("object.convert", {"type": 'C', "value": 'PRESS', "alt": True}, None), + ("object.proxy_make", {"type": 'P', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ("object.make_local", {"type": 'L', "value": 'PRESS'}, None), + ("anim.keyframe_insert_menu", {"type": 'I', "value": 'PRESS'}, None), + ("anim.keyframe_delete_v3d", {"type": 'I', "value": 'PRESS', "alt": True}, None), + ("anim.keying_set_active_set", {"type": 'I', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None), + ("collection.create", {"type": 'G', "value": 'PRESS', "ctrl": True}, None), + ("collection.objects_remove", {"type": 'G', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ("collection.objects_remove_all", {"type": 'G', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None), + ("collection.objects_add_active", {"type": 'G', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ("collection.objects_remove_active", {"type": 'G', "value": 'PRESS', "shift": True, "alt": True}, None), + ( + "wm.call_menu", + {"type": 'W', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_object_specials'), + ], + } + ), + ("object.data_transfer", {"type": 'T', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ( + "object.subdivision_set", + {"type": 'ZERO', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("level", 0), + ], + } + ), + ( + "object.subdivision_set", + {"type": 'ONE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("level", 1), + ], + } + ), + ( + "object.subdivision_set", + {"type": 'TWO', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("level", 2), + ], + } + ), + ( + "object.subdivision_set", + {"type": 'THREE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("level", 3), + ], + } + ), + ( + "object.subdivision_set", + {"type": 'FOUR', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("level", 4), + ], + } + ), + ( + "object.subdivision_set", + {"type": 'FIVE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("level", 5), + ], + } + ), + ("object.move_to_collection", {"type": 'M', "value": 'PRESS'}, None), + ], + }, + ), + ( + "Paint Curve", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ("paintcurve.add_point_slide", {"type": 'ACTIONMOUSE', "value": 'PRESS', "ctrl": True}, None), + ("paintcurve.select", {"type": 'SELECTMOUSE', "value": 'PRESS'}, None), + ( + "paintcurve.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ("paintcurve.slide", {"type": 'ACTIONMOUSE', "value": 'PRESS'}, None), + ( + "paintcurve.slide", + {"type": 'ACTIONMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("align", True), + ], + } + ), + ( + "paintcurve.select", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("toggle", True), + ], + } + ), + ("paintcurve.cursor", {"type": 'ACTIONMOUSE', "value": 'PRESS'}, None), + ("paintcurve.delete_point", {"type": 'X', "value": 'PRESS'}, None), + ("paintcurve.delete_point", {"type": 'DEL', "value": 'PRESS'}, None), + ("paintcurve.draw", {"type": 'RET', "value": 'PRESS'}, None), + ("paintcurve.draw", {"type": 'NUMPAD_ENTER', "value": 'PRESS'}, None), + ("transform.translate", {"type": 'G', "value": 'PRESS'}, None), + ("transform.translate", {"type": 'EVT_TWEAK_S', "value": 'ANY'}, None), + ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None), + ("transform.resize", {"type": 'S', "value": 'PRESS'}, None), + ], + }, + ), + ( + "Curve", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ( + "wm.call_menu", + {"type": 'A', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("name", 'INFO_MT_edit_curve_add'), + ], + } + ), + ("curve.handle_type_set", {"type": 'V', "value": 'PRESS'}, None), + ("curve.vertex_add", {"type": 'ACTIONMOUSE', "value": 'CLICK', "ctrl": True}, None), + ( + "curve.draw", + {"type": 'ACTIONMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("wait_for_input", False), + ], + } + ), + ( + "curve.draw", + {"type": 'PEN', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("wait_for_input", False), + ], + } + ), + ( + "curve.select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "curve.select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ("curve.select_row", {"type": 'R', "value": 'PRESS', "shift": True}, None), + ("curve.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None), + ("curve.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None), + ("curve.select_linked", {"type": 'L', "value": 'PRESS', "ctrl": True}, None), + ("curve.select_similar", {"type": 'G', "value": 'PRESS', "shift": True}, None), + ( + "curve.select_linked_pick", + {"type": 'L', "value": 'PRESS'}, + { + "properties": [ + ("deselect", False), + ], + } + ), + ( + "curve.select_linked_pick", + {"type": 'L', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("deselect", True), + ], + } + ), + ("curve.shortest_path_pick", {"type": 'SELECTMOUSE', "value": 'CLICK', "ctrl": True}, None), + ("curve.separate", {"type": 'P', "value": 'PRESS'}, None), + ("curve.split", {"type": 'Y', "value": 'PRESS'}, None), + ("curve.extrude_move", {"type": 'E', "value": 'PRESS'}, None), + ("curve.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None), + ("curve.make_segment", {"type": 'F', "value": 'PRESS'}, None), + ("curve.cyclic_toggle", {"type": 'C', "value": 'PRESS', "alt": True}, None), + ( + "wm.call_menu", + {"type": 'X', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_edit_curve_delete'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'DEL', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_edit_curve_delete'), + ], + } + ), + ("curve.dissolve_verts", {"type": 'X', "value": 'PRESS', "ctrl": True}, None), + ("curve.dissolve_verts", {"type": 'DEL', "value": 'PRESS', "ctrl": True}, None), + ("curve.tilt_clear", {"type": 'T', "value": 'PRESS', "alt": True}, None), + ("transform.tilt", {"type": 'T', "value": 'PRESS', "ctrl": True}, None), + ( + "transform.transform", + {"type": 'S', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("mode", 'CURVE_SHRINKFATTEN'), + ], + } + ), + ("curve.reveal", {"type": 'H', "value": 'PRESS', "alt": True}, None), + ( + "curve.hide", + {"type": 'H', "value": 'PRESS'}, + { + "properties": [ + ("unselected", False), + ], + } + ), + ( + "curve.hide", + {"type": 'H', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("unselected", True), + ], + } + ), + ("curve.normals_make_consistent", {"type": 'N', "value": 'PRESS', "ctrl": True}, None), + ("object.vertex_parent_set", {"type": 'P', "value": 'PRESS', "ctrl": True}, None), + ( + "wm.call_menu", + {"type": 'W', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_edit_curve_specials'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'H', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_hook'), + ], + } + ), + ( + "wm.context_cycle_enum", + {"type": 'O', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit_falloff'), + ("wrap", True), + ], + } + ), + ( + "wm.context_toggle_enum", + {"type": 'O', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit'), + ("value_1", 'DISABLED'), + ("value_2", 'ENABLED'), + ], + } + ), + ( + "wm.context_toggle_enum", + {"type": 'O', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit'), + ("value_1", 'DISABLED'), + ("value_2", 'CONNECTED'), + ], + } + ), + ], + }, + ), + ( + "Image Paint", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ( + "paint.image_paint", + {"type": 'LEFTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'NORMAL'), + ], + } + ), + ( + "paint.image_paint", + {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("mode", 'INVERT'), + ], + } + ), + ("paint.brush_colors_flip", {"type": 'X', "value": 'PRESS'}, None), + ("paint.grab_clone", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, None), + ("paint.sample_color", {"type": 'S', "value": 'PRESS'}, None), + ( + "brush.active_index_set", + {"type": 'ONE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 0), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'TWO', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 1), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'THREE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 2), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'FOUR', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 3), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'FIVE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 4), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'SIX', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 5), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'SEVEN', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 6), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'EIGHT', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 7), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'NINE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 8), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'ZERO', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 9), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'ONE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 10), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'TWO', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 11), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'THREE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 12), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'FOUR', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 13), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'FIVE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 14), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'SIX', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 15), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'SEVEN', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 16), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'EIGHT', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 17), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'NINE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 18), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'ZERO', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'image_paint'), + ("index", 19), + ], + } + ), + ( + "brush.scale_size", + {"type": 'LEFT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("scalar", 0.9), + ], + } + ), + ( + "brush.scale_size", + {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("scalar", 1.1111112), + ], + } + ), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS'}, + { + "properties": [ + ("data_path_primary", 'tool_settings.image_paint.brush.size'), + ("data_path_secondary", 'tool_settings.unified_paint_settings.size'), + ("use_secondary", 'tool_settings.unified_paint_settings.use_unified_size'), + ("rotation_path", 'tool_settings.image_paint.brush.mask_texture_slot.angle'), + ("color_path", 'tool_settings.image_paint.brush.cursor_color_add'), + ("fill_color_path", 'tool_settings.image_paint.brush.color'), + ("fill_color_override_path", 'tool_settings.unified_paint_settings.color'), + ("fill_color_override_test_path", 'tool_settings.unified_paint_settings.use_unified_color'), + ("zoom_path", 'space_data.zoom'), + ("image_id", 'tool_settings.image_paint.brush'), + ("secondary_tex", True), + ], + } + ), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path_primary", 'tool_settings.image_paint.brush.strength'), + ("data_path_secondary", 'tool_settings.unified_paint_settings.strength'), + ("use_secondary", 'tool_settings.unified_paint_settings.use_unified_strength'), + ("rotation_path", 'tool_settings.image_paint.brush.mask_texture_slot.angle'), + ("color_path", 'tool_settings.image_paint.brush.cursor_color_add'), + ("fill_color_path", 'tool_settings.image_paint.brush.color'), + ("fill_color_override_path", 'tool_settings.unified_paint_settings.color'), + ("fill_color_override_test_path", 'tool_settings.unified_paint_settings.use_unified_color'), + ("zoom_path", ''), + ("image_id", 'tool_settings.image_paint.brush'), + ("secondary_tex", True), + ], + } + ), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path_primary", 'tool_settings.image_paint.brush.texture_slot.angle'), + ("data_path_secondary", ''), + ("use_secondary", ''), + ("rotation_path", 'tool_settings.image_paint.brush.texture_slot.angle'), + ("color_path", 'tool_settings.image_paint.brush.cursor_color_add'), + ("fill_color_path", 'tool_settings.image_paint.brush.color'), + ("fill_color_override_path", 'tool_settings.unified_paint_settings.color'), + ("fill_color_override_test_path", 'tool_settings.unified_paint_settings.use_unified_color'), + ("zoom_path", ''), + ("image_id", 'tool_settings.image_paint.brush'), + ("secondary_tex", False), + ], + } + ), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS', "ctrl": True, "alt": True}, + { + "properties": [ + ("data_path_primary", 'tool_settings.image_paint.brush.mask_texture_slot.angle'), + ("data_path_secondary", ''), + ("use_secondary", ''), + ("rotation_path", 'tool_settings.image_paint.brush.mask_texture_slot.angle'), + ("color_path", 'tool_settings.image_paint.brush.cursor_color_add'), + ("fill_color_path", 'tool_settings.image_paint.brush.color'), + ("fill_color_override_path", 'tool_settings.unified_paint_settings.color'), + ("fill_color_override_test_path", 'tool_settings.unified_paint_settings.use_unified_color'), + ("zoom_path", ''), + ("image_id", 'tool_settings.image_paint.brush'), + ("secondary_tex", True), + ], + } + ), + ( + "brush.stencil_control", + {"type": 'RIGHTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'TRANSLATION'), + ], + } + ), + ( + "brush.stencil_control", + {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'SCALE'), + ], + } + ), + ( + "brush.stencil_control", + {"type": 'RIGHTMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("mode", 'ROTATION'), + ], + } + ), + ( + "brush.stencil_control", + {"type": 'RIGHTMOUSE', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("mode", 'TRANSLATION'), + ("texmode", 'SECONDARY'), + ], + } + ), + ( + "brush.stencil_control", + {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("mode", 'SCALE'), + ("texmode", 'SECONDARY'), + ], + } + ), + ( + "brush.stencil_control", + {"type": 'RIGHTMOUSE', "value": 'PRESS', "ctrl": True, "alt": True}, + { + "properties": [ + ("mode", 'ROTATION'), + ("texmode", 'SECONDARY'), + ], + } + ), + ( + "wm.context_toggle", + {"type": 'M', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'image_paint_object.data.use_paint_mask'), + ], + } + ), + ( + "wm.context_toggle", + {"type": 'S', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'tool_settings.image_paint.brush.use_smooth_stroke'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'R', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_angle_control'), + ], + } + ), + ( + "wm.context_menu_enum", + {"type": 'E', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.image_paint.brush.stroke_method'), + ], + } + ), + ], + }, + ), + ( + "Vertex Paint", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ("paint.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), + ("paint.brush_colors_flip", {"type": 'X', "value": 'PRESS'}, None), + ("paint.sample_color", {"type": 'S', "value": 'PRESS'}, None), + ("paint.vertex_color_set", {"type": 'K', "value": 'PRESS', "shift": True}, None), + ( + "brush.active_index_set", + {"type": 'ONE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 0), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'TWO', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 1), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'THREE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 2), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'FOUR', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 3), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'FIVE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 4), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'SIX', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 5), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'SEVEN', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 6), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'EIGHT', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 7), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'NINE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 8), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'ZERO', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 9), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'ONE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 10), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'TWO', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 11), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'THREE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 12), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'FOUR', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 13), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'FIVE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 14), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'SIX', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 15), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'SEVEN', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 16), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'EIGHT', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 17), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'NINE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 18), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'ZERO', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'vertex_paint'), + ("index", 19), + ], + } + ), + ( + "brush.scale_size", + {"type": 'LEFT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("scalar", 0.9), + ], + } + ), + ( + "brush.scale_size", + {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("scalar", 1.1111112), + ], + } + ), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS'}, + { + "properties": [ + ("data_path_primary", 'tool_settings.vertex_paint.brush.size'), + ("data_path_secondary", 'tool_settings.unified_paint_settings.size'), + ("use_secondary", 'tool_settings.unified_paint_settings.use_unified_size'), + ("rotation_path", 'tool_settings.vertex_paint.brush.texture_slot.angle'), + ("color_path", 'tool_settings.vertex_paint.brush.cursor_color_add'), + ("fill_color_path", 'tool_settings.vertex_paint.brush.color'), + ("fill_color_override_path", 'tool_settings.unified_paint_settings.color'), + ("fill_color_override_test_path", 'tool_settings.unified_paint_settings.use_unified_color'), + ("zoom_path", ''), + ("image_id", 'tool_settings.vertex_paint.brush'), + ("secondary_tex", False), + ], + } + ), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path_primary", 'tool_settings.vertex_paint.brush.strength'), + ("data_path_secondary", 'tool_settings.unified_paint_settings.strength'), + ("use_secondary", 'tool_settings.unified_paint_settings.use_unified_strength'), + ("rotation_path", 'tool_settings.vertex_paint.brush.texture_slot.angle'), + ("color_path", 'tool_settings.vertex_paint.brush.cursor_color_add'), + ("fill_color_path", 'tool_settings.vertex_paint.brush.color'), + ("fill_color_override_path", 'tool_settings.unified_paint_settings.color'), + ("fill_color_override_test_path", 'tool_settings.unified_paint_settings.use_unified_color'), + ("zoom_path", ''), + ("image_id", 'tool_settings.vertex_paint.brush'), + ("secondary_tex", False), + ], + } + ), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path_primary", 'tool_settings.vertex_paint.brush.texture_slot.angle'), + ("data_path_secondary", ''), + ("use_secondary", ''), + ("rotation_path", 'tool_settings.vertex_paint.brush.texture_slot.angle'), + ("color_path", 'tool_settings.vertex_paint.brush.cursor_color_add'), + ("fill_color_path", 'tool_settings.vertex_paint.brush.color'), + ("fill_color_override_path", 'tool_settings.unified_paint_settings.color'), + ("fill_color_override_test_path", 'tool_settings.unified_paint_settings.use_unified_color'), + ("zoom_path", ''), + ("image_id", 'tool_settings.vertex_paint.brush'), + ("secondary_tex", False), + ], + } + ), + ( + "brush.stencil_control", + {"type": 'RIGHTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'TRANSLATION'), + ], + } + ), + ( + "brush.stencil_control", + {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'SCALE'), + ], + } + ), + ( + "brush.stencil_control", + {"type": 'RIGHTMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("mode", 'ROTATION'), + ], + } + ), + ( + "brush.stencil_control", + {"type": 'RIGHTMOUSE', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("mode", 'TRANSLATION'), + ("texmode", 'SECONDARY'), + ], + } + ), + ( + "brush.stencil_control", + {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("mode", 'SCALE'), + ("texmode", 'SECONDARY'), + ], + } + ), + ( + "brush.stencil_control", + {"type": 'RIGHTMOUSE', "value": 'PRESS', "ctrl": True, "alt": True}, + { + "properties": [ + ("mode", 'ROTATION'), + ("texmode", 'SECONDARY'), + ], + } + ), + ( + "wm.context_toggle", + {"type": 'M', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'vertex_paint_object.data.use_paint_mask'), + ], + } + ), + ( + "wm.context_toggle", + {"type": 'S', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'tool_settings.vertex_paint.brush.use_smooth_stroke'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'R', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_angle_control'), + ], + } + ), + ( + "wm.context_menu_enum", + {"type": 'E', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.vertex_paint.brush.stroke_method'), + ], + } + ), + ], + }, + ), + ( + "Weight Paint", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ("paint.weight_paint", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), + ("paint.weight_sample", {"type": 'ACTIONMOUSE', "value": 'PRESS', "ctrl": True}, None), + ("paint.weight_sample_group", {"type": 'ACTIONMOUSE', "value": 'PRESS', "shift": True}, None), + ( + "paint.weight_gradient", + {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("type", 'LINEAR'), + ], + } + ), + ( + "paint.weight_gradient", + {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True, "alt": True}, + { + "properties": [ + ("type", 'RADIAL'), + ], + } + ), + ("paint.weight_set", {"type": 'K', "value": 'PRESS', "shift": True}, None), + ( + "brush.active_index_set", + {"type": 'ONE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 0), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'TWO', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 1), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'THREE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 2), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'FOUR', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 3), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'FIVE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 4), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'SIX', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 5), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'SEVEN', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 6), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'EIGHT', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 7), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'NINE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 8), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'ZERO', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 9), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'ONE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 10), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'TWO', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 11), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'THREE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 12), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'FOUR', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 13), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'FIVE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 14), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'SIX', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 15), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'SEVEN', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 16), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'EIGHT', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 17), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'NINE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 18), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'ZERO', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'weight_paint'), + ("index", 19), + ], + } + ), + ( + "brush.scale_size", + {"type": 'LEFT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("scalar", 0.9), + ], + } + ), + ( + "brush.scale_size", + {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("scalar", 1.1111112), + ], + } + ), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS'}, + { + "properties": [ + ("data_path_primary", 'tool_settings.weight_paint.brush.size'), + ("data_path_secondary", 'tool_settings.unified_paint_settings.size'), + ("use_secondary", 'tool_settings.unified_paint_settings.use_unified_size'), + ("rotation_path", 'tool_settings.weight_paint.brush.texture_slot.angle'), + ("color_path", 'tool_settings.weight_paint.brush.cursor_color_add'), + ("fill_color_path", ''), + ("fill_color_override_path", ''), + ("fill_color_override_test_path", ''), + ("zoom_path", ''), + ("image_id", 'tool_settings.weight_paint.brush'), + ("secondary_tex", False), + ], + } + ), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path_primary", 'tool_settings.weight_paint.brush.strength'), + ("data_path_secondary", 'tool_settings.unified_paint_settings.strength'), + ("use_secondary", 'tool_settings.unified_paint_settings.use_unified_strength'), + ("rotation_path", 'tool_settings.weight_paint.brush.texture_slot.angle'), + ("color_path", 'tool_settings.weight_paint.brush.cursor_color_add'), + ("fill_color_path", ''), + ("fill_color_override_path", ''), + ("fill_color_override_test_path", ''), + ("zoom_path", ''), + ("image_id", 'tool_settings.weight_paint.brush'), + ("secondary_tex", False), + ], + } + ), + ( + "wm.radial_control", + {"type": 'W', "value": 'PRESS'}, + { + "properties": [ + ("data_path_primary", 'tool_settings.weight_paint.brush.weight'), + ("data_path_secondary", 'tool_settings.unified_paint_settings.weight'), + ("use_secondary", 'tool_settings.unified_paint_settings.use_unified_weight'), + ("rotation_path", 'tool_settings.weight_paint.brush.texture_slot.angle'), + ("color_path", 'tool_settings.weight_paint.brush.cursor_color_add'), + ("fill_color_path", ''), + ("fill_color_override_path", ''), + ("fill_color_override_test_path", ''), + ("zoom_path", ''), + ("image_id", 'tool_settings.weight_paint.brush'), + ("secondary_tex", False), + ], + } + ), + ( + "wm.context_menu_enum", + {"type": 'E', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.vertex_paint.brush.stroke_method'), + ], + } + ), + ( + "wm.context_toggle", + {"type": 'M', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'weight_paint_object.data.use_paint_mask'), + ], + } + ), + ( + "wm.context_toggle", + {"type": 'V', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'weight_paint_object.data.use_paint_mask_vertex'), + ], + } + ), + ( + "wm.context_toggle", + {"type": 'S', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'tool_settings.weight_paint.brush.use_smooth_stroke'), + ], + } + ), + ], + }, + ), + ( + "Sculpt", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ( + "sculpt.brush_stroke", + {"type": 'LEFTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'NORMAL'), + ], + } + ), + ( + "sculpt.brush_stroke", + {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("mode", 'INVERT'), + ], + } + ), + ( + "sculpt.brush_stroke", + {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'SMOOTH'), + ], + } + ), + ( + "paint.hide_show", + {"type": 'H', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("action", 'SHOW'), + ("area", 'INSIDE'), + ], + } + ), + ( + "paint.hide_show", + {"type": 'H', "value": 'PRESS'}, + { + "properties": [ + ("action", 'HIDE'), + ("area", 'INSIDE'), + ], + } + ), + ( + "paint.hide_show", + {"type": 'H', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("action", 'SHOW'), + ("area", 'ALL'), + ], + } + ), + ( + "object.subdivision_set", + {"type": 'ZERO', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("level", 0), + ], + } + ), + ( + "object.subdivision_set", + {"type": 'ONE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("level", 1), + ], + } + ), + ( + "object.subdivision_set", + {"type": 'TWO', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("level", 2), + ], + } + ), + ( + "object.subdivision_set", + {"type": 'THREE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("level", 3), + ], + } + ), + ( + "object.subdivision_set", + {"type": 'FOUR', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("level", 4), + ], + } + ), + ( + "object.subdivision_set", + {"type": 'FIVE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("level", 5), + ], + } + ), + ( + "paint.mask_flood_fill", + {"type": 'M', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("mode", 'VALUE'), + ("value", 0.0), + ], + } + ), + ( + "paint.mask_flood_fill", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("mode", 'INVERT'), + ], + } + ), + ("paint.mask_lasso_gesture", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ( + "wm.context_toggle", + {"type": 'M', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path", 'scene.tool_settings.sculpt.show_mask'), + ], + } + ), + ("sculpt.dynamic_topology_toggle", {"type": 'D', "value": 'PRESS', "ctrl": True}, None), + ("sculpt.set_detail_size", {"type": 'D', "value": 'PRESS', "shift": True}, None), + ( + "object.subdivision_set", + {"type": 'PAGE_UP', "value": 'PRESS'}, + { + "properties": [ + ("level", 1), + ("relative", True), + ], + } + ), + ( + "object.subdivision_set", + {"type": 'PAGE_DOWN', "value": 'PRESS'}, + { + "properties": [ + ("level", -1), + ("relative", True), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'ONE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 0), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'TWO', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 1), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'THREE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 2), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'FOUR', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 3), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'FIVE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 4), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'SIX', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 5), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'SEVEN', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 6), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'EIGHT', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 7), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'NINE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 8), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'ZERO', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 9), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'ONE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 10), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'TWO', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 11), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'THREE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 12), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'FOUR', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 13), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'FIVE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 14), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'SIX', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 15), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'SEVEN', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 16), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'EIGHT', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 17), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'NINE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 18), + ], + } + ), + ( + "brush.active_index_set", + {"type": 'ZERO', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'sculpt'), + ("index", 19), + ], + } + ), + ( + "brush.scale_size", + {"type": 'LEFT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("scalar", 0.9), + ], + } + ), + ( + "brush.scale_size", + {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("scalar", 1.1111112), + ], + } + ), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS'}, + { + "properties": [ + ("data_path_primary", 'tool_settings.sculpt.brush.size'), + ("data_path_secondary", 'tool_settings.unified_paint_settings.size'), + ("use_secondary", 'tool_settings.unified_paint_settings.use_unified_size'), + ("rotation_path", 'tool_settings.sculpt.brush.texture_slot.angle'), + ("color_path", 'tool_settings.sculpt.brush.cursor_color_add'), + ("fill_color_path", ''), + ("fill_color_override_path", ''), + ("fill_color_override_test_path", ''), + ("zoom_path", ''), + ("image_id", 'tool_settings.sculpt.brush'), + ("secondary_tex", False), + ], + } + ), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path_primary", 'tool_settings.sculpt.brush.strength'), + ("data_path_secondary", 'tool_settings.unified_paint_settings.strength'), + ("use_secondary", 'tool_settings.unified_paint_settings.use_unified_strength'), + ("rotation_path", 'tool_settings.sculpt.brush.texture_slot.angle'), + ("color_path", 'tool_settings.sculpt.brush.cursor_color_add'), + ("fill_color_path", ''), + ("fill_color_override_path", ''), + ("fill_color_override_test_path", ''), + ("zoom_path", ''), + ("image_id", 'tool_settings.sculpt.brush'), + ("secondary_tex", False), + ], + } + ), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path_primary", 'tool_settings.sculpt.brush.texture_slot.angle'), + ("data_path_secondary", ''), + ("use_secondary", ''), + ("rotation_path", 'tool_settings.sculpt.brush.texture_slot.angle'), + ("color_path", 'tool_settings.sculpt.brush.cursor_color_add'), + ("fill_color_path", ''), + ("fill_color_override_path", ''), + ("fill_color_override_test_path", ''), + ("zoom_path", ''), + ("image_id", 'tool_settings.sculpt.brush'), + ("secondary_tex", False), + ], + } + ), + ( + "brush.stencil_control", + {"type": 'RIGHTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'TRANSLATION'), + ], + } + ), + ( + "brush.stencil_control", + {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'SCALE'), + ], + } + ), + ( + "brush.stencil_control", + {"type": 'RIGHTMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("mode", 'ROTATION'), + ], + } + ), + ( + "brush.stencil_control", + {"type": 'RIGHTMOUSE', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("mode", 'TRANSLATION'), + ("texmode", 'SECONDARY'), + ], + } + ), + ( + "brush.stencil_control", + {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("mode", 'SCALE'), + ("texmode", 'SECONDARY'), + ], + } + ), + ( + "brush.stencil_control", + {"type": 'RIGHTMOUSE', "value": 'PRESS', "ctrl": True, "alt": True}, + { + "properties": [ + ("mode", 'ROTATION'), + ("texmode", 'SECONDARY'), + ], + } + ), + ( + "paint.brush_select", + {"type": 'X', "value": 'PRESS'}, + { + "properties": [ + ("paint_mode", 'SCULPT'), + ("sculpt_tool", 'DRAW'), + ], + } + ), + ( + "paint.brush_select", + {"type": 'S', "value": 'PRESS'}, + { + "properties": [ + ("paint_mode", 'SCULPT'), + ("sculpt_tool", 'SMOOTH'), + ], + } + ), + ( + "paint.brush_select", + {"type": 'P', "value": 'PRESS'}, + { + "properties": [ + ("paint_mode", 'SCULPT'), + ("sculpt_tool", 'PINCH'), + ], + } + ), + ( + "paint.brush_select", + {"type": 'I', "value": 'PRESS'}, + { + "properties": [ + ("paint_mode", 'SCULPT'), + ("sculpt_tool", 'INFLATE'), + ], + } + ), + ( + "paint.brush_select", + {"type": 'G', "value": 'PRESS'}, + { + "properties": [ + ("paint_mode", 'SCULPT'), + ("sculpt_tool", 'GRAB'), + ], + } + ), + ( + "paint.brush_select", + {"type": 'L', "value": 'PRESS'}, + { + "properties": [ + ("paint_mode", 'SCULPT'), + ("sculpt_tool", 'LAYER'), + ], + } + ), + ( + "paint.brush_select", + {"type": 'T', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("paint_mode", 'SCULPT'), + ("sculpt_tool", 'FLATTEN'), + ], + } + ), + ( + "paint.brush_select", + {"type": 'C', "value": 'PRESS'}, + { + "properties": [ + ("paint_mode", 'SCULPT'), + ("sculpt_tool", 'CLAY'), + ], + } + ), + ( + "paint.brush_select", + {"type": 'C', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("paint_mode", 'SCULPT'), + ("sculpt_tool", 'CREASE'), + ], + } + ), + ( + "paint.brush_select", + {"type": 'K', "value": 'PRESS'}, + { + "properties": [ + ("paint_mode", 'SCULPT'), + ("sculpt_tool", 'SNAKE_HOOK'), + ], + } + ), + ( + "paint.brush_select", + {"type": 'M', "value": 'PRESS'}, + { + "properties": [ + ("paint_mode", 'SCULPT'), + ("sculpt_tool", 'MASK'), + ("toggle", True), + ("create_missing", True), + ], + } + ), + ( + "wm.context_menu_enum", + {"type": 'E', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.sculpt.brush.stroke_method'), + ], + } + ), + ( + "wm.context_toggle", + {"type": 'S', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'tool_settings.sculpt.brush.use_smooth_stroke'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'R', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_angle_control'), + ], + } + ), + ], + }, + ), + ( + "Mesh", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ("mesh.loopcut_slide", {"type": 'R', "value": 'PRESS', "ctrl": True}, None), + ("mesh.offset_edge_loops_slide", {"type": 'R', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ("mesh.inset", {"type": 'I', "value": 'PRESS'}, None), + ("mesh.poke", {"type": 'P', "value": 'PRESS', "alt": True}, None), + ( + "mesh.bevel", + {"type": 'B', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("vertex_only", False), + ], + } + ), + ( + "mesh.bevel", + {"type": 'B', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("vertex_only", True), + ], + } + ), + ( + "mesh.loop_select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("extend", False), + ("deselect", False), + ("toggle", False), + ], + } + ), + ( + "mesh.loop_select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("extend", False), + ("deselect", False), + ("toggle", True), + ], + } + ), + ( + "mesh.edgering_select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "ctrl": True, "alt": True}, + { + "properties": [ + ("extend", False), + ("deselect", False), + ("toggle", False), + ], + } + ), + ( + "mesh.edgering_select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, + { + "properties": [ + ("extend", False), + ("deselect", False), + ("toggle", True), + ], + } + ), + ( + "mesh.shortest_path_pick", + {"type": 'SELECTMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("use_fill", False), + ], + } + ), + ( + "mesh.shortest_path_pick", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("use_fill", True), + ], + } + ), + ( + "mesh.select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "mesh.select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ("mesh.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None), + ("mesh.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None), + ("mesh.select_next_item", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ("mesh.select_prev_item", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ("mesh.select_non_manifold", {"type": 'M', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None), + ("mesh.select_linked", {"type": 'L', "value": 'PRESS', "ctrl": True}, None), + ( + "mesh.select_linked_pick", + {"type": 'L', "value": 'PRESS'}, + { + "properties": [ + ("deselect", False), + ], + } + ), + ( + "mesh.select_linked_pick", + {"type": 'L', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("deselect", True), + ], + } + ), + ("mesh.faces_select_linked_flat", {"type": 'F', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None), + ( + "wm.call_menu", + {"type": 'G', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_edit_mesh_select_similar'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'TAB', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_edit_mesh_select_mode'), + ], + } + ), + ( + "mesh.hide", + {"type": 'H', "value": 'PRESS'}, + { + "properties": [ + ("unselected", False), + ], + } + ), + ( + "mesh.hide", + {"type": 'H', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("unselected", True), + ], + } + ), + ("mesh.reveal", {"type": 'H', "value": 'PRESS', "alt": True}, None), + ( + "mesh.normals_make_consistent", + {"type": 'N', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("inside", False), + ], + } + ), + ( + "mesh.normals_make_consistent", + {"type": 'N', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("inside", True), + ], + } + ), + ("view3d.edit_mesh_extrude_move_normal", {"type": 'E', "value": 'PRESS'}, None), + ( + "wm.call_menu", + {"type": 'E', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_edit_mesh_extrude'), + ], + } + ), + ("transform.edge_crease", {"type": 'E', "value": 'PRESS', "shift": True}, None), + ("mesh.spin", {"type": 'R', "value": 'PRESS', "alt": True}, None), + ("mesh.fill", {"type": 'F', "value": 'PRESS', "alt": True}, None), + ("mesh.beautify_fill", {"type": 'F', "value": 'PRESS', "shift": True, "alt": True}, None), + ( + "mesh.quads_convert_to_tris", + {"type": 'T', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("quad_method", 'BEAUTY'), + ("ngon_method", 'BEAUTY'), + ], + } + ), + ( + "mesh.quads_convert_to_tris", + {"type": 'T', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("quad_method", 'FIXED'), + ("ngon_method", 'CLIP'), + ], + } + ), + ("mesh.tris_convert_to_quads", {"type": 'J', "value": 'PRESS', "alt": True}, None), + ( + "mesh.rip_move", + {"type": 'V', "value": 'PRESS'}, + { + "properties": [ + ( + "MESH_OT_rip", + [ + ("use_fill", False), + ], + ), + ], + } + ), + ( + "mesh.rip_move", + {"type": 'V', "value": 'PRESS', "alt": True}, + { + "properties": [ + ( + "MESH_OT_rip", + [ + ("use_fill", True), + ], + ), + ], + } + ), + ("mesh.rip_edge_move", {"type": 'D', "value": 'PRESS', "alt": True}, None), + ("mesh.merge", {"type": 'M', "value": 'PRESS', "alt": True}, None), + ("transform.shrink_fatten", {"type": 'S', "value": 'PRESS', "alt": True}, None), + ("mesh.edge_face_add", {"type": 'F', "value": 'PRESS'}, None), + ("mesh.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None), + ( + "wm.call_menu", + {"type": 'A', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("name", 'INFO_MT_mesh_add'), + ], + } + ), + ("mesh.separate", {"type": 'P', "value": 'PRESS'}, None), + ("mesh.split", {"type": 'Y', "value": 'PRESS'}, None), + ("mesh.vert_connect_path", {"type": 'J', "value": 'PRESS'}, None), + ("transform.vert_slide", {"type": 'V', "value": 'PRESS', "shift": True}, None), + ( + "mesh.dupli_extrude_cursor", + {"type": 'ACTIONMOUSE', "value": 'CLICK', "ctrl": True}, + { + "properties": [ + ("rotate_source", True), + ], + } + ), + ( + "mesh.dupli_extrude_cursor", + {"type": 'ACTIONMOUSE', "value": 'CLICK', "shift": True, "ctrl": True}, + { + "properties": [ + ("rotate_source", False), + ], + } + ), + ( + "wm.call_menu", + {"type": 'X', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_edit_mesh_delete'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'DEL', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_edit_mesh_delete'), + ], + } + ), + ("mesh.dissolve_mode", {"type": 'X', "value": 'PRESS', "ctrl": True}, None), + ("mesh.dissolve_mode", {"type": 'DEL', "value": 'PRESS', "ctrl": True}, None), + ( + "mesh.knife_tool", + {"type": 'K', "value": 'PRESS'}, + { + "properties": [ + ("use_occlude_geometry", True), + ("only_selected", False), + ], + } + ), + ( + "mesh.knife_tool", + {"type": 'K', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("use_occlude_geometry", False), + ("only_selected", True), + ], + } + ), + ("object.vertex_parent_set", {"type": 'P', "value": 'PRESS', "ctrl": True}, None), + ( + "wm.call_menu", + {"type": 'W', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_edit_mesh_specials'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'F', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_edit_mesh_faces'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'E', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_edit_mesh_edges'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'V', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_edit_mesh_vertices'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'H', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_hook'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'U', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_uv_map'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'G', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_vertex_group'), + ], + } + ), + ( + "object.subdivision_set", + {"type": 'ZERO', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("level", 0), + ], + } + ), + ( + "object.subdivision_set", + {"type": 'ONE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("level", 1), + ], + } + ), + ( + "object.subdivision_set", + {"type": 'TWO', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("level", 2), + ], + } + ), + ( + "object.subdivision_set", + {"type": 'THREE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("level", 3), + ], + } + ), + ( + "object.subdivision_set", + {"type": 'FOUR', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("level", 4), + ], + } + ), + ( + "object.subdivision_set", + {"type": 'FIVE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("level", 5), + ], + } + ), + ( + "wm.context_cycle_enum", + {"type": 'O', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit_falloff'), + ("wrap", True), + ], + } + ), + ( + "wm.context_toggle_enum", + {"type": 'O', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit'), + ("value_1", 'DISABLED'), + ("value_2", 'ENABLED'), + ], + } + ), + ( + "wm.context_toggle_enum", + {"type": 'O', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit'), + ("value_1", 'DISABLED'), + ("value_2", 'CONNECTED'), + ], + } + ), + ], + }, + ), + ( + "Armature", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ( + "armature.hide", + {"type": 'H', "value": 'PRESS'}, + { + "properties": [ + ("unselected", False), + ], + } + ), + ( + "armature.hide", + {"type": 'H', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("unselected", True), + ], + } + ), + ("armature.reveal", {"type": 'H', "value": 'PRESS', "alt": True}, None), + ("armature.align", {"type": 'A', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ("armature.calculate_roll", {"type": 'N', "value": 'PRESS', "ctrl": True}, None), + ("armature.roll_clear", {"type": 'R', "value": 'PRESS', "alt": True}, None), + ("armature.switch_direction", {"type": 'F', "value": 'PRESS', "alt": True}, None), + ("armature.bone_primitive_add", {"type": 'A', "value": 'PRESS', "shift": True}, None), + ("armature.parent_set", {"type": 'P', "value": 'PRESS', "ctrl": True}, None), + ("armature.parent_clear", {"type": 'P', "value": 'PRESS', "alt": True}, None), + ( + "armature.select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "armature.select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ( + "armature.select_mirror", + {"type": 'M', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("extend", False), + ], + } + ), + ( + "armature.select_hierarchy", + {"type": 'LEFT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("direction", 'PARENT'), + ("extend", False), + ], + } + ), + ( + "armature.select_hierarchy", + {"type": 'LEFT_BRACKET', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("direction", 'PARENT'), + ("extend", True), + ], + } + ), + ( + "armature.select_hierarchy", + {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("direction", 'CHILD'), + ("extend", False), + ], + } + ), + ( + "armature.select_hierarchy", + {"type": 'RIGHT_BRACKET', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("direction", 'CHILD'), + ("extend", True), + ], + } + ), + ("armature.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None), + ("armature.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None), + ("armature.select_similar", {"type": 'G', "value": 'PRESS', "shift": True}, None), + ("armature.select_linked", {"type": 'L', "value": 'PRESS'}, None), + ("armature.shortest_path_pick", {"type": 'SELECTMOUSE', "value": 'PRESS', "ctrl": True}, None), + ( + "wm.call_menu", + {"type": 'X', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_edit_armature_delete'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'DEL', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_edit_armature_delete'), + ], + } + ), + ("armature.dissolve", {"type": 'X', "value": 'PRESS', "ctrl": True}, None), + ("armature.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None), + ("armature.extrude_move", {"type": 'E', "value": 'PRESS'}, None), + ("armature.extrude_forked", {"type": 'E', "value": 'PRESS', "shift": True}, None), + ("armature.click_extrude", {"type": 'ACTIONMOUSE', "value": 'CLICK', "ctrl": True}, None), + ("armature.fill", {"type": 'F', "value": 'PRESS'}, None), + ("armature.merge", {"type": 'M', "value": 'PRESS', "alt": True}, None), + ("armature.split", {"type": 'Y', "value": 'PRESS'}, None), + ("armature.separate", {"type": 'P', "value": 'PRESS'}, None), + ( + "wm.call_menu", + {"type": 'W', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_bone_options_toggle'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'W', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_bone_options_enable'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'W', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_bone_options_disable'), + ], + } + ), + ("armature.layers_show_all", {"type": 'ACCENT_GRAVE', "value": 'PRESS', "ctrl": True}, None), + ("armature.armature_layers", {"type": 'M', "value": 'PRESS', "shift": True}, None), + ("armature.bone_layers", {"type": 'M', "value": 'PRESS'}, None), + ( + "transform.transform", + {"type": 'S', "value": 'PRESS', "ctrl": True, "alt": True}, + { + "properties": [ + ("mode", 'BONE_SIZE'), + ], + } + ), + ( + "transform.transform", + {"type": 'S', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("mode", 'BONE_ENVELOPE'), + ], + } + ), + ( + "transform.transform", + {"type": 'R', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("mode", 'BONE_ROLL'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'W', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_armature_specials'), + ], + } + ), + ], + }, + ), + ( + "Metaball", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ("object.metaball_add", {"type": 'A', "value": 'PRESS', "shift": True}, None), + ("mball.reveal_metaelems", {"type": 'H', "value": 'PRESS', "alt": True}, None), + ( + "mball.hide_metaelems", + {"type": 'H', "value": 'PRESS'}, + { + "properties": [ + ("unselected", False), + ], + } + ), + ( + "mball.hide_metaelems", + {"type": 'H', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("unselected", True), + ], + } + ), + ("mball.delete_metaelems", {"type": 'X', "value": 'PRESS'}, None), + ("mball.delete_metaelems", {"type": 'DEL', "value": 'PRESS'}, None), + ("mball.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None), + ( + "mball.select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "mball.select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ("mball.select_similar", {"type": 'G', "value": 'PRESS', "shift": True}, None), + ( + "wm.context_cycle_enum", + {"type": 'O', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit_falloff'), + ("wrap", True), + ], + } + ), + ( + "wm.context_toggle_enum", + {"type": 'O', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit'), + ("value_1", 'DISABLED'), + ("value_2", 'ENABLED'), + ], + } + ), + ( + "wm.context_toggle_enum", + {"type": 'O', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit'), + ("value_1", 'DISABLED'), + ("value_2", 'CONNECTED'), + ], + } + ), + ], + }, + ), + ( + "Lattice", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ( + "lattice.select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "lattice.select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ("lattice.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None), + ("lattice.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None), + ("object.vertex_parent_set", {"type": 'P', "value": 'PRESS', "ctrl": True}, None), + ("lattice.flip", {"type": 'F', "value": 'PRESS', "ctrl": True}, None), + ( + "wm.call_menu", + {"type": 'H', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_hook'), + ], + } + ), + ( + "wm.context_cycle_enum", + {"type": 'O', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit_falloff'), + ("wrap", True), + ], + } + ), + ( + "wm.context_toggle_enum", + {"type": 'O', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit'), + ("value_1", 'DISABLED'), + ("value_2", 'ENABLED'), + ], + } + ), + ], + }, + ), + ( + "Particle", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ( + "particle.select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "particle.select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ("particle.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None), + ("particle.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None), + ( + "particle.select_linked", + {"type": 'L', "value": 'PRESS'}, + { + "properties": [ + ("deselect", False), + ], + } + ), + ( + "particle.select_linked", + {"type": 'L', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("deselect", True), + ], + } + ), + ("particle.delete", {"type": 'X', "value": 'PRESS'}, None), + ("particle.delete", {"type": 'DEL', "value": 'PRESS'}, None), + ("particle.reveal", {"type": 'H', "value": 'PRESS', "alt": True}, None), + ( + "particle.hide", + {"type": 'H', "value": 'PRESS'}, + { + "properties": [ + ("unselected", False), + ], + } + ), + ( + "particle.hide", + {"type": 'H', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("unselected", True), + ], + } + ), + ("particle.brush_edit", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), + ("particle.brush_edit", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True}, None), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS'}, + { + "properties": [ + ("data_path_primary", 'tool_settings.particle_edit.brush.size'), + ], + } + ), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path_primary", 'tool_settings.particle_edit.brush.strength'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'W', "value": 'PRESS'}, + { + "properties": [ + ("name", 'VIEW3D_MT_particle_specials'), + ], + } + ), + ("particle.weight_set", {"type": 'K', "value": 'PRESS', "shift": True}, None), + ( + "wm.context_cycle_enum", + {"type": 'O', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit_falloff'), + ("wrap", True), + ], + } + ), + ( + "wm.context_toggle_enum", + {"type": 'O', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit'), + ("value_1", 'DISABLED'), + ("value_2", 'ENABLED'), + ], + } + ), + ], + }, + ), + ( + "Font", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ( + "font.style_toggle", + {"type": 'B', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("style", 'BOLD'), + ], + } + ), + ( + "font.style_toggle", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("style", 'ITALIC'), + ], + } + ), + ( + "font.style_toggle", + {"type": 'U', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("style", 'UNDERLINE'), + ], + } + ), + ( + "font.style_toggle", + {"type": 'P', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("style", 'SMALL_CAPS'), + ], + } + ), + ( + "font.delete", + {"type": 'DEL', "value": 'PRESS'}, + { + "properties": [ + ("type", 'NEXT_OR_SELECTION'), + ], + } + ), + ( + "font.delete", + {"type": 'DEL', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'NEXT_WORD'), + ], + } + ), + ( + "font.delete", + {"type": 'BACK_SPACE', "value": 'PRESS'}, + { + "properties": [ + ("type", 'PREVIOUS_OR_SELECTION'), + ], + } + ), + ( + "font.delete", + {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'PREVIOUS_OR_SELECTION'), + ], + } + ), + ( + "font.delete", + {"type": 'BACK_SPACE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'PREVIOUS_WORD'), + ], + } + ), + ( + "font.move", + {"type": 'HOME', "value": 'PRESS'}, + { + "properties": [ + ("type", 'LINE_BEGIN'), + ], + } + ), + ( + "font.move", + {"type": 'END', "value": 'PRESS'}, + { + "properties": [ + ("type", 'LINE_END'), + ], + } + ), + ( + "font.move", + {"type": 'LEFT_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("type", 'PREVIOUS_CHARACTER'), + ], + } + ), + ( + "font.move", + {"type": 'RIGHT_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("type", 'NEXT_CHARACTER'), + ], + } + ), + ( + "font.move", + {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'PREVIOUS_WORD'), + ], + } + ), + ( + "font.move", + {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'NEXT_WORD'), + ], + } + ), + ( + "font.move", + {"type": 'UP_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("type", 'PREVIOUS_LINE'), + ], + } + ), + ( + "font.move", + {"type": 'DOWN_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("type", 'NEXT_LINE'), + ], + } + ), + ( + "font.move", + {"type": 'PAGE_UP', "value": 'PRESS'}, + { + "properties": [ + ("type", 'PREVIOUS_PAGE'), + ], + } + ), + ( + "font.move", + {"type": 'PAGE_DOWN', "value": 'PRESS'}, + { + "properties": [ + ("type", 'NEXT_PAGE'), + ], + } + ), + ( + "font.move_select", + {"type": 'HOME', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'LINE_BEGIN'), + ], + } + ), + ( + "font.move_select", + {"type": 'END', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'LINE_END'), + ], + } + ), + ( + "font.move_select", + {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'PREVIOUS_CHARACTER'), + ], + } + ), + ( + "font.move_select", + {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'NEXT_CHARACTER'), + ], + } + ), + ( + "font.move_select", + {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("type", 'PREVIOUS_WORD'), + ], + } + ), + ( + "font.move_select", + {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("type", 'NEXT_WORD'), + ], + } + ), + ( + "font.move_select", + {"type": 'UP_ARROW', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'PREVIOUS_LINE'), + ], + } + ), + ( + "font.move_select", + {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'NEXT_LINE'), + ], + } + ), + ( + "font.move_select", + {"type": 'PAGE_UP', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'PREVIOUS_PAGE'), + ], + } + ), + ( + "font.move_select", + {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'NEXT_PAGE'), + ], + } + ), + ( + "font.change_spacing", + {"type": 'LEFT_ARROW', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("delta", -1), + ], + } + ), + ( + "font.change_spacing", + {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("delta", 1), + ], + } + ), + ( + "font.change_character", + {"type": 'UP_ARROW', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("delta", 1), + ], + } + ), + ( + "font.change_character", + {"type": 'DOWN_ARROW', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("delta", -1), + ], + } + ), + ("font.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, None), + ("font.text_copy", {"type": 'C', "value": 'PRESS', "ctrl": True}, None), + ("font.text_cut", {"type": 'X', "value": 'PRESS', "ctrl": True}, None), + ("font.text_paste", {"type": 'V', "value": 'PRESS', "ctrl": True}, None), + ("font.line_break", {"type": 'RET', "value": 'PRESS'}, None), + ("font.text_insert", {"type": 'TEXTINPUT', "value": 'ANY', "any": True}, None), + ( + "font.text_insert", + {"type": 'BACK_SPACE', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("accent", True), + ], + } + ), + ], + }, + ), + ( + "Object Non-modal", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ( + "object.mode_set", + {"type": 'TAB', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'EDIT'), + ("toggle", True), + ], + } + ), + ( + "object.mode_set", + {"type": 'TAB', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("mode", 'POSE'), + ("toggle", True), + ], + } + ), + ( + "object.mode_set", + {"type": 'V', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'VERTEX_PAINT'), + ("toggle", True), + ], + } + ), + ( + "object.mode_set", + {"type": 'TAB', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("mode", 'WEIGHT_PAINT'), + ("toggle", True), + ], + } + ), + ("object.origin_set", {"type": 'C', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None), + ], + }, + ), + ( + "3D View", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + { + "items": [ + ("view3d.cursor3d", {"type": 'ACTIONMOUSE', "value": 'CLICK'}, None), + ("view3d.rotate", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None), + ("view3d.move", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "shift": True}, None), + ("view3d.zoom", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "ctrl": True}, None), + ("view3d.dolly", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ( + "view3d.view_selected", + {"type": 'NUMPAD_PERIOD', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("use_all_regions", True), + ], + } + ), + ( + "view3d.view_selected", + {"type": 'NUMPAD_PERIOD', "value": 'PRESS'}, + { + "properties": [ + ("use_all_regions", False), + ], + } + ), + ("view3d.view_lock_to_active", {"type": 'NUMPAD_PERIOD', "value": 'PRESS', "shift": True}, None), + ("view3d.view_lock_clear", {"type": 'NUMPAD_PERIOD', "value": 'PRESS', "alt": True}, None), + ("view3d.navigate", {"type": 'F', "value": 'PRESS', "shift": True}, None), + ("view3d.smoothview", {"type": 'TIMER1', "value": 'ANY', "any": True}, None), + ("view3d.rotate", {"type": 'TRACKPADPAN', "value": 'ANY'}, None), + ("view3d.rotate", {"type": 'MOUSEROTATE', "value": 'ANY'}, None), + ("view3d.move", {"type": 'TRACKPADPAN', "value": 'ANY', "shift": True}, None), + ("view3d.zoom", {"type": 'TRACKPADZOOM', "value": 'ANY'}, None), + ("view3d.zoom", {"type": 'TRACKPADPAN', "value": 'ANY', "ctrl": True}, None), + ( + "view3d.zoom", + {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, + { + "properties": [ + ("delta", 1), + ], + } + ), + ( + "view3d.zoom", + {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, + { + "properties": [ + ("delta", -1), + ], + } + ), + ( + "view3d.zoom", + {"type": 'EQUAL', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("delta", 1), + ], + } + ), + ( + "view3d.zoom", + {"type": 'MINUS', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("delta", -1), + ], + } + ), + ( + "view3d.zoom", + {"type": 'WHEELINMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("delta", 1), + ], + } + ), + ( + "view3d.zoom", + {"type": 'WHEELOUTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("delta", -1), + ], + } + ), + ( + "view3d.dolly", + {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("delta", 1), + ], + } + ), + ( + "view3d.dolly", + {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("delta", -1), + ], + } + ), + ( + "view3d.dolly", + {"type": 'EQUAL', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("delta", 1), + ], + } + ), + ( + "view3d.dolly", + {"type": 'MINUS', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("delta", -1), + ], + } + ), + ("view3d.zoom_camera_1_to_1", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "shift": True}, None), + ("view3d.view_center_camera", {"type": 'HOME', "value": 'PRESS'}, None), + ("view3d.view_center_lock", {"type": 'HOME', "value": 'PRESS'}, None), + ("view3d.view_center_cursor", {"type": 'HOME', "value": 'PRESS', "alt": True}, None), + ("view3d.view_center_pick", {"type": 'F', "value": 'PRESS', "alt": True}, None), + ( + "view3d.view_all", + {"type": 'HOME', "value": 'PRESS'}, + { + "properties": [ + ("center", False), + ], + } + ), + ( + "view3d.view_all", + {"type": 'HOME', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("use_all_regions", True), + ("center", False), + ], + } + ), + ( + "view3d.view_all", + {"type": 'C', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("center", True), + ], + } + ), + ("view3d.view_camera", {"type": 'NUMPAD_0', "value": 'PRESS'}, None), + ( + "view3d.view_axis", + {"type": 'NUMPAD_1', "value": 'PRESS'}, + { + "properties": [ + ("type", 'FRONT'), + ], + } + ), + ( + "view3d.view_orbit", + {"type": 'NUMPAD_2', "value": 'PRESS'}, + { + "properties": [ + ("type", 'ORBITDOWN'), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NUMPAD_3', "value": 'PRESS'}, + { + "properties": [ + ("type", 'RIGHT'), + ], + } + ), + ( + "view3d.view_orbit", + {"type": 'NUMPAD_4', "value": 'PRESS'}, + { + "properties": [ + ("type", 'ORBITLEFT'), + ], + } + ), + ("view3d.view_persportho", {"type": 'NUMPAD_5', "value": 'PRESS'}, None), + ( + "view3d.view_orbit", + {"type": 'NUMPAD_6', "value": 'PRESS'}, + { + "properties": [ + ("type", 'ORBITRIGHT'), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NUMPAD_7', "value": 'PRESS'}, + { + "properties": [ + ("type", 'TOP'), + ], + } + ), + ( + "view3d.view_orbit", + {"type": 'NUMPAD_8', "value": 'PRESS'}, + { + "properties": [ + ("type", 'ORBITUP'), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NUMPAD_1', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'BACK'), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NUMPAD_3', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'LEFT'), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NUMPAD_7', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'BOTTOM'), + ], + } + ), + ( + "view3d.view_pan", + {"type": 'NUMPAD_2', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'PANDOWN'), + ], + } + ), + ( + "view3d.view_pan", + {"type": 'NUMPAD_4', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'PANLEFT'), + ], + } + ), + ( + "view3d.view_pan", + {"type": 'NUMPAD_6', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'PANRIGHT'), + ], + } + ), + ( + "view3d.view_pan", + {"type": 'NUMPAD_8', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'PANUP'), + ], + } + ), + ( + "view3d.view_roll", + {"type": 'NUMPAD_4', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'LEFT'), + ], + } + ), + ( + "view3d.view_roll", + {"type": 'NUMPAD_6', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'RIGHT'), + ], + } + ), + ( + "view3d.view_orbit", + {"type": 'NUMPAD_9', "value": 'PRESS'}, + { + "properties": [ + ("angle", 3.1415927), + ("type", 'ORBITRIGHT'), + ], + } + ), + ( + "view3d.view_pan", + {"type": 'WHEELUPMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'PANRIGHT'), + ], + } + ), + ( + "view3d.view_pan", + {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'PANLEFT'), + ], + } + ), + ( + "view3d.view_pan", + {"type": 'WHEELUPMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'PANUP'), + ], + } + ), + ( + "view3d.view_pan", + {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'PANDOWN'), + ], + } + ), + ( + "view3d.view_orbit", + {"type": 'WHEELUPMOUSE', "value": 'PRESS', "ctrl": True, "alt": True}, + { + "properties": [ + ("type", 'ORBITLEFT'), + ], + } + ), + ( + "view3d.view_orbit", + {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "ctrl": True, "alt": True}, + { + "properties": [ + ("type", 'ORBITRIGHT'), + ], + } + ), + ( + "view3d.view_orbit", + {"type": 'WHEELUPMOUSE', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("type", 'ORBITUP'), + ], + } + ), + ( + "view3d.view_orbit", + {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("type", 'ORBITDOWN'), + ], + } + ), + ( + "view3d.view_roll", + {"type": 'WHEELUPMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("type", 'LEFT'), + ], + } + ), + ( + "view3d.view_roll", + {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("type", 'RIGHT'), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NUMPAD_1', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'FRONT'), + ("align_active", True), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NUMPAD_3', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'RIGHT'), + ("align_active", True), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NUMPAD_7', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'TOP'), + ("align_active", True), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NUMPAD_1', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("type", 'BACK'), + ("align_active", True), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NUMPAD_3', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("type", 'LEFT'), + ("align_active", True), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NUMPAD_7', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("type", 'BOTTOM'), + ("align_active", True), + ], + } + ), + ("view3d.ndof_orbit_zoom", {"type": 'NDOF_MOTION', "value": 'ANY'}, None), + ("view3d.ndof_orbit", {"type": 'NDOF_MOTION', "value": 'ANY', "ctrl": True}, None), + ("view3d.ndof_pan", {"type": 'NDOF_MOTION', "value": 'ANY', "shift": True}, None), + ("view3d.ndof_all", {"type": 'NDOF_MOTION', "value": 'ANY', "shift": True, "ctrl": True}, None), + ( + "view3d.view_selected", + {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, + { + "properties": [ + ("use_all_regions", False), + ], + } + ), + ( + "view3d.view_roll", + {"type": 'NDOF_BUTTON_ROLL_CCW', "value": 'PRESS'}, + { + "properties": [ + ("type", 'LEFT'), + ], + } + ), + ( + "view3d.view_roll", + {"type": 'NDOF_BUTTON_ROLL_CCW', "value": 'PRESS'}, + { + "properties": [ + ("type", 'RIGHT'), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NDOF_BUTTON_FRONT', "value": 'PRESS'}, + { + "properties": [ + ("type", 'FRONT'), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NDOF_BUTTON_BACK', "value": 'PRESS'}, + { + "properties": [ + ("type", 'BACK'), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NDOF_BUTTON_LEFT', "value": 'PRESS'}, + { + "properties": [ + ("type", 'LEFT'), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NDOF_BUTTON_RIGHT', "value": 'PRESS'}, + { + "properties": [ + ("type", 'RIGHT'), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NDOF_BUTTON_TOP', "value": 'PRESS'}, + { + "properties": [ + ("type", 'TOP'), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NDOF_BUTTON_BOTTOM', "value": 'PRESS'}, + { + "properties": [ + ("type", 'BOTTOM'), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NDOF_BUTTON_FRONT', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'FRONT'), + ("align_active", True), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NDOF_BUTTON_RIGHT', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'RIGHT'), + ("align_active", True), + ], + } + ), + ( + "view3d.view_axis", + {"type": 'NDOF_BUTTON_TOP', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'TOP'), + ("align_active", True), + ], + } + ), + ( + "view3d.layers", + {"type": 'ACCENT_GRAVE', "value": 'PRESS'}, + { + "properties": [ + ("nr", 0), + ], + } + ), + ( + "view3d.layers", + {"type": 'ONE', "value": 'PRESS', "any": True}, + { + "properties": [ + ("nr", 1), + ], + } + ), + ( + "view3d.layers", + {"type": 'TWO', "value": 'PRESS', "any": True}, + { + "properties": [ + ("nr", 2), + ], + } + ), + ( + "view3d.layers", + {"type": 'THREE', "value": 'PRESS', "any": True}, + { + "properties": [ + ("nr", 3), + ], + } + ), + ( + "view3d.layers", + {"type": 'FOUR', "value": 'PRESS', "any": True}, + { + "properties": [ + ("nr", 4), + ], + } + ), + ( + "view3d.layers", + {"type": 'FIVE', "value": 'PRESS', "any": True}, + { + "properties": [ + ("nr", 5), + ], + } + ), + ( + "view3d.layers", + {"type": 'SIX', "value": 'PRESS', "any": True}, + { + "properties": [ + ("nr", 6), + ], + } + ), + ( + "view3d.layers", + {"type": 'SEVEN', "value": 'PRESS', "any": True}, + { + "properties": [ + ("nr", 7), + ], + } + ), + ( + "view3d.layers", + {"type": 'EIGHT', "value": 'PRESS', "any": True}, + { + "properties": [ + ("nr", 8), + ], + } + ), + ( + "view3d.layers", + {"type": 'NINE', "value": 'PRESS', "any": True}, + { + "properties": [ + ("nr", 9), + ], + } + ), + ( + "view3d.layers", + {"type": 'ZERO', "value": 'PRESS', "any": True}, + { + "properties": [ + ("nr", 10), + ], + } + ), + ( + "wm.context_toggle_enum", + {"type": 'Z', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("data_path", 'space_data.shading.type'), + ("value_1", 'SOLID'), + ("value_2", 'TEXTURED'), + ], + } + ), + ("view3d.toggle_render", {"type": 'Z', "value": 'PRESS', "shift": True}, None), + ("view3d.toggle_xray_draw_option", {"type": 'Z', "value": 'PRESS'}, None), + ( + "wm.context_toggle", + {"type": 'Z', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.use_occlude_geometry'), + ], + } + ), + ( + "view3d.select", + {"type": 'SELECTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("extend", False), + ("deselect", False), + ("toggle", False), + ("center", False), + ("enumerate", False), + ("object", False), + ], + } + ), + ( + "view3d.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", False), + ("deselect", False), + ("toggle", True), + ("center", False), + ("enumerate", False), + ("object", False), + ], + } + ), + ( + "view3d.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("extend", False), + ("deselect", False), + ("toggle", False), + ("center", True), + ("enumerate", False), + ("object", True), + ], + } + ), + ( + "view3d.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("extend", False), + ("deselect", False), + ("toggle", False), + ("center", False), + ("enumerate", True), + ("object", False), + ], + } + ), + ( + "view3d.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("extend", True), + ("deselect", False), + ("toggle", True), + ("center", True), + ("enumerate", False), + ("object", False), + ], + } + ), + ( + "view3d.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "ctrl": True, "alt": True}, + { + "properties": [ + ("extend", False), + ("deselect", False), + ("toggle", False), + ("center", True), + ("enumerate", True), + ("object", False), + ], + } + ), + ( + "view3d.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("extend", False), + ("deselect", False), + ("toggle", True), + ("center", False), + ("enumerate", True), + ("object", False), + ], + } + ), + ( + "view3d.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, + { + "properties": [ + ("extend", False), + ("deselect", False), + ("toggle", True), + ("center", True), + ("enumerate", True), + ("object", False), + ], + } + ), + ("view3d.select_border", {"type": 'B', "value": 'PRESS'}, None), + ( + "view3d.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "ctrl": True}, + { + "properties": [ + ("deselect", False), + ], + } + ), + ( + "view3d.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "shift": True, "ctrl": True}, + { + "properties": [ + ("deselect", True), + ], + } + ), + ("view3d.select_circle", {"type": 'C', "value": 'PRESS'}, None), + ("view3d.clip_border", {"type": 'B', "value": 'PRESS', "alt": True}, None), + ("view3d.zoom_border", {"type": 'B', "value": 'PRESS', "shift": True}, None), + ( + "view3d.render_border", + {"type": 'B', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("camera_only", True), + ], + } + ), + ( + "view3d.render_border", + {"type": 'B', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("camera_only", False), + ], + } + ), + ("view3d.clear_render_border", {"type": 'B', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ("view3d.camera_to_view", {"type": 'NUMPAD_0', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ("view3d.object_as_camera", {"type": 'NUMPAD_0', "value": 'PRESS', "ctrl": True}, None), + ( + "wm.call_menu", + {"type": 'S', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("name", 'VIEW3D_MT_snap'), + ], + } + ), + ("view3d.copybuffer", {"type": 'C', "value": 'PRESS', "ctrl": True}, None), + ("view3d.pastebuffer", {"type": 'V', "value": 'PRESS', "ctrl": True}, None), + ( + "wm.context_set_enum", + {"type": 'COMMA', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.transform_pivot_point'), + ("value", 'BOUNDING_BOX_CENTER'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'COMMA', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path", 'tool_settings.transform_pivot_point'), + ("value", 'MEDIAN_POINT'), + ], + } + ), + ( + "wm.context_toggle", + {"type": 'COMMA', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("data_path", 'tool_settings.use_transform_pivot_point_align'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'PERIOD', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.transform_pivot_point'), + ("value", 'CURSOR'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'PERIOD', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path", 'tool_settings.transform_pivot_point'), + ("value", 'INDIVIDUAL_ORIGINS'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'PERIOD', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("data_path", 'tool_settings.transform_pivot_point'), + ("value", 'ACTIVE_ELEMENT'), + ], + } + ), + ( + "wm.context_toggle", + {"type": 'SPACE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path", 'space_data.show_manipulator'), + ], + } + ), + ("transform.translate", {"type": 'G', "value": 'PRESS'}, None), + ("transform.translate", {"type": 'EVT_TWEAK_S', "value": 'ANY'}, None), + ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None), + ("transform.resize", {"type": 'S', "value": 'PRESS'}, None), + ("transform.bend", {"type": 'W', "value": 'PRESS', "shift": True}, None), + ("transform.tosphere", {"type": 'S', "value": 'PRESS', "shift": True, "alt": True}, None), + ("transform.shear", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None), + ("transform.select_orientation", {"type": 'SPACE', "value": 'PRESS', "alt": True}, None), + ( + "transform.create_orientation", + {"type": 'SPACE', "value": 'PRESS', "ctrl": True, "alt": True}, + { + "properties": [ + ("use", True), + ], + } + ), + ("transform.mirror", {"type": 'M', "value": 'PRESS', "ctrl": True}, None), + ( + "wm.context_toggle", + {"type": 'TAB', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'tool_settings.use_snap'), + ], + } + ), + ( + "wm.context_menu_enum", + {"type": 'TAB', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("data_path", 'tool_settings.snap_element'), + ], + } + ), + ("object.transform_axis_target", {"type": 'T', "value": 'PRESS', "shift": True}, None), + ( + "transform.translate", + {"type": 'T', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("texture_space", True), + ], + } + ), + ( + "transform.resize", + {"type": 'T', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("texture_space", True), + ], + } + ), + ("transform.skin_resize", {"type": 'A', "value": 'PRESS', "ctrl": True}, None), + ], + }, + ), + ( + "Manipulators", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ], + }, + ), + ( + "Backdrop Transform Widget", + {"space_type": 'NODE_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ("manipulatorgroup.manipulator_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ], + }, + ), + ( + "Backdrop Crop Widget", + {"space_type": 'NODE_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ("manipulatorgroup.manipulator_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ], + }, + ), + ( + "Sun Beams Widget", + {"space_type": 'NODE_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ("manipulatorgroup.manipulator_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ], + }, + ), + ( + "Corner Pin Widget", + {"space_type": 'NODE_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ("manipulatorgroup.manipulator_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ], + }, + ), + ( + "UV Transform Manipulator", + {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ("manipulatorgroup.manipulator_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ], + }, + ), + ( + "Spot Light Widgets", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + { + "items": [ + ("manipulatorgroup.manipulator_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ], + }, + ), + ( + "Area Light Widgets", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + { + "items": [ + ("manipulatorgroup.manipulator_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ("manipulatorgroup.manipulator_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ], + }, + ), + ( + "Target Light Widgets", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + { + "items": [ + ("manipulatorgroup.manipulator_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ], + }, + ), + ( + "Force Field Widgets", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + { + "items": [ + ("manipulatorgroup.manipulator_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ], + }, + ), + ( + "Camera Widgets", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + { + "items": [ + ("manipulatorgroup.manipulator_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ], + }, + ), + ( + "Camera View Widgets", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + { + "items": [ + ("manipulatorgroup.manipulator_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ], + }, + ), + ( + "Armature Spline Widgets", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + { + "items": [ + ("manipulatorgroup.manipulator_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ], + }, + ), + ( + "View3D Navigate", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + { + "items": [ + ("manipulatorgroup.manipulator_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ], + }, + ), + ( + "Animation", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ("anim.change_frame", {"type": 'ACTIONMOUSE', "value": 'PRESS'}, None), + ( + "wm.context_toggle", + {"type": 'T', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path", 'space_data.show_seconds'), + ], + } + ), + ("anim.previewrange_set", {"type": 'P', "value": 'PRESS'}, None), + ("anim.previewrange_clear", {"type": 'P', "value": 'PRESS', "alt": True}, None), + ], + }, + ), + ( + "Animation Channels", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ("anim.channels_click", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), + ( + "anim.channels_click", + {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ( + "anim.channels_click", + {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("children_only", True), + ], + } + ), + ("anim.channels_rename", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, None), + ("anim.channels_rename", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, None), + ("anim.channel_select_keys", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, None), + ( + "anim.channel_select_keys", + {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK', "shift": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ("anim.channels_find", {"type": 'F', "value": 'PRESS', "ctrl": True}, None), + ( + "anim.channels_select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "anim.channels_select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ("anim.channels_select_border", {"type": 'B', "value": 'PRESS'}, None), + ("anim.channels_select_border", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, None), + ("anim.channels_delete", {"type": 'X', "value": 'PRESS'}, None), + ("anim.channels_delete", {"type": 'DEL', "value": 'PRESS'}, None), + ("anim.channels_setting_toggle", {"type": 'W', "value": 'PRESS', "shift": True}, None), + ("anim.channels_setting_enable", {"type": 'W', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ("anim.channels_setting_disable", {"type": 'W', "value": 'PRESS', "alt": True}, None), + ("anim.channels_editable_toggle", {"type": 'TAB', "value": 'PRESS'}, None), + ("anim.channels_expand", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, None), + ("anim.channels_collapse", {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, None), + ( + "anim.channels_expand", + {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("all", False), + ], + } + ), + ( + "anim.channels_collapse", + {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("all", False), + ], + } + ), + ( + "anim.channels_move", + {"type": 'PAGE_UP', "value": 'PRESS'}, + { + "properties": [ + ("direction", 'UP'), + ], + } + ), + ( + "anim.channels_move", + {"type": 'PAGE_DOWN', "value": 'PRESS'}, + { + "properties": [ + ("direction", 'DOWN'), + ], + } + ), + ( + "anim.channels_move", + {"type": 'PAGE_UP', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("direction", 'TOP'), + ], + } + ), + ( + "anim.channels_move", + {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("direction", 'BOTTOM'), + ], + } + ), + ("anim.channels_group", {"type": 'G', "value": 'PRESS', "ctrl": True}, None), + ("anim.channels_ungroup", {"type": 'G', "value": 'PRESS', "alt": True}, None), + ], + }, + ), + ( + "UV Editor", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ( + "wm.context_toggle", + {"type": 'Q', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.use_uv_sculpt'), + ], + } + ), + ("uv.mark_seam", {"type": 'E', "value": 'PRESS', "ctrl": True}, None), + ( + "uv.select", + {"type": 'SELECTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("extend", False), + ], + } + ), + ( + "uv.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ( + "uv.select_loop", + {"type": 'SELECTMOUSE', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("extend", False), + ], + } + ), + ( + "uv.select_loop", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ("uv.select_split", {"type": 'Y', "value": 'PRESS'}, None), + ( + "uv.select_border", + {"type": 'B', "value": 'PRESS'}, + { + "properties": [ + ("pinned", False), + ], + } + ), + ( + "uv.select_border", + {"type": 'B', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("pinned", True), + ], + } + ), + ("uv.circle_select", {"type": 'C', "value": 'PRESS'}, None), + ( + "uv.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "ctrl": True}, + { + "properties": [ + ("deselect", False), + ], + } + ), + ( + "uv.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "shift": True, "ctrl": True}, + { + "properties": [ + ("deselect", True), + ], + } + ), + ( + "uv.select_linked", + {"type": 'L', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("extend", True), + ("deselect", False), + ], + } + ), + ( + "uv.select_linked_pick", + {"type": 'L', "value": 'PRESS'}, + { + "properties": [ + ("extend", True), + ("deselect", False), + ], + } + ), + ( + "uv.select_linked", + {"type": 'L', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("extend", False), + ("deselect", True), + ], + } + ), + ( + "uv.select_linked_pick", + {"type": 'L', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", False), + ("deselect", True), + ], + } + ), + ("uv.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None), + ("uv.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None), + ( + "uv.select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "uv.select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ("uv.select_pinned", {"type": 'P', "value": 'PRESS', "shift": True}, None), + ( + "wm.call_menu", + {"type": 'W', "value": 'PRESS'}, + { + "properties": [ + ("name", 'IMAGE_MT_uvs_weldalign'), + ], + } + ), + ("uv.stitch", {"type": 'V', "value": 'PRESS'}, None), + ( + "uv.pin", + {"type": 'P', "value": 'PRESS'}, + { + "properties": [ + ("clear", False), + ], + } + ), + ( + "uv.pin", + {"type": 'P', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("clear", True), + ], + } + ), + ("uv.unwrap", {"type": 'E', "value": 'PRESS'}, None), + ("uv.minimize_stretch", {"type": 'V', "value": 'PRESS', "ctrl": True}, None), + ("uv.pack_islands", {"type": 'P', "value": 'PRESS', "ctrl": True}, None), + ("uv.average_islands_scale", {"type": 'A', "value": 'PRESS', "ctrl": True}, None), + ( + "uv.hide", + {"type": 'H', "value": 'PRESS'}, + { + "properties": [ + ("unselected", False), + ], + } + ), + ( + "uv.hide", + {"type": 'H', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("unselected", True), + ], + } + ), + ("uv.reveal", {"type": 'H', "value": 'PRESS', "alt": True}, None), + ("uv.cursor_set", {"type": 'ACTIONMOUSE', "value": 'PRESS'}, None), + ( + "wm.call_menu", + {"type": 'S', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("name", 'IMAGE_MT_uvs_snap'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'TAB', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("name", 'IMAGE_MT_uvs_select_mode'), + ], + } + ), + ( + "wm.context_cycle_enum", + {"type": 'O', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit_falloff'), + ("wrap", True), + ], + } + ), + ( + "wm.context_toggle_enum", + {"type": 'O', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit'), + ("value_1", 'DISABLED'), + ("value_2", 'ENABLED'), + ], + } + ), + ("transform.translate", {"type": 'G', "value": 'PRESS'}, None), + ("transform.translate", {"type": 'EVT_TWEAK_S', "value": 'ANY'}, None), + ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None), + ("transform.resize", {"type": 'S', "value": 'PRESS'}, None), + ("transform.shear", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None), + ("transform.mirror", {"type": 'M', "value": 'PRESS', "ctrl": True}, None), + ( + "wm.context_toggle", + {"type": 'TAB', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'tool_settings.use_snap'), + ], + } + ), + ( + "wm.context_menu_enum", + {"type": 'TAB', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("data_path", 'tool_settings.snap_uv_element'), + ], + } + ), + ], + }, + ), + ( + "UV Sculpt", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ( + "wm.context_toggle", + {"type": 'Q', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.use_uv_sculpt'), + ], + } + ), + ( + "sculpt.uv_sculpt_stroke", + {"type": 'LEFTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'NORMAL'), + ], + } + ), + ( + "sculpt.uv_sculpt_stroke", + {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("mode", 'INVERT'), + ], + } + ), + ( + "sculpt.uv_sculpt_stroke", + {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'RELAX'), + ], + } + ), + ( + "brush.scale_size", + {"type": 'LEFT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("scalar", 0.9), + ], + } + ), + ( + "brush.scale_size", + {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("scalar", 1.1111112), + ], + } + ), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS'}, + { + "properties": [ + ("data_path_primary", 'tool_settings.uv_sculpt.brush.size'), + ("data_path_secondary", 'tool_settings.unified_paint_settings.size'), + ("use_secondary", 'tool_settings.unified_paint_settings.use_unified_size'), + ("rotation_path", 'tool_settings.uv_sculpt.brush.texture_slot.angle'), + ("color_path", 'tool_settings.uv_sculpt.brush.cursor_color_add'), + ("fill_color_path", ''), + ("fill_color_override_path", ''), + ("fill_color_override_test_path", ''), + ("zoom_path", ''), + ("image_id", 'tool_settings.uv_sculpt.brush'), + ("secondary_tex", False), + ], + } + ), + ( + "wm.radial_control", + {"type": 'F', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path_primary", 'tool_settings.uv_sculpt.brush.strength'), + ("data_path_secondary", 'tool_settings.unified_paint_settings.strength'), + ("use_secondary", 'tool_settings.unified_paint_settings.use_unified_strength'), + ("rotation_path", 'tool_settings.uv_sculpt.brush.texture_slot.angle'), + ("color_path", 'tool_settings.uv_sculpt.brush.cursor_color_add'), + ("fill_color_path", ''), + ("fill_color_override_path", ''), + ("fill_color_override_test_path", ''), + ("zoom_path", ''), + ("image_id", 'tool_settings.uv_sculpt.brush'), + ("secondary_tex", False), + ], + } + ), + ( + "brush.uv_sculpt_tool_set", + {"type": 'S', "value": 'PRESS'}, + { + "properties": [ + ("tool", 'RELAX'), + ], + } + ), + ( + "brush.uv_sculpt_tool_set", + {"type": 'P', "value": 'PRESS'}, + { + "properties": [ + ("tool", 'PINCH'), + ], + } + ), + ( + "brush.uv_sculpt_tool_set", + {"type": 'G', "value": 'PRESS'}, + { + "properties": [ + ("tool", 'GRAB'), + ], + } + ), + ], + }, + ), + ( + "Mask Editing", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ("mask.new", {"type": 'N', "value": 'PRESS', "alt": True}, None), + ( + "wm.call_menu", + {"type": 'A', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("name", 'MASK_MT_add'), + ], + } + ), + ( + "wm.context_cycle_enum", + {"type": 'O', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'tool_settings.proportional_edit_falloff'), + ("wrap", True), + ], + } + ), + ( + "wm.context_toggle", + {"type": 'O', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.use_proportional_edit_mask'), + ], + } + ), + ("mask.add_vertex_slide", {"type": 'ACTIONMOUSE', "value": 'PRESS', "ctrl": True}, None), + ("mask.add_feather_vertex_slide", {"type": 'ACTIONMOUSE', "value": 'PRESS', "shift": True}, None), + ("mask.delete", {"type": 'X', "value": 'PRESS'}, None), + ("mask.delete", {"type": 'DEL', "value": 'PRESS'}, None), + ( + "mask.select", + {"type": 'SELECTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("extend", False), + ("deselect", False), + ("toggle", False), + ], + } + ), + ( + "mask.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", False), + ("deselect", False), + ("toggle", True), + ], + } + ), + ( + "mask.select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "mask.select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ("mask.select_linked", {"type": 'L', "value": 'PRESS', "ctrl": True}, None), + ( + "mask.select_linked_pick", + {"type": 'L', "value": 'PRESS'}, + { + "properties": [ + ("deselect", False), + ], + } + ), + ( + "mask.select_linked_pick", + {"type": 'L', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("deselect", True), + ], + } + ), + ("mask.select_border", {"type": 'B', "value": 'PRESS'}, None), + ("mask.select_circle", {"type": 'C', "value": 'PRESS'}, None), + ( + "mask.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "ctrl": True, "alt": True}, + { + "properties": [ + ("deselect", False), + ], + } + ), + ( + "mask.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "shift": True, "ctrl": True, "alt": True}, + { + "properties": [ + ("deselect", True), + ], + } + ), + ("mask.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None), + ("mask.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None), + ("mask.hide_view_clear", {"type": 'H', "value": 'PRESS', "alt": True}, None), + ( + "mask.hide_view_set", + {"type": 'H', "value": 'PRESS'}, + { + "properties": [ + ("unselected", False), + ], + } + ), + ( + "mask.hide_view_set", + {"type": 'H', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("unselected", True), + ], + } + ), + ( + "clip.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("extend", False), + ], + } + ), + ("mask.cyclic_toggle", {"type": 'C', "value": 'PRESS', "alt": True}, None), + ("mask.slide_point", {"type": 'ACTIONMOUSE', "value": 'PRESS'}, None), + ("mask.slide_spline_curvature", {"type": 'ACTIONMOUSE', "value": 'PRESS'}, None), + ("mask.handle_type_set", {"type": 'V', "value": 'PRESS'}, None), + ("mask.normals_make_consistent", {"type": 'N', "value": 'PRESS', "ctrl": True}, None), + ("mask.parent_set", {"type": 'P', "value": 'PRESS', "ctrl": True}, None), + ("mask.parent_clear", {"type": 'P', "value": 'PRESS', "alt": True}, None), + ("mask.shape_key_insert", {"type": 'I', "value": 'PRESS'}, None), + ("mask.shape_key_clear", {"type": 'I', "value": 'PRESS', "alt": True}, None), + ("mask.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None), + ("mask.copy_splines", {"type": 'C', "value": 'PRESS', "ctrl": True}, None), + ("mask.paste_splines", {"type": 'V', "value": 'PRESS', "ctrl": True}, None), + ("uv.cursor_set", {"type": 'ACTIONMOUSE', "value": 'PRESS'}, None), + ("transform.translate", {"type": 'G', "value": 'PRESS'}, None), + ("transform.translate", {"type": 'EVT_TWEAK_S', "value": 'ANY'}, None), + ("transform.resize", {"type": 'S', "value": 'PRESS'}, None), + ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None), + ( + "transform.transform", + {"type": 'S', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("mode", 'MASK_SHRINKFATTEN'), + ], + } + ), + ], + }, + ), + ( + "Markers", + {"space_type": 'EMPTY', "region_type": 'WINDOW'}, + { + "items": [ + ("marker.add", {"type": 'M', "value": 'PRESS'}, None), + ("marker.move", {"type": 'EVT_TWEAK_S', "value": 'ANY'}, None), + ("marker.duplicate", {"type": 'D', "value": 'PRESS', "shift": True}, None), + ("marker.select", {"type": 'SELECTMOUSE', "value": 'PRESS'}, None), + ( + "marker.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ( + "marker.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("extend", False), + ("camera", True), + ], + } + ), + ( + "marker.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("extend", True), + ("camera", True), + ], + } + ), + ("marker.select_border", {"type": 'B', "value": 'PRESS'}, None), + ("marker.select_all", {"type": 'A', "value": 'PRESS'}, None), + ("marker.delete", {"type": 'X', "value": 'PRESS'}, None), + ("marker.delete", {"type": 'DEL', "value": 'PRESS'}, None), + ("marker.rename", {"type": 'M', "value": 'PRESS', "ctrl": True}, None), + ("marker.move", {"type": 'G', "value": 'PRESS'}, None), + ("marker.camera_bind", {"type": 'B', "value": 'PRESS', "ctrl": True}, None), + ], + }, + ), + ( + "Graph Editor Generic", + {"space_type": 'GRAPH_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ("graph.properties", {"type": 'N', "value": 'PRESS'}, None), + ("graph.extrapolation_type", {"type": 'E', "value": 'PRESS', "shift": True}, None), + ("anim.channels_find", {"type": 'F', "value": 'PRESS', "ctrl": True}, None), + ( + "graph.hide", + {"type": 'H', "value": 'PRESS'}, + { + "properties": [ + ("unselected", False), + ], + } + ), + ( + "graph.hide", + {"type": 'H', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("unselected", True), + ], + } + ), + ("graph.reveal", {"type": 'H', "value": 'PRESS', "alt": True}, None), + ], + }, + ), + ( + "Graph Editor", + {"space_type": 'GRAPH_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ( + "wm.context_toggle", + {"type": 'H', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path", 'space_data.show_handles'), + ], + } + ), + ("graph.cursor_set", {"type": 'ACTIONMOUSE', "value": 'PRESS'}, None), + ( + "graph.clickselect", + {"type": 'SELECTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("extend", False), + ("column", False), + ("curves", False), + ], + } + ), + ( + "graph.clickselect", + {"type": 'SELECTMOUSE', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("extend", False), + ("column", True), + ("curves", False), + ], + } + ), + ( + "graph.clickselect", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", True), + ("column", False), + ("curves", False), + ], + } + ), + ( + "graph.clickselect", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("extend", True), + ("column", True), + ("curves", False), + ], + } + ), + ( + "graph.clickselect", + {"type": 'SELECTMOUSE', "value": 'PRESS', "ctrl": True, "alt": True}, + { + "properties": [ + ("extend", False), + ("column", False), + ("curves", True), + ], + } + ), + ( + "graph.clickselect", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, + { + "properties": [ + ("extend", True), + ("column", False), + ("curves", True), + ], + } + ), + ( + "graph.select_leftright", + {"type": 'SELECTMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("mode", 'CHECK'), + ("extend", False), + ], + } + ), + ( + "graph.select_leftright", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("mode", 'CHECK'), + ("extend", True), + ], + } + ), + ( + "graph.select_leftright", + {"type": 'LEFT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'LEFT'), + ("extend", False), + ], + } + ), + ( + "graph.select_leftright", + {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'RIGHT'), + ("extend", False), + ], + } + ), + ( + "graph.select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "graph.select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ( + "graph.select_border", + {"type": 'B', "value": 'PRESS'}, + { + "properties": [ + ("axis_range", False), + ("include_handles", False), + ], + } + ), + ( + "graph.select_border", + {"type": 'B', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("axis_range", True), + ("include_handles", False), + ], + } + ), + ( + "graph.select_border", + {"type": 'B', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("axis_range", False), + ("include_handles", True), + ], + } + ), + ( + "graph.select_border", + {"type": 'B', "value": 'PRESS', "ctrl": True, "alt": True}, + { + "properties": [ + ("axis_range", True), + ("include_handles", True), + ], + } + ), + ( + "graph.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "ctrl": True}, + { + "properties": [ + ("deselect", False), + ], + } + ), + ( + "graph.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "shift": True, "ctrl": True}, + { + "properties": [ + ("deselect", True), + ], + } + ), + ("graph.select_circle", {"type": 'C', "value": 'PRESS'}, None), + ( + "graph.select_column", + {"type": 'K', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'KEYS'), + ], + } + ), + ( + "graph.select_column", + {"type": 'K', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("mode", 'CFRA'), + ], + } + ), + ( + "graph.select_column", + {"type": 'K', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'MARKERS_COLUMN'), + ], + } + ), + ( + "graph.select_column", + {"type": 'K', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("mode", 'MARKERS_BETWEEN'), + ], + } + ), + ("graph.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None), + ("graph.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None), + ("graph.select_linked", {"type": 'L', "value": 'PRESS'}, None), + ("graph.frame_jump", {"type": 'G', "value": 'PRESS', "ctrl": True}, None), + ("graph.snap", {"type": 'S', "value": 'PRESS', "shift": True}, None), + ("graph.mirror", {"type": 'M', "value": 'PRESS', "shift": True}, None), + ("graph.handle_type", {"type": 'V', "value": 'PRESS'}, None), + ("graph.interpolation_type", {"type": 'T', "value": 'PRESS'}, None), + ("graph.easing_type", {"type": 'E', "value": 'PRESS', "ctrl": True}, None), + ("graph.smooth", {"type": 'O', "value": 'PRESS', "alt": True}, None), + ("graph.sample", {"type": 'O', "value": 'PRESS', "shift": True}, None), + ("graph.bake", {"type": 'C', "value": 'PRESS', "alt": True}, None), + ( + "wm.call_menu", + {"type": 'X', "value": 'PRESS'}, + { + "properties": [ + ("name", 'GRAPH_MT_delete'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'DEL', "value": 'PRESS'}, + { + "properties": [ + ("name", 'GRAPH_MT_delete'), + ], + } + ), + ("graph.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None), + ("graph.keyframe_insert", {"type": 'I', "value": 'PRESS'}, None), + ( + "graph.click_insert", + {"type": 'ACTIONMOUSE', "value": 'CLICK', "ctrl": True}, + { + "properties": [ + ("extend", False), + ], + } + ), + ( + "graph.click_insert", + {"type": 'ACTIONMOUSE', "value": 'CLICK', "shift": True, "ctrl": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ("graph.copy", {"type": 'C', "value": 'PRESS', "ctrl": True}, None), + ("graph.paste", {"type": 'V', "value": 'PRESS', "ctrl": True}, None), + ( + "graph.paste", + {"type": 'V', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("flipped", True), + ], + } + ), + ("graph.previewrange_set", {"type": 'P', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ("graph.view_all", {"type": 'HOME', "value": 'PRESS'}, None), + ("graph.view_all", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, None), + ("graph.view_selected", {"type": 'NUMPAD_PERIOD', "value": 'PRESS'}, None), + ("graph.view_frame", {"type": 'NUMPAD_0', "value": 'PRESS'}, None), + ( + "graph.fmodifier_add", + {"type": 'M', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("only_active", False), + ], + } + ), + ("anim.channels_editable_toggle", {"type": 'TAB', "value": 'PRESS'}, None), + ("transform.translate", {"type": 'G', "value": 'PRESS'}, None), + ("transform.translate", {"type": 'EVT_TWEAK_S', "value": 'ANY'}, None), + ( + "transform.transform", + {"type": 'E', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'TIME_EXTEND'), + ], + } + ), + ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None), + ("transform.resize", {"type": 'S', "value": 'PRESS'}, None), + ( + "wm.context_toggle", + {"type": 'O', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.use_proportional_fcurve'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'COMMA', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.pivot_point'), + ("value", 'BOUNDING_BOX_CENTER'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'PERIOD', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.pivot_point'), + ("value", 'CURSOR'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'PERIOD', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path", 'space_data.pivot_point'), + ("value", 'INDIVIDUAL_ORIGINS'), + ], + } + ), + ("marker.add", {"type": 'M', "value": 'PRESS'}, None), + ("marker.rename", {"type": 'M', "value": 'PRESS', "ctrl": True}, None), + ], + }, + ), + ( + "Image Generic", + {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ("image.new", {"type": 'N', "value": 'PRESS', "alt": True}, None), + ("image.open", {"type": 'O', "value": 'PRESS', "alt": True}, None), + ("image.reload", {"type": 'R', "value": 'PRESS', "alt": True}, None), + ("image.read_viewlayers", {"type": 'R', "value": 'PRESS', "ctrl": True}, None), + ("image.save", {"type": 'S', "value": 'PRESS', "alt": True}, None), + ("image.save_as", {"type": 'F3', "value": 'PRESS'}, None), + ("image.properties", {"type": 'N', "value": 'PRESS'}, None), + ("image.toolshelf", {"type": 'T', "value": 'PRESS'}, None), + ("image.cycle_render_slot", {"type": 'J', "value": 'PRESS'}, None), + ( + "image.cycle_render_slot", + {"type": 'J', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("reverse", True), + ], + } + ), + ], + }, + ), + ( + "Image", + {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ("image.view_all", {"type": 'HOME', "value": 'PRESS'}, None), + ( + "image.view_all", + {"type": 'HOME', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("fit_view", True), + ], + } + ), + ("image.view_selected", {"type": 'NUMPAD_PERIOD', "value": 'PRESS'}, None), + ("image.view_pan", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None), + ("image.view_pan", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "shift": True}, None), + ("image.view_pan", {"type": 'TRACKPADPAN', "value": 'ANY'}, None), + ("image.view_all", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, None), + ("image.view_ndof", {"type": 'NDOF_MOTION', "value": 'ANY'}, None), + ("image.view_zoom_in", {"type": 'WHEELINMOUSE', "value": 'PRESS'}, None), + ("image.view_zoom_out", {"type": 'WHEELOUTMOUSE', "value": 'PRESS'}, None), + ("image.view_zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, None), + ("image.view_zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, None), + ("image.view_zoom", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "ctrl": True}, None), + ("image.view_zoom", {"type": 'TRACKPADZOOM', "value": 'ANY'}, None), + ("image.view_zoom", {"type": 'TRACKPADPAN', "value": 'ANY', "ctrl": True}, None), + ("image.view_zoom_border", {"type": 'B', "value": 'PRESS', "shift": True}, None), + ( + "image.view_zoom_ratio", + {"type": 'NUMPAD_8', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("ratio", 8.0), + ], + } + ), + ( + "image.view_zoom_ratio", + {"type": 'NUMPAD_4', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("ratio", 4.0), + ], + } + ), + ( + "image.view_zoom_ratio", + {"type": 'NUMPAD_2', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("ratio", 2.0), + ], + } + ), + ( + "image.view_zoom_ratio", + {"type": 'NUMPAD_8', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("ratio", 8.0), + ], + } + ), + ( + "image.view_zoom_ratio", + {"type": 'NUMPAD_4', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("ratio", 4.0), + ], + } + ), + ( + "image.view_zoom_ratio", + {"type": 'NUMPAD_2', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("ratio", 2.0), + ], + } + ), + ( + "image.view_zoom_ratio", + {"type": 'NUMPAD_1', "value": 'PRESS'}, + { + "properties": [ + ("ratio", 1.0), + ], + } + ), + ( + "image.view_zoom_ratio", + {"type": 'NUMPAD_2', "value": 'PRESS'}, + { + "properties": [ + ("ratio", 0.5), + ], + } + ), + ( + "image.view_zoom_ratio", + {"type": 'NUMPAD_4', "value": 'PRESS'}, + { + "properties": [ + ("ratio", 0.25), + ], + } + ), + ( + "image.view_zoom_ratio", + {"type": 'NUMPAD_8', "value": 'PRESS'}, + { + "properties": [ + ("ratio", 0.125), + ], + } + ), + ("image.change_frame", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), + ("image.sample", {"type": 'ACTIONMOUSE', "value": 'PRESS'}, None), + ( + "image.curves_point_set", + {"type": 'ACTIONMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("point", 'BLACK_POINT'), + ], + } + ), + ( + "image.curves_point_set", + {"type": 'ACTIONMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("point", 'WHITE_POINT'), + ], + } + ), + ( + "object.mode_set", + {"type": 'TAB', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'EDIT'), + ("toggle", True), + ], + } + ), + ( + "wm.context_set_int", + {"type": 'ONE', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.image.render_slots.active_index'), + ("value", 0), + ], + } + ), + ( + "wm.context_set_int", + {"type": 'TWO', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.image.render_slots.active_index'), + ("value", 1), + ], + } + ), + ( + "wm.context_set_int", + {"type": 'THREE', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.image.render_slots.active_index'), + ("value", 2), + ], + } + ), + ( + "wm.context_set_int", + {"type": 'FOUR', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.image.render_slots.active_index'), + ("value", 3), + ], + } + ), + ( + "wm.context_set_int", + {"type": 'FIVE', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.image.render_slots.active_index'), + ("value", 4), + ], + } + ), + ( + "wm.context_set_int", + {"type": 'SIX', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.image.render_slots.active_index'), + ("value", 5), + ], + } + ), + ( + "wm.context_set_int", + {"type": 'SEVEN', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.image.render_slots.active_index'), + ("value", 6), + ], + } + ), + ( + "wm.context_set_int", + {"type": 'EIGHT', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.image.render_slots.active_index'), + ("value", 7), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'COMMA', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.pivot_point'), + ("value", 'CENTER'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'COMMA', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path", 'space_data.pivot_point'), + ("value", 'MEDIAN'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'PERIOD', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.pivot_point'), + ("value", 'CURSOR'), + ], + } + ), + ("image.render_border", {"type": 'B', "value": 'PRESS', "ctrl": True}, None), + ("image.clear_render_border", {"type": 'B', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ], + }, + ), + ( + "Node Generic", + {"space_type": 'NODE_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ("node.properties", {"type": 'N', "value": 'PRESS'}, None), + ("node.toolbar", {"type": 'T', "value": 'PRESS'}, None), + ], + }, + ), + ( + "Node Editor", + {"space_type": 'NODE_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ( + "node.select", + {"type": 'ACTIONMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("extend", False), + ], + } + ), + ( + "node.select", + {"type": 'SELECTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("extend", False), + ], + } + ), + ( + "node.select", + {"type": 'ACTIONMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("extend", False), + ], + } + ), + ( + "node.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("extend", False), + ], + } + ), + ( + "node.select", + {"type": 'ACTIONMOUSE', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("extend", False), + ], + } + ), + ( + "node.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("extend", False), + ], + } + ), + ( + "node.select", + {"type": 'ACTIONMOUSE', "value": 'PRESS', "ctrl": True, "alt": True}, + { + "properties": [ + ("extend", False), + ], + } + ), + ( + "node.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "ctrl": True, "alt": True}, + { + "properties": [ + ("extend", False), + ], + } + ), + ( + "node.select", + {"type": 'ACTIONMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ( + "node.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ( + "node.select", + {"type": 'ACTIONMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ( + "node.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ( + "node.select", + {"type": 'ACTIONMOUSE', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ( + "node.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ( + "node.select", + {"type": 'ACTIONMOUSE', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ( + "node.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ( + "node.select_border", + {"type": 'EVT_TWEAK_S', "value": 'ANY'}, + { + "properties": [ + ("tweak", True), + ], + } + ), + ( + "node.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "ctrl": True, "alt": True}, + { + "properties": [ + ("deselect", False), + ], + } + ), + ( + "node.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "shift": True, "ctrl": True, "alt": True}, + { + "properties": [ + ("deselect", True), + ], + } + ), + ("node.select_circle", {"type": 'C', "value": 'PRESS'}, None), + ( + "node.link", + {"type": 'LEFTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("detach", False), + ], + } + ), + ( + "node.link", + {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("detach", True), + ], + } + ), + ("node.resize", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), + ("node.add_reroute", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True}, None), + ("node.links_cut", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, None), + ("node.select_link_viewer", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ("node.backimage_move", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "alt": True}, None), + ( + "node.backimage_zoom", + {"type": 'V', "value": 'PRESS'}, + { + "properties": [ + ("factor", 0.8333333), + ], + } + ), + ( + "node.backimage_zoom", + {"type": 'V', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("factor", 1.2), + ], + } + ), + ("node.backimage_fit", {"type": 'HOME', "value": 'PRESS', "alt": True}, None), + ("node.backimage_sample", {"type": 'ACTIONMOUSE', "value": 'PRESS', "alt": True}, None), + ( + "node.link_make", + {"type": 'F', "value": 'PRESS'}, + { + "properties": [ + ("replace", False), + ], + } + ), + ( + "node.link_make", + {"type": 'F', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("replace", True), + ], + } + ), + ( + "wm.call_menu", + {"type": 'A', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("name", 'NODE_MT_add'), + ], + } + ), + ("node.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None), + ("node.duplicate_move_keep_inputs", {"type": 'D', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ("node.parent_set", {"type": 'P', "value": 'PRESS', "ctrl": True}, None), + ("node.detach", {"type": 'P', "value": 'PRESS', "alt": True}, None), + ("node.join", {"type": 'J', "value": 'PRESS', "ctrl": True}, None), + ("node.hide_toggle", {"type": 'H', "value": 'PRESS'}, None), + ("node.mute_toggle", {"type": 'M', "value": 'PRESS'}, None), + ("node.preview_toggle", {"type": 'H', "value": 'PRESS', "shift": True}, None), + ("node.hide_socket_toggle", {"type": 'H', "value": 'PRESS', "ctrl": True}, None), + ("node.view_all", {"type": 'HOME', "value": 'PRESS'}, None), + ("node.view_all", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, None), + ("node.view_selected", {"type": 'NUMPAD_PERIOD', "value": 'PRESS'}, None), + ( + "node.select_border", + {"type": 'B', "value": 'PRESS'}, + { + "properties": [ + ("tweak", False), + ], + } + ), + ("node.delete", {"type": 'X', "value": 'PRESS'}, None), + ("node.delete", {"type": 'DEL', "value": 'PRESS'}, None), + ("node.delete_reconnect", {"type": 'X', "value": 'PRESS', "ctrl": True}, None), + ( + "node.select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "node.select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ("node.select_linked_to", {"type": 'L', "value": 'PRESS', "shift": True}, None), + ("node.select_linked_from", {"type": 'L', "value": 'PRESS'}, None), + ( + "node.select_grouped", + {"type": 'G', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", False), + ], + } + ), + ( + "node.select_grouped", + {"type": 'G', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ( + "node.select_same_type_step", + {"type": 'RIGHT_BRACKET', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("prev", False), + ], + } + ), + ( + "node.select_same_type_step", + {"type": 'LEFT_BRACKET', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("prev", True), + ], + } + ), + ("node.find_node", {"type": 'F', "value": 'PRESS', "ctrl": True}, None), + ("node.group_make", {"type": 'G', "value": 'PRESS', "ctrl": True}, None), + ("node.group_ungroup", {"type": 'G', "value": 'PRESS', "alt": True}, None), + ("node.group_separate", {"type": 'P', "value": 'PRESS'}, None), + ( + "node.group_edit", + {"type": 'TAB', "value": 'PRESS'}, + { + "properties": [ + ("exit", False), + ], + } + ), + ( + "node.group_edit", + {"type": 'TAB', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("exit", True), + ], + } + ), + ("node.read_viewlayers", {"type": 'R', "value": 'PRESS', "ctrl": True}, None), + ("node.render_changed", {"type": 'Z', "value": 'PRESS'}, None), + ("node.clipboard_copy", {"type": 'C', "value": 'PRESS', "ctrl": True}, None), + ("node.clipboard_paste", {"type": 'V', "value": 'PRESS', "ctrl": True}, None), + ("node.viewer_border", {"type": 'B', "value": 'PRESS', "ctrl": True}, None), + ("node.clear_viewer_border", {"type": 'B', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ("node.translate_attach", {"type": 'G', "value": 'PRESS'}, None), + ("node.translate_attach", {"type": 'EVT_TWEAK_A', "value": 'ANY'}, None), + ("node.translate_attach", {"type": 'EVT_TWEAK_S', "value": 'ANY'}, None), + ( + "transform.translate", + {"type": 'G', "value": 'PRESS'}, + { + "properties": [ + ("release_confirm", True), + ], + } + ), + ( + "transform.translate", + {"type": 'EVT_TWEAK_A', "value": 'ANY'}, + { + "properties": [ + ("release_confirm", True), + ], + } + ), + ( + "transform.translate", + {"type": 'EVT_TWEAK_S', "value": 'ANY'}, + { + "properties": [ + ("release_confirm", True), + ], + } + ), + ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None), + ("transform.resize", {"type": 'S', "value": 'PRESS'}, None), + ("node.move_detach_links", {"type": 'D', "value": 'PRESS', "alt": True}, None), + ("node.move_detach_links_release", {"type": 'EVT_TWEAK_A', "value": 'ANY', "alt": True}, None), + ("node.move_detach_links", {"type": 'EVT_TWEAK_S', "value": 'ANY', "alt": True}, None), + ( + "wm.context_toggle", + {"type": 'TAB', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'tool_settings.use_snap'), + ], + } + ), + ( + "wm.context_menu_enum", + {"type": 'TAB', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("data_path", 'tool_settings.snap_node_element'), + ], + } + ), + ], + }, + ), + ( + "File Browser", + {"space_type": 'FILE_BROWSER', "region_type": 'WINDOW'}, + { + "items": [ + ("file.parent", {"type": 'UP_ARROW', "value": 'PRESS', "alt": True}, None), + ("file.previous", {"type": 'LEFT_ARROW', "value": 'PRESS', "alt": True}, None), + ("file.next", {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True}, None), + ("file.refresh", {"type": 'R', "value": 'PRESS'}, None), + ("file.parent", {"type": 'P', "value": 'PRESS'}, None), + ("file.previous", {"type": 'BACK_SPACE', "value": 'PRESS'}, None), + ("file.next", {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True}, None), + ( + "wm.context_toggle", + {"type": 'H', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.params.show_hidden'), + ], + } + ), + ("file.directory_new", {"type": 'I', "value": 'PRESS'}, None), + ("file.delete", {"type": 'X', "value": 'PRESS'}, None), + ("file.delete", {"type": 'DEL', "value": 'PRESS'}, None), + ("file.smoothscroll", {"type": 'TIMER1', "value": 'ANY', "any": True}, None), + ("file.bookmark_toggle", {"type": 'T', "value": 'PRESS'}, None), + ("file.bookmark_add", {"type": 'B', "value": 'PRESS', "ctrl": True}, None), + ], + }, + ), + ( + "File Browser Main", + {"space_type": 'FILE_BROWSER', "region_type": 'WINDOW'}, + { + "items": [ + ( + "file.execute", + {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, + { + "properties": [ + ("need_active", True), + ], + } + ), + ("file.refresh", {"type": 'NUMPAD_PERIOD', "value": 'PRESS'}, None), + ("file.select", {"type": 'LEFTMOUSE', "value": 'CLICK'}, None), + ( + "file.select", + {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ( + "file.select", + {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True, "ctrl": True}, + { + "properties": [ + ("extend", True), + ("fill", True), + ], + } + ), + ( + "file.select", + {"type": 'RIGHTMOUSE', "value": 'CLICK'}, + { + "properties": [ + ("open", False), + ], + } + ), + ( + "file.select", + {"type": 'RIGHTMOUSE', "value": 'CLICK', "shift": True}, + { + "properties": [ + ("extend", True), + ("open", False), + ], + } + ), + ( + "file.select", + {"type": 'RIGHTMOUSE', "value": 'CLICK', "alt": True}, + { + "properties": [ + ("extend", True), + ("fill", True), + ("open", False), + ], + } + ), + ( + "file.select_walk", + {"type": 'UP_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("direction", 'UP'), + ], + } + ), + ( + "file.select_walk", + {"type": 'UP_ARROW', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("direction", 'UP'), + ("extend", True), + ], + } + ), + ( + "file.select_walk", + {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("direction", 'UP'), + ("extend", True), + ("fill", True), + ], + } + ), + ( + "file.select_walk", + {"type": 'DOWN_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("direction", 'DOWN'), + ], + } + ), + ( + "file.select_walk", + {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("direction", 'DOWN'), + ("extend", True), + ], + } + ), + ( + "file.select_walk", + {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("direction", 'DOWN'), + ("extend", True), + ("fill", True), + ], + } + ), + ( + "file.select_walk", + {"type": 'LEFT_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("direction", 'LEFT'), + ], + } + ), + ( + "file.select_walk", + {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("direction", 'LEFT'), + ("extend", True), + ], + } + ), + ( + "file.select_walk", + {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("direction", 'LEFT'), + ("extend", True), + ("fill", True), + ], + } + ), + ( + "file.select_walk", + {"type": 'RIGHT_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("direction", 'RIGHT'), + ], + } + ), + ( + "file.select_walk", + {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("direction", 'RIGHT'), + ("extend", True), + ], + } + ), + ( + "file.select_walk", + {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("direction", 'RIGHT'), + ("extend", True), + ("fill", True), + ], + } + ), + ("file.previous", {"type": 'BUTTON4MOUSE', "value": 'CLICK'}, None), + ("file.next", {"type": 'BUTTON5MOUSE', "value": 'CLICK'}, None), + ("file.select_all_toggle", {"type": 'A', "value": 'PRESS'}, None), + ("file.select_border", {"type": 'B', "value": 'PRESS'}, None), + ("file.select_border", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, None), + ("file.rename", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, None), + ("file.highlight", {"type": 'MOUSEMOVE', "value": 'ANY', "any": True}, None), + ( + "file.filenum", + {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, + { + "properties": [ + ("increment", 1), + ], + } + ), + ( + "file.filenum", + {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("increment", 10), + ], + } + ), + ( + "file.filenum", + {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("increment", 100), + ], + } + ), + ( + "file.filenum", + {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, + { + "properties": [ + ("increment", -1), + ], + } + ), + ( + "file.filenum", + {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("increment", -10), + ], + } + ), + ( + "file.filenum", + {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("increment", -100), + ], + } + ), + ], + }, + ), + ( + "File Browser Buttons", + {"space_type": 'FILE_BROWSER', "region_type": 'WINDOW'}, + { + "items": [ + ( + "file.filenum", + {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, + { + "properties": [ + ("increment", 1), + ], + } + ), + ( + "file.filenum", + {"type": 'NUMPAD_PLUS', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("increment", 10), + ], + } + ), + ( + "file.filenum", + {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("increment", 100), + ], + } + ), + ( + "file.filenum", + {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, + { + "properties": [ + ("increment", -1), + ], + } + ), + ( + "file.filenum", + {"type": 'NUMPAD_MINUS', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("increment", -10), + ], + } + ), + ( + "file.filenum", + {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("increment", -100), + ], + } + ), + ], + }, + ), + ( + "Dopesheet Generic", + {"space_type": 'DOPESHEET_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ("action.properties", {"type": 'N', "value": 'PRESS'}, None), + ], + }, + ), + ( + "Dopesheet", + {"space_type": 'DOPESHEET_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ( + "action.clickselect", + {"type": 'SELECTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("extend", False), + ("column", False), + ("channel", False), + ], + } + ), + ( + "action.clickselect", + {"type": 'SELECTMOUSE', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("extend", False), + ("column", True), + ("channel", False), + ], + } + ), + ( + "action.clickselect", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", True), + ("column", False), + ("channel", False), + ], + } + ), + ( + "action.clickselect", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("extend", True), + ("column", True), + ("channel", False), + ], + } + ), + ( + "action.clickselect", + {"type": 'SELECTMOUSE', "value": 'PRESS', "ctrl": True, "alt": True}, + { + "properties": [ + ("extend", False), + ("column", False), + ("channel", True), + ], + } + ), + ( + "action.clickselect", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, + { + "properties": [ + ("extend", True), + ("column", False), + ("channel", True), + ], + } + ), + ( + "action.select_leftright", + {"type": 'SELECTMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("mode", 'CHECK'), + ("extend", False), + ], + } + ), + ( + "action.select_leftright", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("mode", 'CHECK'), + ("extend", True), + ], + } + ), + ( + "action.select_leftright", + {"type": 'LEFT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'LEFT'), + ("extend", False), + ], + } + ), + ( + "action.select_leftright", + {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'RIGHT'), + ("extend", False), + ], + } + ), + ( + "action.select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "action.select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ( + "action.select_border", + {"type": 'B', "value": 'PRESS'}, + { + "properties": [ + ("axis_range", False), + ], + } + ), + ( + "action.select_border", + {"type": 'B', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("axis_range", True), + ], + } + ), + ( + "action.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "ctrl": True}, + { + "properties": [ + ("deselect", False), + ], + } + ), + ( + "action.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "shift": True, "ctrl": True}, + { + "properties": [ + ("deselect", True), + ], + } + ), + ("action.select_circle", {"type": 'C', "value": 'PRESS'}, None), + ( + "action.select_column", + {"type": 'K', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'KEYS'), + ], + } + ), + ( + "action.select_column", + {"type": 'K', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("mode", 'CFRA'), + ], + } + ), + ( + "action.select_column", + {"type": 'K', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'MARKERS_COLUMN'), + ], + } + ), + ( + "action.select_column", + {"type": 'K', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("mode", 'MARKERS_BETWEEN'), + ], + } + ), + ("action.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None), + ("action.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None), + ("action.select_linked", {"type": 'L', "value": 'PRESS'}, None), + ("action.frame_jump", {"type": 'G', "value": 'PRESS', "ctrl": True}, None), + ("action.snap", {"type": 'S', "value": 'PRESS', "shift": True}, None), + ("action.mirror", {"type": 'M', "value": 'PRESS', "shift": True}, None), + ("action.handle_type", {"type": 'V', "value": 'PRESS'}, None), + ("action.interpolation_type", {"type": 'T', "value": 'PRESS'}, None), + ("action.extrapolation_type", {"type": 'E', "value": 'PRESS', "shift": True}, None), + ("action.keyframe_type", {"type": 'R', "value": 'PRESS'}, None), + ("action.sample", {"type": 'O', "value": 'PRESS', "shift": True}, None), + ( + "wm.call_menu", + {"type": 'X', "value": 'PRESS'}, + { + "properties": [ + ("name", 'DOPESHEET_MT_delete'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'DEL', "value": 'PRESS'}, + { + "properties": [ + ("name", 'DOPESHEET_MT_delete'), + ], + } + ), + ("action.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None), + ("action.keyframe_insert", {"type": 'I', "value": 'PRESS'}, None), + ("action.copy", {"type": 'C', "value": 'PRESS', "ctrl": True}, None), + ("action.paste", {"type": 'V', "value": 'PRESS', "ctrl": True}, None), + ( + "action.paste", + {"type": 'V', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("flipped", True), + ], + } + ), + ("action.previewrange_set", {"type": 'P', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ("action.view_all", {"type": 'HOME', "value": 'PRESS'}, None), + ("action.view_all", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, None), + ("action.view_selected", {"type": 'NUMPAD_PERIOD', "value": 'PRESS'}, None), + ("action.view_frame", {"type": 'NUMPAD_0', "value": 'PRESS'}, None), + ("anim.channels_editable_toggle", {"type": 'TAB', "value": 'PRESS'}, None), + ("anim.channels_find", {"type": 'F', "value": 'PRESS', "ctrl": True}, None), + ( + "transform.transform", + {"type": 'G', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'TIME_TRANSLATE'), + ], + } + ), + ( + "transform.transform", + {"type": 'EVT_TWEAK_S', "value": 'ANY'}, + { + "properties": [ + ("mode", 'TIME_TRANSLATE'), + ], + } + ), + ( + "transform.transform", + {"type": 'E', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'TIME_EXTEND'), + ], + } + ), + ( + "transform.transform", + {"type": 'S', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'TIME_SCALE'), + ], + } + ), + ( + "transform.transform", + {"type": 'T', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("mode", 'TIME_SLIDE'), + ], + } + ), + ( + "wm.context_toggle", + {"type": 'O', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'tool_settings.use_proportional_action'), + ], + } + ), + ("marker.add", {"type": 'M', "value": 'PRESS'}, None), + ("marker.rename", {"type": 'M', "value": 'PRESS', "ctrl": True}, None), + ], + }, + ), + ( + "NLA Generic", + {"space_type": 'NLA_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ("nla.properties", {"type": 'N', "value": 'PRESS'}, None), + ("nla.tweakmode_enter", {"type": 'TAB', "value": 'PRESS'}, None), + ("nla.tweakmode_exit", {"type": 'TAB', "value": 'PRESS'}, None), + ( + "nla.tweakmode_enter", + {"type": 'TAB', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("isolate_action", True), + ], + } + ), + ( + "nla.tweakmode_exit", + {"type": 'TAB', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("isolate_action", True), + ], + } + ), + ("anim.channels_find", {"type": 'F', "value": 'PRESS', "ctrl": True}, None), + ], + }, + ), + ( + "NLA Channels", + {"space_type": 'NLA_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ( + "nla.channels_click", + {"type": 'LEFTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("extend", False), + ], + } + ), + ( + "nla.channels_click", + {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ( + "nla.tracks_add", + {"type": 'A', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("above_selected", False), + ], + } + ), + ( + "nla.tracks_add", + {"type": 'A', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("above_selected", True), + ], + } + ), + ("nla.tracks_delete", {"type": 'X', "value": 'PRESS'}, None), + ("nla.tracks_delete", {"type": 'DEL', "value": 'PRESS'}, None), + ], + }, + ), + ( + "NLA Editor", + {"space_type": 'NLA_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ( + "nla.click_select", + {"type": 'SELECTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("extend", False), + ], + } + ), + ( + "nla.click_select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ( + "nla.select_leftright", + {"type": 'SELECTMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("mode", 'CHECK'), + ("extend", False), + ], + } + ), + ( + "nla.select_leftright", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("mode", 'CHECK'), + ("extend", True), + ], + } + ), + ( + "nla.select_leftright", + {"type": 'LEFT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'LEFT'), + ("extend", False), + ], + } + ), + ( + "nla.select_leftright", + {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'RIGHT'), + ("extend", False), + ], + } + ), + ( + "nla.select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "nla.select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ( + "nla.select_border", + {"type": 'B', "value": 'PRESS'}, + { + "properties": [ + ("axis_range", False), + ], + } + ), + ( + "nla.select_border", + {"type": 'B', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("axis_range", True), + ], + } + ), + ("nla.previewrange_set", {"type": 'P', "value": 'PRESS', "ctrl": True, "alt": True}, None), + ("nla.view_all", {"type": 'HOME', "value": 'PRESS'}, None), + ("nla.view_all", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, None), + ("nla.view_selected", {"type": 'NUMPAD_PERIOD', "value": 'PRESS'}, None), + ("nla.view_frame", {"type": 'NUMPAD_0', "value": 'PRESS'}, None), + ("nla.actionclip_add", {"type": 'A', "value": 'PRESS', "shift": True}, None), + ("nla.transition_add", {"type": 'T', "value": 'PRESS', "shift": True}, None), + ("nla.soundclip_add", {"type": 'K', "value": 'PRESS', "shift": True}, None), + ("nla.meta_add", {"type": 'G', "value": 'PRESS', "shift": True}, None), + ("nla.meta_remove", {"type": 'G', "value": 'PRESS', "alt": True}, None), + ( + "nla.duplicate", + {"type": 'D', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("linked", False), + ], + } + ), + ( + "nla.duplicate", + {"type": 'D', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("linked", True), + ], + } + ), + ("nla.make_single_user", {"type": 'U', "value": 'PRESS'}, None), + ("nla.delete", {"type": 'X', "value": 'PRESS'}, None), + ("nla.delete", {"type": 'DEL', "value": 'PRESS'}, None), + ("nla.split", {"type": 'Y', "value": 'PRESS'}, None), + ("nla.mute_toggle", {"type": 'H', "value": 'PRESS'}, None), + ("nla.swap", {"type": 'F', "value": 'PRESS', "alt": True}, None), + ("nla.move_up", {"type": 'PAGE_UP', "value": 'PRESS'}, None), + ("nla.move_down", {"type": 'PAGE_DOWN', "value": 'PRESS'}, None), + ("nla.apply_scale", {"type": 'A', "value": 'PRESS', "ctrl": True}, None), + ("nla.clear_scale", {"type": 'S', "value": 'PRESS', "alt": True}, None), + ("nla.snap", {"type": 'S', "value": 'PRESS', "shift": True}, None), + ("nla.fmodifier_add", {"type": 'M', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ( + "transform.transform", + {"type": 'G', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'TRANSLATION'), + ], + } + ), + ( + "transform.transform", + {"type": 'EVT_TWEAK_S', "value": 'ANY'}, + { + "properties": [ + ("mode", 'TRANSLATION'), + ], + } + ), + ( + "transform.transform", + {"type": 'E', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'TIME_EXTEND'), + ], + } + ), + ( + "transform.transform", + {"type": 'S', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'TIME_SCALE'), + ], + } + ), + ("marker.add", {"type": 'M', "value": 'PRESS'}, None), + ("marker.rename", {"type": 'M', "value": 'PRESS', "ctrl": True}, None), + ], + }, + ), + ( + "Text Generic", + {"space_type": 'TEXT_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ("text.start_find", {"type": 'F', "value": 'PRESS', "ctrl": True}, None), + ("text.jump", {"type": 'J', "value": 'PRESS', "ctrl": True}, None), + ("text.find", {"type": 'G', "value": 'PRESS', "ctrl": True}, None), + ("text.replace", {"type": 'H', "value": 'PRESS', "ctrl": True}, None), + ("text.properties", {"type": 'T', "value": 'PRESS', "ctrl": True}, None), + ], + }, + ), + ( + "Text", + {"space_type": 'TEXT_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ( + "wm.context_cycle_int", + {"type": 'WHEELUPMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path", 'space_data.font_size'), + ("reverse", False), + ], + } + ), + ( + "wm.context_cycle_int", + {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path", 'space_data.font_size'), + ("reverse", True), + ], + } + ), + ( + "wm.context_cycle_int", + {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path", 'space_data.font_size'), + ("reverse", False), + ], + } + ), + ( + "wm.context_cycle_int", + {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path", 'space_data.font_size'), + ("reverse", True), + ], + } + ), + ("text.new", {"type": 'N', "value": 'PRESS', "ctrl": True}, None), + ("text.open", {"type": 'O', "value": 'PRESS', "alt": True}, None), + ("text.reload", {"type": 'R', "value": 'PRESS', "alt": True}, None), + ("text.save", {"type": 'S', "value": 'PRESS', "alt": True}, None), + ("text.save_as", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None), + ("text.run_script", {"type": 'P', "value": 'PRESS', "alt": True}, None), + ("text.cut", {"type": 'X', "value": 'PRESS', "ctrl": True}, None), + ("text.copy", {"type": 'C', "value": 'PRESS', "ctrl": True}, None), + ("text.paste", {"type": 'V', "value": 'PRESS', "ctrl": True}, None), + ("text.cut", {"type": 'DEL', "value": 'PRESS', "shift": True}, None), + ("text.copy", {"type": 'INSERT', "value": 'PRESS', "ctrl": True}, None), + ("text.paste", {"type": 'INSERT', "value": 'PRESS', "shift": True}, None), + ("text.duplicate_line", {"type": 'D', "value": 'PRESS', "ctrl": True}, None), + ("text.select_all", {"type": 'A', "value": 'PRESS', "ctrl": True}, None), + ("text.select_line", {"type": 'A', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ("text.select_word", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, None), + ( + "text.move_lines", + {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("direction", 'UP'), + ], + } + ), + ( + "text.move_lines", + {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("direction", 'DOWN'), + ], + } + ), + ("text.indent", {"type": 'TAB', "value": 'PRESS'}, None), + ("text.unindent", {"type": 'TAB', "value": 'PRESS', "shift": True}, None), + ("text.uncomment", {"type": 'D', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ( + "text.move", + {"type": 'HOME', "value": 'PRESS'}, + { + "properties": [ + ("type", 'LINE_BEGIN'), + ], + } + ), + ( + "text.move", + {"type": 'END', "value": 'PRESS'}, + { + "properties": [ + ("type", 'LINE_END'), + ], + } + ), + ( + "text.move", + {"type": 'E', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'LINE_END'), + ], + } + ), + ( + "text.move", + {"type": 'E', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("type", 'LINE_END'), + ], + } + ), + ( + "text.move", + {"type": 'LEFT_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("type", 'PREVIOUS_CHARACTER'), + ], + } + ), + ( + "text.move", + {"type": 'RIGHT_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("type", 'NEXT_CHARACTER'), + ], + } + ), + ( + "text.move", + {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'PREVIOUS_WORD'), + ], + } + ), + ( + "text.move", + {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'NEXT_WORD'), + ], + } + ), + ( + "text.move", + {"type": 'UP_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("type", 'PREVIOUS_LINE'), + ], + } + ), + ( + "text.move", + {"type": 'DOWN_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("type", 'NEXT_LINE'), + ], + } + ), + ( + "text.move", + {"type": 'PAGE_UP', "value": 'PRESS'}, + { + "properties": [ + ("type", 'PREVIOUS_PAGE'), + ], + } + ), + ( + "text.move", + {"type": 'PAGE_DOWN', "value": 'PRESS'}, + { + "properties": [ + ("type", 'NEXT_PAGE'), + ], + } + ), + ( + "text.move", + {"type": 'HOME', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'FILE_TOP'), + ], + } + ), + ( + "text.move", + {"type": 'END', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'FILE_BOTTOM'), + ], + } + ), + ( + "text.move_select", + {"type": 'HOME', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'LINE_BEGIN'), + ], + } + ), + ( + "text.move_select", + {"type": 'END', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'LINE_END'), + ], + } + ), + ( + "text.move_select", + {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'PREVIOUS_CHARACTER'), + ], + } + ), + ( + "text.move_select", + {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'NEXT_CHARACTER'), + ], + } + ), + ( + "text.move_select", + {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("type", 'PREVIOUS_WORD'), + ], + } + ), + ( + "text.move_select", + {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("type", 'NEXT_WORD'), + ], + } + ), + ( + "text.move_select", + {"type": 'UP_ARROW', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'PREVIOUS_LINE'), + ], + } + ), + ( + "text.move_select", + {"type": 'DOWN_ARROW', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'NEXT_LINE'), + ], + } + ), + ( + "text.move_select", + {"type": 'PAGE_UP', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'PREVIOUS_PAGE'), + ], + } + ), + ( + "text.move_select", + {"type": 'PAGE_DOWN', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'NEXT_PAGE'), + ], + } + ), + ( + "text.move_select", + {"type": 'HOME', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("type", 'FILE_TOP'), + ], + } + ), + ( + "text.move_select", + {"type": 'END', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("type", 'FILE_BOTTOM'), + ], + } + ), + ( + "text.delete", + {"type": 'DEL', "value": 'PRESS'}, + { + "properties": [ + ("type", 'NEXT_CHARACTER'), + ], + } + ), + ( + "text.delete", + {"type": 'BACK_SPACE', "value": 'PRESS'}, + { + "properties": [ + ("type", 'PREVIOUS_CHARACTER'), + ], + } + ), + ( + "text.delete", + {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'PREVIOUS_CHARACTER'), + ], + } + ), + ( + "text.delete", + {"type": 'DEL', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'NEXT_WORD'), + ], + } + ), + ( + "text.delete", + {"type": 'BACK_SPACE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'PREVIOUS_WORD'), + ], + } + ), + ("text.overwrite_toggle", {"type": 'INSERT', "value": 'PRESS'}, None), + ("text.scroll_bar", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), + ("text.scroll_bar", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None), + ("text.scroll", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None), + ("text.scroll", {"type": 'TRACKPADPAN', "value": 'ANY'}, None), + ("text.selection_set", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, None), + ("text.cursor_set", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), + ( + "text.selection_set", + {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("select", True), + ], + } + ), + ( + "text.scroll", + {"type": 'WHEELUPMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("lines", -1), + ], + } + ), + ( + "text.scroll", + {"type": 'WHEELDOWNMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("lines", 1), + ], + } + ), + ("text.line_break", {"type": 'RET', "value": 'PRESS'}, None), + ("text.line_break", {"type": 'NUMPAD_ENTER', "value": 'PRESS'}, None), + ( + "wm.call_menu", + {"type": 'RIGHTMOUSE', "value": 'PRESS', "any": True}, + { + "properties": [ + ("name", 'TEXT_MT_toolbox'), + ], + } + ), + ("text.autocomplete", {"type": 'SPACE', "value": 'PRESS', "ctrl": True}, None), + ("text.line_number", {"type": 'TEXTINPUT', "value": 'ANY', "any": True}, None), + ("text.insert", {"type": 'TEXTINPUT', "value": 'ANY', "any": True}, None), + ], + }, + ), + ( + "SequencerCommon", + {"space_type": 'SEQUENCE_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ("sequencer.properties", {"type": 'N', "value": 'PRESS'}, None), + ( + "wm.context_toggle", + {"type": 'O', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("data_path", 'scene.sequence_editor.show_overlay'), + ], + } + ), + ("sequencer.view_toggle", {"type": 'TAB', "value": 'PRESS', "ctrl": True}, None), + ], + }, + ), + ( + "Sequencer", + {"space_type": 'SEQUENCE_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ( + "sequencer.select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "sequencer.select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ( + "sequencer.cut", + {"type": 'K', "value": 'PRESS'}, + { + "properties": [ + ("type", 'SOFT'), + ], + } + ), + ( + "sequencer.cut", + {"type": 'K', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'HARD'), + ], + } + ), + ( + "sequencer.mute", + {"type": 'H', "value": 'PRESS'}, + { + "properties": [ + ("unselected", False), + ], + } + ), + ( + "sequencer.mute", + {"type": 'H', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("unselected", True), + ], + } + ), + ( + "sequencer.unmute", + {"type": 'H', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("unselected", False), + ], + } + ), + ( + "sequencer.unmute", + {"type": 'H', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("unselected", True), + ], + } + ), + ("sequencer.lock", {"type": 'L', "value": 'PRESS', "shift": True}, None), + ("sequencer.unlock", {"type": 'L', "value": 'PRESS', "shift": True, "alt": True}, None), + ("sequencer.reassign_inputs", {"type": 'R', "value": 'PRESS'}, None), + ("sequencer.reload", {"type": 'R', "value": 'PRESS', "alt": True}, None), + ( + "sequencer.reload", + {"type": 'R', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("adjust_length", True), + ], + } + ), + ("sequencer.offset_clear", {"type": 'O', "value": 'PRESS', "alt": True}, None), + ("sequencer.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None), + ("sequencer.delete", {"type": 'X', "value": 'PRESS'}, None), + ("sequencer.delete", {"type": 'DEL', "value": 'PRESS'}, None), + ("sequencer.copy", {"type": 'C', "value": 'PRESS', "ctrl": True}, None), + ("sequencer.paste", {"type": 'V', "value": 'PRESS', "ctrl": True}, None), + ("sequencer.images_separate", {"type": 'Y', "value": 'PRESS'}, None), + ("sequencer.meta_toggle", {"type": 'TAB', "value": 'PRESS'}, None), + ("sequencer.meta_make", {"type": 'G', "value": 'PRESS', "ctrl": True}, None), + ("sequencer.meta_separate", {"type": 'G', "value": 'PRESS', "alt": True}, None), + ("sequencer.view_all", {"type": 'HOME', "value": 'PRESS'}, None), + ("sequencer.view_all", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, None), + ("sequencer.view_selected", {"type": 'NUMPAD_PERIOD', "value": 'PRESS'}, None), + ("sequencer.view_frame", {"type": 'NUMPAD_0', "value": 'PRESS'}, None), + ( + "sequencer.strip_jump", + {"type": 'PAGE_UP', "value": 'PRESS'}, + { + "properties": [ + ("next", True), + ("center", False), + ], + } + ), + ( + "sequencer.strip_jump", + {"type": 'PAGE_DOWN', "value": 'PRESS'}, + { + "properties": [ + ("next", False), + ("center", False), + ], + } + ), + ( + "sequencer.strip_jump", + {"type": 'PAGE_UP', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("next", True), + ("center", True), + ], + } + ), + ( + "sequencer.strip_jump", + {"type": 'PAGE_DOWN', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("next", False), + ("center", True), + ], + } + ), + ( + "sequencer.swap", + {"type": 'LEFT_ARROW', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("side", 'LEFT'), + ], + } + ), + ( + "sequencer.swap", + {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("side", 'RIGHT'), + ], + } + ), + ( + "sequencer.gap_remove", + {"type": 'BACK_SPACE', "value": 'PRESS'}, + { + "properties": [ + ("all", False), + ], + } + ), + ( + "sequencer.gap_remove", + {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("all", True), + ], + } + ), + ("sequencer.gap_insert", {"type": 'EQUAL', "value": 'PRESS', "shift": True}, None), + ("sequencer.snap", {"type": 'S', "value": 'PRESS', "shift": True}, None), + ("sequencer.swap_inputs", {"type": 'S', "value": 'PRESS', "alt": True}, None), + ( + "sequencer.cut_multicam", + {"type": 'ONE', "value": 'PRESS'}, + { + "properties": [ + ("camera", 1), + ], + } + ), + ( + "sequencer.cut_multicam", + {"type": 'TWO', "value": 'PRESS'}, + { + "properties": [ + ("camera", 2), + ], + } + ), + ( + "sequencer.cut_multicam", + {"type": 'THREE', "value": 'PRESS'}, + { + "properties": [ + ("camera", 3), + ], + } + ), + ( + "sequencer.cut_multicam", + {"type": 'FOUR', "value": 'PRESS'}, + { + "properties": [ + ("camera", 4), + ], + } + ), + ( + "sequencer.cut_multicam", + {"type": 'FIVE', "value": 'PRESS'}, + { + "properties": [ + ("camera", 5), + ], + } + ), + ( + "sequencer.cut_multicam", + {"type": 'SIX', "value": 'PRESS'}, + { + "properties": [ + ("camera", 6), + ], + } + ), + ( + "sequencer.cut_multicam", + {"type": 'SEVEN', "value": 'PRESS'}, + { + "properties": [ + ("camera", 7), + ], + } + ), + ( + "sequencer.cut_multicam", + {"type": 'EIGHT', "value": 'PRESS'}, + { + "properties": [ + ("camera", 8), + ], + } + ), + ( + "sequencer.cut_multicam", + {"type": 'NINE', "value": 'PRESS'}, + { + "properties": [ + ("camera", 9), + ], + } + ), + ( + "sequencer.cut_multicam", + {"type": 'ZERO', "value": 'PRESS'}, + { + "properties": [ + ("camera", 10), + ], + } + ), + ( + "sequencer.select", + {"type": 'SELECTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("extend", False), + ("linked_handle", False), + ("left_right", 'NONE'), + ("linked_time", False), + ], + } + ), + ( + "sequencer.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", True), + ("linked_handle", False), + ("left_right", 'NONE'), + ("linked_time", False), + ], + } + ), + ( + "sequencer.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("extend", False), + ("linked_handle", True), + ("left_right", 'NONE'), + ("linked_time", False), + ], + } + ), + ( + "sequencer.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("extend", True), + ("linked_handle", True), + ("left_right", 'NONE'), + ("linked_time", False), + ], + } + ), + ( + "sequencer.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("extend", False), + ("linked_handle", False), + ("left_right", 'MOUSE'), + ("linked_time", True), + ], + } + ), + ( + "sequencer.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("extend", True), + ("linked_handle", False), + ("left_right", 'NONE'), + ("linked_time", True), + ], + } + ), + ("sequencer.select_more", {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, None), + ("sequencer.select_less", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, None), + ( + "sequencer.select_linked_pick", + {"type": 'L', "value": 'PRESS'}, + { + "properties": [ + ("extend", False), + ], + } + ), + ( + "sequencer.select_linked_pick", + {"type": 'L', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ("sequencer.select_linked", {"type": 'L', "value": 'PRESS', "ctrl": True}, None), + ("sequencer.select_border", {"type": 'B', "value": 'PRESS'}, None), + ("sequencer.select_grouped", {"type": 'G', "value": 'PRESS', "shift": True}, None), + ( + "wm.call_menu", + {"type": 'A', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("name", 'SEQUENCER_MT_add'), + ], + } + ), + ( + "wm.call_menu", + {"type": 'C', "value": 'PRESS'}, + { + "properties": [ + ("name", 'SEQUENCER_MT_change'), + ], + } + ), + ("sequencer.slip", {"type": 'S', "value": 'PRESS'}, None), + ( + "wm.context_set_int", + {"type": 'O', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'scene.sequence_editor.overlay_frame'), + ("value", 0), + ], + } + ), + ("transform.seq_slide", {"type": 'G', "value": 'PRESS'}, None), + ("transform.seq_slide", {"type": 'EVT_TWEAK_S', "value": 'ANY'}, None), + ( + "transform.transform", + {"type": 'E', "value": 'PRESS'}, + { + "properties": [ + ("mode", 'TIME_EXTEND'), + ], + } + ), + ("marker.add", {"type": 'M', "value": 'PRESS'}, None), + ("marker.rename", {"type": 'M', "value": 'PRESS', "ctrl": True}, None), + ], + }, + ), + ( + "SequencerPreview", + {"space_type": 'SEQUENCE_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ("sequencer.view_all_preview", {"type": 'HOME', "value": 'PRESS'}, None), + ("sequencer.view_all_preview", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, None), + ("sequencer.view_ghost_border", {"type": 'O', "value": 'PRESS'}, None), + ( + "sequencer.view_zoom_ratio", + {"type": 'NUMPAD_1', "value": 'PRESS'}, + { + "properties": [ + ("ratio", 1.0), + ], + } + ), + ("sequencer.sample", {"type": 'ACTIONMOUSE', "value": 'PRESS'}, None), + ], + }, + ), + ( + "Console", + {"space_type": 'CONSOLE', "region_type": 'WINDOW'}, + { + "items": [ + ( + "console.move", + {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'PREVIOUS_WORD'), + ], + } + ), + ( + "console.move", + {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'NEXT_WORD'), + ], + } + ), + ( + "console.move", + {"type": 'HOME', "value": 'PRESS'}, + { + "properties": [ + ("type", 'LINE_BEGIN'), + ], + } + ), + ( + "console.move", + {"type": 'END', "value": 'PRESS'}, + { + "properties": [ + ("type", 'LINE_END'), + ], + } + ), + ( + "wm.context_cycle_int", + {"type": 'WHEELUPMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path", 'space_data.font_size'), + ("reverse", False), + ], + } + ), + ( + "wm.context_cycle_int", + {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path", 'space_data.font_size'), + ("reverse", True), + ], + } + ), + ( + "wm.context_cycle_int", + {"type": 'NUMPAD_PLUS', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path", 'space_data.font_size'), + ("reverse", False), + ], + } + ), + ( + "wm.context_cycle_int", + {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path", 'space_data.font_size'), + ("reverse", True), + ], + } + ), + ( + "console.move", + {"type": 'LEFT_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("type", 'PREVIOUS_CHARACTER'), + ], + } + ), + ( + "console.move", + {"type": 'RIGHT_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("type", 'NEXT_CHARACTER'), + ], + } + ), + ( + "console.history_cycle", + {"type": 'UP_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("reverse", True), + ], + } + ), + ( + "console.history_cycle", + {"type": 'DOWN_ARROW', "value": 'PRESS'}, + { + "properties": [ + ("reverse", False), + ], + } + ), + ( + "console.delete", + {"type": 'DEL', "value": 'PRESS'}, + { + "properties": [ + ("type", 'NEXT_CHARACTER'), + ], + } + ), + ( + "console.delete", + {"type": 'BACK_SPACE', "value": 'PRESS'}, + { + "properties": [ + ("type", 'PREVIOUS_CHARACTER'), + ], + } + ), + ( + "console.delete", + {"type": 'BACK_SPACE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("type", 'PREVIOUS_CHARACTER'), + ], + } + ), + ( + "console.delete", + {"type": 'DEL', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'NEXT_WORD'), + ], + } + ), + ( + "console.delete", + {"type": 'BACK_SPACE', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("type", 'PREVIOUS_WORD'), + ], + } + ), + ("console.clear_line", {"type": 'RET', "value": 'PRESS', "shift": True}, None), + ("console.clear_line", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "shift": True}, None), + ( + "console.execute", + {"type": 'RET', "value": 'PRESS'}, + { + "properties": [ + ("interactive", True), + ], + } + ), + ( + "console.execute", + {"type": 'NUMPAD_ENTER', "value": 'PRESS'}, + { + "properties": [ + ("interactive", True), + ], + } + ), + ("console.autocomplete", {"type": 'SPACE', "value": 'PRESS', "ctrl": True}, None), + ("console.copy_as_script", {"type": 'C', "value": 'PRESS', "shift": True, "ctrl": True}, None), + ("console.copy", {"type": 'C', "value": 'PRESS', "ctrl": True}, None), + ("console.paste", {"type": 'V', "value": 'PRESS', "ctrl": True}, None), + ("console.select_set", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), + ("console.select_word", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'}, None), + ( + "console.insert", + {"type": 'TAB', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("text", '\t'), + ], + } + ), + ("console.indent", {"type": 'TAB', "value": 'PRESS'}, None), + ("console.unindent", {"type": 'TAB', "value": 'PRESS', "shift": True}, None), + ("console.insert", {"type": 'TEXTINPUT', "value": 'ANY', "any": True}, None), + ], + }, + ), + ( + "Clip", + {"space_type": 'CLIP_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ("clip.open", {"type": 'O', "value": 'PRESS', "alt": True}, None), + ("clip.tools", {"type": 'T', "value": 'PRESS'}, None), + ("clip.properties", {"type": 'N', "value": 'PRESS'}, None), + ( + "clip.track_markers", + {"type": 'LEFT_ARROW', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("backwards", True), + ("sequence", False), + ], + } + ), + ( + "clip.track_markers", + {"type": 'RIGHT_ARROW', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("backwards", False), + ("sequence", False), + ], + } + ), + ( + "clip.track_markers", + {"type": 'T', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("backwards", False), + ("sequence", True), + ], + } + ), + ( + "clip.track_markers", + {"type": 'T', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("backwards", True), + ("sequence", True), + ], + } + ), + ( + "wm.context_toggle_enum", + {"type": 'TAB', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.mode'), + ("value_1", 'TRACKING'), + ("value_2", 'MASK'), + ], + } + ), + ("clip.solve_camera", {"type": 'S', "value": 'PRESS', "shift": True}, None), + ( + "clip.set_solver_keyframe", + {"type": 'Q', "value": 'PRESS'}, + { + "properties": [ + ("keyframe", 'KEYFRAME_A'), + ], + } + ), + ( + "clip.set_solver_keyframe", + {"type": 'E', "value": 'PRESS'}, + { + "properties": [ + ("keyframe", 'KEYFRAME_B'), + ], + } + ), + ("clip.prefetch", {"type": 'P', "value": 'PRESS'}, None), + ], + }, + ), + ( + "Clip Editor", + {"space_type": 'CLIP_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ("clip.view_pan", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None), + ("clip.view_pan", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "shift": True}, None), + ("clip.view_pan", {"type": 'TRACKPADPAN', "value": 'ANY'}, None), + ("clip.view_zoom", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "ctrl": True}, None), + ("clip.view_zoom", {"type": 'TRACKPADZOOM', "value": 'ANY'}, None), + ("clip.view_zoom", {"type": 'TRACKPADPAN', "value": 'ANY', "ctrl": True}, None), + ("clip.view_zoom_in", {"type": 'WHEELINMOUSE', "value": 'PRESS'}, None), + ("clip.view_zoom_out", {"type": 'WHEELOUTMOUSE', "value": 'PRESS'}, None), + ("clip.view_zoom_in", {"type": 'NUMPAD_PLUS', "value": 'PRESS'}, None), + ("clip.view_zoom_out", {"type": 'NUMPAD_MINUS', "value": 'PRESS'}, None), + ( + "clip.view_zoom_ratio", + {"type": 'NUMPAD_8', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("ratio", 8.0), + ], + } + ), + ( + "clip.view_zoom_ratio", + {"type": 'NUMPAD_4', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("ratio", 4.0), + ], + } + ), + ( + "clip.view_zoom_ratio", + {"type": 'NUMPAD_2', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("ratio", 2.0), + ], + } + ), + ( + "clip.view_zoom_ratio", + {"type": 'NUMPAD_8', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("ratio", 8.0), + ], + } + ), + ( + "clip.view_zoom_ratio", + {"type": 'NUMPAD_4', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("ratio", 4.0), + ], + } + ), + ( + "clip.view_zoom_ratio", + {"type": 'NUMPAD_2', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("ratio", 2.0), + ], + } + ), + ( + "clip.view_zoom_ratio", + {"type": 'NUMPAD_1', "value": 'PRESS'}, + { + "properties": [ + ("ratio", 1.0), + ], + } + ), + ( + "clip.view_zoom_ratio", + {"type": 'NUMPAD_2', "value": 'PRESS'}, + { + "properties": [ + ("ratio", 0.5), + ], + } + ), + ( + "clip.view_zoom_ratio", + {"type": 'NUMPAD_4', "value": 'PRESS'}, + { + "properties": [ + ("ratio", 0.25), + ], + } + ), + ( + "clip.view_zoom_ratio", + {"type": 'NUMPAD_8', "value": 'PRESS'}, + { + "properties": [ + ("ratio", 0.125), + ], + } + ), + ("clip.view_all", {"type": 'HOME', "value": 'PRESS'}, None), + ( + "clip.view_all", + {"type": 'F', "value": 'PRESS'}, + { + "properties": [ + ("fit_view", True), + ], + } + ), + ("clip.view_selected", {"type": 'NUMPAD_PERIOD', "value": 'PRESS'}, None), + ("clip.view_all", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, None), + ("clip.view_ndof", {"type": 'NDOF_MOTION', "value": 'ANY'}, None), + ( + "clip.frame_jump", + {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("position", 'PATHSTART'), + ], + } + ), + ( + "clip.frame_jump", + {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "ctrl": True}, + { + "properties": [ + ("position", 'PATHEND'), + ], + } + ), + ( + "clip.frame_jump", + {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("position", 'FAILEDPREV'), + ], + } + ), + ( + "clip.frame_jump", + {"type": 'RIGHT_ARROW', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("position", 'PATHSTART'), + ], + } + ), + ("clip.change_frame", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), + ( + "clip.select", + {"type": 'SELECTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("extend", False), + ], + } + ), + ( + "clip.select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ( + "clip.select_all", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "clip.select_all", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ("clip.select_border", {"type": 'B', "value": 'PRESS'}, None), + ("clip.select_circle", {"type": 'C', "value": 'PRESS'}, None), + ( + "wm.call_menu", + {"type": 'G', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("name", 'CLIP_MT_select_grouped'), + ], + } + ), + ( + "clip.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "ctrl": True, "alt": True}, + { + "properties": [ + ("deselect", False), + ], + } + ), + ( + "clip.select_lasso", + {"type": 'EVT_TWEAK_A', "value": 'ANY', "shift": True, "ctrl": True, "alt": True}, + { + "properties": [ + ("deselect", True), + ], + } + ), + ("clip.add_marker_slide", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True}, None), + ("clip.delete_marker", {"type": 'DEL', "value": 'PRESS', "shift": True}, None), + ("clip.delete_marker", {"type": 'X', "value": 'PRESS', "shift": True}, None), + ("clip.slide_marker", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), + ( + "clip.disable_markers", + {"type": 'D', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ("clip.delete_track", {"type": 'DEL', "value": 'PRESS'}, None), + ("clip.delete_track", {"type": 'X', "value": 'PRESS'}, None), + ( + "clip.lock_tracks", + {"type": 'L', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'LOCK'), + ], + } + ), + ( + "clip.lock_tracks", + {"type": 'L', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("action", 'UNLOCK'), + ], + } + ), + ( + "clip.hide_tracks", + {"type": 'H', "value": 'PRESS'}, + { + "properties": [ + ("unselected", False), + ], + } + ), + ( + "clip.hide_tracks", + {"type": 'H', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("unselected", True), + ], + } + ), + ("clip.hide_tracks_clear", {"type": 'H', "value": 'PRESS', "alt": True}, None), + ("clip.slide_plane_marker", {"type": 'ACTIONMOUSE', "value": 'PRESS'}, None), + ("clip.keyframe_insert", {"type": 'I', "value": 'PRESS'}, None), + ("clip.keyframe_delete", {"type": 'I', "value": 'PRESS', "alt": True}, None), + ("clip.join_tracks", {"type": 'J', "value": 'PRESS', "ctrl": True}, None), + ( + "wm.call_menu", + {"type": 'W', "value": 'PRESS'}, + { + "properties": [ + ("name", 'CLIP_MT_tracking_specials'), + ], + } + ), + ( + "wm.context_toggle", + {"type": 'L', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.lock_selection'), + ], + } + ), + ( + "wm.context_toggle", + {"type": 'D', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("data_path", 'space_data.show_disabled'), + ], + } + ), + ( + "wm.context_toggle", + {"type": 'S', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("data_path", 'space_data.show_marker_search'), + ], + } + ), + ( + "wm.context_toggle", + {"type": 'M', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.use_mute_footage'), + ], + } + ), + ("transform.translate", {"type": 'G', "value": 'PRESS'}, None), + ("transform.translate", {"type": 'EVT_TWEAK_S', "value": 'ANY'}, None), + ("transform.resize", {"type": 'S', "value": 'PRESS'}, None), + ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None), + ( + "clip.clear_track_path", + {"type": 'T', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("action", 'REMAINED'), + ("clear_active", False), + ], + } + ), + ( + "clip.clear_track_path", + {"type": 'T', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("action", 'UPTO'), + ("clear_active", False), + ], + } + ), + ( + "clip.clear_track_path", + {"type": 'T', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("action", 'ALL'), + ("clear_active", False), + ], + } + ), + ("clip.cursor_set", {"type": 'ACTIONMOUSE', "value": 'PRESS'}, None), + ( + "wm.context_set_enum", + {"type": 'COMMA', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.pivot_point'), + ("value", 'BOUNDING_BOX_CENTER'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'COMMA', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path", 'space_data.pivot_point'), + ("value", 'MEDIAN_POINT'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'PERIOD', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.pivot_point'), + ("value", 'CURSOR'), + ], + } + ), + ( + "wm.context_set_enum", + {"type": 'PERIOD', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("data_path", 'space_data.pivot_point'), + ("value", 'INDIVIDUAL_ORIGINS'), + ], + } + ), + ("clip.copy_tracks", {"type": 'C', "value": 'PRESS', "ctrl": True}, None), + ("clip.paste_tracks", {"type": 'V', "value": 'PRESS', "ctrl": True}, None), + ], + }, + ), + ( + "Clip Graph Editor", + {"space_type": 'CLIP_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ("clip.change_frame", {"type": 'ACTIONMOUSE', "value": 'PRESS'}, None), + ( + "clip.graph_select", + {"type": 'SELECTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("extend", False), + ], + } + ), + ( + "clip.graph_select", + {"type": 'SELECTMOUSE', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("extend", True), + ], + } + ), + ( + "clip.graph_select_all_markers", + {"type": 'A', "value": 'PRESS'}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ( + "clip.graph_select_all_markers", + {"type": 'I', "value": 'PRESS', "ctrl": True}, + { + "properties": [ + ("action", 'INVERT'), + ], + } + ), + ("clip.graph_select_border", {"type": 'B', "value": 'PRESS'}, None), + ("clip.graph_delete_curve", {"type": 'DEL', "value": 'PRESS'}, None), + ("clip.graph_delete_curve", {"type": 'X', "value": 'PRESS'}, None), + ("clip.graph_delete_knot", {"type": 'DEL', "value": 'PRESS', "shift": True}, None), + ("clip.graph_delete_knot", {"type": 'X', "value": 'PRESS', "shift": True}, None), + ("clip.graph_view_all", {"type": 'HOME', "value": 'PRESS'}, None), + ("clip.graph_view_all", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, None), + ("clip.graph_center_current_frame", {"type": 'NUMPAD_PERIOD', "value": 'PRESS'}, None), + ( + "wm.context_toggle", + {"type": 'L', "value": 'PRESS'}, + { + "properties": [ + ("data_path", 'space_data.lock_time_cursor'), + ], + } + ), + ( + "clip.clear_track_path", + {"type": 'T', "value": 'PRESS', "alt": True}, + { + "properties": [ + ("action", 'REMAINED'), + ("clear_active", True), + ], + } + ), + ( + "clip.clear_track_path", + {"type": 'T', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("action", 'UPTO'), + ("clear_active", True), + ], + } + ), + ( + "clip.clear_track_path", + {"type": 'T', "value": 'PRESS', "shift": True, "alt": True}, + { + "properties": [ + ("action", 'ALL'), + ("clear_active", True), + ], + } + ), + ( + "clip.graph_disable_markers", + {"type": 'D', "value": 'PRESS', "shift": True}, + { + "properties": [ + ("action", 'TOGGLE'), + ], + } + ), + ("transform.translate", {"type": 'G', "value": 'PRESS'}, None), + ("transform.translate", {"type": 'EVT_TWEAK_S', "value": 'ANY'}, None), + ("transform.resize", {"type": 'S', "value": 'PRESS'}, None), + ("transform.rotate", {"type": 'R', "value": 'PRESS'}, None), + ], + }, + ), + ( + "Clip Dopesheet Editor", + {"space_type": 'CLIP_EDITOR', "region_type": 'WINDOW'}, + { + "items": [ + ( + "clip.dopesheet_select_channel", + {"type": 'LEFTMOUSE', "value": 'PRESS'}, + { + "properties": [ + ("extend", True), + ], + } + ), + ("clip.dopesheet_view_all", {"type": 'HOME', "value": 'PRESS'}, None), + ("clip.dopesheet_view_all", {"type": 'NDOF_BUTTON_FIT', "value": 'PRESS'}, None), + ], + }, + ), + ( + "3D View Tool: OBJECT, Move", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + { + "items": [ + ( + "transform.translate", + {"type": 'EVT_TWEAK_A', "value": 'ANY'}, + { + "properties": [ + ("release_confirm", True), + ], + } + ), + ], + }, + ), + ( + "3D View Tool: OBJECT, Rotate", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + { + "items": [ + ( + "transform.rotate", + {"type": 'EVT_TWEAK_A', "value": 'ANY'}, + { + "properties": [ + ("release_confirm", True), + ], + } + ), + ], + }, + ), + ( + "3D View Tool: OBJECT, Scale", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + { + "items": [ + ( + "transform.resize", + {"type": 'EVT_TWEAK_A', "value": 'ANY'}, + { + "properties": [ + ("release_confirm", True), + ], + } + ), + ], + }, + ), + ( + "3D View Tool: OBJECT, Ruler/Protractor", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + { + "items": [ + ("view3d.ruler_add", {"type": 'EVT_TWEAK_A', "value": 'ANY'}, None), + ], + }, + ), + ( + "3D View Tool: PARTICLE, Cursor Click", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + { + "items": [ + ("view3d.cursor3d", {"type": 'ACTIONMOUSE', "value": 'CLICK'}, None), + ], + }, + ), + ( + "Spot Lamp Widgets", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + { + "items": [ + ("manipulatorgroup.manipulator_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ], + }, + ), + ( + "Area Lamp Widgets", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + { + "items": [ + ("manipulatorgroup.manipulator_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ("manipulatorgroup.manipulator_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ], + }, + ), + ( + "Target Lamp Widgets", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + { + "items": [ + ("manipulatorgroup.manipulator_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ], + }, + ), +] + + +if __name__ == "__main__": + import os + from bpy_extras.keyconfig_utils import keyconfig_import_from_data + keyconfig_import_from_data(os.path.splitext(os.path.basename(__file__))[0], keyconfig_data) 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_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index f31ae721fd3..a01298f5696 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -1636,7 +1636,7 @@ class WM_OT_keyconfig_export(Operator): wm = context.window_manager - keyconfig_utils.keyconfig_export( + keyconfig_utils.keyconfig_export_as_data( wm, wm.keyconfigs.active, self.filepath, @@ -2398,6 +2398,10 @@ class WM_OT_toolbar(Operator): def draw_menu(popover, context): layout = popover.layout + + layout.operator_context = 'INVOKE_DEFAULT' + layout.operator("wm.search_menu", text="Search Commands...", icon='VIEWZOOM') + cls.draw_cls(layout, context, detect_layout=False, scale_y=1.0) wm.popover(draw_menu, ui_units_x=8, keymap=keymap) 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..1b89cfd470d 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: @@ -283,7 +283,7 @@ class DOPESHEET_HT_editor_buttons(Header): row = layout.row(align=True) row.operator("action.copy", text="", icon='COPYDOWN') row.operator("action.paste", text="", icon='PASTEDOWN') - if st.mode not in ('GPENCIL', 'MASK'): + if st.mode not in {'GPENCIL', 'MASK'}: row.operator("action.paste", text="", icon='PASTEFLIPDOWN').flipped = True 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..965de6b1ce1 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -260,28 +260,31 @@ class OUTLINER_PT_filter(Panel): col = layout.column(align=True) - col.prop(space, "use_filter_collection", text="Collections", icon="GROUP") - col.prop(space, "use_filter_object", text="Objects", icon="OBJECT_DATAMODE") + col.prop(space, "use_filter_collection", text="Collections", icon='GROUP') + col.prop(space, "use_filter_object", text="Objects", icon='OBJECT_DATAMODE') sub = col.column(align=True) sub.active = space.use_filter_object if bpy.data.meshes: - sub.prop(space, "use_filter_object_mesh", text="Meshes", icon="MESH_DATA") + 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") + sub.prop(space, "use_filter_object_armature", text="Armatures", icon='ARMATURE_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") - - sub.prop(space, "use_filter_object_empty", text="Empties", icon="EMPTY_DATA") - - if bpy.data.curves or \ - bpy.data.metaballs or \ - bpy.data.lightprobes or \ - bpy.data.lattices or \ - bpy.data.fonts or bpy.data.speakers: + sub.prop(space, "use_filter_object_camera", text="Cameras", icon='CAMERA_DATA') + + sub.prop(space, "use_filter_object_empty", text="Empties", icon='EMPTY_DATA') + + if ( + bpy.data.curves or + bpy.data.metaballs or + bpy.data.lightprobes or + bpy.data.lattices or + bpy.data.fonts or + bpy.data.speakers + ): sub.prop(space, "use_filter_object_others", text="Others") subsub = sub.column(align=False) diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py index 2d7afb7a56a..7fe8360b4da 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_common.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py @@ -624,7 +624,10 @@ def keymap_from_context(context, space_type): """ Keymap for popup toolbar, currently generated each time. """ + + use_search = False # allows double tap use_simple_keymap = False + km_name = "Toolbar Popup" wm = context.window_manager keyconf = wm.keyconfigs.active @@ -634,6 +637,10 @@ def keymap_from_context(context, space_type): for kmi in keymap.keymap_items: keymap.keymap_items.remove(kmi) + if use_search: + kmi_search = wm.keyconfigs.find_item_from_operator(idname="wm.toolbar")[1] + kmi_search_type = None if not kmi_search else kmi_search.type + items = [] cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type) for i, item in enumerate( @@ -679,6 +686,16 @@ def keymap_from_context(context, space_type): ) kmi.properties.name = item.text + if use_search: + # Disallow overlap + if kmi_search_type == kmi_found_type: + kmi_search_type = None + + if use_search: + # Support double-tap for search. + if kmi_search_type: + keymap.keymap_items.new("wm.search_menu", type=kmi_search_type, value='PRESS') + wm.keyconfigs.update() return keymap 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 611deb1889b..c905dc51b0e 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -128,7 +128,7 @@ class VIEW3D_HT_header(Header): trans_icon = getattr(trans_orientation, "icon", "BLANK1") trans_name = getattr(trans_orientation, "name", "Orientation") else: - trans_icon = "VISIBLE_IPO_OFF" + trans_icon = 'VISIBLE_IPO_OFF' trans_name = getattr(current_orientation, "name", "Orientation") row = layout.row(align=True) @@ -1391,15 +1391,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): @@ -1459,7 +1459,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() @@ -1731,14 +1731,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 @@ -1749,28 +1749,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" @@ -3609,76 +3609,138 @@ class VIEW3D_PT_view3d_properties(Panel): bl_region_type = 'UI' bl_label = "View" - @classmethod - def poll(cls, context): + def draw(self, context): + layout = self.layout + view = context.space_data - return (view) + + layout.use_property_split = True + layout.use_property_decorate = False # No animation. + + flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=True) + col = flow.column() + + subcol = col.column() + subcol.active = bool(view.region_3d.view_perspective != 'CAMERA' or view.region_quadviews) + subcol.prop(view, "lens", text="Focal Length") + + subcol = col.column(align=True) + subcol.prop(view, "clip_start", text="Clip Start") + subcol.prop(view, "clip_end", text="End") + + subcol.separator() + + col = flow.column() + + subcol = col.column() + subcol.enabled = not view.lock_camera_and_layers + subcol.prop(view, "camera", text="Local Camera") + + subcol = col.column(align=True) + subcol.prop(view, "use_render_border") + subcol.active = view.region_3d.view_perspective != 'CAMERA' + + +class VIEW3D_PT_view3d_camera_lock(Panel): + bl_space_type = 'VIEW_3D' + bl_region_type = 'UI' + bl_label = "Camera Lock" + bl_parent_id = "VIEW3D_PT_view3d_properties" def draw(self, context): layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False # No animation. + view = context.space_data - col = layout.column() - col.active = bool(view.region_3d.view_perspective != 'CAMERA' or view.region_quadviews) - col.prop(view, "lens") - col.label(text="Lock to Object:") - col.prop(view, "lock_object", text="") + col = layout.column(align=True) + subcol = col.column() + subcol.active = bool(view.region_3d.view_perspective != 'CAMERA' or view.region_quadviews) + + subcol.prop(view, "lock_object") lock_object = view.lock_object if lock_object: if lock_object.type == 'ARMATURE': - col.prop_search(view, "lock_bone", lock_object.data, - "edit_bones" if lock_object.mode == 'EDIT' - else "bones", - text="") + subcol.prop_search( + view, "lock_bone", lock_object.data, + "edit_bones" if lock_object.mode == 'EDIT' + else "bones", + text="" + ) else: - col.prop(view, "lock_cursor", text="Lock to Cursor") + subcol.prop(view, "lock_cursor", text="Lock to 3D Cursor") - col = layout.column() col.prop(view, "lock_camera") - col = layout.column(align=True) - col.label(text="Clip:") - col.prop(view, "clip_start", text="Start") - col.prop(view, "clip_end", text="End") - - subcol = col.column(align=True) - subcol.enabled = not view.lock_camera_and_layers - subcol.label(text="Local Camera:") - subcol.prop(view, "camera", text="") - - col = layout.column(align=True) - col.prop(view, "use_render_border") - col.active = view.region_3d.view_perspective != 'CAMERA' - class VIEW3D_PT_view3d_cursor(Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'UI' bl_label = "3D Cursor" - @classmethod - def poll(cls, context): - view = context.space_data - return (view is not None) - def draw(self, context): layout = self.layout + layout.use_property_split = True view = context.space_data + layout.column().prop(view, "cursor_location", text="Location") +class VIEW3D_PT_object_type_visibility(Panel): + bl_space_type = 'VIEW_3D' + bl_region_type = 'UI' + bl_label = "View Object Types" + bl_options = {'DEFAULT_CLOSED'} + + def draw(self, context): + layout = self.layout + view = context.space_data + + col = layout.column() + + split = col.split() + + heading_pair = ("Visible", "Selectable") + attr_object_types = ( + "mesh", + "curve", + "surf", + "meta", + "font", + "armature", + "lattice", + "empty", + "camera", + "lamp", + "light_probe", + "speaker", + ) + + attr_vis = [f"show_object_viewport_{attr}" for attr in attr_object_types] + attr_sel = [f"show_object_select_{attr}" for attr in attr_object_types] + + sub = split.column() + sub.label("Visible") + for attr_v in attr_vis: + sub.prop(view, attr_v) + + sub = split.column() + sub.label("Selectable") + for attr_v, attr_s in zip(attr_vis, attr_sel): + row = sub.row(align=True) + row.active = getattr(view, attr_v) + row.prop(view, attr_s) + + class VIEW3D_PT_shading(Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'HEADER' bl_label = "Shading" bl_ui_units_x = 11 - @classmethod - def poll(cls, context): - return True - def draw(self, context): pass @@ -3689,10 +3751,6 @@ class VIEW3D_PT_shading_lighting(Panel): bl_label = "Lighting" bl_parent_id = 'VIEW3D_PT_shading' - @classmethod - def poll(cls, context): - return True - def draw(self, context): layout = self.layout @@ -3717,14 +3775,18 @@ class VIEW3D_PT_shading_lighting(Panel): sub.operator('wm.studiolight_userpref_show', emboss=False, text="", icon='PREFERENCES') elif shading.type == 'MATERIAL': - row = layout.row() - row.template_icon_view(shading, "studio_light", show_labels=True) - sub = row.column() - sub.operator('wm.studiolight_userpref_show', emboss=False, text="", icon='PREFERENCES') - if shading.selected_studio_light.orientation == 'WORLD': - layout.row().prop(shading, "studiolight_rotate_z") - layout.row().prop(shading, "studiolight_background_alpha") - layout.prop(shading, "use_scene_light") + col = layout.column(align=True) + col.prop(shading, "use_scene_lights") + col.prop(shading, "use_scene_world") + + if not shading.use_scene_world: + row = layout.row() + row.template_icon_view(shading, "studio_light", show_labels=True) + sub = row.column() + sub.operator('wm.studiolight_userpref_show', emboss=False, text="", icon='PREFERENCES') + if shading.selected_studio_light.orientation == 'WORLD': + layout.row().prop(shading, "studiolight_rotate_z") + layout.row().prop(shading, "studiolight_background_alpha") class VIEW3D_PT_shading_color(Panel): @@ -3737,7 +3799,7 @@ class VIEW3D_PT_shading_color(Panel): def poll(cls, context): view = context.space_data shading = view.shading - return shading.type in ['SOLID'] + return shading.type == 'SOLID' def draw(self, context): layout = self.layout @@ -3809,10 +3871,6 @@ class VIEW3D_PT_overlay(Panel): bl_label = "Overlays" bl_ui_units_x = 14 - @classmethod - def poll(cls, context): - return True - def draw(self, context): layout = self.layout @@ -3834,7 +3892,6 @@ class VIEW3D_PT_overlay(Panel): sub.prop(overlay, "show_all_objects_origin") sub = split.column() - sub.prop(overlay, "show_non_geometry") sub.prop(overlay, "show_relationship_lines") sub.prop(overlay, "show_motion_paths") #sub.prop(overlay, "show_onion_skins") @@ -4181,11 +4238,6 @@ class VIEW3D_PT_transform_orientations(Panel): bl_label = "Transform Orientations" bl_ui_units_x = 8 - @classmethod - def poll(cls, context): - view = context.space_data - return (view) - def draw(self, context): layout = self.layout layout.label("Transform Orientations") @@ -4242,7 +4294,7 @@ class VIEW3D_PT_view3d_stereo(Panel): scene = context.scene multiview = scene.render.use_multiview - return context.space_data and multiview + return multiview def draw(self, context): layout = self.layout @@ -4355,7 +4407,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, @@ -4444,7 +4496,9 @@ classes = ( VIEW3D_PT_grease_pencil, VIEW3D_PT_grease_pencil_palettecolor, VIEW3D_PT_view3d_properties, + VIEW3D_PT_view3d_camera_lock, VIEW3D_PT_view3d_cursor, + VIEW3D_PT_object_type_visibility, VIEW3D_PT_quad_view, VIEW3D_PT_view3d_stereo, VIEW3D_PT_shading, 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..e72c6c14bfb 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -152,7 +152,7 @@ typedef struct bNodeType { float width, minwidth, maxwidth; float height, minheight, maxheight; - short nclass, flag, compatibility; + short nclass, flag; /* templates for static sockets */ bNodeSocketTemplate *inputs, *outputs; @@ -251,10 +251,6 @@ typedef struct bNodeType { #define NODE_CLASS_SHADER 40 #define NODE_CLASS_LAYOUT 100 -/* nodetype->compatibility */ -#define NODE_OLD_SHADING (1 << 0) -#define NODE_NEW_SHADING (1 << 1) - /* node resize directions */ #define NODE_RESIZE_TOP 1 #define NODE_RESIZE_BOTTOM 2 @@ -600,7 +596,6 @@ void node_type_update(struct bNodeType *ntype, void node_type_exec(struct bNodeType *ntype, NodeInitExecFunction initexecfunc, NodeFreeExecFunction freeexecfunc, NodeExecFunction execfunc); void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpufunc); void node_type_internal_links(struct bNodeType *ntype, void (*update_internal_links)(struct bNodeTree *, struct bNode *)); -void node_type_compatibility(struct bNodeType *ntype, short compatibility); /** \} */ @@ -733,7 +728,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/BKE_studiolight.h b/source/blender/blenkernel/BKE_studiolight.h index f8a9498724e..fee01fa8abb 100644 --- a/source/blender/blenkernel/BKE_studiolight.h +++ b/source/blender/blenkernel/BKE_studiolight.h @@ -103,7 +103,7 @@ enum StudioLightFlag { #define STUDIOLIGHT_FLAG_ALL (STUDIOLIGHT_INTERNAL | STUDIOLIGHT_EXTERNAL_FILE) #define STUDIOLIGHT_FLAG_ORIENTATIONS (STUDIOLIGHT_ORIENTATION_CAMERA | STUDIOLIGHT_ORIENTATION_WORLD | STUDIOLIGHT_ORIENTATION_VIEWNORMAL) -#define STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE (STUDIOLIGHT_INTERNAL | STUDIOLIGHT_ORIENTATION_WORLD) +#define STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE (STUDIOLIGHT_ORIENTATION_WORLD) #define STUDIOLIGHT_ORIENTATIONS_SOLID (STUDIOLIGHT_INTERNAL | STUDIOLIGHT_ORIENTATION_CAMERA | STUDIOLIGHT_ORIENTATION_WORLD) typedef void StudioLightFreeFunction(struct StudioLight *, void *data); diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index 1d9cc9bb8d0..0c93f304218 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -473,7 +473,7 @@ static bool collection_object_add(Main *bmain, Collection *collection, Object *o { if (ob->dup_group) { /* Cyclic dependency check. */ - if (collection_find_child_recursive(collection, ob->dup_group)) { + if (collection_find_child_recursive(ob->dup_group, collection)) { return false; } } 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/node.c b/source/blender/blenkernel/intern/node.c index f7cd2bd52dc..7aa0ecdad87 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -3333,11 +3333,6 @@ void node_type_internal_links(bNodeType *ntype, void (*update_internal_links)(bN ntype->update_internal_links = update_internal_links; } -void node_type_compatibility(struct bNodeType *ntype, short compatibility) -{ - ntype->compatibility = compatibility; -} - /* callbacks for undefined types */ static bool node_undefined_poll(bNodeType *UNUSED(ntype), bNodeTree *UNUSED(nodetree)) diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 44c83a8d587..275e215e71a 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -648,7 +648,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..23e50f125ba 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); } } @@ -2186,7 +2186,7 @@ void DepsgraphRelationBuilder::build_nested_shapekey(ID *owner, Key *key) void DepsgraphRelationBuilder::build_copy_on_write_relations(IDDepsNode *id_node) { ID *id_orig = id_node->id_orig; - + const ID_Type id_type = GS(id_orig->name); TimeSourceKey time_source_key; OperationKey copy_on_write_key(id_orig, DEG_NODE_TYPE_COPY_ON_WRITE, @@ -2209,9 +2209,12 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations(IDDepsNode *id_node /* Component explicitly requests to not add relation. */ continue; } - int rel_flag = 0; - if (comp_node->type == DEG_NODE_TYPE_ANIMATION) { - rel_flag |= DEPSREL_FLAG_NO_FLUSH; + int rel_flag = DEPSREL_FLAG_NO_FLUSH; + if (id_type == ID_ME && comp_node->type == DEG_NODE_TYPE_GEOMETRY) { + rel_flag &= ~DEPSREL_FLAG_NO_FLUSH; + } + if (comp_node->type == DEG_NODE_TYPE_PARAMETERS) { + rel_flag &= ~DEPSREL_FLAG_NO_FLUSH; } /* All entry operations of each component should wait for a proper * copy of ID. diff --git a/source/blender/draw/engines/eevee/eevee_bloom.c b/source/blender/draw/engines/eevee/eevee_bloom.c index 8be9c637fbc..2ec6f841409 100644 --- a/source/blender/draw/engines/eevee/eevee_bloom.c +++ b/source/blender/draw/engines/eevee/eevee_bloom.c @@ -132,9 +132,9 @@ int EEVEE_bloom_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata) /* determine the iteration count */ const float minDim = (float)MIN2(blitsize[0], blitsize[1]); const float maxIter = (radius - 8.0f) + log(minDim) / log(2); - const int maxIterInt = effects->bloom_iteration_ct = (int)maxIter; + const int maxIterInt = effects->bloom_iteration_len = (int)maxIter; - CLAMP(effects->bloom_iteration_ct, 1, MAX_BLOOM_STEP); + CLAMP(effects->bloom_iteration_len, 1, MAX_BLOOM_STEP); effects->bloom_sample_scale = 0.5f + maxIter - (float)maxIterInt; effects->bloom_curve_threshold[0] = threshold - knee; @@ -146,7 +146,7 @@ int EEVEE_bloom_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata) /* Downsample buffers */ copy_v2_v2_int(texsize, blitsize); - for (int i = 0; i < effects->bloom_iteration_ct; ++i) { + for (int i = 0; i < effects->bloom_iteration_len; ++i) { texsize[0] /= 2; texsize[1] /= 2; texsize[0] = MAX2(texsize[0], 2); @@ -165,7 +165,7 @@ int EEVEE_bloom_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata) /* Upsample buffers */ copy_v2_v2_int(texsize, blitsize); - for (int i = 0; i < effects->bloom_iteration_ct - 1; ++i) { + for (int i = 0; i < effects->bloom_iteration_len - 1; ++i) { texsize[0] /= 2; texsize[1] /= 2; texsize[0] = MAX2(texsize[0], 2); @@ -291,7 +291,7 @@ void EEVEE_bloom_draw(EEVEE_Data *vedata) last = effects->bloom_downsample[0]; - for (int i = 1; i < effects->bloom_iteration_ct; ++i) { + for (int i = 1; i < effects->bloom_iteration_len; ++i) { copy_v2_v2(effects->unf_source_texel_size, effects->downsamp_texel_size[i - 1]); effects->unf_source_buffer = last; @@ -303,7 +303,7 @@ void EEVEE_bloom_draw(EEVEE_Data *vedata) } /* Upsample and accumulate */ - for (int i = effects->bloom_iteration_ct - 2; i >= 0; --i) { + for (int i = effects->bloom_iteration_len - 2; i >= 0; --i) { copy_v2_v2(effects->unf_source_texel_size, effects->downsamp_texel_size[i]); effects->unf_source_buffer = effects->bloom_downsample[i]; effects->unf_base_buffer = last; diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.c b/source/blender/draw/engines/eevee/eevee_depth_of_field.c index 60c6175f4fa..b9f7624552c 100644 --- a/source/blender/draw/engines/eevee/eevee_depth_of_field.c +++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.c @@ -208,8 +208,8 @@ void EEVEE_depth_of_field_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_ /* This create an empty batch of N triangles to be positioned * by the vertex shader 0.4ms against 6ms with instancing */ const float *viewport_size = DRW_viewport_size_get(); - const int sprite_ct = ((int)viewport_size[0] / 2) * ((int)viewport_size[1] / 2); /* brackets matters */ - grp = DRW_shgroup_empty_tri_batch_create(e_data.dof_scatter_sh, psl->dof_scatter, sprite_ct); + const int sprite_len = ((int)viewport_size[0] / 2) * ((int)viewport_size[1] / 2); /* brackets matters */ + grp = DRW_shgroup_empty_tri_batch_create(e_data.dof_scatter_sh, psl->dof_scatter, sprite_len); DRW_shgroup_uniform_texture_ref(grp, "nearBuffer", &effects->dof_down_near); DRW_shgroup_uniform_texture_ref(grp, "farBuffer", &effects->dof_down_far); diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c index 6d68e609f03..adbe165354a 100644 --- a/source/blender/draw/engines/eevee/eevee_engine.c +++ b/source/blender/draw/engines/eevee/eevee_engine.c @@ -191,10 +191,10 @@ static void eevee_draw_background(void *vedata) /* Number of iteration: needed for all temporal effect (SSR, volumetrics) * when using opengl render. */ - int loop_ct = (DRW_state_is_image_render() && + int loop_len = (DRW_state_is_image_render() && (stl->effects->enabled_effects & (EFFECT_VOLUMETRIC | EFFECT_SSR)) != 0) ? 4 : 1; - while (loop_ct--) { + while (loop_len--) { float clear_col[4] = {0.0f, 0.0f, 0.0f, 0.0f}; float clear_depth = 1.0f; uint clear_stencil = 0xFF; diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c index 54bf59234b3..1cb9a957211 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -364,8 +364,8 @@ void EEVEE_lightbake_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, DRWShadingGroup *grp = DRW_shgroup_create(e_data.probe_filter_glossy_sh, psl->probe_glossy_compute); DRW_shgroup_uniform_float(grp, "intensityFac", &pinfo->intensity_fac, 1); - DRW_shgroup_uniform_float(grp, "sampleCount", &pinfo->samples_ct, 1); - DRW_shgroup_uniform_float(grp, "invSampleCount", &pinfo->invsamples_ct, 1); + DRW_shgroup_uniform_float(grp, "sampleCount", &pinfo->samples_len, 1); + DRW_shgroup_uniform_float(grp, "invSampleCount", &pinfo->samples_len_inv, 1); DRW_shgroup_uniform_float(grp, "roughnessSquared", &pinfo->roughness, 1); DRW_shgroup_uniform_float(grp, "lodFactor", &pinfo->lodfactor, 1); DRW_shgroup_uniform_float(grp, "lodMax", &pinfo->lod_rt_max, 1); @@ -385,8 +385,8 @@ void EEVEE_lightbake_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, #ifdef IRRADIANCE_SH_L2 DRW_shgroup_uniform_int(grp, "probeSize", &pinfo->shres, 1); #else - DRW_shgroup_uniform_float(grp, "sampleCount", &pinfo->samples_ct, 1); - DRW_shgroup_uniform_float(grp, "invSampleCount", &pinfo->invsamples_ct, 1); + DRW_shgroup_uniform_float(grp, "sampleCount", &pinfo->samples_len, 1); + DRW_shgroup_uniform_float(grp, "invSampleCount", &pinfo->samples_len_inv, 1); DRW_shgroup_uniform_float(grp, "lodFactor", &pinfo->lodfactor, 1); DRW_shgroup_uniform_float(grp, "lodMax", &pinfo->lod_rt_max, 1); DRW_shgroup_uniform_texture(grp, "texHammersley", e_data.hammersley); @@ -405,8 +405,8 @@ void EEVEE_lightbake_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, DRW_shgroup_uniform_int(grp, "outputSize", &pinfo->shres, 1); DRW_shgroup_uniform_float(grp, "visibilityRange", &pinfo->visibility_range, 1); DRW_shgroup_uniform_float(grp, "visibilityBlur", &pinfo->visibility_blur, 1); - DRW_shgroup_uniform_float(grp, "sampleCount", &pinfo->samples_ct, 1); - DRW_shgroup_uniform_float(grp, "invSampleCount", &pinfo->invsamples_ct, 1); + DRW_shgroup_uniform_float(grp, "sampleCount", &pinfo->samples_len, 1); + DRW_shgroup_uniform_float(grp, "invSampleCount", &pinfo->samples_len_inv, 1); DRW_shgroup_uniform_float(grp, "storedTexelSize", &pinfo->texel_size, 1); DRW_shgroup_uniform_float(grp, "nearClip", &pinfo->near_clip, 1); DRW_shgroup_uniform_float(grp, "farClip", &pinfo->far_clip, 1); @@ -1111,18 +1111,18 @@ void EEVEE_lightbake_filter_glossy( #if 1 /* Variable Sample count (fast) */ switch (i) { - case 0: pinfo->samples_ct = 1.0f; break; - case 1: pinfo->samples_ct = 16.0f; break; - case 2: pinfo->samples_ct = 32.0f; break; - case 3: pinfo->samples_ct = 64.0f; break; - default: pinfo->samples_ct = 128.0f; break; + case 0: pinfo->samples_len = 1.0f; break; + case 1: pinfo->samples_len = 16.0f; break; + case 2: pinfo->samples_len = 32.0f; break; + case 3: pinfo->samples_len = 64.0f; break; + default: pinfo->samples_len = 128.0f; break; } #else /* Constant Sample count (slow) */ - pinfo->samples_ct = 1024.0f; + pinfo->samples_len = 1024.0f; #endif - pinfo->invsamples_ct = 1.0f / pinfo->samples_ct; - pinfo->lodfactor = bias + 0.5f * log((float)(target_size * target_size) * pinfo->invsamples_ct) / log(2); + pinfo->samples_len_inv = 1.0f / pinfo->samples_len; + pinfo->lodfactor = bias + 0.5f * log((float)(target_size * target_size) * pinfo->samples_len_inv) / log(2); GPU_framebuffer_ensure_config(&fb, { GPU_ATTACHMENT_NONE, @@ -1157,10 +1157,10 @@ void EEVEE_lightbake_filter_diffuse( int size[2] = {3, 3}; #elif defined(IRRADIANCE_CUBEMAP) int size[2] = {8, 8}; - pinfo->samples_ct = 1024.0f; + pinfo->samples_len = 1024.0f; #elif defined(IRRADIANCE_HL2) int size[2] = {3, 2}; - pinfo->samples_ct = 1024.0f; + pinfo->samples_len = 1024.0f; #endif int cell_per_row = GPU_texture_width(light_cache->grid_tx.tex) / size[0]; @@ -1170,8 +1170,8 @@ void EEVEE_lightbake_filter_diffuse( #ifndef IRRADIANCE_SH_L2 /* Tweaking parameters to balance perf. vs precision */ const float bias = 0.0f; - pinfo->invsamples_ct = 1.0f / pinfo->samples_ct; - pinfo->lodfactor = bias + 0.5f * log((float)(target_size * target_size) * pinfo->invsamples_ct) / log(2); + pinfo->samples_len_inv = 1.0f / pinfo->samples_len; + pinfo->lodfactor = bias + 0.5f * log((float)(target_size * target_size) * pinfo->samples_len_inv) / log(2); pinfo->lod_rt_max = floorf(log2f(target_size)) - 2.0f; #else pinfo->shres = 32; /* Less texture fetches & reduce branches */ @@ -1207,8 +1207,8 @@ void EEVEE_lightbake_filter_visibility( EEVEE_LightProbesInfo *pinfo = sldata->probes; LightCache *light_cache = vedata->stl->g_data->light_cache; - pinfo->samples_ct = 512.0f; /* TODO refine */ - pinfo->invsamples_ct = 1.0f / pinfo->samples_ct; + pinfo->samples_len = 512.0f; /* TODO refine */ + pinfo->samples_len_inv = 1.0f / pinfo->samples_len; pinfo->shres = vis_size; pinfo->visibility_range = vis_range; pinfo->visibility_blur = vis_blur; diff --git a/source/blender/draw/engines/eevee/eevee_lights.c b/source/blender/draw/engines/eevee/eevee_lights.c index 1e11f224231..0f0d9d281c9 100644 --- a/source/blender/draw/engines/eevee/eevee_lights.c +++ b/source/blender/draw/engines/eevee/eevee_lights.c @@ -235,9 +235,9 @@ static GPUShader *eevee_lights_get_store_sh(int shadow_method, bool high_blur, b return *shader; } -static DRWPass *eevee_lights_cube_store_pass_get(EEVEE_PassList *psl, EEVEE_ViewLayerData *sldata, int shadow_method, int shadow_samples_ct) +static DRWPass *eevee_lights_cube_store_pass_get(EEVEE_PassList *psl, EEVEE_ViewLayerData *sldata, int shadow_method, int shadow_samples_len) { - bool high_blur = shadow_samples_ct > 16; + bool high_blur = shadow_samples_len > 16; DRWPass **pass = (high_blur) ? &psl->shadow_cube_store_pass : &psl->shadow_cube_store_high_pass; if (*pass == NULL) { EEVEE_LampsInfo *linfo = sldata->lamps; @@ -252,9 +252,9 @@ static DRWPass *eevee_lights_cube_store_pass_get(EEVEE_PassList *psl, EEVEE_View return *pass; } -static DRWPass *eevee_lights_cascade_store_pass_get(EEVEE_PassList *psl, EEVEE_ViewLayerData *sldata, int shadow_method, int shadow_samples_ct) +static DRWPass *eevee_lights_cascade_store_pass_get(EEVEE_PassList *psl, EEVEE_ViewLayerData *sldata, int shadow_method, int shadow_samples_len) { - bool high_blur = shadow_samples_ct > 16; + bool high_blur = shadow_samples_len > 16; DRWPass **pass = (high_blur) ? &psl->shadow_cascade_store_pass : &psl->shadow_cascade_store_high_pass; if (*pass == NULL) { EEVEE_LampsInfo *linfo = sldata->lamps; @@ -280,8 +280,8 @@ void EEVEE_lights_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) linfo->num_light = 0; linfo->num_cube_layer = 0; linfo->num_cascade_layer = 0; - linfo->gpu_cube_ct = linfo->gpu_cascade_ct = linfo->gpu_shadow_ct = 0; - linfo->cpu_cube_ct = linfo->cpu_cascade_ct = 0; + linfo->gpu_cube_len = linfo->gpu_cascade_len = linfo->gpu_shadow_len = 0; + linfo->cpu_cube_len = linfo->cpu_cascade_len = 0; memset(linfo->light_ref, 0, sizeof(linfo->light_ref)); memset(linfo->shadow_cube_ref, 0, sizeof(linfo->shadow_cube_ref)); memset(linfo->shadow_cascade_ref, 0, sizeof(linfo->shadow_cascade_ref)); @@ -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; @@ -361,56 +361,56 @@ void EEVEE_lights_cache_add(EEVEE_ViewLayerData *sldata, Object *ob) int sh_nbr = 1; /* TODO : MSM */ int cascade_nbr = la->cascade_count; - if ((linfo->gpu_cascade_ct + sh_nbr) <= MAX_SHADOW_CASCADE) { + if ((linfo->gpu_cascade_len + sh_nbr) <= MAX_SHADOW_CASCADE) { /* Save Light object. */ - linfo->shadow_cascade_ref[linfo->cpu_cascade_ct] = ob; + linfo->shadow_cascade_ref[linfo->cpu_cascade_len] = ob; /* Store indices. */ EEVEE_ShadowCascadeData *data = &led->data.scad; - data->shadow_id = linfo->gpu_shadow_ct; - data->cascade_id = linfo->gpu_cascade_ct; + data->shadow_id = linfo->gpu_shadow_len; + data->cascade_id = linfo->gpu_cascade_len; data->layer_id = linfo->num_cascade_layer; /* Increment indices. */ - linfo->gpu_shadow_ct += 1; - linfo->gpu_cascade_ct += sh_nbr; + linfo->gpu_shadow_len += 1; + linfo->gpu_cascade_len += sh_nbr; linfo->num_cascade_layer += sh_nbr * cascade_nbr; - linfo->cpu_cascade_ct += 1; + linfo->cpu_cascade_len += 1; } } else if (la->type == LA_SPOT || la->type == LA_LOCAL || la->type == LA_AREA) { int sh_nbr = 1; /* TODO : MSM */ - if ((linfo->gpu_cube_ct + sh_nbr) <= MAX_SHADOW_CUBE) { + if ((linfo->gpu_cube_len + sh_nbr) <= MAX_SHADOW_CUBE) { /* Save Light object. */ - linfo->shadow_cube_ref[linfo->cpu_cube_ct] = ob; + linfo->shadow_cube_ref[linfo->cpu_cube_len] = ob; /* For light update tracking. */ if ((prev_cube_sh_id >= 0) && (prev_cube_sh_id < linfo->shcaster_backbuffer->count)) { - linfo->new_shadow_id[prev_cube_sh_id] = linfo->cpu_cube_ct; + linfo->new_shadow_id[prev_cube_sh_id] = linfo->cpu_cube_len; } - led->prev_cube_shadow_id = linfo->cpu_cube_ct; + led->prev_cube_shadow_id = linfo->cpu_cube_len; /* Saving lamp bounds for later. */ - BLI_assert(linfo->cpu_cube_ct >= 0 && linfo->cpu_cube_ct < MAX_LIGHT); - copy_v3_v3(linfo->shadow_bounds[linfo->cpu_cube_ct].center, ob->obmat[3]); - linfo->shadow_bounds[linfo->cpu_cube_ct].radius = la->clipend; + BLI_assert(linfo->cpu_cube_len >= 0 && linfo->cpu_cube_len < MAX_LIGHT); + copy_v3_v3(linfo->shadow_bounds[linfo->cpu_cube_len].center, ob->obmat[3]); + linfo->shadow_bounds[linfo->cpu_cube_len].radius = la->clipend; EEVEE_ShadowCubeData *data = &led->data.scd; /* Store indices. */ - data->shadow_id = linfo->gpu_shadow_ct; - data->cube_id = linfo->gpu_cube_ct; + data->shadow_id = linfo->gpu_shadow_len; + data->cube_id = linfo->gpu_cube_len; data->layer_id = linfo->num_cube_layer; /* Increment indices. */ - linfo->gpu_shadow_ct += 1; - linfo->gpu_cube_ct += sh_nbr; + linfo->gpu_shadow_len += 1; + linfo->gpu_cube_len += sh_nbr; linfo->num_cube_layer += sh_nbr; - linfo->cpu_cube_ct += 1; + linfo->cpu_cube_len += 1; } } } @@ -993,7 +993,7 @@ void EEVEE_lights_update(EEVEE_ViewLayerData *sldata) for (i = 0; i < frontbuffer->count; i++, flag++, shcaster++) { /* Run intersection checks to fill the bitfields. */ bsphere = linfo->shadow_bounds; - for (int j = 0; j < linfo->cpu_cube_ct; j++, bsphere++) { + for (int j = 0; j < linfo->cpu_cube_len; j++, bsphere++) { bool iter = sphere_bbox_intersect(bsphere, &shcaster->bbox); lightbits_set_single(&shcaster->bits, j, iter); } @@ -1139,19 +1139,19 @@ void EEVEE_draw_shadows(EEVEE_ViewLayerData *sldata, EEVEE_PassList *psl) filter_pixel_size = max_ff(0.0f, filter_pixel_size - 3.0f); /* Compute number of concentric samples. Depends directly on filter size. */ float pix_size_sqr = filter_pixel_size * filter_pixel_size; - srd->shadow_samples_ct = min_ii(max_sample, 4 + 8 * (int)filter_pixel_size + 4 * (int)(pix_size_sqr)); + srd->shadow_samples_len = min_ii(max_sample, 4 + 8 * (int)filter_pixel_size + 4 * (int)(pix_size_sqr)); } else { linfo->filter_size = 0.0f; - srd->shadow_samples_ct = 4; + srd->shadow_samples_len = 4; } - srd->shadow_inv_samples_ct = 1.0f / (float)srd->shadow_samples_ct; + srd->shadow_samples_len_inv = 1.0f / (float)srd->shadow_samples_len; DRW_uniformbuffer_update(sldata->shadow_render_ubo, srd); GPU_framebuffer_texture_layer_attach(sldata->shadow_cube_store_fb, sldata->shadow_cube_pool, 0, evscd->layer_id, 0); GPU_framebuffer_bind(sldata->shadow_cube_store_fb); - DRWPass *store_pass = eevee_lights_cube_store_pass_get(psl, sldata, linfo->shadow_method, srd->shadow_samples_ct); + DRWPass *store_pass = eevee_lights_cube_store_pass_get(psl, sldata, linfo->shadow_method, srd->shadow_samples_len); DRW_draw_pass(store_pass); led->need_update = false; @@ -1240,20 +1240,20 @@ void EEVEE_draw_shadows(EEVEE_ViewLayerData *sldata, EEVEE_PassList *psl) filter_pixel_size = max_ff(0.0f, filter_pixel_size - 3.0f); /* Compute number of concentric samples. Depends directly on filter size. */ float pix_size_sqr = filter_pixel_size * filter_pixel_size; - srd->shadow_samples_ct = min_ii(max_sample, 4 + 8 * (int)filter_pixel_size + 4 * (int)(pix_size_sqr)); + srd->shadow_samples_len = min_ii(max_sample, 4 + 8 * (int)filter_pixel_size + 4 * (int)(pix_size_sqr)); } else { linfo->filter_size = 0.0f; - srd->shadow_samples_ct = 4; + srd->shadow_samples_len = 4; } - srd->shadow_inv_samples_ct = 1.0f / (float)srd->shadow_samples_ct; + srd->shadow_samples_len_inv = 1.0f / (float)srd->shadow_samples_len; DRW_uniformbuffer_update(sldata->shadow_render_ubo, &linfo->shadow_render_data); int layer = evscd->layer_id + linfo->current_shadow_cascade; GPU_framebuffer_texture_layer_attach(sldata->shadow_cascade_store_fb, sldata->shadow_cascade_pool, 0, layer, 0); GPU_framebuffer_bind(sldata->shadow_cascade_store_fb); - DRWPass *store_pass = eevee_lights_cascade_store_pass_get(psl, sldata, linfo->shadow_method, srd->shadow_samples_ct); + DRWPass *store_pass = eevee_lights_cascade_store_pass_get(psl, sldata, linfo->shadow_method, srd->shadow_samples_len); DRW_draw_pass(store_pass); } } diff --git a/source/blender/draw/engines/eevee/eevee_lookdev.c b/source/blender/draw/engines/eevee/eevee_lookdev.c index 4c403b93f3e..2e568d97c07 100644 --- a/source/blender/draw/engines/eevee/eevee_lookdev.c +++ b/source/blender/draw/engines/eevee/eevee_lookdev.c @@ -57,9 +57,9 @@ void EEVEE_lookdev_cache_init( EEVEE_TextureList *txl = vedata->txl; const DRWContextState *draw_ctx = DRW_context_state_get(); View3D *v3d = draw_ctx->v3d; - if (LOOK_DEV_MODE_ENABLED(v3d)) { - StudioLight *sl = BKE_studiolight_find(v3d->shading.studio_light, STUDIOLIGHT_INTERNAL | STUDIOLIGHT_ORIENTATION_WORLD); - if ((sl->flag & STUDIOLIGHT_ORIENTATION_WORLD)) { + if (LOOK_DEV_STUDIO_LIGHT_ENABLED(v3d)) { + StudioLight *sl = BKE_studiolight_find(v3d->shading.studio_light, STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE); + if (sl && (sl->flag & STUDIOLIGHT_ORIENTATION_WORLD)) { struct Gwn_Batch *geom = DRW_cache_fullscreen_quad_get(); GPUTexture *tex = NULL; diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index fba377cbcaf..20d755d2245 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -115,8 +115,8 @@ static struct GPUTexture *create_ggx_lut_texture(int UNUSED(w), int UNUSED(h)) { struct GPUTexture *tex; struct GPUFrameBuffer *fb = NULL; - static float samples_ct = 8192.0f; - static float inv_samples_ct = 1.0f / 8192.0f; + static float samples_len = 8192.0f; + static float inv_samples_len = 1.0f / 8192.0f; char *lib_str = BLI_string_joinN( datatoc_bsdf_common_lib_glsl, @@ -130,8 +130,8 @@ static struct GPUTexture *create_ggx_lut_texture(int UNUSED(w), int UNUSED(h)) DRWPass *pass = DRW_pass_create("LightProbe Filtering", DRW_STATE_WRITE_COLOR); DRWShadingGroup *grp = DRW_shgroup_create(sh, pass); - DRW_shgroup_uniform_float(grp, "sampleCount", &samples_ct, 1); - DRW_shgroup_uniform_float(grp, "invSampleCount", &inv_samples_ct, 1); + DRW_shgroup_uniform_float(grp, "sampleCount", &samples_len, 1); + DRW_shgroup_uniform_float(grp, "invSampleCount", &inv_samples_len, 1); DRW_shgroup_uniform_texture(grp, "texHammersley", e_data.hammersley); DRW_shgroup_uniform_texture(grp, "texJitter", e_data.jitter); @@ -172,9 +172,9 @@ static struct GPUTexture *create_ggx_refraction_lut_texture(int w, int h) struct GPUTexture *tex; struct GPUTexture *hammersley = create_hammersley_sample_texture(8192); struct GPUFrameBuffer *fb = NULL; - static float samples_ct = 8192.0f; + static float samples_len = 8192.0f; static float a2 = 0.0f; - static float inv_samples_ct = 1.0f / 8192.0f; + static float inv_samples_len = 1.0f / 8192.0f; char *frag_str = BLI_string_joinN( datatoc_bsdf_common_lib_glsl, @@ -192,8 +192,8 @@ static struct GPUTexture *create_ggx_refraction_lut_texture(int w, int h) DRWPass *pass = DRW_pass_create("LightProbe Filtering", DRW_STATE_WRITE_COLOR); DRWShadingGroup *grp = DRW_shgroup_create(sh, pass); DRW_shgroup_uniform_float(grp, "a2", &a2, 1); - DRW_shgroup_uniform_float(grp, "sampleCount", &samples_ct, 1); - DRW_shgroup_uniform_float(grp, "invSampleCount", &inv_samples_ct, 1); + DRW_shgroup_uniform_float(grp, "sampleCount", &samples_len, 1); + DRW_shgroup_uniform_float(grp, "invSampleCount", &inv_samples_len, 1); DRW_shgroup_uniform_texture(grp, "texHammersley", hammersley); DRW_shgroup_uniform_texture(grp, "utilTex", e_data.util_tex); diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h index c9149d3bcf8..e2a875dca1f 100644 --- a/source/blender/draw/engines/eevee/eevee_private.h +++ b/source/blender/draw/engines/eevee/eevee_private.h @@ -98,7 +98,8 @@ extern struct DrawEngineType draw_engine_eevee_type; #define OVERLAY_ENABLED(v3d) ((v3d) && (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) #define LOOK_DEV_MODE_ENABLED(v3d) ((v3d) && (v3d->drawtype == OB_MATERIAL)) #define LOOK_DEV_OVERLAY_ENABLED(v3d) (LOOK_DEV_MODE_ENABLED(v3d) && OVERLAY_ENABLED(v3d) && (v3d->overlay.flag & V3D_OVERLAY_LOOK_DEV)) -#define USE_SCENE_LIGHT(v3d) ((!v3d) || (!LOOK_DEV_MODE_ENABLED(v3d)) || ((LOOK_DEV_MODE_ENABLED(v3d) && (v3d->shading.flag & V3D_SHADING_SCENE_LIGHT)))) +#define USE_SCENE_LIGHT(v3d) ((!v3d) || (!LOOK_DEV_MODE_ENABLED(v3d)) || ((LOOK_DEV_MODE_ENABLED(v3d) && (v3d->shading.flag & V3D_SHADING_SCENE_LIGHTS)))) +#define LOOK_DEV_STUDIO_LIGHT_ENABLED(v3d) (LOOK_DEV_MODE_ENABLED(v3d) && !(v3d->shading.flag & V3D_SHADING_SCENE_WORLD)) #define OCTAHEDRAL_SIZE_FROM_CUBESIZE(cube_size) ((int)ceilf(sqrtf((cube_size * cube_size) * 6.0f))) #define MIN_CUBE_LOD_LEVEL 3 @@ -359,14 +360,14 @@ typedef struct EEVEE_ShadowRender { float stored_texel_size; float clip_near; float clip_far; - int shadow_samples_ct; - float shadow_inv_samples_ct; + int shadow_samples_len; + float shadow_samples_len_inv; } EEVEE_ShadowRender; /* This is just a really long bitflag with special function to access it. */ #define MAX_LIGHTBITS_FIELDS (MAX_LIGHT / 8) typedef struct EEVEE_LightBits { - unsigned char fields[MAX_LIGHTBITS_FIELDS]; + uchar fields[MAX_LIGHTBITS_FIELDS]; } EEVEE_LightBits; typedef struct EEVEE_ShadowCaster { @@ -386,8 +387,8 @@ typedef struct EEVEE_LampsInfo { int num_light, cache_num_light; int num_cube_layer, cache_num_cube_layer; int num_cascade_layer, cache_num_cascade_layer; - int gpu_cube_ct, gpu_cascade_ct, gpu_shadow_ct; - int cpu_cube_ct, cpu_cascade_ct; + int gpu_cube_len, gpu_cascade_len, gpu_shadow_len; + int cpu_cube_len, cpu_cascade_len; int update_flag; int shadow_cube_size, shadow_cascade_size, shadow_method; bool shadow_high_bitdepth; @@ -451,8 +452,8 @@ typedef struct EEVEE_LightProbesInfo { int layer; float texel_size; float padding_size; - float samples_ct; - float invsamples_ct; + float samples_len; + float samples_len_inv; float near_clip; float far_clip; float roughness; @@ -558,7 +559,7 @@ typedef struct EEVEE_EffectsInfo { /* Other */ float prev_persmat[4][4]; /* Bloom */ - int bloom_iteration_ct; + int bloom_iteration_len; float source_texel_size[2]; float blit_texel_size[2]; float downsamp_texel_size[MAX_BLOOM_STEP][2]; diff --git a/source/blender/draw/engines/workbench/shaders/workbench_shadow_caps_geom.glsl b/source/blender/draw/engines/workbench/shaders/workbench_shadow_caps_geom.glsl index 948392bd8ee..d8c8f22ed1c 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_shadow_caps_geom.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_shadow_caps_geom.glsl @@ -6,24 +6,24 @@ #ifdef DOUBLE_MANIFOLD # ifdef USE_INVOC_EXT -# define invoc_ct 2 +# define invoc_len 2 # else -# define vert_ct 6 +# define vert_len 6 # endif #else # ifdef USE_INVOC_EXT -# define invoc_ct 2 +# define invoc_len 2 # else -# define vert_ct 6 +# define vert_len 6 # endif #endif #ifdef USE_INVOC_EXT -layout(triangles, invocations = invoc_ct) in; +layout(triangles, invocations = invoc_len) in; layout(triangle_strip, max_vertices = 3) out; #else layout(triangles) in; -layout(triangle_strip, max_vertices = vert_ct) out; +layout(triangle_strip, max_vertices = vert_len) out; #endif uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57); diff --git a/source/blender/draw/engines/workbench/shaders/workbench_shadow_geom.glsl b/source/blender/draw/engines/workbench/shaders/workbench_shadow_geom.glsl index 5a31aa34932..7418f86a58e 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_shadow_geom.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_shadow_geom.glsl @@ -6,24 +6,24 @@ #ifdef DOUBLE_MANIFOLD # ifdef USE_INVOC_EXT -# define invoc_ct 2 +# define invoc_len 2 # else -# define vert_ct 8 +# define vert_len 8 # endif #else # ifdef USE_INVOC_EXT -# define invoc_ct 1 +# define invoc_len 1 # else -# define vert_ct 4 +# define vert_len 4 # endif #endif #ifdef USE_INVOC_EXT -layout(lines_adjacency, invocations = invoc_ct) in; +layout(lines_adjacency, invocations = invoc_len) in; layout(triangle_strip, max_vertices = 4) out; #else layout(lines_adjacency) in; -layout(triangle_strip, max_vertices = vert_ct) out; +layout(triangle_strip, max_vertices = vert_len) out; #endif uniform vec3 lightDirection = vec3(0.57, 0.57, -0.57); diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h index f420a4a24b3..4d1b8269494 100644 --- a/source/blender/draw/intern/DRW_render.h +++ b/source/blender/draw/intern/DRW_render.h @@ -347,9 +347,9 @@ void DRW_shgroup_free(struct DRWShadingGroup *shgroup); void DRW_shgroup_call_add(DRWShadingGroup *shgroup, struct Gwn_Batch *geom, float (*obmat)[4]); void DRW_shgroup_call_range_add( DRWShadingGroup *shgroup, struct Gwn_Batch *geom, float (*obmat)[4], uint v_sta, uint v_count); -void DRW_shgroup_call_procedural_points_add(DRWShadingGroup *shgroup, unsigned int point_count, float (*obmat)[4]); -void DRW_shgroup_call_procedural_lines_add(DRWShadingGroup *shgroup, unsigned int line_count, float (*obmat)[4]); -void DRW_shgroup_call_procedural_triangles_add(DRWShadingGroup *shgroup, unsigned int tria_count, float (*obmat)[4]); +void DRW_shgroup_call_procedural_points_add(DRWShadingGroup *shgroup, uint point_len, float (*obmat)[4]); +void DRW_shgroup_call_procedural_lines_add(DRWShadingGroup *shgroup, uint line_count, float (*obmat)[4]); +void DRW_shgroup_call_procedural_triangles_add(DRWShadingGroup *shgroup, uint tria_count, float (*obmat)[4]); void DRW_shgroup_call_object_procedural_triangles_culled_add(DRWShadingGroup *shgroup, uint tria_count, struct Object *ob); void DRW_shgroup_call_object_add_ex(DRWShadingGroup *shgroup, struct Gwn_Batch *geom, struct Object *ob, bool bypass_culling); #define DRW_shgroup_call_object_add(shgroup, geom, ob) DRW_shgroup_call_object_add_ex(shgroup, geom, ob, false) @@ -513,7 +513,7 @@ void DRW_state_lock(DRWState state); void DRW_state_invert_facing(void); -void DRW_state_clip_planes_count_set(uint plane_ct); +void DRW_state_clip_planes_count_set(uint plane_len); void DRW_state_clip_planes_reset(void); /* Culling, return true if object is inside view frustum. */ diff --git a/source/blender/draw/intern/draw_anim_viz.c b/source/blender/draw/intern/draw_anim_viz.c index 42c36ab3662..e634710980a 100644 --- a/source/blender/draw/intern/draw_anim_viz.c +++ b/source/blender/draw/intern/draw_anim_viz.c @@ -149,12 +149,12 @@ static void MPATH_cache_init(void *vedata) MPATH_PassList *psl = ((MPATH_Data *)vedata)->psl; { - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS; + DRWState state = DRW_STATE_WRITE_COLOR; psl->lines = DRW_pass_create("Motionpath Line Pass", state); } { - DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS | DRW_STATE_POINT; + DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_POINT; psl->points = DRW_pass_create("Motionpath Point Pass", state); } } @@ -256,7 +256,7 @@ static void MPATH_cache_motion_path(MPATH_PassList *psl, bool show_kf_no = (avs->path_viewflag & MOTIONPATH_VIEW_KFNOS) != 0; if ((avs->path_viewflag & (MOTIONPATH_VIEW_FNUMS)) || (show_kf_no && show_keyframes)) { int i; - unsigned char col[4], col_kf[4]; + uchar col[4], col_kf[4]; UI_GetThemeColor3ubv(TH_TEXT_HI, col); UI_GetThemeColor3ubv(TH_VERTEX_SELECT, col_kf); col[3] = col_kf[3] = 255; diff --git a/source/blender/draw/intern/draw_armature.c b/source/blender/draw/intern/draw_armature.c index 3faf8a352b2..9bc8b70b67c 100644 --- a/source/blender/draw/intern/draw_armature.c +++ b/source/blender/draw/intern/draw_armature.c @@ -514,7 +514,7 @@ static void set_pchan_colorset(Object *ob, bPoseChannel *pchan) } /* This function is for brightening/darkening a given color (like UI_GetThemeColorShade3ubv()) */ -static void cp_shade_color3ub(unsigned char cp[3], const int offset) +static void cp_shade_color3ub(uchar cp[3], const int offset) { int r, g, b; @@ -549,7 +549,7 @@ static bool set_pchan_color(short colCode, const int boneflag, const short const case PCHAN_COLOR_NORMAL: { if (bcolor) { - unsigned char cp[4] = {255}; + uchar cp[4] = {255}; if (boneflag & BONE_DRAW_ACTIVE) { copy_v3_v3_char((char *)cp, bcolor->active); @@ -591,7 +591,7 @@ static bool set_pchan_color(short colCode, const int boneflag, const short const if (bcolor) { float solid_bcolor[3]; - rgb_uchar_to_float(solid_bcolor, (unsigned char *)bcolor->solid); + rgb_uchar_to_float(solid_bcolor, (uchar *)bcolor->solid); interp_v3_v3v3(fcolor, fcolor, solid_bcolor, 1.0f); } @@ -600,7 +600,7 @@ static bool set_pchan_color(short colCode, const int boneflag, const short const case PCHAN_COLOR_CONSTS: { if ((bcolor == NULL) || (bcolor->flag & TH_WIRECOLOR_CONSTCOLS)) { - unsigned char cp[4]; + uchar cp[4]; if (constflag & PCHAN_HAS_TARGET) rgba_char_args_set((char *)cp, 255, 150, 0, 80); else if (constflag & PCHAN_HAS_IK) rgba_char_args_set((char *)cp, 255, 255, 0, 80); else if (constflag & PCHAN_HAS_SPLINEIK) rgba_char_args_set((char *)cp, 200, 255, 0, 80); @@ -618,7 +618,7 @@ static bool set_pchan_color(short colCode, const int boneflag, const short const case PCHAN_COLOR_SPHEREBONE_BASE: { if (bcolor) { - unsigned char cp[4] = {255}; + uchar cp[4] = {255}; if (boneflag & BONE_DRAW_ACTIVE) { copy_v3_v3_char((char *)cp, bcolor->active); @@ -649,7 +649,7 @@ static bool set_pchan_color(short colCode, const int boneflag, const short const case PCHAN_COLOR_SPHEREBONE_END: { if (bcolor) { - unsigned char cp[4] = {255}; + uchar cp[4] = {255}; if (boneflag & BONE_DRAW_ACTIVE) { copy_v3_v3_char((char *)cp, bcolor->active); @@ -683,7 +683,7 @@ static bool set_pchan_color(short colCode, const int boneflag, const short const { /* inner part in background color or constraint */ if ((constflag) && ((bcolor == NULL) || (bcolor->flag & TH_WIRECOLOR_CONSTCOLS))) { - unsigned char cp[4]; + uchar cp[4]; if (constflag & PCHAN_HAS_TARGET) rgba_char_args_set((char *)cp, 255, 150, 0, 255); else if (constflag & PCHAN_HAS_IK) rgba_char_args_set((char *)cp, 255, 255, 0, 255); else if (constflag & PCHAN_HAS_SPLINEIK) rgba_char_args_set((char *)cp, 200, 255, 0, 255); @@ -695,7 +695,7 @@ static bool set_pchan_color(short colCode, const int boneflag, const short const else { if (bcolor) { const char *cp = bcolor->solid; - rgb_uchar_to_float(fcolor, (unsigned char *)cp); + rgb_uchar_to_float(fcolor, (uchar *)cp); fcolor[3] = 204.f / 255.f; } else { @@ -1588,7 +1588,7 @@ static void draw_armature_edit(Object *ob) /* Draw names of bone */ if (show_text && (arm->flag & ARM_DRAWNAMES)) { - unsigned char color[4]; + uchar color[4]; UI_GetThemeColor4ubv((eBone->flag & BONE_SELECTED) ? TH_TEXT_HI : TH_TEXT, color); float vec[3]; @@ -1702,7 +1702,7 @@ static void draw_armature_pose(Object *ob, const float const_color[4]) /* Draw names of bone */ if (show_text && (arm->flag & ARM_DRAWNAMES)) { - unsigned char color[4]; + uchar color[4]; UI_GetThemeColor4ubv((arm->flag & ARM_POSEMODE) && (bone->flag & BONE_SELECTED) ? TH_TEXT_HI : TH_TEXT, color); float vec[3]; diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c index a8d2c2a3642..2251285be74 100644 --- a/source/blender/draw/intern/draw_cache.c +++ b/source/blender/draw/intern/draw_cache.c @@ -164,7 +164,7 @@ static Gwn_VertBuf *fill_arrows_vbo(const float scale) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -211,7 +211,7 @@ static Gwn_VertBuf *sphere_wire_vbo(const float rad) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -263,7 +263,7 @@ Gwn_Batch *DRW_cache_fullscreen_quad_get(void) /* Position Only 2D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos, uvs; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); attr_id.uvs = GWN_vertformat_attr_add(&format, "uvs", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -291,7 +291,7 @@ Gwn_Batch *DRW_cache_quad_get(void) /* Position Only 2D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos, uvs; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); attr_id.uvs = GWN_vertformat_attr_add(&format, "uvs", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -344,7 +344,7 @@ Gwn_Batch *DRW_cache_cube_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -369,7 +369,7 @@ Gwn_Batch *DRW_cache_circle_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -400,7 +400,7 @@ Gwn_Batch *DRW_cache_square_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -427,7 +427,7 @@ Gwn_Batch *DRW_cache_single_line_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -452,7 +452,7 @@ Gwn_Batch *DRW_cache_single_line_endpoints_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -476,7 +476,7 @@ Gwn_Batch *DRW_cache_screenspace_circle_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -613,7 +613,7 @@ Gwn_Batch *DRW_cache_plain_axes_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -644,7 +644,7 @@ Gwn_Batch *DRW_cache_single_arrow_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -700,7 +700,7 @@ Gwn_Batch *DRW_cache_empty_cone_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -752,7 +752,7 @@ Gwn_Batch *DRW_cache_axis_names_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* Using 3rd component as axis indicator */ attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -810,7 +810,7 @@ Gwn_Batch *DRW_cache_image_plane_get(void) const float quad[4][2] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}}; static Gwn_VertFormat format = { 0 }; static struct { uint pos, texCoords; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); attr_id.texCoords = GWN_vertformat_attr_add(&format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -831,7 +831,7 @@ Gwn_Batch *DRW_cache_image_plane_wire_get(void) const float quad[4][2] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}}; static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format); @@ -854,7 +854,7 @@ Gwn_Batch *DRW_cache_field_wind_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -891,7 +891,7 @@ Gwn_Batch *DRW_cache_field_force_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -929,7 +929,7 @@ Gwn_Batch *DRW_cache_field_vortex_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -966,7 +966,7 @@ Gwn_Batch *DRW_cache_field_tube_limit_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1015,7 +1015,7 @@ Gwn_Batch *DRW_cache_field_cone_limit_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1070,7 +1070,7 @@ Gwn_Batch *DRW_cache_lamp_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -1102,7 +1102,7 @@ Gwn_Batch *DRW_cache_lamp_shadows_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -1133,7 +1133,7 @@ Gwn_Batch *DRW_cache_lamp_sunrays_get(void) /* Position Only 2D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -1168,7 +1168,7 @@ Gwn_Batch *DRW_cache_lamp_area_square_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1201,7 +1201,7 @@ Gwn_Batch *DRW_cache_lamp_area_disk_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1235,7 +1235,7 @@ Gwn_Batch *DRW_cache_lamp_hemi_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1313,7 +1313,7 @@ Gwn_Batch *DRW_cache_lamp_spot_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos, n1, n2; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.n1 = GWN_vertformat_attr_add(&format, "N1", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.n2 = GWN_vertformat_attr_add(&format, "N2", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); @@ -1372,7 +1372,7 @@ Gwn_Batch *DRW_cache_lamp_spot_square_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1410,7 +1410,7 @@ Gwn_Batch *DRW_cache_speaker_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1483,7 +1483,7 @@ Gwn_Batch *DRW_cache_lightprobe_cube_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1528,7 +1528,7 @@ Gwn_Batch *DRW_cache_lightprobe_grid_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1581,7 +1581,7 @@ Gwn_Batch *DRW_cache_lightprobe_planar_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1709,7 +1709,7 @@ Gwn_Batch *DRW_cache_bone_octahedral_get(void) static Gwn_VertFormat format = { 0 }; static struct { uint pos, nor, snor; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.snor = GWN_vertformat_attr_add(&format, "snor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); @@ -1875,7 +1875,7 @@ Gwn_Batch *DRW_cache_bone_box_get(void) static Gwn_VertFormat format = { 0 }; static struct { uint pos, nor, snor; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.snor = GWN_vertformat_attr_add(&format, "snor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); @@ -1942,7 +1942,7 @@ Gwn_Batch *DRW_cache_bone_envelope_solid_get(void) static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -1989,7 +1989,7 @@ Gwn_Batch *DRW_cache_bone_envelope_outline_get(void) /* Position Only 2D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos0, pos1, pos2; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos0 = GWN_vertformat_attr_add(&format, "pos0", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); attr_id.pos1 = GWN_vertformat_attr_add(&format, "pos1", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); attr_id.pos2 = GWN_vertformat_attr_add(&format, "pos2", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); @@ -2045,7 +2045,7 @@ Gwn_Batch *DRW_cache_bone_point_get(void) static Gwn_VertFormat format = { 0 }; static struct { uint pos, nor; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -2081,7 +2081,7 @@ Gwn_Batch *DRW_cache_bone_point_get(void) /* Position Only 2D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -2115,7 +2115,7 @@ Gwn_Batch *DRW_cache_bone_point_wire_outline_get(void) /* Position Only 2D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos0, pos1; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos0 = GWN_vertformat_attr_add(&format, "pos0", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); attr_id.pos1 = GWN_vertformat_attr_add(&format, "pos1", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -2172,7 +2172,7 @@ Gwn_Batch *DRW_cache_bone_stick_get(void) /* Position Only 2D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos, flag; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); attr_id.flag = GWN_vertformat_attr_add(&format, "flag", GWN_COMP_U32, 1, GWN_FETCH_INT); } @@ -2314,7 +2314,7 @@ Gwn_Batch *DRW_cache_bone_arrows_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint axis, pos, col; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.axis = GWN_vertformat_attr_add(&format, "axis", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); attr_id.pos = GWN_vertformat_attr_add(&format, "screenPos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); attr_id.col = GWN_vertformat_attr_add(&format, "colorAxis", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); @@ -2349,26 +2349,26 @@ Gwn_Batch *DRW_cache_bone_arrows_get(void) a = axis + 0.31f; /* Axis name */ - int axis_v_ct; + int axis_v_len; float (*axis_verts)[2]; if (axis == 0) { axis_verts = x_axis_name; - axis_v_ct = X_LEN; + axis_v_len = X_LEN; } else if (axis == 1) { axis_verts = y_axis_name; - axis_v_ct = Y_LEN; + axis_v_len = Y_LEN; } else { axis_verts = z_axis_name; - axis_v_ct = Z_LEN; + axis_v_len = Z_LEN; } /* Axis name shadows */ copy_v3_fl(c, 0.0f); c[axis] = 0.3f; for (int j = 0; j < SHADOW_RES; ++j) { - for (int i = 0; i < axis_v_ct; ++i) { + for (int i = 0; i < axis_v_len; ++i) { float tmp[2]; add_v2_v2v2(tmp, axis_verts[i], axis_name_shadow[j]); set_bone_axis_vert(vbo, attr_id.axis, attr_id.pos, attr_id.col, @@ -2379,7 +2379,7 @@ Gwn_Batch *DRW_cache_bone_arrows_get(void) /* Axis name */ copy_v3_fl(c, 0.1f); c[axis] = 1.0f; - for (int i = 0; i < axis_v_ct; ++i) { + for (int i = 0; i < axis_v_len; ++i) { set_bone_axis_vert(vbo, attr_id.axis, attr_id.pos, attr_id.col, &v, &a, axis_verts[i], c); } @@ -2456,7 +2456,7 @@ Gwn_Batch *DRW_cache_camera_get(void) if (!SHC.drw_camera) { static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); } @@ -2489,7 +2489,7 @@ Gwn_Batch *DRW_cache_camera_frame_get(void) static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); } @@ -2515,7 +2515,7 @@ Gwn_Batch *DRW_cache_camera_tria_get(void) if (!SHC.drw_camera_tria) { static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); } @@ -2552,7 +2552,7 @@ Gwn_Batch *DRW_cache_single_vert_get(void) /* Position Only 3D format */ static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -2985,9 +2985,9 @@ Gwn_Batch *DRW_cache_particles_get_prim(int type) case PART_DRAW_CROSS: if (!SHC.drw_particle_cross) { static Gwn_VertFormat format = { 0 }; - static unsigned pos_id, axis_id; + static uint pos_id, axis_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { pos_id = GWN_vertformat_attr_add(&format, "inst_pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); axis_id = GWN_vertformat_attr_add(&format, "axis", GWN_COMP_I32, 1, GWN_FETCH_INT); } @@ -3032,9 +3032,9 @@ Gwn_Batch *DRW_cache_particles_get_prim(int type) case PART_DRAW_AXIS: if (!SHC.drw_particle_axis) { static Gwn_VertFormat format = { 0 }; - static unsigned pos_id, axis_id; + static uint pos_id, axis_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { pos_id = GWN_vertformat_attr_add(&format, "inst_pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); axis_id = GWN_vertformat_attr_add(&format, "axis", GWN_COMP_I32, 1, GWN_FETCH_INT); } @@ -3083,9 +3083,9 @@ Gwn_Batch *DRW_cache_particles_get_prim(int type) int axis = -1; static Gwn_VertFormat format = { 0 }; - static unsigned pos_id, axis_id; + static uint pos_id, axis_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { pos_id = GWN_vertformat_attr_add(&format, "inst_pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); axis_id = GWN_vertformat_attr_add(&format, "axis", GWN_COMP_I32, 1, GWN_FETCH_INT); } @@ -3125,24 +3125,24 @@ Gwn_Batch *DRW_cache_cursor_get(bool crosshair_lines) const float f20 = 1.0f; const int segments = 16; - const int vert_ct = segments + 8; - const int index_ct = vert_ct + 5; + const int vert_len = segments + 8; + const int index_len = vert_len + 5; - unsigned char red[3] = {255, 0, 0}; - unsigned char white[3] = {255, 255, 255}; + uchar red[3] = {255, 0, 0}; + uchar white[3] = {255, 255, 255}; static Gwn_VertFormat format = { 0 }; static struct { uint pos, color; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); attr_id.color = GWN_vertformat_attr_add(&format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); } Gwn_IndexBufBuilder elb; - GWN_indexbuf_init_ex(&elb, GWN_PRIM_LINE_STRIP, index_ct, vert_ct, true); + GWN_indexbuf_init_ex(&elb, GWN_PRIM_LINE_STRIP, index_len, vert_len, true); Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format); - GWN_vertbuf_data_alloc(vbo, vert_ct); + GWN_vertbuf_data_alloc(vbo, vert_len); int v = 0; for (int i = 0; i < segments; ++i) { @@ -3161,7 +3161,7 @@ Gwn_Batch *DRW_cache_cursor_get(bool crosshair_lines) GWN_indexbuf_add_generic_vert(&elb, 0); if (crosshair_lines) { - unsigned char crosshair_color[3]; + uchar crosshair_color[3]; UI_GetThemeColor3ubv(TH_VIEW_OVERLAY, crosshair_color); GWN_indexbuf_add_primitive_restart(&elb); diff --git a/source/blender/draw/intern/draw_cache_impl_curve.c b/source/blender/draw/intern/draw_cache_impl_curve.c index 1bf34953dc6..4de1dfd24f5 100644 --- a/source/blender/draw/intern/draw_cache_impl_curve.c +++ b/source/blender/draw/intern/draw_cache_impl_curve.c @@ -503,7 +503,7 @@ static Gwn_VertBuf *curve_batch_cache_get_wire_verts(CurveRenderData *rdata, Cur if (cache->wire.verts == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* initialize vertex format */ attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -581,7 +581,7 @@ static Gwn_VertBuf *curve_batch_cache_get_normal_verts(CurveRenderData *rdata, C if (cache->normal.verts == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* initialize vertex format */ attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -675,7 +675,7 @@ static void curve_batch_cache_create_overlay_batches(Curve *cu) if (cache->overlay.verts == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos, data; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* initialize vertex format */ attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.data = GWN_vertformat_attr_add(&format, "data", GWN_COMP_U8, 1, GWN_FETCH_INT); @@ -743,7 +743,7 @@ static void curve_batch_cache_create_overlay_batches(Curve *cu) static Gwn_VertFormat format = { 0 }; static struct { uint pos, data; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* initialize vertex format */ attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.data = GWN_vertformat_attr_add(&format, "data", GWN_COMP_U8, 1, GWN_FETCH_INT); @@ -850,7 +850,7 @@ static Gwn_Batch *curve_batch_cache_get_overlay_select(CurveRenderData *rdata, C EditFont *ef = rdata->text.edit_font; static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -924,7 +924,7 @@ static Gwn_Batch *curve_batch_cache_get_overlay_cursor(CurveRenderData *rdata, C if (cache->text.cursor == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } diff --git a/source/blender/draw/intern/draw_cache_impl_displist.c b/source/blender/draw/intern/draw_cache_impl_displist.c index 3eecff024a1..8d187af0501 100644 --- a/source/blender/draw/intern/draw_cache_impl_displist.c +++ b/source/blender/draw/intern/draw_cache_impl_displist.c @@ -122,7 +122,7 @@ Gwn_VertBuf *DRW_displist_vertbuf_calc_pos_with_normals(ListBase *lb) { static Gwn_VertFormat format = { 0 }; static struct { uint pos, nor; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* initialize vertex format */ attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); @@ -228,7 +228,7 @@ Gwn_Batch **DRW_displist_batch_calc_tri_pos_normals_and_uv_split_by_material(Lis static Gwn_VertFormat shaded_triangles_format = { 0 }; static struct { uint pos, nor, uv; } attr_id; - if (shaded_triangles_format.attrib_ct == 0) { + if (shaded_triangles_format.attr_len == 0) { /* initialize vertex format */ attr_id.pos = GWN_vertformat_attr_add(&shaded_triangles_format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.nor = GWN_vertformat_attr_add(&shaded_triangles_format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); diff --git a/source/blender/draw/intern/draw_cache_impl_lattice.c b/source/blender/draw/intern/draw_cache_impl_lattice.c index 6046d9854fb..99dce2d7343 100644 --- a/source/blender/draw/intern/draw_cache_impl_lattice.c +++ b/source/blender/draw/intern/draw_cache_impl_lattice.c @@ -507,7 +507,7 @@ static void lattice_batch_cache_create_overlay_batches(Lattice *lt) if (cache->overlay_verts == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos, data; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* initialize vertex format */ attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.data = GWN_vertformat_attr_add(&format, "data", GWN_COMP_U8, 1, GWN_FETCH_INT); diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index eafcfb007e7..7a72622cb9e 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -116,10 +116,10 @@ typedef struct EdgeAdjacentVerts { } EdgeAdjacentVerts; typedef struct EdgeDrawAttr { - unsigned char v_flag; - unsigned char e_flag; - unsigned char crease; - unsigned char bweight; + uchar v_flag; + uchar e_flag; + uchar crease; + uchar bweight; } EdgeDrawAttr; typedef struct MeshRenderData { @@ -1349,9 +1349,9 @@ enum { * (see gpu_shader_edit_mesh_overlay_geom.glsl) */ }; -static unsigned char mesh_render_data_looptri_flag(MeshRenderData *rdata, const BMFace *efa) +static uchar mesh_render_data_looptri_flag(MeshRenderData *rdata, const BMFace *efa) { - unsigned char fflag = 0; + uchar fflag = 0; if (efa == rdata->efa_act) fflag |= VFLAG_FACE_ACTIVE; @@ -1397,10 +1397,10 @@ static void mesh_render_data_edge_flag( } } -static unsigned char mesh_render_data_vertex_flag(MeshRenderData *rdata, const BMVert *eve) +static uchar mesh_render_data_vertex_flag(MeshRenderData *rdata, const BMVert *eve) { - unsigned char vflag = 0; + uchar vflag = 0; /* Current vertex */ if (eve == rdata->eve_act) @@ -1417,8 +1417,8 @@ static void add_overlay_tri( const uint pos_id, const uint vnor_id, const uint lnor_id, const uint data_id, const BMLoop **bm_looptri, const int base_vert_idx) { - unsigned char fflag; - unsigned char vflag; + uchar fflag; + uchar vflag; if (vbo_pos) { /* TODO(sybren): deduplicate this and all the other places it's pasted to in this file. */ @@ -1528,7 +1528,7 @@ static void add_overlay_loose_vert( } if (vbo_data) { - unsigned char vflag[4] = {0, 0, 0, 0}; + uchar vflag[4] = {0, 0, 0, 0}; vflag[0] = mesh_render_data_vertex_flag(rdata, eve); GWN_vertbuf_attr_set(vbo_data, data_id, base_vert_idx, vflag); } @@ -1634,7 +1634,7 @@ typedef struct MeshBatchCache { * set srgb conversion for auto attribs.*/ char *auto_layer_names; int *auto_layer_is_srgb; - int auto_layer_ct; + int auto_layer_len; /* settings to determine if cache is invalid */ bool is_maybe_dirty; @@ -1947,22 +1947,22 @@ static Gwn_VertBuf *mesh_batch_cache_get_tri_shading_data(MeshRenderData *rdata, uint auto_names_len = 0; uint auto_ofs = 0; uint auto_id = 0; - cache->auto_layer_ct = 0; + cache->auto_layer_len = 0; for (uint i = 0; i < uv_len; i++) { const char *attrib_name = mesh_render_data_uv_auto_layer_uuid_get(rdata, i); auto_names_len += strlen(attrib_name) + 2; /* include null terminator and b prefix. */ - cache->auto_layer_ct++; + cache->auto_layer_len++; } for (uint i = 0; i < vcol_len; i++) { if (rdata->cd.layers.auto_vcol[i]) { const char *attrib_name = mesh_render_data_vcol_auto_layer_uuid_get(rdata, i); auto_names_len += strlen(attrib_name) + 2; /* include null terminator and b prefix. */ - cache->auto_layer_ct++; + cache->auto_layer_len++; } } auto_names_len += 1; /* add an ultimate '\0' terminator */ cache->auto_layer_names = MEM_callocN(auto_names_len * sizeof(char), "Auto layer name buf"); - cache->auto_layer_is_srgb = MEM_mallocN(cache->auto_layer_ct * sizeof(int), "Auto layer value buf"); + cache->auto_layer_is_srgb = MEM_mallocN(cache->auto_layer_len * sizeof(int), "Auto layer value buf"); for (uint i = 0; i < uv_len; i++) { /* UV */ @@ -2159,7 +2159,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_tri_uv_active( static Gwn_VertFormat format = { 0 }; static struct { uint uv; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.uv = GWN_vertformat_attr_add(&format, "uv", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -2222,7 +2222,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_tri_pos_and_normals_ex( if (*r_vbo == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos, nor; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_I10, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); } @@ -2374,7 +2374,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_facedot_pos_with_normals_and_flag( if (cache->ed_fcenter_pos_with_nor_and_sel == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos, data; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.data = GWN_vertformat_attr_add(&format, "norAndFlag", GWN_COMP_I10, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); } @@ -2418,7 +2418,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_edges_visible( if (cache->ed_edge_pos == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos, data; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -2463,7 +2463,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_verts_visible( if (cache->ed_vert_pos == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos, data; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -2513,7 +2513,7 @@ static Gwn_VertBuf *mesh_create_facedot_select_id( { static Gwn_VertFormat format = { 0 }; static struct { uint pos, col; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_I32, 1, GWN_FETCH_INT); } @@ -2561,7 +2561,7 @@ static Gwn_VertBuf *mesh_create_edges_select_id( { static Gwn_VertFormat format = { 0 }; static struct { uint pos, col; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_I32, 1, GWN_FETCH_INT); } @@ -2611,7 +2611,7 @@ static Gwn_VertBuf *mesh_create_verts_select_id( { static Gwn_VertFormat format = { 0 }; static struct { uint pos, col; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_I32, 1, GWN_FETCH_INT); } @@ -2671,7 +2671,7 @@ static Gwn_VertBuf *mesh_create_tri_weights( static Gwn_VertFormat format = { 0 }; static struct { uint col; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } @@ -2731,7 +2731,7 @@ static Gwn_VertBuf *mesh_create_tri_vert_colors( static Gwn_VertFormat format = { 0 }; static struct { uint col; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); } @@ -2791,7 +2791,7 @@ static Gwn_VertBuf *mesh_create_tri_select_id( static Gwn_VertFormat format = { 0 }; static struct { uint col; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_I32, 1, GWN_FETCH_INT); } @@ -2847,7 +2847,7 @@ static Gwn_VertBuf *mesh_batch_cache_get_vert_pos_and_nor_in_order( if (cache->pos_in_order == NULL) { static Gwn_VertFormat format = { 0 }; static struct { uint pos, nor; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* Normal is padded so that the vbo can be used as a buffer texture */ attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_I16, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); @@ -2886,8 +2886,8 @@ static Gwn_VertBuf *mesh_batch_cache_get_vert_pos_and_nor_in_order( static Gwn_VertFormat *edit_mesh_overlay_pos_format(uint *r_pos_id) { static Gwn_VertFormat format_pos = { 0 }; - static unsigned pos_id; - if (format_pos.attrib_ct == 0) { + static uint pos_id; + if (format_pos.attr_len == 0) { pos_id = GWN_vertformat_attr_add(&format_pos, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); } *r_pos_id = pos_id; @@ -2898,8 +2898,8 @@ static Gwn_VertFormat *edit_mesh_overlay_nor_format(uint *r_vnor_id, uint *r_lno { static Gwn_VertFormat format_nor = { 0 }; static Gwn_VertFormat format_nor_loop = { 0 }; - static unsigned vnor_id, vnor_loop_id, lnor_id; - if (format_nor.attrib_ct == 0) { + static uint vnor_id, vnor_loop_id, lnor_id; + if (format_nor.attr_len == 0) { vnor_id = GWN_vertformat_attr_add(&format_nor, "vnor", GWN_COMP_I10, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); vnor_loop_id = GWN_vertformat_attr_add(&format_nor_loop, "vnor", GWN_COMP_I10, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); lnor_id = GWN_vertformat_attr_add(&format_nor_loop, "lnor", GWN_COMP_I10, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); @@ -2918,8 +2918,8 @@ static Gwn_VertFormat *edit_mesh_overlay_nor_format(uint *r_vnor_id, uint *r_lno static Gwn_VertFormat *edit_mesh_overlay_data_format(uint *r_data_id) { static Gwn_VertFormat format_flag = { 0 }; - static unsigned data_id; - if (format_flag.attrib_ct == 0) { + static uint data_id; + if (format_flag.attr_len == 0) { data_id = GWN_vertformat_attr_add(&format_flag, "data", GWN_COMP_U8, 4, GWN_FETCH_INT); } *r_data_id = data_id; @@ -3420,7 +3420,7 @@ static Gwn_VertBuf *mesh_batch_cache_create_edges_overlay_texture_buf(MeshRender int j, j_next; for (j = 2, j_next = 0; j_next < 3; j = j_next++) { MEdge *ed = &medge[mloop[mlt->tri[j]].e]; - unsigned int tri_edge[2] = {mloop[mlt->tri[j]].v, mloop[mlt->tri[j_next]].v}; + uint tri_edge[2] = {mloop[mlt->tri[j]].v, mloop[mlt->tri[j_next]].v}; if (((ed->v1 == tri_edge[0]) && (ed->v2 == tri_edge[1])) || ((ed->v1 == tri_edge[1]) && (ed->v2 == tri_edge[0]))) @@ -3657,7 +3657,7 @@ static Gwn_VertBuf *mesh_create_edge_pos_with_sel( static Gwn_VertFormat format = { 0 }; static struct { uint pos, sel; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.sel = GWN_vertformat_attr_add(&format, "select", GWN_COMP_U8, 1, GWN_FETCH_INT); } @@ -3744,7 +3744,7 @@ static Gwn_VertBuf *mesh_create_vert_pos_with_overlay_data( static Gwn_VertFormat format = { 0 }; static struct { uint data; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.data = GWN_vertformat_attr_add(&format, "data", GWN_COMP_I8, 1, GWN_FETCH_INT); } @@ -3997,7 +3997,7 @@ Gwn_Batch *DRW_mesh_batch_cache_get_fancy_edges(Mesh *me) /* create batch from DM */ static Gwn_VertFormat format = { 0 }; static struct { uint pos, n1, n2; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); attr_id.n1 = GWN_vertformat_attr_add(&format, "N1", GWN_COMP_I10, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); @@ -4330,7 +4330,7 @@ Gwn_Batch **DRW_mesh_batch_cache_get_surface_shaded( if (auto_layer_names) { *auto_layer_names = cache->auto_layer_names; *auto_layer_is_srgb = cache->auto_layer_is_srgb; - *auto_layer_count = cache->auto_layer_ct; + *auto_layer_count = cache->auto_layer_len; } return cache->shaded_triangles; diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c index 28693b47c89..df67d34d566 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.c +++ b/source/blender/draw/intern/draw_cache_impl_particles.c @@ -66,8 +66,8 @@ static void particle_batch_cache_clear(ParticleSystem *psys); typedef struct ParticlePointCache { Gwn_VertBuf *pos; Gwn_Batch *points; - int elems_count; - int point_count; + int elems_len; + int point_len; } ParticlePointCache; typedef struct ParticleBatchCache { @@ -82,11 +82,11 @@ typedef struct ParticleBatchCache { Gwn_VertBuf *edit_inner_pos; Gwn_Batch *edit_inner_points; - int edit_inner_point_count; + int edit_inner_point_len; Gwn_VertBuf *edit_tip_pos; Gwn_Batch *edit_tip_points; - int edit_tip_point_count; + int edit_tip_point_len; /* Settings to determine if cache is invalid. */ bool is_dirty; @@ -225,9 +225,9 @@ static void count_cache_segment_keys( for (int i = 0; i < num_path_cache_keys; i++) { ParticleCacheKey *path = pathcache[i]; if (path->segments > 0) { - hair_cache->strands_count++; - hair_cache->elems_count += path->segments + 2; - hair_cache->point_count += path->segments + 1; + hair_cache->strands_len++; + hair_cache->elems_len += path->segments + 2; + hair_cache->point_len += path->segments + 1; } } } @@ -243,9 +243,9 @@ static void ensure_seg_pt_count( return; } - hair_cache->strands_count = 0; - hair_cache->elems_count = 0; - hair_cache->point_count = 0; + hair_cache->strands_len = 0; + hair_cache->elems_len = 0; + hair_cache->point_len = 0; if (edit != NULL && edit->pathcache != NULL) { count_cache_segment_keys(edit->pathcache, edit->totcached, hair_cache); @@ -263,7 +263,7 @@ static void ensure_seg_pt_count( } } -static void particle_pack_mcol(MCol *mcol, unsigned short r_scol[3]) +static void particle_pack_mcol(MCol *mcol, ushort r_scol[3]) { /* Convert to linear ushort and swizzle */ r_scol[0] = unit_float_to_ushort_clamp(BLI_color_from_srgb_table[mcol->b]); @@ -573,7 +573,7 @@ static int particle_batch_cache_fill_segments( } for (int k = 0; k < num_col_layers; k++) { /* TODO Put the conversion outside the loop */ - unsigned short scol[4]; + ushort scol[4]; particle_pack_mcol( (is_simple && is_child) ? &(*r_parent_mcol)[psys->child[i].parent][k] : &mcol[k], @@ -600,7 +600,7 @@ static int particle_batch_cache_fill_segments( } for (int k = 0; k < num_col_layers; k++) { /* TODO Put the conversion outside the loop */ - unsigned short scol[4]; + ushort scol[4]; particle_pack_mcol( (is_simple && is_child) ? &(*r_parent_mcol)[psys->child[i].parent][k] : &mcol[k], @@ -734,7 +734,7 @@ static int particle_batch_cache_fill_strands_data( copy_v2_v2(t_uv, uv[k]); } for (int k = 0; k < num_col_layers; k++) { - unsigned short *scol = (unsigned short *)GWN_vertbuf_raw_step(col_step + k); + ushort *scol = (ushort *)GWN_vertbuf_raw_step(col_step + k); particle_pack_mcol( (is_simple && is_child) ? &(*r_parent_mcol)[psys->child[i].parent][k] : &mcol[k], @@ -761,7 +761,7 @@ static void particle_batch_cache_ensure_procedural_final_points( /* Create a destination buffer for the tranform feedback. Sized appropriately */ /* Thoses are points! not line segments. */ - GWN_vertbuf_data_alloc(cache->final[subdiv].proc_buf, cache->final[subdiv].strands_res * cache->strands_count); + GWN_vertbuf_data_alloc(cache->final[subdiv].proc_buf, cache->final[subdiv].strands_res * cache->strands_len); /* Create vbo immediatly to bind to texture buffer. */ GWN_vertbuf_use(cache->final[subdiv].proc_buf); @@ -814,13 +814,13 @@ static void particle_batch_cache_ensure_procedural_strand_data( /* Strand Data */ cache->proc_strand_buf = GWN_vertbuf_create_with_format(&format_data); - GWN_vertbuf_data_alloc(cache->proc_strand_buf, cache->strands_count); + GWN_vertbuf_data_alloc(cache->proc_strand_buf, cache->strands_len); GWN_vertbuf_attr_get_raw_data(cache->proc_strand_buf, data_id, &data_step); /* UV layers */ for (int i = 0; i < cache->num_uv_layers; i++) { cache->proc_uv_buf[i] = GWN_vertbuf_create_with_format(&format_uv); - GWN_vertbuf_data_alloc(cache->proc_uv_buf[i], cache->strands_count); + GWN_vertbuf_data_alloc(cache->proc_uv_buf[i], cache->strands_len); GWN_vertbuf_attr_get_raw_data(cache->proc_uv_buf[i], uv_id, &uv_step[i]); const char *name = CustomData_get_layer_name(&psmd->mesh_final->ldata, CD_MLOOPUV, i); @@ -836,7 +836,7 @@ static void particle_batch_cache_ensure_procedural_strand_data( /* Vertex colors */ for (int i = 0; i < cache->num_col_layers; i++) { cache->proc_col_buf[i] = GWN_vertbuf_create_with_format(&format_col); - GWN_vertbuf_data_alloc(cache->proc_col_buf[i], cache->strands_count); + GWN_vertbuf_data_alloc(cache->proc_col_buf[i], cache->strands_len); GWN_vertbuf_attr_get_raw_data(cache->proc_col_buf[i], col_id, &col_step[i]); const char *name = CustomData_get_layer_name(&psmd->mesh_final->ldata, CD_MLOOPCOL, i); @@ -942,7 +942,7 @@ static void particle_batch_cache_ensure_procedural_indices( int verts_per_hair = cache->final[subdiv].strands_res * thickness_res; /* +1 for primitive restart */ - int element_count = (verts_per_hair + 1) * cache->strands_count; + int element_count = (verts_per_hair + 1) * cache->strands_len; Gwn_PrimType prim_type = (thickness_res == 1) ? GWN_PRIM_LINE_STRIP : GWN_PRIM_TRI_STRIP; static Gwn_VertFormat format = { 0 }; @@ -997,7 +997,7 @@ static void particle_batch_cache_ensure_procedural_pos( uint pos_id = GWN_vertformat_attr_add(&format, "posTime", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); cache->proc_point_buf = GWN_vertbuf_create_with_format(&format); - GWN_vertbuf_data_alloc(cache->proc_point_buf, cache->point_count); + GWN_vertbuf_data_alloc(cache->proc_point_buf, cache->point_len); Gwn_VertBufRaw pos_step; GWN_vertbuf_attr_get_raw_data(cache->proc_point_buf, pos_id, &pos_step); @@ -1109,13 +1109,13 @@ static void particle_batch_cache_ensure_pos_and_seg( } hair_cache->pos = GWN_vertbuf_create_with_format(&format); - GWN_vertbuf_data_alloc(hair_cache->pos, hair_cache->point_count); + GWN_vertbuf_data_alloc(hair_cache->pos, hair_cache->point_len); Gwn_IndexBufBuilder elb; GWN_indexbuf_init_ex( &elb, GWN_PRIM_LINE_STRIP, - hair_cache->elems_count, hair_cache->point_count, + hair_cache->elems_len, hair_cache->point_len, true); if (num_uv_layers || num_col_layers) { @@ -1196,7 +1196,7 @@ static void particle_batch_cache_ensure_pos( } static Gwn_VertFormat format = { 0 }; - static unsigned pos_id, rot_id, val_id; + static uint pos_id, rot_id, val_id; int i, curr_point; ParticleData *pa; ParticleKey state; @@ -1219,7 +1219,7 @@ static void particle_batch_cache_ensure_pos( GWN_VERTBUF_DISCARD_SAFE(point_cache->pos); - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* initialize vertex format */ pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); rot_id = GWN_vertformat_attr_add(&format, "rot", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); @@ -1392,11 +1392,11 @@ static void ensure_edit_inner_points_count( if (cache->edit_inner_pos != NULL) { return; } - cache->edit_inner_point_count = 0; + cache->edit_inner_point_len = 0; for (int point_index = 0; point_index < edit->totpoint; point_index++) { const PTCacheEditPoint *point = &edit->points[point_index]; BLI_assert(point->totkey >= 1); - cache->edit_inner_point_count += (point->totkey - 1); + cache->edit_inner_point_len += (point->totkey - 1); } } @@ -1420,18 +1420,18 @@ static void particle_batch_cache_ensure_edit_inner_pos( } static Gwn_VertFormat format = { 0 }; - static unsigned pos_id, color_id; + static uint pos_id, color_id; GWN_VERTBUF_DISCARD_SAFE(cache->edit_inner_pos); - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* initialize vertex format */ pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); color_id = GWN_vertformat_attr_add(&format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); } cache->edit_inner_pos = GWN_vertbuf_create_with_format(&format); - GWN_vertbuf_data_alloc(cache->edit_inner_pos, cache->edit_inner_point_count); + GWN_vertbuf_data_alloc(cache->edit_inner_pos, cache->edit_inner_point_len); float selected_color[4], normal_color[4]; edit_colors_get(edit, selected_color, normal_color); @@ -1479,7 +1479,7 @@ static void ensure_edit_tip_points_count( if (cache->edit_tip_pos != NULL) { return; } - cache->edit_tip_point_count = edit->totpoint; + cache->edit_tip_point_len = edit->totpoint; } static void particle_batch_cache_ensure_edit_tip_pos( @@ -1491,18 +1491,18 @@ static void particle_batch_cache_ensure_edit_tip_pos( } static Gwn_VertFormat format = { 0 }; - static unsigned pos_id, color_id; + static uint pos_id, color_id; GWN_VERTBUF_DISCARD_SAFE(cache->edit_tip_pos); - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { /* initialize vertex format */ pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); color_id = GWN_vertformat_attr_add(&format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); } cache->edit_tip_pos = GWN_vertbuf_create_with_format(&format); - GWN_vertbuf_data_alloc(cache->edit_tip_pos, cache->edit_tip_point_count); + GWN_vertbuf_data_alloc(cache->edit_tip_pos, cache->edit_tip_point_len); float selected_color[4], normal_color[4]; edit_colors_get(edit, selected_color, normal_color); diff --git a/source/blender/draw/intern/draw_hair.c b/source/blender/draw/intern/draw_hair.c index 8320ae55179..6ede573199f 100644 --- a/source/blender/draw/intern/draw_hair.c +++ b/source/blender/draw/intern/draw_hair.c @@ -137,14 +137,14 @@ static DRWShadingGroup *drw_shgroup_create_hair_procedural_ex( /* Transform Feedback subdiv. */ if (need_ft_update) { - int final_points_ct = hair_cache->final[subdiv].strands_res * hair_cache->strands_count; + int final_points_len = hair_cache->final[subdiv].strands_res * hair_cache->strands_len; GPUShader *tf_shader = hair_refine_shader_get(PART_REFINE_CATMULL_ROM); DRWShadingGroup *tf_shgrp = DRW_shgroup_transform_feedback_create(tf_shader, g_tf_pass, hair_cache->final[subdiv].proc_buf); DRW_shgroup_uniform_texture(tf_shgrp, "hairPointBuffer", hair_cache->point_tex); DRW_shgroup_uniform_texture(tf_shgrp, "hairStrandBuffer", hair_cache->strand_tex); DRW_shgroup_uniform_int(tf_shgrp, "hairStrandsRes", &hair_cache->final[subdiv].strands_res, 1); - DRW_shgroup_call_procedural_points_add(tf_shgrp, final_points_ct, NULL); + DRW_shgroup_call_procedural_points_add(tf_shgrp, final_points_len, NULL); } return shgrp; diff --git a/source/blender/draw/intern/draw_hair_private.h b/source/blender/draw/intern/draw_hair_private.h index 2e6c9a0d3c1..17acd7e6259 100644 --- a/source/blender/draw/intern/draw_hair_private.h +++ b/source/blender/draw/intern/draw_hair_private.h @@ -31,7 +31,7 @@ #define __DRAW_HAIR_PRIVATE_H__ #define MAX_LAYER_NAME_CT 3 /* u0123456789, u, a0123456789 */ -#define MAX_LAYER_NAME_LEN DECIMAL_DIGITS_BOUND(unsigned int) + 2 +#define MAX_LAYER_NAME_LEN DECIMAL_DIGITS_BOUND(uint) + 2 #define MAX_THICKRES 2 /* see eHairType */ #define MAX_HAIR_SUBDIV 4 /* see hair_subdiv rna */ @@ -76,9 +76,9 @@ typedef struct ParticleHairCache { ParticleHairFinalCache final[MAX_HAIR_SUBDIV]; - int strands_count; - int elems_count; - int point_count; + int strands_len; + int elems_len; + int point_len; } ParticleHairCache; bool particles_ensure_procedural_data( diff --git a/source/blender/draw/intern/draw_instance_data.c b/source/blender/draw/intern/draw_instance_data.c index 3e4f812af27..e322d4780d5 100644 --- a/source/blender/draw/intern/draw_instance_data.c +++ b/source/blender/draw/intern/draw_instance_data.c @@ -213,10 +213,10 @@ void DRW_instance_buffer_finish(DRWInstanceDataList *idatalist) for (int i = 0; i < batching->alloc_size; i++, bbuf++) { if (bbuf->shgroup != NULL) { realloc_size = i + 1; - uint vert_ct = DRW_shgroup_get_instance_count(bbuf->shgroup); - vert_ct += (vert_ct == 0) ? 1 : 0; /* Do not realloc to 0 size buffer */ - if (vert_ct + BUFFER_VERTS_CHUNK <= bbuf->vert->vertex_ct) { - uint size = vert_ct + BUFFER_VERTS_CHUNK - 1; + uint vert_len = DRW_shgroup_get_instance_count(bbuf->shgroup); + vert_len += (vert_len == 0) ? 1 : 0; /* Do not realloc to 0 size buffer */ + if (vert_len + BUFFER_VERTS_CHUNK <= bbuf->vert->vertex_len) { + uint size = vert_len + BUFFER_VERTS_CHUNK - 1; size = size - size % BUFFER_VERTS_CHUNK; GWN_vertbuf_data_resize(bbuf->vert, size); } @@ -245,10 +245,10 @@ void DRW_instance_buffer_finish(DRWInstanceDataList *idatalist) for (int i = 0; i < instancing->alloc_size; i++, ibuf++) { if (ibuf->shgroup != NULL) { realloc_size = i + 1; - uint vert_ct = DRW_shgroup_get_instance_count(ibuf->shgroup); - vert_ct += (vert_ct == 0) ? 1 : 0; /* Do not realloc to 0 size buffer */ - if (vert_ct + BUFFER_VERTS_CHUNK <= ibuf->vert->vertex_ct) { - uint size = vert_ct + BUFFER_VERTS_CHUNK - 1; + uint vert_len = DRW_shgroup_get_instance_count(ibuf->shgroup); + vert_len += (vert_len == 0) ? 1 : 0; /* Do not realloc to 0 size buffer */ + if (vert_len + BUFFER_VERTS_CHUNK <= ibuf->vert->vertex_len) { + uint size = vert_len + BUFFER_VERTS_CHUNK - 1; size = size - size % BUFFER_VERTS_CHUNK; GWN_vertbuf_data_resize(ibuf->vert, size); } diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 26e5365a6fd..30f7742fd35 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -1370,9 +1370,12 @@ void DRW_draw_render_loop_ex( drw_engines_cache_init(); drw_engines_world_update(scene); + const int object_type_exclude_viewport = v3d->object_type_exclude_viewport; DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN(depsgraph, ob) { - drw_engines_cache_populate(ob); + if ((object_type_exclude_viewport & (1 << ob->type)) == 0) { + drw_engines_cache_populate(ob); + } } DEG_OBJECT_ITER_FOR_RENDER_ENGINE_END; @@ -1645,12 +1648,17 @@ void DRW_render_object_iter( void *vedata, RenderEngine *engine, struct Depsgraph *depsgraph, void (*callback)(void *vedata, Object *ob, RenderEngine *engine, struct Depsgraph *depsgraph)) { + const DRWContextState *draw_ctx = DRW_context_state_get(); + DRW_hair_init(); + const int object_type_exclude_viewport = draw_ctx->v3d ? draw_ctx->v3d->object_type_exclude_viewport : 0; DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN(depsgraph, ob) { - DST.ob_state = NULL; - callback(vedata, ob, engine, depsgraph); + if ((object_type_exclude_viewport & (1 << ob->type)) == 0) { + DST.ob_state = NULL; + callback(vedata, ob, engine, depsgraph); + } } DEG_OBJECT_ITER_FOR_RENDER_ENGINE_END } @@ -1840,6 +1848,9 @@ void DRW_draw_select_loop( #endif } else { + const int object_type_exclude_select = ( + v3d->object_type_exclude_viewport | v3d->object_type_exclude_select + ); bool filter_exclude = false; DEG_OBJECT_ITER_BEGIN( depsgraph, ob, @@ -1847,8 +1858,9 @@ void DRW_draw_select_loop( DEG_ITER_OBJECT_FLAG_VISIBLE | DEG_ITER_OBJECT_FLAG_DUPLI) { - if ((ob->base_flag & BASE_SELECTABLE) != 0) { - + if ((ob->base_flag & BASE_SELECTABLE) && + (object_type_exclude_select & (1 << ob->type)) == 0) + { if (object_filter_fn != NULL) { if (ob->base_flag & BASE_FROMDUPLI) { /* pass (use previous filter_exclude value) */ @@ -2020,9 +2032,12 @@ void DRW_draw_depth_loop( drw_engines_cache_init(); drw_engines_world_update(scene); + const int object_type_exclude_viewport = v3d->object_type_exclude_viewport; DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN(depsgraph, ob) { - drw_engines_cache_populate(ob); + if ((object_type_exclude_viewport & (1 << ob->type)) == 0) { + drw_engines_cache_populate(ob); + } } DEG_OBJECT_ITER_FOR_RENDER_ENGINE_END; diff --git a/source/blender/draw/intern/draw_manager.h b/source/blender/draw/intern/draw_manager.h index 9954754990f..6eae3459c2b 100644 --- a/source/blender/draw/intern/draw_manager.h +++ b/source/blender/draw/intern/draw_manager.h @@ -106,8 +106,8 @@ typedef struct DRWCallState { DRWCallVisibilityFn *visibility_cb; void *user_data; - unsigned char flag; - unsigned char cache_id; /* Compared with DST.state_cache_id to see if matrices are still valid. */ + uchar flag; + uchar cache_id; /* Compared with DST.state_cache_id to see if matrices are still valid. */ uint16_t matflag; /* Which matrices to compute. */ /* Culling: Using Bounding Sphere for now for faster culling. * Not ideal for planes. */ @@ -308,7 +308,7 @@ typedef struct DRWManager { DRWInstanceData *object_instance_data[MAX_INSTANCE_DATA_SIZE]; /* State of the object being evaluated if already allocated. */ DRWCallState *ob_state; - unsigned char state_cache_id; /* Could be larger but 254 view changes is already a lot! */ + uchar state_cache_id; /* Could be larger but 254 view changes is already a lot! */ /* Rendering state */ GPUShader *shader; diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c index db4e16d362a..c259633982e 100644 --- a/source/blender/draw/intern/draw_manager_data.c +++ b/source/blender/draw/intern/draw_manager_data.c @@ -412,9 +412,9 @@ static void drw_shgroup_call_procedural_add_ex( BLI_LINKS_APPEND(&shgroup->calls, call); } -void DRW_shgroup_call_procedural_points_add(DRWShadingGroup *shgroup, uint point_count, float (*obmat)[4]) +void DRW_shgroup_call_procedural_points_add(DRWShadingGroup *shgroup, uint point_len, float (*obmat)[4]) { - drw_shgroup_call_procedural_add_ex(shgroup, GWN_PRIM_POINTS, point_count, obmat, NULL); + drw_shgroup_call_procedural_add_ex(shgroup, GWN_PRIM_POINTS, point_len, obmat, NULL); } void DRW_shgroup_call_procedural_lines_add(DRWShadingGroup *shgroup, uint line_count, float (*obmat)[4]) @@ -553,7 +553,7 @@ void DRW_shgroup_call_dynamic_add_array(DRWShadingGroup *shgroup, const void *at { #ifdef USE_GPU_SELECT if (G.f & G_PICKSEL) { - if (shgroup->instance_count == shgroup->inst_selectid->vertex_ct) { + if (shgroup->instance_count == shgroup->inst_selectid->vertex_len) { GWN_vertbuf_data_resize(shgroup->inst_selectid, shgroup->instance_count + 32); } GWN_vertbuf_attr_set(shgroup->inst_selectid, 0, shgroup->instance_count, &DST.select_id); @@ -564,7 +564,7 @@ void DRW_shgroup_call_dynamic_add_array(DRWShadingGroup *shgroup, const void *at UNUSED_VARS_NDEBUG(attr_len); for (int i = 0; i < attr_len; ++i) { - if (shgroup->instance_count == shgroup->instance_vbo->vertex_ct) { + if (shgroup->instance_count == shgroup->instance_vbo->vertex_len) { GWN_vertbuf_data_resize(shgroup->instance_vbo, shgroup->instance_count + 32); } GWN_vertbuf_attr_set(shgroup->instance_vbo, i, shgroup->instance_count, attr[i]); @@ -651,7 +651,7 @@ static void drw_shgroup_instance_init( shgroup->instance_geom = batch; #ifndef NDEBUG - shgroup->attribs_count = format->attrib_ct; + shgroup->attribs_count = format->attr_len; #endif DRW_instancing_buffer_request(DST.idatalist, format, batch, shgroup, @@ -662,7 +662,7 @@ static void drw_shgroup_instance_init( /* Not actually used for rendering but alloced in one chunk. * Plus we don't have to care about ownership. */ static Gwn_VertFormat inst_select_format = {0}; - if (inst_select_format.attrib_ct == 0) { + if (inst_select_format.attr_len == 0) { GWN_vertformat_attr_add(&inst_select_format, "selectId", GWN_COMP_I32, 1, GWN_FETCH_INT); } Gwn_Batch *batch_dummy; /* Not used */ @@ -679,7 +679,7 @@ static void drw_shgroup_batching_init( drw_shgroup_init(shgroup, shader); #ifndef NDEBUG - shgroup->attribs_count = (format != NULL) ? format->attrib_ct : 0; + shgroup->attribs_count = (format != NULL) ? format->attr_len : 0; #endif BLI_assert(format != NULL); @@ -698,7 +698,7 @@ static void drw_shgroup_batching_init( if (G.f & G_PICKSEL) { /* Not actually used for rendering but alloced in one chunk. */ static Gwn_VertFormat inst_select_format = {0}; - if (inst_select_format.attrib_ct == 0) { + if (inst_select_format.attr_len == 0) { GWN_vertformat_attr_add(&inst_select_format, "selectId", GWN_COMP_I32, 1, GWN_FETCH_INT); } Gwn_Batch *batch; /* Not used */ diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index 03692fd9475..5957643d090 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -419,10 +419,10 @@ void DRW_state_invert_facing(void) * and if the shaders have support for it (see usage of gl_ClipDistance). * Be sure to call DRW_state_clip_planes_reset() after you finish drawing. **/ -void DRW_state_clip_planes_count_set(uint plane_ct) +void DRW_state_clip_planes_count_set(uint plane_len) { - BLI_assert(plane_ct <= MAX_CLIP_PLANES); - DST.num_clip_planes = plane_ct; + BLI_assert(plane_len <= MAX_CLIP_PLANES); + DST.num_clip_planes = plane_len; } void DRW_state_clip_planes_reset(void) diff --git a/source/blender/draw/intern/draw_manager_text.c b/source/blender/draw/intern/draw_manager_text.c index 1f385b958b8..977374a00c5 100644 --- a/source/blender/draw/intern/draw_manager_text.c +++ b/source/blender/draw/intern/draw_manager_text.c @@ -46,7 +46,7 @@ typedef struct ViewCachedString { struct ViewCachedString *next, *prev; float vec[3]; union { - unsigned char ub[4]; + uchar ub[4]; int pack; } col; short sco[2]; @@ -79,7 +79,7 @@ void DRW_text_cache_add( const float co[3], const char *str, const int str_len, short xoffs, short flag, - const unsigned char col[4]) + const uchar col[4]) { int alloc_len; ViewCachedString *vos; diff --git a/source/blender/draw/intern/draw_manager_text.h b/source/blender/draw/intern/draw_manager_text.h index a675a200924..14c33be4cf8 100644 --- a/source/blender/draw/intern/draw_manager_text.h +++ b/source/blender/draw/intern/draw_manager_text.h @@ -34,7 +34,7 @@ void DRW_text_cache_add( const float co[3], const char *str, const int str_len, short xoffs, short flag, - const unsigned char col[4]); + const uchar col[4]); void DRW_text_cache_draw(struct DRWTextStore *dt, struct ARegion *ar); diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c index 347932619b9..59ae8a918f9 100644 --- a/source/blender/draw/intern/draw_view.c +++ b/source/blender/draw/intern/draw_view.c @@ -79,7 +79,7 @@ void DRW_draw_region_info(void) /* ************************* Grid ************************** */ -static void gridline_range(double x0, double dx, double max, int *r_first, int *r_count) +static void gridline_range(double x0, double dx, double max, int *r_first, int *r_len) { /* determine range of gridlines that appear in this Area -- similar calc but separate ranges for x & y * x0 is gridline 0, the axis in screen space @@ -90,11 +90,11 @@ static void gridline_range(double x0, double dx, double max, int *r_first, int * if (first <= last) { *r_first = first; - *r_count = last - first + 1; + *r_len = last - first + 1; } else { *r_first = 0; - *r_count = 0; + *r_len = 0; } } @@ -104,19 +104,19 @@ static int gridline_count(ARegion *ar, double x0, double y0, double dx) * dx is the frequency, shared by x & y directions * pass in dx of smallest (highest precision) grid we want to draw */ - int first, x_ct, y_ct; + int first, x_len, y_len; - gridline_range(x0, dx, ar->winx, &first, &x_ct); - gridline_range(y0, dx, ar->winy, &first, &y_ct); + gridline_range(x0, dx, ar->winx, &first, &x_len); + gridline_range(y0, dx, ar->winy, &first, &y_len); - int total_ct = x_ct + y_ct; + int total_len = x_len + y_len; - return total_ct; + return total_len; } static bool drawgrid_draw( ARegion *ar, double x0, double y0, double dx, int skip_mod, - unsigned pos, unsigned col, GLubyte col_value[3]) + uint pos, uint col, GLubyte col_value[3]) { /* skip every skip_mod lines relative to each axis; they will be overlaid by another drawgrid_draw * always skip exact x0 & y0 axes; they will be drawn later in color @@ -129,7 +129,7 @@ static bool drawgrid_draw( const float y_max = (float)ar->winy; int first, ct; - int x_ct = 0, y_ct = 0; /* count of lines actually drawn */ + int x_len = 0, y_len = 0; /* count of lines actually drawn */ int lines_skipped_for_next_unit = 0; /* draw vertical lines */ @@ -143,13 +143,13 @@ static bool drawgrid_draw( continue; } - if (x_ct == 0) + if (x_len == 0) immAttrib3ub(col, col_value[0], col_value[1], col_value[2]); float x = (float)(x0 + i * dx); immVertex2f(pos, x, 0.0f); immVertex2f(pos, x, y_max); - ++x_ct; + ++x_len; } /* draw horizontal lines */ @@ -163,13 +163,13 @@ static bool drawgrid_draw( continue; } - if (x_ct + y_ct == 0) + if (x_len + y_len == 0) immAttrib3ub(col, col_value[0], col_value[1], col_value[2]); float y = (float)(y0 + i * dx); immVertex2f(pos, 0.0f, y); immVertex2f(pos, x_max, y); - ++y_ct; + ++y_len; } return lines_skipped_for_next_unit > 0; @@ -220,7 +220,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char ** immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); - unsigned char col[3], col2[3]; + uchar col[3], col2[3]; UI_GetThemeColor3ubv(TH_GRID, col); if (unit->system) { @@ -249,11 +249,11 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char ** *grid_unit = bUnit_GetNameDisplay(usys, i); rv3d->gridview = (float)((scalar * (double)v3d->grid) / (double)unit->scale_length); - int gridline_ct = gridline_count(ar, x, y, dx_scalar); - if (gridline_ct == 0) + int gridline_len = gridline_count(ar, x, y, dx_scalar); + if (gridline_len == 0) goto drawgrid_cleanup; /* nothing to draw */ - immBegin(GWN_PRIM_LINES, gridline_ct * 2); + immBegin(GWN_PRIM_LINES, gridline_len * 2); } float blend_fac = 1.0f - ((GRID_MIN_PX_F * 2.0f) / (float)dx_scalar); @@ -302,11 +302,11 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char ** } } - int gridline_ct = gridline_count(ar, x, y, dx); - if (gridline_ct == 0) + int gridline_len = gridline_count(ar, x, y, dx); + if (gridline_len == 0) goto drawgrid_cleanup; /* nothing to draw */ - immBegin(GWN_PRIM_LINES, gridline_ct * 2); + immBegin(GWN_PRIM_LINES, gridline_len * 2); if (grids_to_draw == 2) { UI_GetThemeColorBlend3ubv(TH_HIGH_GRAD, TH_GRID, dx / (GRID_MIN_PX_D * 6.0), col2); @@ -369,17 +369,17 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit) bool show_axis_y = (v3d->gridflag & V3D_SHOW_Y) != 0; bool show_axis_z = (v3d->gridflag & V3D_SHOW_Z) != 0; - unsigned char col_grid[3], col_axis[3]; + uchar col_grid[3], col_axis[3]; glLineWidth(1.0f); UI_GetThemeColor3ubv(TH_GRID, col_grid); if (show_floor) { - const unsigned vertex_ct = 2 * (gridlines * 4 + 2); + const uint vertex_len = 2 * (gridlines * 4 + 2); const int sublines = v3d->gridsubdiv; - unsigned char col_bg[3], col_grid_emphasise[3], col_grid_light[3]; + uchar col_bg[3], col_grid_emphasise[3], col_grid_light[3]; Gwn_VertFormat *format = immVertexFormat(); uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); @@ -387,7 +387,7 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit) immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR); - immBegin(GWN_PRIM_LINES, vertex_ct); + immBegin(GWN_PRIM_LINES, vertex_len); /* draw normal grid lines */ UI_GetColorPtrShade3ubv(col_grid, col_grid_light, 10); @@ -583,9 +583,9 @@ void DRW_draw_background(void) glDisable(GL_DEPTH_TEST); Gwn_VertFormat *format = immVertexFormat(); - unsigned pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); - unsigned char col_hi[3], col_lo[3]; + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); + uchar col_hi[3], col_lo[3]; gpuPushMatrix(); gpuLoadIdentity(); diff --git a/source/blender/draw/modes/edit_mesh_mode_text.c b/source/blender/draw/modes/edit_mesh_mode_text.c index def96e79eba..56a015d0e6b 100644 --- a/source/blender/draw/modes/edit_mesh_mode_text.c +++ b/source/blender/draw/modes/edit_mesh_mode_text.c @@ -63,7 +63,7 @@ void DRW_edit_mesh_mode_text_measure_stats( char numstr[32]; /* Stores the measurement display text here */ size_t numstr_len; const char *conv_float; /* Use a float conversion matching the grid size */ - unsigned char col[4] = {0, 0, 0, 255}; /* color of the text to draw */ + uchar col[4] = {0, 0, 0, 255}; /* color of the text to draw */ float area; /* area of the face */ float grid = unit->system ? unit->scale_length : v3d->grid; const bool do_split = (unit->flag & USER_UNIT_OPT_SPLIT) != 0; diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index 332c480aa89..2ac16906102 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -2129,10 +2129,6 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) return; } - if (v3d->overlay.object_type_exclude & (1 << ob->type)) { - return; - } - bool do_outlines = (draw_ctx->v3d->flag & V3D_SELECT_OUTLINE) && ((ob->base_flag & BASE_SELECTED) != 0); bool show_relations = ((draw_ctx->v3d->flag & V3D_HIDE_HELPLINES) == 0); @@ -2278,7 +2274,7 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) if ((ob->dtx & OB_DRAWNAME) && DRW_state_show_text()) { struct DRWTextStore *dt = DRW_text_cache_ensure(); - unsigned char color[4]; + uchar color[4]; UI_GetThemeColor4ubv(theme_id, color); DRW_text_cache_add( diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 6bd333294c5..c70790e0550 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -146,7 +146,7 @@ static void acf_generic_dataexpand_backdrop(bAnimContext *ac, bAnimListElem *ale short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0; float color[3]; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); /* set backdrop drawing color */ acf->get_backdrop_color(ac, ale, color); @@ -235,7 +235,7 @@ static void acf_generic_channel_backdrop(bAnimContext *ac, bAnimListElem *ale, f short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0; float color[3]; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); /* set backdrop drawing color */ acf->get_backdrop_color(ac, ale, color); @@ -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 */ @@ -3868,7 +3868,7 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float /* for F-Curves, draw color-preview of curve behind checkbox */ if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE)) { FCurve *fcu = (FCurve *)ale->data; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -3924,7 +3924,7 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float /* draw red underline if channel is disabled */ if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE) && (ale->flag & FCURVE_DISABLED)) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -3952,7 +3952,7 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float short draw_sliders = 0; float ymin_ofs = 0.0f; float color[3]; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 953898a0586..51ba7d9c269 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -142,7 +142,7 @@ void ANIM_draw_cfra(const bContext *C, View2D *v2d, short flag) GPU_line_width((flag & DRAWCFRA_WIDE) ? 3.0 : 2.0); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -171,7 +171,7 @@ void ANIM_draw_previewrange(const bContext *C, View2D *v2d, int end_frame_width) GPU_blend(true); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShadeAlpha(TH_ANIM_ACTIVE, -25, -30); @@ -204,7 +204,7 @@ void ANIM_draw_framerange(Scene *scene, View2D *v2d) GPU_blend(true); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShadeAlpha(TH_BACK, -25, -100); diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 5f03704f9f5..c5f7782dcee 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -486,7 +486,7 @@ void ED_markers_draw(const bContext *C, int flag) v2d = UI_view2d_fromcontext(C); if (flag & DRAW_MARKERS_MARGIN) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); const unsigned char shade[4] = {0, 0, 0, 16}; diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index fcccf07190b..78ce24db503 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -585,20 +585,20 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa copy_v4_v4(unsel_mhcol, unsel_color); unsel_mhcol[3] *= 0.8f; - unsigned int block_ct = 0; + uint block_len = 0; for (ActKeyBlock *ab = blocks->first; ab; ab = ab->next) { if (actkeyblock_is_valid(ab, keys)) { - block_ct++; + block_len++; } } - if (block_ct > 0) { + if (block_len > 0) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); + uint pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); - immBegin(GWN_PRIM_TRIS, 6 * block_ct); + immBegin(GWN_PRIM_TRIS, 6 * block_len); for (ActKeyBlock *ab = blocks->first; ab; ab = ab->next) { if (actkeyblock_is_valid(ab, keys)) { if (ab->flag & ACTKEYBLOCK_FLAG_MOVING_HOLD) { @@ -622,25 +622,25 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa if (keys) { /* count keys */ - unsigned int key_ct = 0; + uint key_len = 0; for (ActKeyColumn *ak = keys->first; ak; ak = ak->next) { /* optimization: if keyframe doesn't appear within 5 units (screenspace) in visible area, don't draw * - this might give some improvements, since we current have to flip between view/region matrices */ if (IN_RANGE_INCL(ak->cfra, v2d->cur.xmin, v2d->cur.xmax)) - key_ct++; + key_len++; } - if (key_ct > 0) { + if (key_len > 0) { /* draw keys */ Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int size_id = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); - unsigned int color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); - unsigned int outline_color_id = GWN_vertformat_attr_add(format, "outlineColor", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint size_id = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); + uint color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint outline_color_id = GWN_vertformat_attr_add(format, "outlineColor", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND); GPU_enable_program_point_size(); - immBegin(GWN_PRIM_POINTS, key_ct); + immBegin(GWN_PRIM_POINTS, key_len); for (ActKeyColumn *ak = keys->first; ak; ak = ak->next) { if (IN_RANGE_INCL(ak->cfra, v2d->cur.xmin, v2d->cur.xmax)) { diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c index 5e3fec93340..ce72a5ffc9f 100644 --- a/source/blender/editors/curve/editcurve_paint.c +++ b/source/blender/editors/curve/editcurve_paint.c @@ -430,7 +430,7 @@ static void curve_draw_stroke_3d(const struct bContext *UNUSED(C), ARegion *UNUS { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); GPU_depth_test(false); diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index a79a5052eb8..ec4310213ef 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -151,8 +151,8 @@ static void gp_draw_stroke_buffer_fill(const tGPspoint *points, int totpoints, f /* draw triangulation data */ if (tot_triangles > 0) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); @@ -209,8 +209,8 @@ static void gp_draw_stroke_buffer(const tGPspoint *points, int totpoints, short } Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); const tGPspoint *pt = points; @@ -320,9 +320,9 @@ static void gp_draw_stroke_volumetric_buffer(const tGPspoint *points, int totpoi return; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int size = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint size = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR); GPU_enable_program_point_size(); @@ -347,9 +347,9 @@ static void gp_draw_stroke_volumetric_2d(const bGPDspoint *points, int totpoints const float diff_mat[4][4], const float ink[4]) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int size = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint size = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR); GPU_enable_program_point_size(); @@ -380,9 +380,9 @@ static void gp_draw_stroke_volumetric_3d( const float ink[4]) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); - unsigned int size = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint size = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR); GPU_enable_program_point_size(); @@ -517,7 +517,7 @@ static void gp_draw_stroke_fill( } BLI_assert(gps->tot_triangles >= 1); - unsigned int pos; + uint pos; if (gps->flag & GP_STROKE_3DSPACE) { pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); @@ -576,7 +576,7 @@ static void gp_draw_stroke_point( mul_v3_m4v3(fpt, diff_mat, &pt->x); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); if (sflag & GP_STROKE_3DSPACE) { immBindBuiltinProgram(GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA); @@ -618,8 +618,8 @@ static void gp_draw_stroke_3d(const bGPDspoint *points, int totpoints, short thi Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_3D_SMOOTH_COLOR); @@ -717,8 +717,8 @@ static void gp_draw_stroke_2d(const bGPDspoint *points, int totpoints, short thi float fpt[3]; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); immBegin(GWN_PRIM_TRI_STRIP, totpoints * 2 + 4); @@ -1151,9 +1151,9 @@ static void gp_draw_strokes_edit( selectColor[3] = alpha; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos; /* specified later */ - unsigned int size = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos; /* specified later */ + uint size = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); if (gps->flag & GP_STROKE_3DSPACE) { pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index 75e4c510bcf..0ddd8700c09 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -986,7 +986,7 @@ static void gp_brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customda if (brush) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); GPU_line_smooth(true); diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h index 4c67a306e75..a63855439f4 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) @@ -1032,3 +1032,55 @@ DEF_VICO(COLORSET_17_VEC) DEF_VICO(COLORSET_18_VEC) DEF_VICO(COLORSET_19_VEC) DEF_VICO(COLORSET_20_VEC) + +/* Events */ +DEF_ICON(EVENT_A) +DEF_ICON(EVENT_B) +DEF_ICON(EVENT_C) +DEF_ICON(EVENT_D) +DEF_ICON(EVENT_E) +DEF_ICON(EVENT_F) +DEF_ICON(EVENT_G) +DEF_ICON(EVENT_H) +DEF_ICON(EVENT_I) +DEF_ICON(EVENT_J) +DEF_ICON(EVENT_K) +DEF_ICON(EVENT_L) +DEF_ICON(EVENT_M) +DEF_ICON(EVENT_N) +DEF_ICON(EVENT_O) +DEF_ICON(EVENT_P) +DEF_ICON(EVENT_Q) +DEF_ICON(EVENT_R) +DEF_ICON(EVENT_S) +DEF_ICON(EVENT_T) +DEF_ICON(EVENT_U) +DEF_ICON(EVENT_V) +DEF_ICON(EVENT_W) +DEF_ICON(EVENT_X) +DEF_ICON(EVENT_Y) +DEF_ICON(EVENT_Z) +DEF_ICON(EVENT_SHIFT) +DEF_ICON(EVENT_CTRL) +DEF_ICON(EVENT_ALT) +DEF_ICON(EVENT_OS) +DEF_ICON(EVENT_F1) +DEF_ICON(EVENT_F2) +DEF_ICON(EVENT_F3) +DEF_ICON(EVENT_F4) +DEF_ICON(EVENT_F5) +DEF_ICON(EVENT_F6) +DEF_ICON(EVENT_F7) +DEF_ICON(EVENT_F8) +DEF_ICON(EVENT_F9) +DEF_ICON(EVENT_F10) +DEF_ICON(EVENT_F11) +DEF_ICON(EVENT_F12) +DEF_ICON(EVENT_ESC) +DEF_ICON(EVENT_TAB) +DEF_ICON(EVENT_PAGEUP) +DEF_ICON(EVENT_PAGEDOWN) +DEF_ICON(EVENT_HOME) +DEF_ICON(EVENT_END) +DEF_ICON(EVENT_RETURN) +/* add as needed. */ diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 8a758d01809..d23748356fa 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -76,6 +76,7 @@ struct wmEvent; struct wmManipulator; struct wmMsgBus; struct wmKeyMap; +struct wmKeyMapItem; typedef struct uiBut uiBut; typedef struct uiBlock uiBlock; @@ -554,7 +555,7 @@ void UI_but_drag_set_path(uiBut *but, const char *path, const bool use_free); void UI_but_drag_set_name(uiBut *but, const char *name); void UI_but_drag_set_value(uiBut *but); void UI_but_drag_set_image( - uiBut *but, const char *path, int icon, struct ImBuf *ima, float scale, const bool use_free); + uiBut *but, const char *path, int icon, struct ImBuf *ima, float scale, const bool use_free); bool UI_but_active_drop_name(struct bContext *C); bool UI_but_active_drop_color(struct bContext *C); @@ -592,13 +593,14 @@ bool UI_but_online_manual_id_from_active( * - R: RNA * - O: operator */ -uiBut *uiDefBut(uiBlock *block, - int type, int retval, const char *str, - int x1, int y1, - short x2, short y2, - void *poin, - float min, float max, - float a1, float a2, const char *tip); +uiBut *uiDefBut( + uiBlock *block, + int type, int retval, const char *str, + int x1, int y1, + short x2, short y2, + void *poin, + float min, float max, + float a1, float a2, const char *tip); uiBut *uiDefButF(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefButBitF(uiBlock *block, int type, int bit, int retval, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefButI(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip); @@ -612,13 +614,14 @@ uiBut *uiDefButR_prop(uiBlock *block, int type, int retval, const char *str, int uiBut *uiDefButO(uiBlock *block, int type, const char *opname, int opcontext, const char *str, int x, int y, short width, short height, const char *tip); uiBut *uiDefButO_ptr(uiBlock *block, int type, struct wmOperatorType *ot, int opcontext, const char *str, int x, int y, short width, short height, const char *tip); -uiBut *uiDefIconBut(uiBlock *block, - int type, int retval, int icon, - int x1, int y1, - short x2, short y2, - void *poin, - float min, float max, - float a1, float a2, const char *tip); +uiBut *uiDefIconBut( + uiBlock *block, + int type, int retval, int icon, + int x1, int y1, + short x2, short y2, + void *poin, + float min, float max, + float a1, float a2, const char *tip); uiBut *uiDefIconButF(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefIconButBitF(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefIconButI(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip); @@ -632,13 +635,14 @@ uiBut *uiDefIconButR_prop(uiBlock *block, int type, int retval, int icon, int x, uiBut *uiDefIconButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, int x, int y, short width, short height, const char *tip); uiBut *uiDefIconButO_ptr(uiBlock *block, int type, struct wmOperatorType *ot, int opcontext, int icon, int x, int y, short width, short height, const char *tip); -uiBut *uiDefIconTextBut(uiBlock *block, - int type, int retval, int icon, const char *str, - int x1, int y1, - short x2, short y2, - void *poin, - float min, float max, - float a1, float a2, const char *tip); +uiBut *uiDefIconTextBut( + uiBlock *block, + int type, int retval, int icon, const char *str, + int x1, int y1, + short x2, short y2, + void *poin, + float min, float max, + float a1, float a2, const char *tip); uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip); @@ -723,6 +727,9 @@ enum { int UI_icon_from_id(struct ID *id); int UI_icon_from_report_type(int type); +int UI_icon_from_event_type(short event_type, short event_value); +int UI_icon_from_keymap_item(const struct wmKeyMapItem *kmi, int r_icon_mod[4]); + uiBut *uiDefPulldownBut(uiBlock *block, uiBlockCreateFunc func, void *arg, const char *str, int x, int y, short width, short height, const char *tip); uiBut *uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, const char *str, int x, int y, short width, short height, const char *tip); uiBut *uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, const char *str, int x, int y, short width, short height, const char *tip); @@ -738,9 +745,10 @@ uiBut *uiDefKeyevtButS(uiBlock *block, int retval, const char *str, int x, int y uiBut *uiDefHotKeyevtButS(uiBlock *block, int retval, const char *str, int x, int y, short width, short height, short *keypoin, short *modkeypoin, const char *tip); uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxlen, int x, int y, short width, short height, float a1, float a2, const char *tip); -uiBut *uiDefSearchButO_ptr(uiBlock *block, struct wmOperatorType *ot, struct IDProperty *properties, - void *arg, int retval, int icon, int maxlen, int x, int y, - short width, short height, float a1, float a2, const char *tip); +uiBut *uiDefSearchButO_ptr( + uiBlock *block, struct wmOperatorType *ot, struct IDProperty *properties, + void *arg, int retval, int icon, int maxlen, int x, int y, + short width, short height, float a1, float a2, const char *tip); /* For uiDefAutoButsRNA */ @@ -801,8 +809,9 @@ void UI_but_func_tooltip_set(uiBut *but, uiButToolTipFunc func, void *argN); void UI_but_tooltip_refresh(struct bContext *C, uiBut *but); void UI_but_tooltip_timer_remove(struct bContext *C, uiBut *but); -bool UI_textbutton_activate_rna(const struct bContext *C, struct ARegion *ar, - const void *rna_poin_data, const char *rna_prop_id); +bool UI_textbutton_activate_rna( + const struct bContext *C, struct ARegion *ar, + const void *rna_poin_data, const char *rna_prop_id); bool UI_textbutton_activate_but(const struct bContext *C, uiBut *but); void UI_but_focus_on_enter_event(struct wmWindow *win, uiBut *but); @@ -836,9 +845,10 @@ void UI_panels_end(const struct bContext *C, struct ARegion *ar, int *x, int *y) void UI_panels_draw(const struct bContext *C, struct ARegion *ar); struct Panel *UI_panel_find_by_type(struct ListBase *lb, struct PanelType *pt); -struct Panel *UI_panel_begin(struct ScrArea *sa, struct ARegion *ar, struct ListBase *lb, - uiBlock *block, struct PanelType *pt, struct Panel *pa, - bool *r_open); +struct Panel *UI_panel_begin( + struct ScrArea *sa, struct ARegion *ar, struct ListBase *lb, + uiBlock *block, struct PanelType *pt, struct Panel *pa, + bool *r_open); void UI_panel_end(uiBlock *block, int width, int height); void UI_panels_scale(struct ARegion *ar, float new_width); void UI_panel_label_offset(struct uiBlock *block, int *x, int *y); @@ -998,8 +1008,9 @@ uiLayout *uiLayoutColumnFlow(uiLayout *layout, int number, bool align); uiLayout *uiLayoutGridFlow( uiLayout *layout, bool row_major, int columns_len, bool even_columns, bool even_rows, bool align); uiLayout *uiLayoutBox(uiLayout *layout); -uiLayout *uiLayoutListBox(uiLayout *layout, struct uiList *ui_list, struct PointerRNA *ptr, struct PropertyRNA *prop, - struct PointerRNA *actptr, struct PropertyRNA *actprop); +uiLayout *uiLayoutListBox( + uiLayout *layout, struct uiList *ui_list, struct PointerRNA *ptr, struct PropertyRNA *prop, + struct PointerRNA *actptr, struct PropertyRNA *actprop); uiLayout *uiLayoutAbsolute(uiLayout *layout, bool align); uiLayout *uiLayoutSplit(uiLayout *layout, float percentage, bool align); uiLayout *uiLayoutOverlap(uiLayout *layout); @@ -1022,8 +1033,9 @@ void uiTemplateIDTabs( PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop, int filter); -void uiTemplateAnyID(uiLayout *layout, struct PointerRNA *ptr, const char *propname, - const char *proptypename, const char *text); +void uiTemplateAnyID( + uiLayout *layout, struct PointerRNA *ptr, const char *propname, + const char *proptypename, const char *text); void uiTemplateSearch( uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, @@ -1035,27 +1047,31 @@ void uiTemplateSearchPreview( struct PointerRNA *searchptr, const char *searchpropname, const char *newop, const char *unlinkop, const int rows, const int cols); -void uiTemplatePathBuilder(uiLayout *layout, struct PointerRNA *ptr, const char *propname, - struct PointerRNA *root_ptr, const char *text); +void uiTemplatePathBuilder( + uiLayout *layout, struct PointerRNA *ptr, const char *propname, + struct PointerRNA *root_ptr, const char *text); uiLayout *uiTemplateModifier(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr); void uiTemplateOperatorRedoProperties(uiLayout *layout, const struct bContext *C); uiLayout *uiTemplateConstraint(uiLayout *layout, struct PointerRNA *ptr); -void uiTemplatePreview(uiLayout *layout, struct bContext *C, struct ID *id, bool show_buttons, struct ID *parent, - struct MTex *slot, const char *preview_id); +void uiTemplatePreview( + uiLayout *layout, struct bContext *C, struct ID *id, bool show_buttons, struct ID *parent, + struct MTex *slot, const char *preview_id); void uiTemplateColorRamp(uiLayout *layout, struct PointerRNA *ptr, const char *propname, bool expand); void uiTemplateIcon(uiLayout *layout, int icon_value, float icon_scale); void uiTemplateIconView(uiLayout *layout, struct PointerRNA *ptr, const char *propname, bool show_labels, float icon_scale); void uiTemplateHistogram(uiLayout *layout, struct PointerRNA *ptr, const char *propname); void uiTemplateWaveform(uiLayout *layout, struct PointerRNA *ptr, const char *propname); void uiTemplateVectorscope(uiLayout *layout, struct PointerRNA *ptr, const char *propname); -void uiTemplateCurveMapping(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int type, - bool levels, bool brush, bool neg_slope); +void uiTemplateCurveMapping( + uiLayout *layout, struct PointerRNA *ptr, const char *propname, int type, + bool levels, bool brush, bool neg_slope); void uiTemplateColorPicker(uiLayout *layout, struct PointerRNA *ptr, const char *propname, bool value_slider, bool lock, bool lock_luminosity, bool cubic); void uiTemplatePalette(uiLayout *layout, struct PointerRNA *ptr, const char *propname, bool color); -void uiTemplateLayers(uiLayout *layout, struct PointerRNA *ptr, const char *propname, - PointerRNA *used_ptr, const char *used_propname, int active_layer); +void uiTemplateLayers( + uiLayout *layout, struct PointerRNA *ptr, const char *propname, + PointerRNA *used_ptr, const char *used_propname, int active_layer); void uiTemplateImage(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, struct PointerRNA *userptr, bool compact, bool multiview); void uiTemplateImageSettings(uiLayout *layout, struct PointerRNA *imfptr, bool color_management); void uiTemplateImageStereo3d(uiLayout *layout, struct PointerRNA *stereo3d_format_ptr); @@ -1082,10 +1098,11 @@ void uiTemplateCacheFile(uiLayout *layout, struct bContext *C, struct PointerRNA /* Default UIList class name, keep in sync with its declaration in bl_ui/__init__.py */ #define UI_UL_DEFAULT_CLASS_NAME "UI_UL_list" -void uiTemplateList(uiLayout *layout, struct bContext *C, const char *listtype_name, const char *list_id, - struct PointerRNA *dataptr, const char *propname, struct PointerRNA *active_dataptr, - const char *active_propname, const char *item_dyntip_propname, - int rows, int maxrows, int layout_type, int columns); +void uiTemplateList( + uiLayout *layout, struct bContext *C, const char *listtype_name, const char *list_id, + struct PointerRNA *dataptr, const char *propname, struct PointerRNA *active_dataptr, + const char *active_propname, const char *item_dyntip_propname, + int rows, int maxrows, int layout_type, int columns); void uiTemplateNodeLink(uiLayout *layout, struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *input); void uiTemplateNodeView(uiLayout *layout, struct bContext *C, struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *input); void uiTemplateTextureUser(uiLayout *layout, struct bContext *C); @@ -1201,14 +1218,18 @@ uiBut *UI_region_active_but_get(struct ARegion *ar); /* Styled text draw */ void UI_fontstyle_set(const struct uiFontStyle *fs); -void UI_fontstyle_draw_ex(const struct uiFontStyle *fs, const struct rcti *rect, const char *str, - const unsigned char col[4], size_t len, float *r_xofs, float *r_yofs); -void UI_fontstyle_draw(const struct uiFontStyle *fs, const struct rcti *rect, const char *str, - const unsigned char col[4]); -void UI_fontstyle_draw_rotated(const struct uiFontStyle *fs, const struct rcti *rect, const char *str, - const unsigned char col[4]); -void UI_fontstyle_draw_simple(const struct uiFontStyle *fs, float x, float y, const char *str, - const unsigned char col[4]); +void UI_fontstyle_draw_ex( + const struct uiFontStyle *fs, const struct rcti *rect, const char *str, + const unsigned char col[4], size_t len, float *r_xofs, float *r_yofs); +void UI_fontstyle_draw( + const struct uiFontStyle *fs, const struct rcti *rect, const char *str, + const unsigned char col[4]); +void UI_fontstyle_draw_rotated( + const struct uiFontStyle *fs, const struct rcti *rect, const char *str, + const unsigned char col[4]); +void UI_fontstyle_draw_simple( + const struct uiFontStyle *fs, float x, float y, const char *str, + const unsigned char col[4]); void UI_fontstyle_draw_simple_backdrop( const struct uiFontStyle *fs, float x, float y, const char *str, const float col_fg[4], const float col_bg[4]); diff --git a/source/blender/editors/interface/CMakeLists.txt b/source/blender/editors/interface/CMakeLists.txt index ee18f956cac..cf172441be1 100644 --- a/source/blender/editors/interface/CMakeLists.txt +++ b/source/blender/editors/interface/CMakeLists.txt @@ -54,6 +54,7 @@ set(SRC interface_eyedropper_driver.c interface_handlers.c interface_icons.c + interface_icons_event.c interface_layout.c interface_ops.c interface_panel.c diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 427f5621177..20361bde16f 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -3454,6 +3454,12 @@ static void ui_def_but_rna__menu(bContext *UNUSED(C), uiLayout *layout, void *bu block->flag |= UI_BLOCK_IS_FLIP; } +static void ui_but_submenu_enable(uiBlock *block, uiBut *but) +{ + but->flag |= UI_BUT_ICON_SUBMENU; + block->content_hints |= BLOCK_CONTAINS_SUBMENU_BUT; +} + /** * ui_def_but_rna_propname and ui_def_but_rna * both take the same args except for propname vs prop, this is done so we can @@ -3589,7 +3595,7 @@ static uiBut *ui_def_but_rna( } if ((type == UI_BTYPE_MENU) && (but->dt == UI_EMBOSS_PULLDOWN)) { - but->flag |= UI_BUT_ICON_SUBMENU; + ui_but_submenu_enable(block, but); } const char *info; @@ -4328,7 +4334,7 @@ uiBut *uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, in ui_def_but_icon(but, icon, UI_HAS_ICON); but->drawflag |= UI_BUT_ICON_LEFT; - but->flag |= UI_BUT_ICON_SUBMENU; + ui_but_submenu_enable(block, but); but->menu_create_func = func; ui_but_update(but); @@ -4360,7 +4366,7 @@ uiBut *uiDefIconTextBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, but->drawflag |= UI_BUT_ICON_LEFT; } but->flag |= UI_HAS_ICON; - but->flag |= UI_BUT_ICON_SUBMENU; + ui_but_submenu_enable(block, but); but->block_create_func = func; ui_but_update(but); diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index c336c48f62a..0a8a6d1f832 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -159,23 +159,23 @@ void UI_draw_roundbox_4fv(bool filled, float minx, float miny, float maxx, float int a; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); /* mult */ for (a = 0; a < 7; a++) { mul_v2_fl(vec[a], rad); } - unsigned int vert_ct = 0; - vert_ct += (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 9 : 1; - vert_ct += (roundboxtype & UI_CNR_TOP_RIGHT) ? 9 : 1; - vert_ct += (roundboxtype & UI_CNR_TOP_LEFT) ? 9 : 1; - vert_ct += (roundboxtype & UI_CNR_BOTTOM_LEFT) ? 9 : 1; + uint vert_len = 0; + vert_len += (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 9 : 1; + vert_len += (roundboxtype & UI_CNR_TOP_RIGHT) ? 9 : 1; + vert_len += (roundboxtype & UI_CNR_TOP_LEFT) ? 9 : 1; + vert_len += (roundboxtype & UI_CNR_BOTTOM_LEFT) ? 9 : 1; immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(col); - immBegin(filled ? GWN_PRIM_TRI_FAN : GWN_PRIM_LINE_LOOP, vert_ct); + immBegin(filled ? GWN_PRIM_TRI_FAN : GWN_PRIM_LINE_LOOP, vert_len); /* start with corner right-bottom */ if (roundboxtype & UI_CNR_BOTTOM_RIGHT) { immVertex2f(pos, maxx - rad, miny); @@ -280,8 +280,8 @@ void UI_draw_roundbox_shade_x( int a; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); @@ -432,8 +432,8 @@ void UI_draw_roundbox_shade_y( } Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); @@ -535,7 +535,7 @@ void UI_draw_text_underline(int pos_x, int pos_y, int len, int height, const flo int ofs_y = 4 * U.pixelsize; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(color); @@ -550,8 +550,8 @@ void UI_draw_text_underline(int pos_x, int pos_y, int len, int height, const flo void ui_draw_but_TAB_outline(const rcti *rect, float rad, unsigned char highlight[3], unsigned char highlight_fade[3]) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int col = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint col = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); /* add a 1px offset, looks nicer */ const int minx = rect->xmin + U.pixelsize, maxx = rect->xmax - U.pixelsize; const int miny = rect->ymin + U.pixelsize, maxy = rect->ymax - U.pixelsize; @@ -818,7 +818,7 @@ void ui_draw_but_HISTOGRAM(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UNUS (rect.ymax + 1) - (rect.ymin - 1)); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -869,7 +869,7 @@ void ui_draw_but_HISTOGRAM(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UNUS static void waveform_draw_one(float *waveform, int nbr, const float col[3]) { Gwn_VertFormat format = {0}; - unsigned int pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format); GWN_vertbuf_data_alloc(vbo, nbr); @@ -957,7 +957,7 @@ void ui_draw_but_WAVEFORM(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UNUSE GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -1215,7 +1215,7 @@ void ui_draw_but_VECTORSCOPE(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UN (rect.ymax + 1) - (rect.ymin - 1)); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -1404,7 +1404,7 @@ static void ui_draw_colorband_handle( void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti *rect) { struct ColorManagedDisplay *display = NULL; - unsigned int position, color; + uint pos_id, col_id; ColorBand *coba = (ColorBand *)(but->editcoba ? but->editcoba : but->poin); if (coba == NULL) return; @@ -1419,20 +1419,20 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti float y1 = rect->ymin; Gwn_VertFormat *format = immVertexFormat(); - position = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_CHECKER); /* Drawing the checkerboard. */ immUniform4f("color1", UI_ALPHA_CHECKER_DARK / 255.0f, UI_ALPHA_CHECKER_DARK / 255.0f, UI_ALPHA_CHECKER_DARK / 255.0f, 1.0f); immUniform4f("color2", UI_ALPHA_CHECKER_LIGHT / 255.0f, UI_ALPHA_CHECKER_LIGHT / 255.0f, UI_ALPHA_CHECKER_LIGHT / 255.0f, 1.0f); immUniform1i("size", 8); - immRectf(position, x1, y1, x1 + sizex, rect->ymax); + immRectf(pos_id, x1, y1, x1 + sizex, rect->ymax); immUnbindProgram(); /* New format */ format = immVertexFormat(); - position = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); + pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + col_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); /* layer: color ramp */ @@ -1455,9 +1455,9 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti v1[0] = v2[0] = x1 + a; - immAttrib4fv(color, colf); - immVertex2fv(position, v1); - immVertex2fv(position, v2); + immAttrib4fv(col_id, colf); + immVertex2fv(pos_id, v1); + immVertex2fv(pos_id, v2); } immEnd(); @@ -1474,9 +1474,9 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti v1[0] = v2[0] = x1 + a; - immAttrib4f(color, colf[0], colf[1], colf[2], 1.0f); - immVertex2fv(position, v1); - immVertex2fv(position, v2); + immAttrib4f(col_id, colf[0], colf[1], colf[2], 1.0f); + immVertex2fv(pos_id, v1); + immVertex2fv(pos_id, v2); } immEnd(); @@ -1486,27 +1486,27 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti /* New format */ format = immVertexFormat(); - position = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* layer: box outline */ immUniformColor4f(0.0f, 0.0f, 0.0f, 1.0f); - imm_draw_box_wire_2d(position, x1, y1, x1 + sizex, rect->ymax); + imm_draw_box_wire_2d(pos_id, x1, y1, x1 + sizex, rect->ymax); /* layer: box outline */ GPU_blend(true); immUniformColor4f(0.0f, 0.0f, 0.0f, 0.5f); immBegin(GWN_PRIM_LINES, 2); - immVertex2f(position, x1, y1); - immVertex2f(position, x1 + sizex, y1); + immVertex2f(pos_id, x1, y1); + immVertex2f(pos_id, x1 + sizex, y1); immEnd(); immUniformColor4f(1.0f, 1.0f, 1.0f, 0.25f); immBegin(GWN_PRIM_LINES, 2); - immVertex2f(position, x1, y1 - 1); - immVertex2f(position, x1 + sizex, y1 - 1); + immVertex2f(pos_id, x1, y1 - 1); + immVertex2f(pos_id, x1 + sizex, y1 - 1); immEnd(); GPU_blend(false); @@ -1515,7 +1515,7 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti for (int a = 0; a < coba->tot; a++, cbd++) { if (a != coba->cur) { float pos = x1 + cbd->pos * (sizex - 1) + 1; - ui_draw_colorband_handle(position, rect, pos, &cbd->r, display, false); + ui_draw_colorband_handle(pos_id, rect, pos, &cbd->r, display, false); } } @@ -1523,7 +1523,7 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti if (coba->tot != 0) { cbd = &coba->data[coba->cur]; float pos = x1 + cbd->pos * (sizex - 1) + 1; - ui_draw_colorband_handle(position, rect, pos, &cbd->r, display, true); + ui_draw_colorband_handle(pos_id, rect, pos, &cbd->r, display, true); } immUnbindProgram(); @@ -1568,7 +1568,7 @@ void ui_draw_but_UNITVEC(uiBut *but, uiWidgetColors *wcol, const rcti *rect) /* AA circle */ Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3ubv((unsigned char *)wcol->inner); @@ -1675,7 +1675,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, const rcti GPU_line_width(1.0f); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* backdrop */ @@ -1807,7 +1807,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, const rcti /* the points, use aspect to make them visible on edges */ format = immVertexFormat(); pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); + uint col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); cmp = cuma->curve; @@ -1926,8 +1926,8 @@ void ui_draw_but_TRACKPREVIEW(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *U BLI_rctf_size_y(&rect)); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); UI_GetThemeColor4fv(TH_SEL_MARKER, col_sel); @@ -2018,7 +2018,7 @@ void ui_draw_but_NODESOCKET(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol float y = 0.5f * (recti->ymin + recti->ymax); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ubv(but->col); @@ -2115,8 +2115,8 @@ void UI_draw_box_shadow(unsigned char alpha, float minx, float miny, float maxx, GPU_blend(true); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index c3246213d4e..9c5a4392f78 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -108,6 +108,7 @@ typedef void (*VectorDrawFunc)(int x, int y, int w, int h, float alpha); #define ICON_TYPE_BUFFER 3 #define ICON_TYPE_VECTOR 4 #define ICON_TYPE_GEOM 5 +#define ICON_TYPE_EVENT 6 /* draw keymap entries using custom renderer. */ typedef struct DrawInfo { int type; @@ -126,6 +127,14 @@ typedef struct DrawInfo { struct { int x, y, w, h; } texture; + struct { + /* Can be packed into a single int. */ + short event_type; + short event_value; + int icon; + /* Allow lookups. */ + struct DrawInfo *next; + } input; } data; } DrawInfo; @@ -241,7 +250,7 @@ static void vicon_small_tri_right_draw(int x, int y, int w, int UNUSED(h), float viconutil_set_point(pts[1], cx - d2, cy - d); viconutil_set_point(pts[2], cx + d2, cy); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4f(0.2f, 0.2f, 0.2f, alpha); @@ -272,10 +281,10 @@ static void vicon_keytype_draw_wrapper(int x, int y, int w, int h, float alpha, int yco = y + h / 2; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int size_id = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); - unsigned int color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); - unsigned int outline_color_id = GWN_vertformat_attr_add(format, "outlineColor", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint size_id = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); + uint color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint outline_color_id = GWN_vertformat_attr_add(format, "outlineColor", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND); GPU_enable_program_point_size(); @@ -334,7 +343,7 @@ static void vicon_colorset_draw(int index, int x, int y, int w, int h, float UNU const int b = x + w / 3 * 2; const int c = x + w; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* XXX: Include alpha into this... */ @@ -437,6 +446,143 @@ static void init_brush_icons(void) #undef INIT_BRUSH_ICON } +static DrawInfo *g_di_event_list = NULL; + +int UI_icon_from_event_type(short event_type, short event_value) +{ + if (event_type == RIGHTSHIFTKEY) { + event_type = LEFTSHIFTKEY; + } + else if (event_type == RIGHTCTRLKEY) { + event_type = LEFTCTRLKEY; + } + else if (event_type == RIGHTALTKEY) { + event_type = LEFTALTKEY; + } + else if (event_type == EVT_TWEAK_L) { + event_type = LEFTMOUSE; + event_value = KM_CLICK_DRAG; + } + else if (event_type == EVT_TWEAK_M) { + event_type = MIDDLEMOUSE; + event_value = KM_CLICK_DRAG; + } + else if (event_type == EVT_TWEAK_R) { + event_type = RIGHTMOUSE; + event_value = KM_CLICK_DRAG; + } + + DrawInfo *di = g_di_event_list; + do { + if (di->data.input.event_type == event_type) { + return di->data.input.icon; + } + } while ((di = di->data.input.next)); + + if (event_type == LEFTMOUSE) { + return ELEM(event_value, KM_CLICK, KM_PRESS) ? ICON_MOUSE_LMB : ICON_MOUSE_LMB_DRAG; + } + else if (event_type == MIDDLEMOUSE) { + return ELEM(event_value, KM_CLICK, KM_PRESS) ? ICON_MOUSE_MMB : ICON_MOUSE_MMB_DRAG; + } + else if (event_type == RIGHTMOUSE) { + return ELEM(event_value, KM_CLICK, KM_PRESS) ? ICON_MOUSE_RMB : ICON_MOUSE_RMB_DRAG; + } + + return ICON_NONE; +} + +int UI_icon_from_keymap_item(const wmKeyMapItem *kmi, int r_icon_mod[4]) +{ + if (r_icon_mod) { + memset(r_icon_mod, 0x0, sizeof(int[4])); + int i = 0; + if (!ELEM(kmi->ctrl, KM_NOTHING, KM_ANY)) { + r_icon_mod[i++] = ICON_EVENT_CTRL; + } + if (!ELEM(kmi->alt, KM_NOTHING, KM_ANY)) { + r_icon_mod[i++] = ICON_EVENT_ALT; + } + if (!ELEM(kmi->shift, KM_NOTHING, KM_ANY)) { + r_icon_mod[i++] = ICON_EVENT_SHIFT; + } + if (!ELEM(kmi->oskey, KM_NOTHING, KM_ANY)) { + r_icon_mod[i++] = ICON_EVENT_OS; + } + } + return UI_icon_from_event_type(kmi->type, kmi->val); +} + +static void init_event_icons(void) +{ + DrawInfo *di_next = NULL; + +#define INIT_EVENT_ICON(icon_id, type, value) \ + { \ + DrawInfo *di = def_internal_icon(NULL, icon_id, 0, 0, w, ICON_TYPE_EVENT); \ + di->data.input.event_type = type; \ + di->data.input.event_value = value; \ + di->data.input.icon = icon_id; \ + di->data.input.next = di_next; \ + di_next = di; \ + } + /* end INIT_EVENT_ICON */ + + const int w = 16; /* DUMMY */ + + INIT_EVENT_ICON(ICON_EVENT_A, AKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_B, BKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_C, CKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_D, DKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_E, EKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F, FKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_G, GKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_H, HKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_I, IKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_J, JKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_K, KKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_L, LKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_M, MKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_N, NKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_O, OKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_P, PKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_Q, QKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_R, RKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_S, SKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_T, TKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_U, UKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_V, VKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_W, WKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_X, XKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_Y, YKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_Z, ZKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_SHIFT, LEFTSHIFTKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_CTRL, LEFTCTRLKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_ALT, LEFTALTKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_OS, OSKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F1, F1KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F2, F2KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F3, F3KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F4, F4KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F5, F5KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F6, F6KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F7, F7KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F8, F8KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F9, F9KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F10, F10KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F11, F11KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_F12, F12KEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_ESC, ESCKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_TAB, TABKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_PAGEUP, PAGEUPKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_PAGEDOWN, PAGEDOWNKEY, KM_ANY); + INIT_EVENT_ICON(ICON_EVENT_RETURN, RETKEY, KM_ANY); + + g_di_event_list = di_next; + +#undef INIT_EVENT_ICON +} + static void icon_verify_datatoc(IconImage *iimg) { /* if it has own rect, things are all OK */ @@ -795,6 +941,7 @@ void UI_icons_init(int first_dyn_id) init_iconfile_list(&iconfilelist); init_internal_icons(); init_brush_icons(); + init_event_icons(); #endif } @@ -1285,6 +1432,11 @@ static void icon_draw_size( icon_draw_rect(x, y, w, h, aspect, w, h, ibuf->rect, alpha, rgb, desaturate); GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); } + else if (di->type == ICON_TYPE_EVENT) { + const short event_type = di->data.input.event_type; + const short event_value = di->data.input.event_value; + icon_draw_rect_input(x, y, w, h, alpha, event_type, event_value); + } else if (di->type == ICON_TYPE_TEXTURE) { /* texture image use premul alpha for correct scaling */ GPU_blend_set_func(GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); @@ -1554,7 +1706,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_icons_event.c b/source/blender/editors/interface/interface_icons_event.c new file mode 100644 index 00000000000..dc444b98b2c --- /dev/null +++ b/source/blender/editors/interface/interface_icons_event.c @@ -0,0 +1,295 @@ +/* + * ***** 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 ***** + */ + +/** \file blender/editors/interface/interface_icons_event.c + * \ingroup edinterface + * + * A special set of icons to represent input devices, + * this is a mix of text (via fonts) and a handful of custom glyphs for special keys. + * + * Event codes are used as identifiers. + */ + +#include <math.h> +#include <stdlib.h> +#include <string.h> + +#include "MEM_guardedalloc.h" + +#include "GPU_draw.h" +#include "GPU_matrix.h" +#include "GPU_batch.h" +#include "GPU_immediate.h" +#include "GPU_state.h" + +#include "BLI_blenlib.h" +#include "BLI_utildefines.h" +#include "BLI_fileops_types.h" +#include "BLI_math_vector.h" + +#include "DNA_brush_types.h" +#include "DNA_curve_types.h" +#include "DNA_dynamicpaint_types.h" +#include "DNA_object_types.h" +#include "DNA_screen_types.h" +#include "DNA_space_types.h" +#include "DNA_workspace_types.h" + +#include "RNA_access.h" +#include "RNA_enum_types.h" + +#include "BKE_context.h" +#include "BKE_global.h" +#include "BKE_icons.h" +#include "BKE_appdir.h" +#include "BKE_studiolight.h" + +#include "IMB_imbuf.h" +#include "IMB_imbuf_types.h" +#include "IMB_thumbs.h" + +#include "BIF_glutil.h" +#include "BLF_api.h" + +#include "DEG_depsgraph.h" + +#include "DRW_engine.h" + +#include "ED_datafiles.h" +#include "ED_keyframes_draw.h" +#include "ED_render.h" + +#include "UI_interface.h" +#include "UI_interface_icons.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "interface_intern.h" + +static void icon_draw_rect_input_small_text_ex( + const rctf *rect, const float color[4], const float margin[2], const char *str, + int font_size) +{ + BLF_batch_draw_flush(); + const int font_id = BLF_default(); + BLF_color4fv(font_id, color); + BLF_size(font_id, font_size * U.pixelsize, U.dpi); + BLF_position(font_id, rect->xmin + margin[0] * 2, rect->ymin + margin[1] * 5, 0.0f); + BLF_draw(font_id, str, BLF_DRAW_STR_DUMMY_MAX); + BLF_batch_draw_flush(); +} + +static void icon_draw_rect_input_small_text( + const rctf *rect, const float color[4], const float margin[2], const char *str) +{ + icon_draw_rect_input_small_text_ex(rect, color, margin, str, 8); +} + +static void icon_draw_rect_input_default_text( + const rctf *rect, + const float color[4], const float margin[2], const char *str) +{ + BLF_batch_draw_flush(); + const int font_id = BLF_default(); + BLF_color4fv(font_id, color); + BLF_position(font_id, (int)(rect->xmin + margin[0] * 5), (int)(rect->ymin + margin[1] * 5), 0.0f); + BLF_draw(font_id, str, BLF_DRAW_STR_DUMMY_MAX); + BLF_batch_draw_flush(); +} + +static void icon_draw_rect_input_mono_text( + const rctf *rect, + const float color[4], const float margin[2], const char *str) +{ + BLF_batch_draw_flush(); + const int font_id = blf_mono_font; + BLF_color4fv(font_id, color); + BLF_size(font_id, 20 * U.pixelsize, U.dpi); + BLF_position(font_id, (int)(rect->xmin + margin[0] * 5), (int)(rect->ymin + margin[1] * 5), 0.0f); + BLF_draw(font_id, str, BLF_DRAW_STR_DUMMY_MAX); + BLF_batch_draw_flush(); +} + +static void icon_draw_rect_input_line_prim( + const rctf *rect, + const float color[4], + const int prim, + const char lines[][2], int lines_len) +{ + glEnable(GL_LINE_SMOOTH); + glEnable(GL_BLEND); + BLI_assert(ELEM(prim, GWN_PRIM_LINE_LOOP, GWN_PRIM_LINE_STRIP)); + const uint pos_id = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); + immUniformColor4fv(color); + immBegin(prim, lines_len); + float w_inv = BLI_rctf_size_x(rect) / 255.0f; + float h_inv = BLI_rctf_size_y(rect) / 255.0f; + for (int i = 0; i < lines_len; i++) { + immVertex2f( + pos_id, + round_fl_to_int(rect->xmin + ((float)lines[i][0] * w_inv)), + round_fl_to_int(rect->ymin + ((float)lines[i][1] * h_inv)) + ); + } + immEnd(); + immUnbindProgram(); + glDisable(GL_LINE_SMOOTH); + glDisable(GL_BLEND); +} + +void icon_draw_rect_input( + float x, float y, int w, int h, float UNUSED(alpha), + short event_type, short UNUSED(event_value)) +{ + float color[4]; + const float margin[2] = {w / 20.0f, h / 20.0f}; + UI_GetThemeColor4fv(TH_TEXT, color); + UI_draw_roundbox_corner_set(UI_CNR_ALL); + UI_draw_roundbox_aa( + false, + (int)x, + (int)y, + (int)(x + w), + (int)(y + h), 4.0f, color + ); + + const rctf rect = { + .xmin = x, + .ymin = y, + .xmax = x + w, + .ymax = y + h, + }; + + const bool simple_text = false; + + if ((event_type >= AKEY) || (ZKEY <= event_type)) { + char str[2] = {'A' + (event_type - AKEY), '\0'}; + icon_draw_rect_input_default_text(&rect, color, margin, str); + } + if ((event_type >= F1KEY) || (F12KEY <= event_type)) { + char str[3] = {'F', '1' + (event_type - F1KEY), '\0'}; + icon_draw_rect_input_default_text(&rect, color, margin, str); + } + else if (event_type == LEFTSHIFTKEY) { + if (simple_text) { + icon_draw_rect_input_small_text(&rect, color, margin, "Shift"); + } + else { + rctf rect_ofs = rect; + BLI_rctf_translate(&rect_ofs, (w / -14.0f), (w / -14.0f)); + icon_draw_rect_input_mono_text(&rect_ofs, color, margin, (const char[]){0xe2, 0x87, 0xa7, 0x0}); + } + } + else if (event_type == LEFTCTRLKEY) { + if (simple_text) { + icon_draw_rect_input_small_text(&rect, color, margin, "Ctrl"); + } + else { + rctf rect_ofs = rect; + BLI_rctf_translate(&rect_ofs, (w / -16.0f), 0.0f); + icon_draw_rect_input_default_text(&rect_ofs, color, margin, "^"); + } + } + else if (event_type == LEFTALTKEY) { + if (simple_text) { + icon_draw_rect_input_small_text(&rect, color, margin, "Alt"); + } + else { + rctf rect_ofs = rect; + BLI_rctf_translate(&rect_ofs, (w / -8.0f), 0.0f); + icon_draw_rect_input_default_text(&rect_ofs, color, margin, (const char[]){0xe2, 0x8c, 0xa5, 0x0}); + } + } + else if (event_type == OSKEY) { + icon_draw_rect_input_small_text(&rect, color, margin, "OS"); + } + else if (event_type == DELKEY) { + icon_draw_rect_input_small_text(&rect, color, margin, "Del"); + } + else if (event_type == TABKEY) { + if (simple_text) { + icon_draw_rect_input_small_text(&rect, color, margin, "Tab"); + } + else { + rctf rect_ofs = rect; + BLI_rctf_translate(&rect_ofs, (w / -12.0f), (w / -12.0f)); + icon_draw_rect_input_mono_text(&rect_ofs, color, margin, (const char[]){0xe2, 0x86, 0xb9, 0x0}); + } + } + else if (event_type == HOMEKEY) { + if (simple_text) { + icon_draw_rect_input_small_text(&rect, color, margin, "Home"); + } + else { + rctf rect_ofs = rect; + BLI_rctf_translate(&rect_ofs, (w / -12.0f), (w / -12.0f)); + icon_draw_rect_input_mono_text(&rect_ofs, color, margin, (const char[]){0xe2, 0x87, 0xa4, 0x0}); + } + } + else if (event_type == ENDKEY) { + if (simple_text) { + icon_draw_rect_input_small_text(&rect, color, margin, "End"); + } + else { + rctf rect_ofs = rect; + BLI_rctf_translate(&rect_ofs, (w / -12.0f), (w / -12.0f)); + icon_draw_rect_input_mono_text(&rect_ofs, color, margin, (const char[]){0xe2, 0x87, 0xa5, 0x0}); + } + } + else if (event_type == RETKEY) { + if (simple_text) { + icon_draw_rect_input_small_text(&rect, color, margin, "Ret"); + } + else { + rctf rect_ofs = rect; + BLI_rctf_translate(&rect_ofs, (w / -8.0f), (w / -6.0f)); + icon_draw_rect_input_mono_text(&rect_ofs, color, margin, (const char[]){0xe2, 0x8f, 0x8e, 0x0}); + } + } + else if (event_type == ESCKEY) { + icon_draw_rect_input_small_text(&rect, color, margin, "Esc"); + } + else if (event_type == PAGEUPKEY) { + icon_draw_rect_input_small_text_ex(&rect, color, margin, (const char[]){'P', 0xe2, 0x86, 0x91, 0x0}, 10); + } + else if (event_type == PAGEDOWNKEY) { + icon_draw_rect_input_small_text_ex(&rect, color, margin, (const char[]){'P', 0xe2, 0x86, 0x93, 0x0}, 10); + } + else if (event_type == LEFTARROWKEY) { + icon_draw_rect_input_default_text(&rect, color, margin, (const char[]){0xe2, 0x86, 0x90, 0x0}); + } + else if (event_type == UPARROWKEY) { + icon_draw_rect_input_default_text(&rect, color, margin, (const char[]){0xe2, 0x86, 0x91, 0x0}); + } + else if (event_type == RIGHTARROWKEY) { + icon_draw_rect_input_default_text(&rect, color, margin, (const char[]){0xe2, 0x86, 0x92, 0x0}); + } + else if (event_type == DOWNARROWKEY) { + icon_draw_rect_input_default_text(&rect, color, margin, (const char[]){0xe2, 0x86, 0x93, 0x0}); + } + else if (event_type == SPACEKEY) { + const uchar lines[] = {60, 118, 60, 60, 195, 60, 195, 118}; + icon_draw_rect_input_line_prim( + &rect, color, GWN_PRIM_LINE_STRIP, + (const void *)lines, ARRAY_SIZE(lines) / 2); + } +} diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 04e9e2b18b4..ffc389c6dfd 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -105,7 +105,8 @@ typedef enum { UI_WTYPE_PROGRESSBAR, } uiWidgetTypeEnum; -#define UI_MENU_WIDTH_MIN (UI_UNIT_Y * 9) +#define UI_MENU_WIDTH_MIN (UI_UNIT_Y * 9) +#define UI_MENU_SUBMENU_PADDING (6 * UI_DPI_FAC) /* some extra padding added to menus containing submenu icons */ /* menu scrolling */ #define UI_MENU_SCROLL_ARROW 12 @@ -349,6 +350,13 @@ struct PieMenuData { float alphafac; }; +/* uiBlock.content_hints */ +enum eBlockContentHints { + /* In a menu block, if there is a single sub-menu button, we add some + * padding to the right to put nicely aligned triangle icons there. */ + BLOCK_CONTAINS_SUBMENU_BUT = (1 << 0), +}; + struct uiBlock { uiBlock *next, *prev; @@ -395,11 +403,15 @@ struct uiBlock { int flag; short alignnr; + /* Hints about the buttons of this block. Used to avoid iterating over + * buttons to find out if some criteria is met by any. Instead, check this + * criteria when adding the button and set a flag here if it's met. */ + short content_hints; /* eBlockContentHints */ char direction; char dt; /* drawtype: UI_EMBOSS, UI_EMBOSS_NONE ... etc, copied to buttons */ bool auto_open; - char _pad[7]; + char _pad[5]; double auto_open_last; const char *lockstr; @@ -744,8 +756,7 @@ struct Gwn_Batch *ui_batch_roundbox_get(bool filled, bool antialiased); struct Gwn_Batch *ui_batch_roundbox_widget_get(int tria); struct Gwn_Batch *ui_batch_roundbox_shadow_get(void); -void ui_draw_anti_roundbox(int mode, float minx, float miny, float maxx, float maxy, - float rad, bool use_alpha, const float color[4]); +void ui_draw_anti_tria_rect(const rctf *rect, char dir, const float color[4]); void ui_draw_menu_back(struct uiStyle *style, uiBlock *block, rcti *rect); void ui_draw_popover_back(ARegion *ar, struct uiStyle *style, uiBlock *block, rcti *rect); void ui_draw_pie_center(uiBlock *block); @@ -778,6 +789,11 @@ void uiStyleInit(void); void ui_icon_ensure_deferred(const struct bContext *C, const int icon_id, const bool big); int ui_id_icon_get(const struct bContext *C, struct ID *id, const bool big); +/* interface_icons_event.c */ +void icon_draw_rect_input( + float x, float y, int w, int h, float alpha, + short event_type, short event_value); + /* resources.c */ void init_userdef_do_versions(struct Main *bmain); void ui_theme_init_default(void); diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index a99a6610e88..27afdcdd202 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -469,23 +469,6 @@ void UI_draw_icon_tri(float x, float y, char dir, const float color[4]) } } -/* triangle 'icon' inside rect */ -static void ui_draw_tria_rect(const rctf *rect, char dir) -{ - float color[4]; - UI_GetThemeColor3fv(TH_TITLE, color); - color[3] = 1.0f; - - if (dir == 'h') { - float half = 0.5f * BLI_rctf_size_y(rect); - UI_draw_anti_tria(rect->xmin, rect->ymin, rect->xmin, rect->ymax, rect->xmax, rect->ymin + half, color); - } - else { - float half = 0.5f * BLI_rctf_size_x(rect); - UI_draw_anti_tria(rect->xmin, rect->ymax, rect->xmax, rect->ymax, rect->xmin + half, rect->ymin, color); - } -} - static void ui_draw_anti_x(unsigned int pos, float x1, float y1, float x2, float y2) { @@ -695,7 +678,7 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, const rcti *rect, con titlerect.xmin += 5.0f / block->aspect; } - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); if (!is_subpanel) { @@ -708,7 +691,7 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, const rcti *rect, con if (UI_GetThemeValue(TH_PANEL_SHOW_HEADER)) { /* draw with background color */ immUniformThemeColor(TH_PANEL_HEADER); - immRectf(pos, minx, headrect.ymin + 1, maxx, y); + immRectf(pos, minx, headrect.ymin, maxx, y); immBegin(GWN_PRIM_LINES, 4); @@ -770,7 +753,7 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, const rcti *rect, con ui_draw_aligned_panel_header(style, block, &titlerect, 'h'); if (show_drag) { - unsigned int col; + uint col; Gwn_VertFormat *format = immVertexFormat(); pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); @@ -853,12 +836,18 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, const rcti *rect, con BLI_rctf_scale(&itemrect, 0.25f); - if (is_closed_y) - ui_draw_tria_rect(&itemrect, 'h'); - else if (is_closed_x) - ui_draw_tria_rect(&itemrect, 'h'); - else - ui_draw_tria_rect(&itemrect, 'v'); + { + float tria_color[4]; + UI_GetThemeColor3fv(TH_TITLE, tria_color); + tria_color[3] = 1.0f; + + if (is_closed_y) + ui_draw_anti_tria_rect(&itemrect, 'h', tria_color); + else if (is_closed_x) + ui_draw_anti_tria_rect(&itemrect, 'h', tria_color); + else + ui_draw_anti_tria_rect(&itemrect, 'v', tria_color); + } } /************************** panel alignment *************************/ @@ -1741,30 +1730,30 @@ static void ui_panel_category_draw_tab( int a; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); /* mult */ for (a = 0; a < 4; a++) { mul_v2_fl(vec[a], rad); } - unsigned int vert_ct = 0; + uint vert_len = 0; if (use_highlight) { - vert_ct += (roundboxtype & UI_CNR_TOP_RIGHT) ? 6 : 1; - vert_ct += (roundboxtype & UI_CNR_TOP_LEFT) ? 6 : 1; + vert_len += (roundboxtype & UI_CNR_TOP_RIGHT) ? 6 : 1; + vert_len += (roundboxtype & UI_CNR_TOP_LEFT) ? 6 : 1; } if (use_highlight && !use_shadow) { - vert_ct++; + vert_len++; } else { - vert_ct += (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 6 : 1; - vert_ct += (roundboxtype & UI_CNR_BOTTOM_LEFT) ? 6 : 1; + vert_len += (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 6 : 1; + vert_len += (roundboxtype & UI_CNR_BOTTOM_LEFT) ? 6 : 1; } immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); - immBegin(filled ? GWN_PRIM_TRI_FAN : GWN_PRIM_LINE_STRIP, vert_ct); + immBegin(filled ? GWN_PRIM_TRI_FAN : GWN_PRIM_LINE_STRIP, vert_len); /* start with corner right-top */ if (use_highlight) { @@ -1969,7 +1958,7 @@ void UI_panel_category_draw_all(ARegion *ar, const char *category_id_active) /* begin drawing */ GPU_line_smooth(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* draw the background */ diff --git a/source/blender/editors/interface/interface_region_popup.c b/source/blender/editors/interface/interface_region_popup.c index 320ee1f4616..1bbf2242c5d 100644 --- a/source/blender/editors/interface/interface_region_popup.c +++ b/source/blender/editors/interface/interface_region_popup.c @@ -116,6 +116,9 @@ static void ui_popup_block_position(wmWindow *window, ARegion *butregion, uiBut BLI_rctf_init_minmax(&block->rect); for (uiBut *bt = block->buttons.first; bt; bt = bt->next) { + if (block->content_hints & BLOCK_CONTAINS_SUBMENU_BUT) { + bt->rect.xmax += UI_MENU_SUBMENU_PADDING; + } BLI_rctf_union(&block->rect, &bt->rect); } } 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/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index c390c3fdda8..03ff6593c59 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -259,7 +259,7 @@ static struct { static Gwn_VertFormat *vflag_format(void) { - if (g_ui_batch_cache.format.attrib_ct == 0) { + if (g_ui_batch_cache.format.attr_len == 0) { Gwn_VertFormat *format = &g_ui_batch_cache.format; g_ui_batch_cache.vflag_id = GWN_vertformat_attr_add(format, "vflag", GWN_COMP_U32, 1, GWN_FETCH_INT); } @@ -512,7 +512,7 @@ void UI_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y GPU_blend(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(draw_color); @@ -532,6 +532,20 @@ void UI_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y GPU_blend(false); } +/* triangle 'icon' inside rect */ +void ui_draw_anti_tria_rect(const rctf *rect, char dir, const float color[4]) +{ + if (dir == 'h') { + float half = 0.5f * BLI_rctf_size_y(rect); + UI_draw_anti_tria(rect->xmin, rect->ymin, rect->xmin, rect->ymax, rect->xmax, rect->ymin + half, color); + } + else { + float half = 0.5f * BLI_rctf_size_x(rect); + UI_draw_anti_tria(rect->xmin, rect->ymax, rect->xmax, rect->ymax, rect->xmin + half, rect->ymin, color); + } +} + + void UI_draw_anti_fan(float tri_array[][2], unsigned int length, const float color[4]) { float draw_color[4]; @@ -541,7 +555,7 @@ void UI_draw_anti_fan(float tri_array[][2], unsigned int length, const float col GPU_blend(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(draw_color); @@ -1255,8 +1269,8 @@ static int ui_but_draw_menu_icon(const uiBut *but) /* icons have been standardized... and this call draws in untransformed coordinates */ static void widget_draw_icon_ex( - const uiBut *but, BIFIconID icon, float alpha, const rcti *rect, const bool show_menu_icon, - const int icon_size) + const uiBut *but, BIFIconID icon, float alpha, + const rcti *rect, const int icon_size) { float xs = 0.0f, ys = 0.0f; float aspect, height; @@ -1331,20 +1345,35 @@ static void widget_draw_icon_ex( } } - if (show_menu_icon) { - xs = rect->xmax - UI_DPI_ICON_SIZE - aspect; - ys = (rect->ymin + rect->ymax - height) / 2.0f; - - UI_icon_draw_aspect(xs, ys, ICON_RIGHTARROW_THIN, aspect, alpha); - } - GPU_blend(false); } static void widget_draw_icon( - const uiBut *but, BIFIconID icon, float alpha, const rcti *rect, const bool show_menu_icon) + const uiBut *but, BIFIconID icon, float alpha, const rcti *rect) +{ + widget_draw_icon_ex(but, icon, alpha, rect, ICON_DEFAULT_HEIGHT); +} + +static void widget_draw_submenu_tria(const uiBut *but, const rcti *rect, const uiWidgetColors *wcol) { - widget_draw_icon_ex(but, icon, alpha, rect, show_menu_icon, ICON_DEFAULT_HEIGHT); + const float aspect = but->block->aspect / UI_DPI_FAC; + const int tria_height = (int)(ICON_DEFAULT_HEIGHT / aspect); + const int tria_width = (int)(ICON_DEFAULT_WIDTH / aspect) - 2 * U.pixelsize; + const int xs = rect->xmax - tria_width; + const int ys = (rect->ymin + rect->ymax - tria_height) / 2.0f; + float col[4]; + rctf tria_rect; + + rgba_uchar_to_float(col, (const uchar *)wcol->text); + col[3] *= 0.8f; + + BLI_rctf_init(&tria_rect, xs, xs + tria_width, ys, ys + tria_height); + BLI_rctf_scale(&tria_rect, 0.4f); + + GPU_blend(true); + UI_widgetbase_draw_cache_flush(); + GPU_blend(false); + ui_draw_anti_tria_rect(&tria_rect, 'h', col); } static void ui_text_clip_give_prev_off(uiBut *but, const char *str) @@ -1806,7 +1835,7 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b selwidth_draw = BLF_width(fstyle->uifont_id, drawstr + but->ofs, but->selend - but->ofs); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ubv((unsigned char *)wcol->item); @@ -1842,7 +1871,7 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b UI_widgetbase_draw_cache_flush(); GPU_blend(false); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3f(0.2f, 0.6f, 0.9f); @@ -1987,7 +2016,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB if (ELEM(but->type, UI_BTYPE_MENU, UI_BTYPE_POPOVER) && (but->flag & UI_BUT_NODE_LINK)) { rcti temp = *rect; temp.xmin = rect->xmax - BLI_rcti_size_y(rect) - 1; - widget_draw_icon(but, ICON_LAYER_USED, alpha, &temp, false); + widget_draw_icon(but, ICON_LAYER_USED, alpha, &temp); rect->xmax = temp.xmin; } @@ -2057,17 +2086,17 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB else if (ui_block_is_menu(but->block)) rect->xmin += 0.3f * U.widget_unit; - widget_draw_icon(but, icon, alpha, rect, show_menu_icon); + widget_draw_icon(but, icon, alpha, rect); + if (show_menu_icon) { + BLI_assert(but->block->content_hints & BLOCK_CONTAINS_SUBMENU_BUT); + widget_draw_submenu_tria(but, rect, wcol); + } #ifdef USE_UI_TOOLBAR_HACK but->block->aspect = aspect_orig; #endif rect->xmin += icon_size; - /* without this menu keybindings will overlap the arrow icon [#38083] */ - if (show_menu_icon) { - rect->xmax -= icon_size / 2.0f; - } } if (but->editstr || (but->drawflag & UI_BUT_TEXT_LEFT)) { @@ -2077,6 +2106,12 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB rect->xmax -= (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect; } + /* Menu contains sub-menu items with triangle icon on their right. Shortcut + * strings should be drawn with some padding to the right then. */ + if (ui_block_is_menu(but->block) && (but->block->content_hints & BLOCK_CONTAINS_SUBMENU_BUT)) { + rect->xmax -= UI_MENU_SUBMENU_PADDING; + } + /* extra icons, e.g. 'x' icon to clear text or icon for eyedropper */ if (extra_icon_type != UI_BUT_ICONEXTRA_NONE) { rcti temp = *rect; @@ -2084,10 +2119,10 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB temp.xmin = temp.xmax - (BLI_rcti_size_y(rect) * 1.08f); if (extra_icon_type == UI_BUT_ICONEXTRA_CLEAR) { - widget_draw_icon(but, ICON_PANEL_CLOSE, alpha, &temp, false); + widget_draw_icon(but, ICON_PANEL_CLOSE, alpha, &temp); } else if (extra_icon_type == UI_BUT_ICONEXTRA_EYEDROPPER) { - widget_draw_icon(but, ICON_EYEDROPPER, alpha, &temp, false); + widget_draw_icon(but, ICON_EYEDROPPER, alpha, &temp); } else { BLI_assert(0); @@ -2387,7 +2422,7 @@ static void widget_softshadow(const rcti *rect, int roundboxalign, const float r /* we draw a number of increasing size alpha quad strips */ alphastep = 3.0f * btheme->tui.menu_shadow_fac / radout; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -2439,7 +2474,7 @@ static void widget_menu_back(uiWidgetColors *wcol, rcti *rect, int flag, int dir static void ui_hsv_cursor(float x, float y) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -2536,8 +2571,8 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, const rcti * ui_color_picker_to_rgb(0.0f, 0.0f, hsv[2], colcent, colcent + 1, colcent + 2); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); @@ -2647,8 +2682,8 @@ void ui_draw_gradient(const rcti *rect, const float hsv[3], const int type, cons /* old below */ Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); immBegin(GWN_PRIM_TRIS, steps * 3 * 6); @@ -2807,7 +2842,7 @@ static void ui_draw_but_HSVCUBE(uiBut *but, const rcti *rect) ui_hsv_cursor(x, y); /* outline */ - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3ub(0, 0, 0); imm_draw_box_wire_2d(pos, (rect->xmin), (rect->ymin), (rect->xmax), (rect->ymax)); @@ -2904,7 +2939,7 @@ static void ui_draw_separator(const rcti *rect, uiWidgetColors *wcol) 30 }; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); GPU_blend(true); @@ -3366,7 +3401,7 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat UI_widgetbase_draw_cache_flush(); GPU_blend(false); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3f(bw, bw, bw); @@ -3747,7 +3782,7 @@ static void widget_draw_extra_mask(const bContext *C, uiBut *but, uiWidgetType * /* note: drawextra can change rect +1 or -1, to match round errors of existing previews */ but->block->drawextra(C, but->poin, but->block->drawextra_arg1, but->block->drawextra_arg2, rect); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* make mask to draw over image */ @@ -4384,7 +4419,7 @@ static void ui_draw_popover_back_impl( /* Draw popover arrow (top/bottom) */ if (ELEM(direction, UI_DIR_UP, UI_DIR_DOWN)) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ubv((unsigned char *)wcol->inner); GPU_blend(true); @@ -4521,7 +4556,7 @@ void ui_draw_pie_center(uiBlock *block) } Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ubv((unsigned char *)btheme->tui.wcol_pie_menu.outline); diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index fc282e50ce2..bf768f26a93 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -1340,8 +1340,8 @@ void UI_view2d_grid_draw(View2D *v2d, View2DGrid *grid, int flag) return; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); immBegin(GWN_PRIM_LINES, vertex_count); @@ -1482,8 +1482,8 @@ void UI_view2d_constant_grid_draw(View2D *v2d, float step) if (count_x > 0 || count_y > 0) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); float theme_color[3]; UI_GetThemeColorShade3fv(TH_BACK, -10, theme_color); @@ -1533,8 +1533,8 @@ void UI_view2d_multi_grid_draw(View2D *v2d, int colorid, float step, int level_s vertex_count += 2 * ((int)((v2d->cur.ymax - v2d->cur.ymin) / lstep) + 1); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); GPU_line_width(1.0f); diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c index 6b5fce26deb..4717ef309f3 100644 --- a/source/blender/editors/mask/mask_draw.c +++ b/source/blender/editors/mask/mask_draw.c @@ -125,7 +125,7 @@ static void draw_single_handle(const MaskLayer *mask_layer, const MaskSplinePoin } Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); const unsigned char rgb_gray[4] = {0x60, 0x60, 0x60, 0xff}; immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -213,7 +213,7 @@ static void draw_spline_points(const bContext *C, MaskLayer *masklay, MaskSpline mask_spline_color_get(masklay, spline, is_spline_sel, rgb_spline); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA); immUniform1f("size", 0.7f * handle_size); @@ -371,10 +371,10 @@ static void mask_color_active_tint(unsigned char r_rgb[4], const unsigned char r } } -static void mask_draw_array(unsigned int pos, Gwn_PrimType prim_type, const float (*points)[2], unsigned int vertex_ct) +static void mask_draw_array(unsigned int pos, Gwn_PrimType prim_type, const float (*points)[2], unsigned int vertex_len) { - immBegin(prim_type, vertex_ct); - for (unsigned int i = 0; i < vertex_ct; ++i) { + immBegin(prim_type, vertex_len); + for (unsigned int i = 0; i < vertex_len; ++i) { immVertex2fv(pos, points[i]); } immEnd(); @@ -403,7 +403,7 @@ static void mask_draw_curve_type(const bContext *C, MaskSpline *spline, float (* } Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); switch (draw_type) { @@ -747,7 +747,7 @@ void ED_mask_draw_frames(Mask *mask, ARegion *ar, const int cfra, const int sfra unsigned int num_lines = BLI_listbase_count(&masklay->splines_shapes); if (num_lines > 0) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ub(255, 175, 0, 255); diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 8f8400e2d20..8a9a5eadbdd 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -1007,7 +1007,7 @@ static void knifetool_draw_angle_snapping(const KnifeTool_OpData *kcd) copy_v3_v3(v2, ray_hit_best[1]); } - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformThemeColor(TH_TRANSFORM); @@ -1048,7 +1048,7 @@ static void knifetool_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void gpuPushMatrix(); gpuMultMatrix(kcd->ob->obmat); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c index b437bdca111..87c006095ed 100644 --- a/source/blender/editors/mesh/editmesh_loopcut.c +++ b/source/blender/editors/mesh/editmesh_loopcut.c @@ -116,7 +116,7 @@ static void ringsel_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *a gpuPushMatrix(); gpuMultMatrix(lcd->ob->obmat); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformColor3ub(255, 0, 255); 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/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index a08e35d08a7..10d9c90aeb3 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -2892,7 +2892,7 @@ static void brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customdata) brush = &pset->brush[pset->brushtype]; if (brush) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ub(255, 255, 255, 128); 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 19f30ac59aa..886b3112aad 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -1836,7 +1836,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/screen/area.c b/source/blender/editors/screen/area.c index 77e178bf0b2..137fd01a146 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -106,7 +106,7 @@ static void region_draw_emboss(const ARegion *ar, const rcti *scirct, int sides) UI_GetThemeColor3fv(TH_EDITOR_OUTLINE, color); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(color); @@ -263,7 +263,7 @@ static void area_draw_azone_fullscreen(short x1, short y1, short x2, short y2, f BLI_rcti_init(&click_rect, x, x + icon_size, y, y + icon_size); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -296,7 +296,7 @@ static void draw_azone_plus(float x1, float y1, float x2, float y2) float pad = 0.2f * U.widget_unit; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); GPU_blend(true); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -501,7 +501,7 @@ void ED_region_do_draw(bContext *C, ARegion *ar) #if 0 GPU_blend(true); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4f(drand48(), drand48(), drand48(), 0.1f); immRectf(pos, ar->drawrct.xmin - ar->winrct.xmin, ar->drawrct.ymin - ar->winrct.ymin, @@ -2473,7 +2473,7 @@ void ED_region_info_draw_multiline(ARegion *ar, const char *text_array[], float GPU_blend(true); GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(fill_color); immRecti(pos, rect.xmin, rect.ymin, rect.xmax + 1, rect.ymax + 1); @@ -2692,7 +2692,7 @@ void ED_region_image_metadata_draw(int x, int y, ImBuf *ibuf, const rctf *frame, BLI_rctf_init(&rect, frame->xmin, frame->xmax, frame->ymax, frame->ymax + box_y); /* draw top box */ Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_METADATA_BG); immRectf(pos, rect.xmin, rect.ymin, rect.xmax, rect.ymax); @@ -2717,7 +2717,7 @@ void ED_region_image_metadata_draw(int x, int y, ImBuf *ibuf, const rctf *frame, BLI_rctf_init(&rect, frame->xmin, frame->xmax, frame->ymin - box_y, frame->ymin); /* draw top box */ Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_METADATA_BG); immRectf(pos, rect.xmin, rect.ymin, rect.xmax, rect.ymax); @@ -2746,7 +2746,7 @@ void ED_region_grid_draw(ARegion *ar, float zoomx, float zoomy) UI_view2d_view_to_region(&ar->v2d, 1.0f, 1.0f, &x2, &y2); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShade(TH_BACK, 20); @@ -2877,7 +2877,7 @@ void ED_region_visible_rect(ARegion *ar, rcti *rect) void ED_region_cache_draw_background(const ARegion *ar) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ub(128, 128, 255, 64); immRecti(pos, 0, 0, ar->winx, 8 * UI_DPI_FAC); @@ -2897,7 +2897,7 @@ void ED_region_cache_draw_curfra_label(const int framenr, const float x, const f BLF_width_and_height(fontid, numstr, sizeof(numstr), &font_dims[0], &font_dims[1]); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_CFRAME); immRecti(pos, x, y, x + font_dims[0] + 6.0f, y + font_dims[1] + 4.0f); @@ -2911,7 +2911,7 @@ void ED_region_cache_draw_curfra_label(const int framenr, const float x, const f void ED_region_cache_draw_cached_segments(const ARegion *ar, const int num_segments, const int *points, const int sfra, const int efra) { if (num_segments) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ub(128, 128, 255, 128); diff --git a/source/blender/editors/screen/screen_draw.c b/source/blender/editors/screen/screen_draw.c index b5b0d16f6a7..9c46938a90f 100644 --- a/source/blender/editors/screen/screen_draw.c +++ b/source/blender/editors/screen/screen_draw.c @@ -323,7 +323,7 @@ static void drawscredge_corner(ScrArea *sa, int sizex, int sizey) /* Wrap up the corners with a nice embossing. */ rcti rect = sa->totrct; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(color); @@ -439,7 +439,7 @@ void ED_screen_draw_edges(wmWindow *win) ScrArea *sa; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* Note: first loop only draws if U.pixelsize > 1, skip otherwise */ @@ -477,7 +477,7 @@ void ED_screen_draw_edges(wmWindow *win) */ void ED_screen_draw_join_shape(ScrArea *sa1, ScrArea *sa2) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); GPU_line_width(1); @@ -518,7 +518,7 @@ void ED_screen_draw_join_shape(ScrArea *sa1, ScrArea *sa2) void ED_screen_draw_split_preview(ScrArea *sa, const int dir, const float fac) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* splitpoint */ @@ -594,7 +594,7 @@ static void screen_preview_draw_areas(const bScreen *screen, const float scale[2 const float ofs_between_areas) { const float ofs_h = ofs_between_areas * 0.5f; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(col); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 4a8ab724c9a..381a20feca4 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -4888,9 +4888,11 @@ void ED_keymap_screen(wmKeyConfig *keyconf) /* tests */ WM_keymap_add_item(keymap, "SCREEN_OT_region_quadview", QKEY, KM_PRESS, KM_CTRL | KM_ALT, 0); + + WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", RKEY, KM_PRESS, KM_SHIFT, 0); + #ifdef USE_WM_KEYMAP_27X WM_keymap_verify_item(keymap, "SCREEN_OT_repeat_history", RKEY, KM_PRESS, KM_CTRL | KM_ALT, 0); - WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", RKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_verify_item(keymap, "SCREEN_OT_region_flip", F5KEY, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "SCREEN_OT_redo_last", F6KEY, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "SCRIPT_OT_reload", F8KEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 815bcd8a050..6b3c358d2ac 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -681,8 +681,8 @@ static void paint_draw_tex_overlay( /* set quad color. Colored overlay does not get blending */ Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int texCoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint texCoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); if (col) { immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR); @@ -770,8 +770,8 @@ static void paint_draw_cursor_overlay( } Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int texCoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint texCoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR); @@ -930,7 +930,7 @@ static void paint_draw_curve_cursor(Brush *brush) GPU_blend(true); /* draw the bezier handles and the curve segment between the current and next point */ - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -1118,7 +1118,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused)) GPU_blend(true); /* TODO: also set blend mode? */ GPU_line_smooth(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* set brush color */ diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 7f71270c52d..6276a2838f5 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -420,7 +420,7 @@ static void gradient_draw_line(bContext *UNUSED(C), int x, int y, void *customda GPU_blend(true); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 8db78a41252..0ef25eb63a1 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -155,7 +155,7 @@ static void paint_draw_smooth_cursor(bContext *C, int x, int y, void *customdata ARegion *ar = stroke->vc.ar; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ubv(paint->paint_cursor_col); diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c index 29b258fc80d..a0ef753e200 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.c +++ b/source/blender/editors/sculpt_paint/sculpt_uv.c @@ -215,7 +215,7 @@ static void brush_drawcursor_uvsculpt(bContext *C, int x, int y, void *UNUSED(cu alpha *= (size - PX_SIZE_FADE_MIN) / (PX_SIZE_FADE_MAX - PX_SIZE_FADE_MIN); } - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3fvAlpha(brush->add_col, alpha); diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 6105652a4c7..8e521c997fd 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -212,7 +212,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) y = (float)(-ACHANNEL_HEIGHT(ac)); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -404,7 +404,7 @@ void timeline_draw_cache(SpaceAction *saction, Object *ob, Scene *scene) BKE_ptcache_ids_from_object(&pidlist, ob, scene, 0); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* iterate over pointcaches on the active object, and draw each one's range */ 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_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c index d50d10d5cc3..76450cba3cb 100644 --- a/source/blender/editors/space_clip/clip_dopesheet_draw.c +++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c @@ -128,10 +128,10 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene) float strip[4], selected_strip[4]; float height = (dopesheet->tot_channel * CHANNEL_STEP) + (CHANNEL_HEIGHT); - unsigned int keyframe_ct = 0; + uint keyframe_len = 0; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* don't use totrect set, as the width stays the same @@ -186,10 +186,10 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene) if (start_frame != end_frame) { immRectf(pos_id, start_frame, (float) y - STRIP_HEIGHT_HALF, end_frame, (float) y + STRIP_HEIGHT_HALF); - keyframe_ct += 2; + keyframe_len += 2; } else { - keyframe_ct++; + keyframe_len++; } } @@ -199,7 +199,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene) MovieTrackingMarker *marker = &track->markers[i]; if ((marker->flag & (MARKER_DISABLED | MARKER_TRACKED)) == 0) { - keyframe_ct++; + keyframe_len++; } i++; @@ -212,17 +212,17 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene) immUnbindProgram(); - if (keyframe_ct > 0) { + if (keyframe_len > 0) { /* draw keyframe markers */ format = immVertexFormat(); pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int size_id = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); - unsigned int color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); - unsigned int outline_color_id = GWN_vertformat_attr_add(format, "outlineColor", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint size_id = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); + uint color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); + uint outline_color_id = GWN_vertformat_attr_add(format, "outlineColor", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND); GPU_enable_program_point_size(); - immBegin(GWN_PRIM_POINTS, keyframe_ct); + immBegin(GWN_PRIM_POINTS, keyframe_len); /* all same size with black outline */ immAttrib1f(size_id, 2.0f * STRIP_HEIGHT_HALF); @@ -316,7 +316,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar) float y = (float) CHANNEL_FIRST; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 909f0a55c1c..164565192fd 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -167,7 +167,7 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Sc BKE_movieclip_get_cache_segments(clip, &sc->user, &totseg, &points); ED_region_cache_draw_cached_segments(ar, totseg, points, sfra, efra); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* track */ @@ -290,7 +290,7 @@ static void draw_movieclip_muted(ARegion *ar, int width, int height, float zoomx { int x, y; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* find window pixel coordinates of origin */ @@ -452,7 +452,7 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin i++; } - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -1145,8 +1145,8 @@ static void draw_plane_marker_image(Scene *scene, gpuMultMatrix(gl_matrix); Gwn_VertFormat *imm_format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(imm_format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int texCoord = GWN_vertformat_attr_add(imm_format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(imm_format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint texCoord = GWN_vertformat_attr_add(imm_format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR); immUniformColor4f(1.0f, 1.0f, 1.0f, plane_track->image_opacity); @@ -1414,7 +1414,7 @@ static void draw_tracking_tracks(SpaceClip *sc, Scene *scene, ARegion *ar, Movie } } - unsigned int position = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint position = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -1598,7 +1598,7 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip, gpuMultMatrix(sc->stabmat); gpuScale2f(width, height); - unsigned int position = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint position = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/space_clip/clip_graph_draw.c b/source/blender/editors/space_clip/clip_graph_draw.c index d463f585470..34720b3a627 100644 --- a/source/blender/editors/space_clip/clip_graph_draw.c +++ b/source/blender/editors/space_clip/clip_graph_draw.c @@ -328,7 +328,7 @@ void clip_draw_graph(SpaceClip *sc, ARegion *ar, Scene *scene) UI_view2d_grid_free(grid); if (clip) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); GPU_point_size(3.0f); diff --git a/source/blender/editors/space_clip/clip_utils.c b/source/blender/editors/space_clip/clip_utils.c index c3208260b3b..c94853d4233 100644 --- a/source/blender/editors/space_clip/clip_utils.c +++ b/source/blender/editors/space_clip/clip_utils.c @@ -273,7 +273,7 @@ void clip_draw_sfra_efra(View2D *v2d, Scene *scene) GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); GPU_blend(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4f(0.0f, 0.0f, 0.0f, 0.4f); diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c index 66b203ff612..0ffbe451042 100644 --- a/source/blender/editors/space_console/console_draw.c +++ b/source/blender/editors/space_console/console_draw.c @@ -159,7 +159,7 @@ static int console_textview_line_color(struct TextViewContext *tvc, unsigned cha int xy[2] = {CONSOLE_DRAW_MARGIN, CONSOLE_DRAW_MARGIN}; int pen[2]; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); xy[1] += tvc->lheight / 6; console_cursor_wrap_offset(sc->prompt, tvc->console_width, &offl, &offc, NULL); diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 4d4845c41b9..42ad34b659b 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -403,7 +403,7 @@ static void file_draw_preview( /* border */ if (use_dropshadow) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4f(0.0f, 0.0f, 0.0f, 0.4f); @@ -466,7 +466,7 @@ static void draw_background(FileLayout *layout, View2D *v2d) int i; int sy; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShade(TH_BACK, -7); @@ -486,14 +486,14 @@ static void draw_dividers(FileLayout *layout, View2D *v2d) const int step = (layout->tile_w + 2 * layout->tile_border_x); - unsigned int vertex_ct = 0; + unsigned int vertex_len = 0; int sx = (int)v2d->tot.xmin; while (sx < v2d->cur.xmax) { sx += step; - vertex_ct += 4; /* vertex_count = 2 points per line * 2 lines per divider */ + vertex_len += 4; /* vertex_count = 2 points per line * 2 lines per divider */ } - if (vertex_ct > 0) { + if (vertex_len > 0) { int v1[2], v2[2]; unsigned char col_hi[3], col_lo[3]; @@ -504,11 +504,11 @@ static void draw_dividers(FileLayout *layout, View2D *v2d) v2[1] = v2d->cur.ymin; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); - immBegin(GWN_PRIM_LINES, vertex_ct); + immBegin(GWN_PRIM_LINES, vertex_len); sx = (int)v2d->tot.xmin; while (sx < v2d->cur.xmax) { 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_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 4e9f8cd3733..16658c0d8db 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -286,7 +286,7 @@ static void draw_fcurve_vertices(ARegion *ar, FCurve *fcu, bool do_handles, bool * - draw handles before keyframes, so that keyframes will overlap handles (keyframes are more important for users) */ - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); GPU_blend(true); GPU_enable_program_point_size(); @@ -331,8 +331,8 @@ static void draw_fcurve_handles(SpaceIpo *sipo, FCurve *fcu) int sel, b; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); immBeginAtMost(GWN_PRIM_LINES, 4 * 2 * fcu->totvert); @@ -459,7 +459,7 @@ static void draw_fcurve_samples(SpaceIpo *sipo, ARegion *ar, FCurve *fcu) if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) GPU_line_smooth(true); GPU_blend(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor((fcu->flag & FCURVE_SELECTED) ? TH_TEXT_HI : TH_TEXT); diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index c94f2b00db2..699dc29ff47 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -279,7 +279,7 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar) UI_view2d_grid_free(grid); if (((sipo->flag & SIPO_NODRAWCURSOR) == 0) || (sipo->mode == SIPO_MODE_DRIVERS)) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index f70efa00244..24b02106021 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -127,7 +127,7 @@ static void draw_render_info(const bContext *C, (int)(-rd->border.ymin * rd->ysch * rd->size * 0.01f)); } - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_FACE_SELECT); @@ -174,7 +174,7 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, bool color_manage, bool use_d GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); GPU_blend(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* noisy, high contrast make impossible to read if lower alpha is used. */ @@ -574,7 +574,7 @@ void draw_image_sample_line(SpaceImage *sima) Histogram *hist = &sima->sample_line_hist; Gwn_VertFormat *format = immVertexFormat(); - unsigned int shdr_dashed_pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint shdr_dashed_pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR); @@ -779,7 +779,7 @@ void draw_image_cache(const bContext *C, ARegion *ar) /* Draw current frame. */ x = (cfra - sfra) / (efra - sfra + 1) * ar->winx; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_CFRAME); immRecti(pos, x, 0, x + ceilf(framelen), 8 * UI_DPI_FAC); diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c index a1e3842f887..5c1b23e140c 100644 --- a/source/blender/editors/space_info/textview.c +++ b/source/blender/editors/space_info/textview.c @@ -86,7 +86,7 @@ static void console_draw_sel(const char *str, const int sel[2], const int xy[2], GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ubv(bg_sel); @@ -192,7 +192,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str if (bg) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3ubv(bg); @@ -243,7 +243,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str if (bg) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3ubv(bg); diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index a21a62dc8e8..3f1bd0db74c 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -121,7 +121,7 @@ static void nla_action_draw_keyframes(AnimData *adt, bAction *act, float y, floa color[3] *= 2.5f; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -138,17 +138,17 @@ static void nla_action_draw_keyframes(AnimData *adt, bAction *act, float y, floa /* count keys before drawing */ /* Note: It's safe to cast DLRBT_Tree, as it's designed to degrade down to a ListBase */ - unsigned int key_ct = BLI_listbase_count((ListBase *)&keys); + uint key_len = BLI_listbase_count((ListBase *)&keys); - if (key_ct > 0) { + if (key_len > 0) { format = immVertexFormat(); pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int size_id = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); - unsigned int color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); - unsigned int outline_color_id = GWN_vertformat_attr_add(format, "outlineColor", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint size_id = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT); + uint color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint outline_color_id = GWN_vertformat_attr_add(format, "outlineColor", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND); GPU_enable_program_point_size(); - immBegin(GWN_PRIM_POINTS, key_ct); + immBegin(GWN_PRIM_POINTS, key_len); /* - disregard the selection status of keyframes so they draw a certain way * - size is 6.0f which is smaller than the editable keyframes, so that there is a distinction @@ -706,7 +706,7 @@ void draw_nla_main_data(bAnimContext *ac, SpaceNla *snla, ARegion *ar) { AnimData *adt = ale->adt; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* just draw a semi-shaded rect spanning the width of the viewable area if there's data, diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index d7015ed5e53..335c135cfba 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; @@ -2182,7 +2182,7 @@ static void node_composit_backdrop_viewer(SpaceNode *snode, ImBuf *backdrop, bNo const float cross_size = 12 * U.pixelsize; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -2227,7 +2227,7 @@ static void node_composit_backdrop_boxmask(SpaceNode *snode, ImBuf *backdrop, bN y4 = cy - (-sine * halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -2271,7 +2271,7 @@ static void node_composit_backdrop_ellipsemask(SpaceNode *snode, ImBuf *backdrop y4 = cy - (-sine * halveBoxWidth + cosine * -halveBoxHeight) * snode->zoom; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -3264,7 +3264,7 @@ void draw_nodespace_back_pix(const bContext *C, ARegion *ar, SpaceNode *snode, b y + snode->zoom * viewer_border->ymin * ibuf->y, y + snode->zoom * viewer_border->ymax * ibuf->y); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_ACTIVE); @@ -3423,9 +3423,9 @@ static void set_nodelink_vertex( static void nodelink_batch_init(void) { Gwn_VertFormat format = {0}; - unsigned int uv_id = GWN_vertformat_attr_add(&format, "uv", GWN_COMP_U8, 2, GWN_FETCH_INT_TO_FLOAT_UNIT); - unsigned int pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int expand_id = GWN_vertformat_attr_add(&format, "expand", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint uv_id = GWN_vertformat_attr_add(&format, "uv", GWN_COMP_U8, 2, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint expand_id = GWN_vertformat_attr_add(&format, "expand", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format_ex(&format, GWN_USAGE_STATIC); int vcount = LINK_RESOL * 2; /* curve */ vcount += 2; /* restart strip */ diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index c4ed35faabd..5b91796d41c 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -649,7 +649,7 @@ static void node_draw_preview_background(float tile, rctf *rect) float x, y; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -721,7 +721,7 @@ static void node_draw_preview(bNodePreview *preview, rctf *prv) GPU_blend(false); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShadeAlpha(TH_BACK, -15, +100); imm_draw_box_wire_2d(pos, draw_rect.xmin, draw_rect.ymin, draw_rect.xmax, draw_rect.ymax); @@ -758,10 +758,10 @@ void node_draw_shadow(SpaceNode *snode, bNode *node, float radius, float alpha) void node_draw_sockets(View2D *v2d, const bContext *C, bNodeTree *ntree, bNode *node, bool draw_outputs, bool select_all) { - const unsigned int total_input_ct = BLI_listbase_count(&node->inputs); - const unsigned int total_output_ct = BLI_listbase_count(&node->outputs); + const uint total_input_len = BLI_listbase_count(&node->inputs); + const uint total_output_len = BLI_listbase_count(&node->outputs); - if (total_input_ct + total_output_ct == 0) { + if (total_input_len + total_output_len == 0) { return; } @@ -772,8 +772,8 @@ void node_draw_sockets(View2D *v2d, const bContext *C, bNodeTree *ntree, bNode * UI_view2d_scale_get(v2d, &scale, NULL); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint col = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); GPU_blend(true); GPU_enable_program_point_size(); @@ -788,17 +788,17 @@ void node_draw_sockets(View2D *v2d, const bContext *C, bNodeTree *ntree, bNode * immUniform1f("outlineWidth", 1.0f); immUniform4f("outlineColor", 0.0f, 0.0f, 0.0f, 0.6f); - immBeginAtMost(GWN_PRIM_POINTS, total_input_ct + total_output_ct); + immBeginAtMost(GWN_PRIM_POINTS, total_input_len + total_output_len); } /* socket inputs */ - short selected_input_ct = 0; + short selected_input_len = 0; bNodeSocket *sock; for (sock = node->inputs.first; sock; sock = sock->next) { if (nodeSocketIsHidden(sock)) continue; if (select_all || (sock->flag & SELECT)) { - ++selected_input_ct; + ++selected_input_len; continue; } @@ -806,13 +806,13 @@ void node_draw_sockets(View2D *v2d, const bContext *C, bNodeTree *ntree, bNode * } /* socket outputs */ - short selected_output_ct = 0; + short selected_output_len = 0; if (draw_outputs) { for (sock = node->outputs.first; sock; sock = sock->next) { if (nodeSocketIsHidden(sock)) continue; if (select_all || (sock->flag & SELECT)) { - ++selected_output_ct; + ++selected_output_len; continue; } @@ -825,36 +825,36 @@ void node_draw_sockets(View2D *v2d, const bContext *C, bNodeTree *ntree, bNode * } /* go back and draw selected sockets */ - if (selected_input_ct + selected_output_ct > 0) { + if (selected_input_len + selected_output_len > 0) { /* outline for selected sockets */ float c[3]; UI_GetThemeColor3fv(TH_TEXT_HI, c); immUniform4f("outlineColor", c[0], c[1], c[2], 1.0f); immUniform1f("outlineWidth", 1.5f); - immBegin(GWN_PRIM_POINTS, selected_input_ct + selected_output_ct); + immBegin(GWN_PRIM_POINTS, selected_input_len + selected_output_len); - if (selected_input_ct) { + if (selected_input_len) { /* socket inputs */ for (sock = node->inputs.first; sock; sock = sock->next) { if (nodeSocketIsHidden(sock)) continue; if (select_all || (sock->flag & SELECT)) { node_socket_circle_draw(C, ntree, node_ptr, sock, pos, col); - if (--selected_input_ct == 0) + if (--selected_input_len == 0) break; /* stop as soon as last one is drawn */ } } } - if (selected_output_ct) { + if (selected_output_len) { /* socket outputs */ for (sock = node->outputs.first; sock; sock = sock->next) { if (nodeSocketIsHidden(sock)) continue; if (select_all || (sock->flag & SELECT)) { node_socket_circle_draw(C, ntree, node_ptr, sock, pos, col); - if (--selected_output_ct == 0) + if (--selected_output_len == 0) break; /* stop as soon as last one is drawn */ } } @@ -1102,7 +1102,7 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b } /* scale widget thing */ - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShade(color_id, -10); 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_node/node_templates.c b/source/blender/editors/space_node/node_templates.c index b884db1ced4..e3aeb0244e8 100644 --- a/source/blender/editors/space_node/node_templates.c +++ b/source/blender/editors/space_node/node_templates.c @@ -446,21 +446,12 @@ static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname) uiBut *but; NodeLinkArg *argN; int first = 1; - int compatibility = 0; - - if (ntree->type == NTREE_SHADER) { - compatibility = NODE_NEW_SHADING; - } /* generate array of node types sorted by UI name */ bNodeType **sorted_ntypes = NULL; BLI_array_declare(sorted_ntypes); NODE_TYPES_BEGIN(ntype) { - if (compatibility && !(ntype->compatibility & compatibility)) { - continue; - } - if (ntype->nclass != nclass) { continue; } diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index ed4853f5ede..8a8f4715ea3 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -742,7 +742,7 @@ static void outliner_draw_rnacols(ARegion *ar, int sizex) GPU_line_width(1.0f); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShadeAlpha(TH_BACK, -15, -200); @@ -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; } @@ -1740,7 +1740,7 @@ static void outliner_draw_tree_element( /* divider */ { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); unsigned char col[4]; immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -1797,7 +1797,7 @@ static void outliner_draw_tree_element_floating( const TreeElement *te_insert = te_floating->drag_data->insert_handle; const int line_width = 2; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); int coord_y = te_insert->ys; int coord_x = te_insert->xs; float col[4]; @@ -1902,7 +1902,7 @@ static void outliner_draw_hierarchy_lines_recursive( static void outliner_draw_hierarchy_lines(SpaceOops *soops, ListBase *lb, int startx, int *starty) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); unsigned char col[4]; immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -1925,7 +1925,7 @@ static void outliner_draw_struct_marks(ARegion *ar, SpaceOops *soops, ListBase * if (TSELEM_OPEN(tselem, soops)) { if (tselem->type == TSE_RNA_STRUCT) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immThemeColorShadeAlpha(TH_BACK, -15, -200); immRecti(pos, 0, *starty + 1, (int)ar->v2d.cur.xmax, *starty + UI_UNIT_Y - 1); @@ -1938,7 +1938,7 @@ static void outliner_draw_struct_marks(ARegion *ar, SpaceOops *soops, ListBase * outliner_draw_struct_marks(ar, soops, &te->subtree, starty); if (tselem->type == TSE_RNA_STRUCT) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immThemeColorShadeAlpha(TH_BACK, -15, -200); @@ -2008,7 +2008,7 @@ static void outliner_draw_highlights(ARegion *ar, SpaceOops *soops, int startx, GPU_blend(true); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); outliner_draw_highlights_recursive( pos, ar, soops, &soops->tree, col_selection, col_highlight, col_searchmatch, @@ -2083,7 +2083,7 @@ static void outliner_back(ARegion *ar) ystart = UI_UNIT_Y * (ystart / (UI_UNIT_Y)) - OL_Y_OFFSET; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShade(TH_BACK, 6); @@ -2114,7 +2114,7 @@ static void outliner_draw_restrictcols(ARegion *ar) { GPU_line_width(1.0f); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShadeAlpha(TH_BACK, -15, -200); immBegin(GWN_PRIM_LINES, 8); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 7da20131069..a10eda5c3e6 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -343,7 +343,7 @@ static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1, col[3] = 196; /* alpha, used for all meta children */ - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -719,7 +719,7 @@ static void draw_seq_strip(const bContext *C, SpaceSeq *sseq, Scene *scene, AReg x2 = (seq->endstill) ? (seq->start + seq->len) : seq->enddisp; y2 = seq->machine + SEQ_STRIP_OFSTOP; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -1231,8 +1231,8 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq * Do it here because OCIO binds it's own shader. */ Gwn_VertFormat *imm_format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(imm_format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int texCoord = GWN_vertformat_attr_add(imm_format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(imm_format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint texCoord = GWN_vertformat_attr_add(imm_format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); if (scope) { IMB_freeImBuf(ibuf); @@ -1514,7 +1514,7 @@ static void draw_seq_backdrop(View2D *v2d) { int i; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* darker gray overlay over the view backdrop */ @@ -1539,10 +1539,10 @@ static void draw_seq_backdrop(View2D *v2d) /* Darker lines separating the horizontal bands */ i = max_ii(1, ((int)v2d->cur.ymin) - 1); - int line_ct = (int)v2d->cur.ymax - i + 1; + int line_len = (int)v2d->cur.ymax - i + 1; immUniformThemeColor(TH_GRID); - immBegin(GWN_PRIM_LINES, line_ct * 2); - while (line_ct--) { + immBegin(GWN_PRIM_LINES, line_len * 2); + while (line_len--) { immVertex2f(pos, v2d->cur.xmax, i); immVertex2f(pos, v2d->cur.xmin, i); } @@ -1593,7 +1593,7 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar) const Sequence *seq = special_seq_update; GPU_blend(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4ub(255, 255, 255, 48); @@ -1613,7 +1613,7 @@ static void seq_draw_sfra_efra(Scene *scene, View2D *v2d) GPU_blend(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* draw darkened area outside of active timeline @@ -1735,7 +1735,7 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) if (scene->ed && scene->ed->over_flag & SEQ_EDIT_OVERLAY_SHOW) { int cfra_over = (scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS) ? scene->ed->over_cfra : scene->r.cfra + scene->ed->over_ofs; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3f(0.2f, 0.2f, 0.2f); diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 21cd24cf84c..748a5c05ef1 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -913,7 +913,7 @@ static void draw_textscroll(const SpaceText *st, rcti *scroll, rcti *back) float rad; /* background so highlights don't go behind the scrollbar */ - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_BACK); immRecti(pos, back->xmin, back->ymin, back->xmax, back->ymax); @@ -967,7 +967,7 @@ static void draw_documentation(const SpaceText *st, ARegion *ar) boxh = (DOC_HEIGHT + 1) * (st->lheight_dpi + TXT_LINE_SPACING); /* Draw panel */ - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_BACK); @@ -1066,7 +1066,7 @@ static void draw_suggestion_list(const SpaceText *st, const TextDrawContext *tdc /* not needed but stands out nicer */ UI_draw_box_shadow(220, x, y - boxh, x + boxw, y); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_SHADE1); @@ -1089,7 +1089,7 @@ static void draw_suggestion_list(const SpaceText *st, const TextDrawContext *tdc w = st->cwidth * text_get_char_pos(st, str, len); if (item == sel) { - unsigned int posi = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint posi = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_SHADE2); @@ -1130,7 +1130,7 @@ static void draw_text_decoration(SpaceText *st, ARegion *ar) return; } - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* Draw the selection */ @@ -1443,7 +1443,7 @@ void draw_text_main(SpaceText *st, ARegion *ar) if (st->showlinenrs) { x = TXT_OFFSET + TEXTXLOC; - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColor(TH_GRID); immRecti(pos, (TXT_OFFSET - 12), 0, (TXT_OFFSET - 5) + TEXTXLOC, ar->winy - 2); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index bca5faa314a..beb323fb21c 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -748,7 +748,7 @@ void ED_draw_object_facemap( const int *facemap_data = CustomData_get_layer(&me->pdata, CD_FACEMAP); if (facemap_data) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformColor4fv(col); diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 7495733382c..9aaced3e583 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -1065,11 +1065,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_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index bcf9a7c4ad1..8fa327d8782 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1226,7 +1226,7 @@ void VIEW3D_OT_properties(wmOperatorType *ot) static int view3d_object_mode_menu(bContext *C, wmOperator *UNUSED(op)) { Object *ob = CTX_data_active_object(C); - if (ob->type == OB_ARMATURE) { + if (ob && ((ob->mode & OB_MODE_EDIT) == 0) && (ELEM(ob->type, OB_ARMATURE))) { ED_object_mode_toggle(C, OB_MODE_POSE); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index a428b60643d..2c732586606 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -814,8 +814,8 @@ static void draw_view_axis(RegionView3D *rv3d, const rcti *rect) GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int col = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint col = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); immBegin(GWN_PRIM_LINES, 6); @@ -859,8 +859,8 @@ static void UNUSED_FUNCTION(draw_rotation_guide)(RegionView3D *rv3d) glDepthMask(GL_FALSE); /* don't overwrite zbuf */ Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); - unsigned int col = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint col = GWN_vertformat_attr_add(format, "color", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT); immBindBuiltinProgram(GPU_SHADER_3D_SMOOTH_COLOR); diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index f9fdf8c2cc0..8c6bbaa94da 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -263,7 +263,7 @@ static void drawFlyPixel(const struct bContext *UNUSED(C), ARegion *UNUSED(ar), y2 = yoff + 0.55f * fly->height; Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); 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/editors/space_view3d/view3d_manipulator_ruler.c b/source/blender/editors/space_view3d/view3d_manipulator_ruler.c index c33f15c0493..d102fdc6e04 100644 --- a/source/blender/editors/space_view3d/view3d_manipulator_ruler.c +++ b/source/blender/editors/space_view3d/view3d_manipulator_ruler.c @@ -793,7 +793,7 @@ static void manipulator_ruler_draw(const bContext *C, wmManipulator *mpr) float co_ss_snap[3]; ED_view3d_project_float_global(ar, ruler_item->co[inter->co_index], co_ss_snap, V3D_PROJ_TEST_NOP); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(color_act); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 00f0dea8fe2..0fd109f858d 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -311,7 +311,8 @@ void view3d_keymap(wmKeyConfig *keyconf) RNA_boolean_set(kmi->ptr, "center", true); #endif - WM_keymap_add_menu_pie(keymap, "VIEW3D_MT_view_pie", ACCENTGRAVEKEY, KM_CLICK_DRAG, 0, 0); + WM_keymap_add_menu_pie(keymap, "VIEW3D_MT_view_pie", ACCENTGRAVEKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "VIEW3D_OT_navigate", ACCENTGRAVEKEY, KM_PRESS, KM_SHIFT, 0); /* numpad view hotkeys*/ WM_keymap_add_item(keymap, "VIEW3D_OT_view_camera", PAD0, KM_PRESS, 0, 0); diff --git a/source/blender/editors/space_view3d/view3d_ruler.c b/source/blender/editors/space_view3d/view3d_ruler.c index 5911c8224be..4617b92c780 100644 --- a/source/blender/editors/space_view3d/view3d_ruler.c +++ b/source/blender/editors/space_view3d/view3d_ruler.c @@ -703,7 +703,7 @@ static void ruler_info_draw_pixel(const struct bContext *C, ARegion *ar, void *a float co_ss[3]; ED_view3d_project_float_global(ar, ruler_item->co[ruler_item->co_index], co_ss, V3D_PROJ_TEST_NOP); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(color_act); diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index b7dbb09e1a4..0f82dfa775c 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1062,6 +1062,8 @@ static Base *object_mouse_select_menu( short baseCount = 0; bool ok; LinkNode *linklist = NULL; + const int object_type_exclude_select = ( + vc->v3d->object_type_exclude_viewport | vc->v3d->object_type_exclude_select); /* handle base->object->select_color */ CTX_DATA_BEGIN (C, Base *, base, selectable_bases) @@ -1079,6 +1081,9 @@ static Base *object_mouse_select_menu( } } else { + if (object_type_exclude_select & (1 << base->object->type)) { + continue; + } const int dist = 15 * U.pixelsize; if (ED_view3d_project_base(vc->ar, base) == V3D_PROJ_RET_OK) { const int delta_px[2] = {base->sx - mval[0], base->sy - mval[1]}; @@ -1447,9 +1452,13 @@ static bool ed_object_select_pick( basact = object_mouse_select_menu(C, &vc, NULL, 0, mval, toggle); } else { + const int object_type_exclude_select = ( + vc.v3d->object_type_exclude_viewport | vc.v3d->object_type_exclude_select); base = startbase; while (base) { - if (BASE_SELECTABLE(base)) { + if (BASE_SELECTABLE(base) && + ((object_type_exclude_select & (1 << base->object->type)) == 0)) + { float screen_co[2]; if (ED_view3d_project_float_global( ar, base->object->obmat[3], screen_co, diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c index e3e82e8b9c2..7356d4a6eea 100644 --- a/source/blender/editors/space_view3d/view3d_walk.c +++ b/source/blender/editors/space_view3d/view3d_walk.c @@ -344,7 +344,7 @@ static void drawWalkPixel(const struct bContext *UNUSED(C), ARegion *ar, void *a } Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index d26da986a6c..1f2589d8a0c 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -813,25 +813,100 @@ enum { TFM_MODAL_INSERTOFS_TOGGLE_DIR = 27, }; +static bool transform_modal_item_poll(const wmOperator *op, int value) +{ + const TransInfo *t = op->customdata; + switch (value) { + case TFM_MODAL_PROPSIZE: + case TFM_MODAL_PROPSIZE_UP: + case TFM_MODAL_PROPSIZE_DOWN: + { + if ((t->flag & T_PROP_EDIT) == 0) { + return false; + } + break; + } + case TFM_MODAL_ADD_SNAP: + case TFM_MODAL_REMOVE_SNAP: + { + if (t->spacetype != SPACE_VIEW3D) { + return false; + } + else if (t->tsnap.mode & (SCE_SNAP_MODE_INCREMENT | SCE_SNAP_MODE_GRID)) { + return false; + } + else if (!validSnap(t)) { + return false; + } + break; + } + case TFM_MODAL_AXIS_X: + case TFM_MODAL_AXIS_Y: + case TFM_MODAL_AXIS_Z: + case TFM_MODAL_PLANE_X: + case TFM_MODAL_PLANE_Y: + case TFM_MODAL_PLANE_Z: + { + if (t->flag & T_NO_CONSTRAINT) { + return false; + } + if (!ELEM(value, TFM_MODAL_AXIS_X, TFM_MODAL_AXIS_Y)) { + if (t->flag & T_2D_EDIT) { + return false; + } + } + break; + } + case TFM_MODAL_CONS_OFF: + { + if ((t->con.mode & CON_APPLY) == 0) { + return false; + } + break; + } + case TFM_MODAL_EDGESLIDE_UP: + case TFM_MODAL_EDGESLIDE_DOWN: + { + if (t->mode != TFM_EDGE_SLIDE) { + return false; + } + break; + } + case TFM_MODAL_INSERTOFS_TOGGLE_DIR: + { + if (t->spacetype != SPACE_NODE) { + return false; + } + break; + } + case TFM_MODAL_AUTOIK_LEN_INC: + case TFM_MODAL_AUTOIK_LEN_DEC: + { + if ((t->flag & T_AUTOIK) == 0) { + return false; + } + break; + } + } + return true; +} + /* called in transform_ops.c, on each regeneration of keymaps */ wmKeyMap *transform_modal_keymap(wmKeyConfig *keyconf) { static const EnumPropertyItem modal_items[] = { - {TFM_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""}, {TFM_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""}, - {TFM_MODAL_TRANSLATE, "TRANSLATE", 0, "Translate", ""}, - {TFM_MODAL_ROTATE, "ROTATE", 0, "Rotate", ""}, - {TFM_MODAL_RESIZE, "RESIZE", 0, "Resize", ""}, - {TFM_MODAL_SNAP_INV_ON, "SNAP_INV_ON", 0, "Invert Snap On", ""}, + {TFM_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""}, + {TFM_MODAL_AXIS_X, "AXIS_X", 0, "X axis", ""}, + {TFM_MODAL_AXIS_Y, "AXIS_Y", 0, "Y axis", ""}, + {TFM_MODAL_AXIS_Z, "AXIS_Z", 0, "Z axis", ""}, + {TFM_MODAL_PLANE_X, "PLANE_X", 0, "X plane", ""}, + {TFM_MODAL_PLANE_Y, "PLANE_Y", 0, "Y plane", ""}, + {TFM_MODAL_PLANE_Z, "PLANE_Z", 0, "Z plane", ""}, + {TFM_MODAL_CONS_OFF, "CONS_OFF", 0, "Clear Constraints", ""}, + {TFM_MODAL_SNAP_INV_ON, "SNAP_INV_ON", 0, "Invert Snap", ""}, {TFM_MODAL_SNAP_INV_OFF, "SNAP_INV_OFF", 0, "Invert Snap Off", ""}, {TFM_MODAL_SNAP_TOGGLE, "SNAP_TOGGLE", 0, "Snap Toggle", ""}, - {TFM_MODAL_AXIS_X, "AXIS_X", 0, "Orientation X axis", ""}, - {TFM_MODAL_AXIS_Y, "AXIS_Y", 0, "Orientation Y axis", ""}, - {TFM_MODAL_AXIS_Z, "AXIS_Z", 0, "Orientation Z axis", ""}, - {TFM_MODAL_PLANE_X, "PLANE_X", 0, "Orientation X plane", ""}, - {TFM_MODAL_PLANE_Y, "PLANE_Y", 0, "Orientation Y plane", ""}, - {TFM_MODAL_PLANE_Z, "PLANE_Z", 0, "Orientation Z plane", ""}, - {TFM_MODAL_CONS_OFF, "CONS_OFF", 0, "Remove Constraints", ""}, {TFM_MODAL_ADD_SNAP, "ADD_SNAP", 0, "Add Snap Point", ""}, {TFM_MODAL_REMOVE_SNAP, "REMOVE_SNAP", 0, "Remove Last Snap Point", ""}, {NUM_MODAL_INCREMENT_UP, "INCREMENT_UP", 0, "Numinput Increment Up", ""}, @@ -844,6 +919,9 @@ wmKeyMap *transform_modal_keymap(wmKeyConfig *keyconf) {TFM_MODAL_EDGESLIDE_DOWN, "EDGESLIDE_PREV_NEXT", 0, "Select previous Edge Slide Edge", ""}, {TFM_MODAL_PROPSIZE, "PROPORTIONAL_SIZE", 0, "Adjust Proportional Influence", ""}, {TFM_MODAL_INSERTOFS_TOGGLE_DIR, "INSERTOFS_TOGGLE_DIR", 0, "Toggle Direction for Node Auto-offset", ""}, + {TFM_MODAL_TRANSLATE, "TRANSLATE", 0, "Translate", ""}, + {TFM_MODAL_ROTATE, "ROTATE", 0, "Rotate", ""}, + {TFM_MODAL_RESIZE, "RESIZE", 0, "Resize", ""}, {0, NULL, 0, NULL, NULL} }; @@ -853,12 +931,24 @@ wmKeyMap *transform_modal_keymap(wmKeyConfig *keyconf) if (keymap && keymap->modal_items) return NULL; keymap = WM_modalkeymap_add(keyconf, "Transform Modal Map", modal_items); + keymap->poll_modal_item = transform_modal_item_poll; /* items for modal map */ - WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, TFM_MODAL_CANCEL); - WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_PRESS, KM_ANY, 0, TFM_MODAL_CONFIRM); - WM_modalkeymap_add_item(keymap, RETKEY, KM_PRESS, KM_ANY, 0, TFM_MODAL_CONFIRM); - WM_modalkeymap_add_item(keymap, PADENTER, KM_PRESS, KM_ANY, 0, TFM_MODAL_CONFIRM); + WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_PRESS, KM_ANY, 0, TFM_MODAL_CONFIRM); + WM_modalkeymap_add_item(keymap, RETKEY, KM_PRESS, KM_ANY, 0, TFM_MODAL_CONFIRM); + WM_modalkeymap_add_item(keymap, PADENTER, KM_PRESS, KM_ANY, 0, TFM_MODAL_CONFIRM); + WM_modalkeymap_add_item(keymap, RIGHTMOUSE, KM_PRESS, KM_ANY, 0, TFM_MODAL_CANCEL); + WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, TFM_MODAL_CANCEL); + + WM_modalkeymap_add_item(keymap, XKEY, KM_PRESS, 0, 0, TFM_MODAL_AXIS_X); + WM_modalkeymap_add_item(keymap, YKEY, KM_PRESS, 0, 0, TFM_MODAL_AXIS_Y); + WM_modalkeymap_add_item(keymap, ZKEY, KM_PRESS, 0, 0, TFM_MODAL_AXIS_Z); + + WM_modalkeymap_add_item(keymap, XKEY, KM_PRESS, KM_SHIFT, 0, TFM_MODAL_PLANE_X); + WM_modalkeymap_add_item(keymap, YKEY, KM_PRESS, KM_SHIFT, 0, TFM_MODAL_PLANE_Y); + WM_modalkeymap_add_item(keymap, ZKEY, KM_PRESS, KM_SHIFT, 0, TFM_MODAL_PLANE_Z); + + WM_modalkeymap_add_item(keymap, CKEY, KM_PRESS, 0, 0, TFM_MODAL_CONS_OFF); WM_modalkeymap_add_item(keymap, GKEY, KM_PRESS, 0, 0, TFM_MODAL_TRANSLATE); WM_modalkeymap_add_item(keymap, RKEY, KM_PRESS, 0, 0, TFM_MODAL_ROTATE); @@ -1410,21 +1500,6 @@ int transformEvent(TransInfo *t, const wmEvent *event) handled = true; } } - else { - if (!(t->flag & T_NO_CONSTRAINT)) { - stopConstraint(t); - t->redraw |= TREDRAW_HARD; - handled = true; - } - } - break; - case XKEY: - case YKEY: - case ZKEY: - if (!(t->flag & T_NO_CONSTRAINT)) { - transform_event_xyz_constraint(t, event->type, cmode); - handled = true; - } break; case OKEY: if (t->flag & T_PROP_EDIT && event->shift) { @@ -1551,6 +1626,12 @@ int transformEvent(TransInfo *t, const wmEvent *event) handled = true; } + if (t->redraw && + !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) + { + WM_window_status_area_tag_redraw(CTX_wm_window(t->context)); + } + if (handled || t->redraw) { return 0; } @@ -1774,7 +1855,7 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata) } /* And now, solid lines. */ - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); UNUSED_VARS_NDEBUG(pos); /* silence warning */ BLI_assert(pos == POS_INDEX); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -6982,7 +7063,7 @@ static void drawEdgeSlide(TransInfo *t) gpuPushMatrix(); gpuMultMatrix(TRANS_DATA_CONTAINER_FIRST_OK(t)->obedit->obmat); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 744170d9aba..6685f785247 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -772,8 +772,8 @@ void snapGridIncrementAction(TransInfo *t, float *val, GearsType action); void snapSequenceBounds(TransInfo *t, const int mval[2]); -bool activeSnap(TransInfo *t); -bool validSnap(TransInfo *t); +bool activeSnap(const TransInfo *t); +bool validSnap(const TransInfo *t); void initSnapping(struct TransInfo *t, struct wmOperator *op); void freeSnapping(struct TransInfo *t); @@ -783,10 +783,10 @@ void applySnapping(TransInfo *t, float *vec); void resetSnapping(TransInfo *t); eRedrawFlag handleSnapping(TransInfo *t, const struct wmEvent *event); void drawSnapping(const struct bContext *C, TransInfo *t); -bool usingSnappingNormal(TransInfo *t); -bool validSnappingNormal(TransInfo *t); +bool usingSnappingNormal(const TransInfo *t); +bool validSnappingNormal(const TransInfo *t); -void getSnapPoint(TransInfo *t, float vec[3]); +void getSnapPoint(const TransInfo *t, float vec[3]); void addSnapPoint(TransInfo *t); eRedrawFlag updateSelectedSnapPoint(TransInfo *t); void removeSnapPoint(TransInfo *t); diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 9df8264cc76..d40602f8d43 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -823,7 +823,7 @@ void drawPropCircle(const struct bContext *C, TransInfo *t) if (depth_test_enabled) GPU_depth_test(false); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformThemeColor(TH_GRID); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index b007a8d1b99..3f71915a690 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1132,7 +1132,7 @@ void drawLine(TransInfo *t, const float center[3], const float dir[3], char axis } UI_make_axis_color(col, col2, axis); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformColor3ubv(col2); diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 9ffd14ad956..dc922b5c9ba 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -124,13 +124,13 @@ int BIF_snappingSupported(Object *obedit) } #endif -bool validSnap(TransInfo *t) +bool validSnap(const TransInfo *t) { return (t->tsnap.status & (POINT_INIT | TARGET_INIT)) == (POINT_INIT | TARGET_INIT) || (t->tsnap.status & (MULTI_POINTS | TARGET_INIT)) == (MULTI_POINTS | TARGET_INIT); } -bool activeSnap(TransInfo *t) +bool activeSnap(const TransInfo *t) { return ((t->modifiers & (MOD_SNAP | MOD_SNAP_INVERT)) == MOD_SNAP) || ((t->modifiers & (MOD_SNAP | MOD_SNAP_INVERT)) == MOD_SNAP_INVERT); @@ -165,7 +165,7 @@ void drawSnapping(const struct bContext *C, TransInfo *t) invert_m4_m4(imat, rv3d->viewmat); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); @@ -219,7 +219,7 @@ void drawSnapping(const struct bContext *C, TransInfo *t) GPU_blend(true); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -451,12 +451,12 @@ void resetSnapping(TransInfo *t) t->tsnap.snapNodeBorder = 0; } -bool usingSnappingNormal(TransInfo *t) +bool usingSnappingNormal(const TransInfo *t) { return t->tsnap.align; } -bool validSnappingNormal(TransInfo *t) +bool validSnappingNormal(const TransInfo *t) { if (validSnap(t)) { if (!is_zero_v3(t->tsnap.snapNormal)) { @@ -789,7 +789,7 @@ void removeSnapPoint(TransInfo *t) } } -void getSnapPoint(TransInfo *t, float vec[3]) +void getSnapPoint(const TransInfo *t, float vec[3]) { if (t->tsnap.points.first) { TransSnapPoint *p; diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 411c4838252..f0d6b5c2a71 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -168,7 +168,7 @@ static void draw_uvs_shadow(Object *obedit) const int cd_loop_uv_offset = CustomData_get_offset(&bm->ldata, CD_MLOOPUV); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -229,7 +229,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, Object *obedit, BME } } - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -309,8 +309,8 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, Object *obedit, BME col[3] = 0.5f; /* hard coded alpha, not that nice */ Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint color = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR); @@ -495,7 +495,7 @@ static void draw_uvs_other_mesh(Object *ob, const Image *curimage, static void draw_uvs_other(ViewLayer *view_layer, Object *obedit, const Image *curimage, const int other_uv_filter) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -536,7 +536,7 @@ static void draw_uvs_texpaint(SpaceImage *sima, Scene *scene, ViewLayer *view_la mloopuv = me->mloopuv; } - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -765,7 +765,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, ViewLayer *view_layer, Obje immEnd(); /* Then draw each face contour separately. */ - if (loop_vbo->vertex_ct != 0) { + if (loop_vbo->vertex_len != 0) { GWN_batch_program_use_begin(loop_batch); unsigned int index = 0, loop_vbo_count; BM_ITER_MESH(efa, &iter, bm, BM_FACES_OF_MESH) { @@ -792,7 +792,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, ViewLayer *view_layer, Obje /* Create a color buffer. */ static Gwn_VertFormat format = { 0 }; static uint shdr_col; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { shdr_col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT); } diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index 9091f3eff0b..c3737787933 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -1567,7 +1567,7 @@ static void stitch_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *ar static Gwn_VertFormat format = { 0 }; static unsigned int pos_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } diff --git a/source/blender/gpu/GPU_framebuffer.h b/source/blender/gpu/GPU_framebuffer.h index 084ee4c0459..ddf485c3c21 100644 --- a/source/blender/gpu/GPU_framebuffer.h +++ b/source/blender/gpu/GPU_framebuffer.h @@ -117,7 +117,7 @@ void GPU_framebuffer_texture_detach_slot( GPU_framebuffer_config_array(*(_fb), config, (sizeof(config) / sizeof(GPUAttachment))); \ } while (0) -void GPU_framebuffer_config_array(GPUFrameBuffer *fb, const GPUAttachment *config, int config_ct); +void GPU_framebuffer_config_array(GPUFrameBuffer *fb, const GPUAttachment *config, int config_len); #define GPU_ATTACHMENT_NONE \ {.tex = NULL, .layer = -1, .mip = 0} diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index a65c09152ee..8ddb7b87c4a 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -241,7 +241,7 @@ GPUBuiltin GPU_get_material_builtins(GPUMaterial *material); void GPU_material_sss_profile_create(GPUMaterial *material, float radii[3], short *falloff_type, float *sharpness); struct GPUUniformBuffer *GPU_material_sss_profile_get( - GPUMaterial *material, int sample_ct, struct GPUTexture **tex_profile); + GPUMaterial *material, int sample_len, struct GPUTexture **tex_profile); /* High level functions to create and use GPU materials */ GPUMaterial *GPU_material_from_nodetree_find( diff --git a/source/blender/gpu/intern/gpu_batch.c b/source/blender/gpu/intern/gpu_batch.c index 59d88e81822..6194e720156 100644 --- a/source/blender/gpu/intern/gpu_batch.c +++ b/source/blender/gpu/intern/gpu_batch.c @@ -126,7 +126,7 @@ Gwn_Batch *GPU_batch_tris_from_poly_2d_encoded( /* We have vertices and tris, make a batch from this. */ static Gwn_VertFormat format = {0}; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } @@ -230,7 +230,7 @@ Gwn_Batch *GPU_batch_wire_from_poly_2d_encoded( /* We have vertices and tris, make a batch from this. */ static Gwn_VertFormat format = {0}; static struct { uint pos; } attr_id; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { attr_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); } diff --git a/source/blender/gpu/intern/gpu_batch_presets.c b/source/blender/gpu/intern/gpu_batch_presets.c index 10cbd16490b..eaf0a6821ff 100644 --- a/source/blender/gpu/intern/gpu_batch_presets.c +++ b/source/blender/gpu/intern/gpu_batch_presets.c @@ -65,7 +65,7 @@ static ListBase presets_list = {NULL, NULL}; static Gwn_VertFormat *preset_3D_format(void) { - if (g_presets_3d.format.attrib_ct == 0) { + if (g_presets_3d.format.attr_len == 0) { Gwn_VertFormat *format = &g_presets_3d.format; g_presets_3d.attr_id.pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); g_presets_3d.attr_id.nor = GWN_vertformat_attr_add(format, "nor", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 688386810ea..1a4750652cc 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -126,29 +126,29 @@ static void gpu_material_diffuse_get(int UNUSED(nr), float diff[4]) /* Allocates a non-initialized buffer to be sent to GPU. * Return is false it indicates that the memory map failed. */ -static bool gpu_pbvh_vert_buf_data_set(GPU_PBVH_Buffers *buffers, unsigned int vert_ct) +static bool gpu_pbvh_vert_buf_data_set(GPU_PBVH_Buffers *buffers, unsigned int vert_len) { if (buffers->vert_buf == NULL) { /* Initialize vertex buffer */ /* match 'VertexBufferFormat' */ static Gwn_VertFormat format = {0}; - if (format.attrib_ct == 0) { + if (format.attr_len == 0) { g_vbo_id.pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT); g_vbo_id.nor = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_I16, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); g_vbo_id.col = GWN_vertformat_attr_add(&format, "color", GWN_COMP_U8, 3, GWN_FETCH_INT_TO_FLOAT_UNIT); } #if 0 buffers->vert_buf = GWN_vertbuf_create_with_format_ex(&format, GWN_USAGE_DYNAMIC); - GWN_vertbuf_data_alloc(buffers->vert_buf, vert_ct); + GWN_vertbuf_data_alloc(buffers->vert_buf, vert_len); } - else if (vert_ct != buffers->vert_buf->vertex_ct) { - GWN_vertbuf_data_resize(buffers->vert_buf, vert_ct); + else if (vert_len != buffers->vert_buf->vertex_len) { + GWN_vertbuf_data_resize(buffers->vert_buf, vert_len); } #else buffers->vert_buf = GWN_vertbuf_create_with_format_ex(&format, GWN_USAGE_STATIC); } - GWN_vertbuf_data_alloc(buffers->vert_buf, vert_ct); + GWN_vertbuf_data_alloc(buffers->vert_buf, vert_len); #endif return buffers->vert_buf->data != NULL; } diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c index eabd501f1d5..ffc72718e42 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.c +++ b/source/blender/gpu/intern/gpu_framebuffer.c @@ -300,7 +300,7 @@ void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, GPUTexture *tex) * Setting GPUAttachment.mip to -1 will leave the texture in this slot. * Setting GPUAttachment.tex to NULL will detach the texture in this slot. **/ -void GPU_framebuffer_config_array(GPUFrameBuffer *fb, const GPUAttachment *config, int config_ct) +void GPU_framebuffer_config_array(GPUFrameBuffer *fb, const GPUAttachment *config, int config_len) { if (config[0].tex) { BLI_assert(GPU_texture_depth(config[0].tex)); @@ -317,7 +317,7 @@ void GPU_framebuffer_config_array(GPUFrameBuffer *fb, const GPUAttachment *confi } int slot = 0; - for (int i = 1; i < config_ct; ++i, ++slot) { + for (int i = 1; i < config_len; ++i, ++slot) { if (config[i].tex != NULL) { BLI_assert(GPU_texture_depth(config[i].tex) == false); gpu_framebuffer_texture_attach_ex(fb, config[i].tex, slot, config[i].layer, config[i].mip); diff --git a/source/blender/gpu/intern/gpu_immediate_util.c b/source/blender/gpu/intern/gpu_immediate_util.c index bad878ef4bf..30672af9c02 100644 --- a/source/blender/gpu/intern/gpu_immediate_util.c +++ b/source/blender/gpu/intern/gpu_immediate_util.c @@ -235,7 +235,7 @@ void imm_draw_box_wire_3d(unsigned pos, float x1, float y1, float x2, float y2) */ void imm_draw_box_checker_2d(float x1, float y1, float x2, float y2) { - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_CHECKER); immUniform4f("color1", 0.15f, 0.15f, 0.15f, 1.0f); diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index c224e3e0e32..bd0e35f5ab6 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -354,7 +354,7 @@ static float eval_integral(float x0, float x1, short falloff_type, float sharpne #undef INTEGRAL_RESOLUTION static void compute_sss_kernel( - GPUSssKernelData *kd, float radii[3], int sample_ct, int falloff_type, float sharpness) + GPUSssKernelData *kd, float radii[3], int sample_len, int falloff_type, float sharpness) { float rad[3]; /* Minimum radius */ @@ -390,13 +390,13 @@ static void compute_sss_kernel( } /* Compute samples locations on the 1d kernel [-1..1] */ - sss_calculate_offsets(kd, sample_ct, SSS_EXPONENT); + sss_calculate_offsets(kd, sample_len, SSS_EXPONENT); /* Weights sum for normalization */ float sum[3] = {0.0f, 0.0f, 0.0f}; /* Compute integral of each sample footprint */ - for (int i = 0; i < sample_ct; i++) { + for (int i = 0; i < sample_len; i++) { float x0, x1; if (i == 0) { @@ -406,8 +406,8 @@ static void compute_sss_kernel( x0 = (kd->kernel[i - 1][3] + kd->kernel[i][3]) / 2.0f; } - if (i == sample_ct - 1) { - x1 = kd->kernel[sample_ct - 1][3] + fabsf(kd->kernel[sample_ct - 2][3] - kd->kernel[sample_ct - 1][3]) / 2.0f; + if (i == sample_len - 1) { + x1 = kd->kernel[sample_len - 1][3] + fabsf(kd->kernel[sample_len - 2][3] - kd->kernel[sample_len - 1][3]) / 2.0f; } else { x1 = (kd->kernel[i][3] + kd->kernel[i + 1][3]) / 2.0f; @@ -428,25 +428,25 @@ static void compute_sss_kernel( for (int i = 0; i < 3; ++i) { if (sum[i] > 0.0f) { /* Normalize */ - for (int j = 0; j < sample_ct; j++) { + for (int j = 0; j < sample_len; j++) { kd->kernel[j][i] /= sum[i]; } } else { /* Avoid 0 kernel sum. */ - kd->kernel[sample_ct / 2][i] = 1.0f; + kd->kernel[sample_len / 2][i] = 1.0f; } } /* Put center sample at the start of the array (to sample first) */ float tmpv[4]; - copy_v4_v4(tmpv, kd->kernel[sample_ct / 2]); - for (int i = sample_ct / 2; i > 0; i--) { + copy_v4_v4(tmpv, kd->kernel[sample_len / 2]); + for (int i = sample_len / 2; i > 0; i--) { copy_v4_v4(kd->kernel[i], kd->kernel[i - 1]); } copy_v4_v4(kd->kernel[0], tmpv); - kd->samples = sample_ct; + kd->samples = sample_len; } #define INTEGRAL_RESOLUTION 512 @@ -523,12 +523,12 @@ void GPU_material_sss_profile_create(GPUMaterial *material, float radii[3], shor } } -struct GPUUniformBuffer *GPU_material_sss_profile_get(GPUMaterial *material, int sample_ct, GPUTexture **tex_profile) +struct GPUUniformBuffer *GPU_material_sss_profile_get(GPUMaterial *material, int sample_len, GPUTexture **tex_profile) { if (!material->sss_enabled) return NULL; - if (material->sss_dirty || (material->sss_samples != sample_ct)) { + if (material->sss_dirty || (material->sss_samples != sample_len)) { GPUSssKernelData kd; float sharpness = material->sss_sharpness; @@ -536,7 +536,7 @@ struct GPUUniformBuffer *GPU_material_sss_profile_get(GPUMaterial *material, int /* XXX Black magic but it seems to fit. Maybe because we integrate -1..1 */ sharpness *= 0.5f; - compute_sss_kernel(&kd, material->sss_radii, sample_ct, material->sss_falloff, sharpness); + compute_sss_kernel(&kd, material->sss_radii, sample_len, material->sss_falloff, sharpness); /* Update / Create UBO */ GPU_uniformbuffer_update(material->sss_profile, &kd); @@ -553,7 +553,7 @@ struct GPUUniformBuffer *GPU_material_sss_profile_get(GPUMaterial *material, int MEM_freeN(translucence_profile); - material->sss_samples = sample_ct; + material->sss_samples = sample_len; material->sss_dirty = false; } diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c index a85a9a9bac3..d9248e06dfb 100644 --- a/source/blender/gpu/intern/gpu_texture.c +++ b/source/blender/gpu/intern/gpu_texture.c @@ -917,12 +917,12 @@ GPUTexture *GPU_texture_create_from_vertbuf(Gwn_VertBuf *vert) Gwn_VertAttr *attr = &format->attribs[0]; /* Detect incompatible cases (not supported by texture buffers) */ - BLI_assert(format->attrib_ct == 1 && vert->vbo_id != 0); - BLI_assert(attr->comp_ct != 3); /* Not until OGL 4.0 */ + BLI_assert(format->attr_len == 1 && vert->vbo_id != 0); + BLI_assert(attr->comp_len != 3); /* Not until OGL 4.0 */ BLI_assert(attr->comp_type != GWN_COMP_I10); BLI_assert(attr->fetch_mode != GWN_FETCH_INT_TO_FLOAT); - unsigned int byte_per_comp = attr->sz / attr->comp_ct; + unsigned int byte_per_comp = attr->sz / attr->comp_len; bool is_uint = ELEM(attr->comp_type, GWN_COMP_U8, GWN_COMP_U16, GWN_COMP_U32); /* Cannot fetch signed int or 32bit ints as normalized float. */ @@ -933,7 +933,7 @@ GPUTexture *GPU_texture_create_from_vertbuf(Gwn_VertBuf *vert) GPUTextureFormat data_type; switch (attr->fetch_mode) { case GWN_FETCH_FLOAT: - switch (attr->comp_ct) { + switch (attr->comp_len) { case 1: data_type = GPU_R32F; break; case 2: data_type = GPU_RG32F; break; // case 3: data_type = GPU_RGB32F; break; /* Not supported */ @@ -941,7 +941,7 @@ GPUTexture *GPU_texture_create_from_vertbuf(Gwn_VertBuf *vert) } break; case GWN_FETCH_INT: - switch (attr->comp_ct) { + switch (attr->comp_len) { case 1: switch (byte_per_comp) { case 1: data_type = (is_uint) ? GPU_R8UI : GPU_R8I; break; @@ -966,7 +966,7 @@ GPUTexture *GPU_texture_create_from_vertbuf(Gwn_VertBuf *vert) } break; case GWN_FETCH_INT_TO_FLOAT_UNIT: - switch (attr->comp_ct) { + switch (attr->comp_len) { case 1: data_type = (byte_per_comp == 1) ? GPU_R8 : GPU_R16; break; case 2: data_type = (byte_per_comp == 1) ? GPU_RG8 : GPU_RG16; break; default: data_type = (byte_per_comp == 1) ? GPU_RGBA8 : GPU_RGBA16; break; diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 5668cf24fe6..331eb216f61 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -179,7 +179,7 @@ typedef struct View3DOverlay { /* Other settings */ float wireframe_threshold; - int object_type_exclude; + char _pad0[4]; } View3DOverlay; @@ -202,6 +202,9 @@ typedef struct View3D { unsigned int lay_prev; /* for active layer toggle */ unsigned int lay_used; /* used while drawing */ + int object_type_exclude_viewport; + int object_type_exclude_select; + short persp DNA_DEPRECATED; short view DNA_DEPRECATED; @@ -358,10 +361,11 @@ enum { V3D_SHADING_OBJECT_OUTLINE = (1 << 0), V3D_SHADING_XRAY = (1 << 1), V3D_SHADING_SHADOW = (1 << 2), - V3D_SHADING_SCENE_LIGHT = (1 << 3), + V3D_SHADING_SCENE_LIGHTS = (1 << 3), V3D_SHADING_SPECULAR_HIGHLIGHT = (1 << 4), V3D_SHADING_CAVITY = (1 << 5), V3D_SHADING_MATCAP_FLIP_X = (1 << 6), + V3D_SHADING_SCENE_WORLD = (1 << 7), }; /* View3DShading->color_type */ diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index bd2811d3306..80ad3840a8f 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -331,6 +331,8 @@ typedef struct wmKeyMap { /* runtime */ /** Verify if enabled in the current context, use #WM_keymap_poll instead of direct calls. */ bool (*poll)(struct bContext *); + bool (*poll_modal_item)(const struct wmOperator *op, int value); + /** For modal, #EnumPropertyItem for now. */ const void *modal_items; } wmKeyMap; 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_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 8ffcb85deed..89ca6b52c75 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -7756,12 +7756,6 @@ static void rna_def_node(BlenderRNA *brna) {NODE_CUSTOM, "CUSTOM", 0, "Custom", "Custom Node"}, {0, NULL, 0, NULL, NULL}}; - static const EnumPropertyItem node_shading_compatibilities[] = { - {NODE_OLD_SHADING, "OLD_SHADING", 0, "Old Shading", "Old shading system compatibility"}, - {NODE_NEW_SHADING, "NEW_SHADING", 0, "New Shading", "New shading system compatibility"}, - {0, NULL, 0, NULL, NULL} - }; - srna = RNA_def_struct(brna, "Node", NULL); RNA_def_struct_ui_text(srna, "Node", "Node in a node tree"); RNA_def_struct_sdna(srna, "bNode"); @@ -7901,12 +7895,6 @@ static void rna_def_node(BlenderRNA *brna) parm = RNA_def_boolean(func, "result", false, "Result", ""); RNA_def_function_return(func, parm); - prop = RNA_def_property(srna, "shading_compatibility", PROP_ENUM, PROP_NONE); - RNA_def_property_flag(prop, PROP_ENUM_FLAG); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_enum_sdna(prop, NULL, "typeinfo->compatibility"); - RNA_def_property_enum_items(prop, node_shading_compatibilities); - /* registration */ prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "typeinfo->idname"); 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 d6b70bef1d9..20203492990 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -5984,7 +5984,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); @@ -6148,13 +6148,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 2a7bb5994c3..ab83cedd232 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -800,8 +800,13 @@ static int rna_View3DShading_studio_light_get(PointerRNA *ptr) flag = STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE; } StudioLight *sl = BKE_studiolight_find(dna_storage, flag); - BLI_strncpy(dna_storage, sl->name, FILE_MAXFILE); - return sl->index; + if (sl) { + BLI_strncpy(dna_storage, sl->name, FILE_MAXFILE); + return sl->index; + } + else { + return 0; + } } static void rna_View3DShading_studio_light_set(PointerRNA *ptr, int value) @@ -818,7 +823,9 @@ static void rna_View3DShading_studio_light_set(PointerRNA *ptr, int value) flag = STUDIOLIGHT_ORIENTATIONS_MATERIAL_MODE; } StudioLight *sl = BKE_studiolight_findindex(value, flag); - BLI_strncpy(dna_storage, sl->name, FILE_MAXFILE); + if (sl) { + BLI_strncpy(dna_storage, sl->name, FILE_MAXFILE); + } } static const EnumPropertyItem *rna_View3DShading_studio_light_itemf( @@ -846,8 +853,10 @@ static const EnumPropertyItem *rna_View3DShading_studio_light_itemf( bool show_studiolight = false; if (sl->flag & STUDIOLIGHT_INTERNAL) { - /* always show internal lights */ - show_studiolight = true; + /* always show internal lights for solid */ + if (v3d->drawtype == OB_SOLID) { + show_studiolight = true; + } } else { switch (v3d->drawtype) { @@ -1320,7 +1329,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 +2348,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); @@ -2479,10 +2488,16 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - 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); + prop = RNA_def_property(srna, "use_scene_lights", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "shading.flag", V3D_SHADING_SCENE_LIGHTS); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Scene Lights", "Render lights and light probes of the scene"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + + prop = RNA_def_property(srna, "use_scene_world", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "shading.flag", V3D_SHADING_SCENE_WORLD); 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 World", "Use scene world for lighting"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); prop = RNA_def_property(srna, "show_specular_highlight", PROP_BOOLEAN, PROP_NONE); @@ -2609,16 +2624,6 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Show 3D Cursor", "Display 3D Cursor Overlay"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - prop = RNA_def_property(srna, "show_non_geometry", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna( - prop, NULL, "overlay.object_type_exclude", - ((1 << OB_TYPE_MAX) - 1) & - ~((1 << OB_MESH) | (1 << OB_CURVE) | (1 << OB_SURF) | (1 << OB_FONT) | (1 << OB_MBALL))); - RNA_def_property_boolean_default(prop, true); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_ui_text(prop, "Show Non Renderable", "Draw not renderable objects in the overlay"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - prop = RNA_def_property(srna, "show_text", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "overlay.flag", V3D_OVERLAY_HIDE_TEXT); RNA_def_property_ui_text(prop, "Show Text", "Display overlay text"); @@ -3024,6 +3029,54 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Volume Alpha", "Opacity (alpha) of the cameras' frustum volume"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + { + struct { + const char *name; + int type_mask; + const char *identifier[2]; + } info[] = { + {"Mesh", (1 << OB_MESH), + {"show_object_viewport_mesh", "show_object_select_mesh"}}, + {"Curve", (1 << OB_CURVE), + {"show_object_viewport_curve", "show_object_select_curve"}}, + {"Surface", (1 << OB_SURF), + {"show_object_viewport_surf", "show_object_select_surf"}}, + {"Meta", (1 << OB_MBALL), + {"show_object_viewport_meta", "show_object_select_meta"}}, + {"Font", (1 << OB_FONT), + {"show_object_viewport_font", "show_object_select_font"}}, + {"Armature", (1 << OB_ARMATURE), + {"show_object_viewport_armature", "show_object_select_armature"}}, + {"Lattice", (1 << OB_LATTICE), + {"show_object_viewport_lattice", "show_object_select_lattice"}}, + {"Empty", (1 << OB_EMPTY), + {"show_object_viewport_empty", "show_object_select_empty"}}, + {"Camera", (1 << OB_CAMERA), + {"show_object_viewport_camera", "show_object_select_camera"}}, + {"Lamp", (1 << OB_LAMP), + {"show_object_viewport_lamp", "show_object_select_lamp"}}, + {"Speaker", (1 << OB_SPEAKER), + {"show_object_viewport_speaker", "show_object_select_speaker"}}, + {"Light Probe", (1 << OB_LIGHTPROBE), + {"show_object_viewport_light_probe", "show_object_select_light_probe"}}, + }; + + const char *view_mask_member[2] = { + "object_type_exclude_viewport", + "object_type_exclude_select", + }; + for (int mask_index = 0; mask_index < 2; mask_index++) { + for (int type_index = 0; type_index < ARRAY_SIZE(info); type_index++) { + prop = RNA_def_property(srna, info[type_index].identifier[mask_index], PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna( + prop, NULL, view_mask_member[mask_index], info[type_index].type_mask); + RNA_def_property_ui_text(prop, info[type_index].name, ""); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + + } + } + } + /* Nested Structs */ prop = RNA_def_property(srna, "shading", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); @@ -4047,7 +4100,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"}, @@ -4089,7 +4142,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/intern/node_common.c b/source/blender/nodes/intern/node_common.c index cb04b341c26..2dbb573f305 100644 --- a/source/blender/nodes/intern/node_common.c +++ b/source/blender/nodes/intern/node_common.c @@ -210,7 +210,6 @@ void register_node_type_frame(void) node_type_init(ntype, node_frame_init); node_type_storage(ntype, "NodeFrame", node_free_standard_storage, node_copy_standard_storage); node_type_size(ntype, 150, 100, 0); - node_type_compatibility(ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); ntype->needs_free = 1; nodeRegisterType(ntype); @@ -484,7 +483,6 @@ void register_node_type_group_input(void) node_type_size(ntype, 140, 80, 400); node_type_init(ntype, node_group_input_init); node_type_update(ntype, node_group_input_update, node_group_input_verify); - node_type_compatibility(ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); ntype->needs_free = 1; nodeRegisterType(ntype); @@ -583,7 +581,6 @@ void register_node_type_group_output(void) node_type_size(ntype, 140, 80, 400); node_type_init(ntype, node_group_output_init); node_type_update(ntype, node_group_output_update, node_group_output_verify); - node_type_compatibility(ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); ntype->needs_free = 1; nodeRegisterType(ntype); 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/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c index 1ae50dab358..9190f0d53cd 100644 --- a/source/blender/nodes/shader/node_shader_util.c +++ b/source/blender/nodes/shader/node_shader_util.c @@ -226,9 +226,8 @@ void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, int do_outputs) do_it = false; /* for groups, only execute outputs for edited group */ if (node->typeinfo->nclass == NODE_CLASS_OUTPUT) { - if (node->typeinfo->compatibility & NODE_NEW_SHADING) - if (do_outputs && (node->flag & NODE_DO_OUTPUT)) - do_it = true; + if (do_outputs && (node->flag & NODE_DO_OUTPUT)) + do_it = true; } else { do_it = true; diff --git a/source/blender/nodes/shader/nodes/node_shader_add_shader.c b/source/blender/nodes/shader/nodes/node_shader_add_shader.c index d3bb8fccf71..0661ab59434 100644 --- a/source/blender/nodes/shader/nodes/node_shader_add_shader.c +++ b/source/blender/nodes/shader/nodes/node_shader_add_shader.c @@ -51,7 +51,6 @@ void register_node_type_sh_add_shader(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_ADD_SHADER, "Add Shader", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_add_shader_in, sh_node_add_shader_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_ambient_occlusion.c b/source/blender/nodes/shader/nodes/node_shader_ambient_occlusion.c index 4c770984717..76ef257f8a3 100644 --- a/source/blender/nodes/shader/nodes/node_shader_ambient_occlusion.c +++ b/source/blender/nodes/shader/nodes/node_shader_ambient_occlusion.c @@ -62,7 +62,6 @@ void register_node_type_sh_ambient_occlusion(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_AMBIENT_OCCLUSION, "Ambient Occlusion", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_ambient_occlusion_in, sh_node_ambient_occlusion_out); node_type_init(&ntype, node_shader_init_ambient_occlusion); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_attribute.c b/source/blender/nodes/shader/nodes/node_shader_attribute.c index 05091a2709a..aca72ac27cc 100644 --- a/source/blender/nodes/shader/nodes/node_shader_attribute.c +++ b/source/blender/nodes/shader/nodes/node_shader_attribute.c @@ -76,7 +76,6 @@ void register_node_type_sh_attribute(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_ATTRIBUTE, "Attribute", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_attribute_out); node_type_init(&ntype, node_shader_init_attribute); node_type_storage(&ntype, "NodeShaderAttribute", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_background.c b/source/blender/nodes/shader/nodes/node_shader_background.c index 4ea675f9e0c..38b5883bc1e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_background.c +++ b/source/blender/nodes/shader/nodes/node_shader_background.c @@ -51,7 +51,6 @@ void register_node_type_sh_background(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BACKGROUND, "Background", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_background_in, sh_node_background_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_bevel.c b/source/blender/nodes/shader/nodes/node_shader_bevel.c index dd9bc91e2d1..05161bd453a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bevel.c +++ b/source/blender/nodes/shader/nodes/node_shader_bevel.c @@ -60,7 +60,6 @@ void register_node_type_sh_bevel(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BEVEL, "Bevel", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bevel_in, sh_node_bevel_out); node_type_init(&ntype, node_shader_init_bevel); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_blackbody.c b/source/blender/nodes/shader/nodes/node_shader_blackbody.c index 7bdce077977..76291df41bc 100644 --- a/source/blender/nodes/shader/nodes/node_shader_blackbody.c +++ b/source/blender/nodes/shader/nodes/node_shader_blackbody.c @@ -54,7 +54,6 @@ void register_node_type_sh_blackbody(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BLACKBODY, "Blackbody", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_socket_templates(&ntype, sh_node_blackbody_in, sh_node_blackbody_out); node_type_init(&ntype, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_brightness.c b/source/blender/nodes/shader/nodes/node_shader_brightness.c index bb95ed2d32c..d17a5b9ba6e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_brightness.c +++ b/source/blender/nodes/shader/nodes/node_shader_brightness.c @@ -52,7 +52,6 @@ void register_node_type_sh_brightcontrast(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BRIGHTCONTRAST, "Bright/Contrast", NODE_CLASS_OP_COLOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_brightcontrast_in, sh_node_brightcontrast_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c index ee3db99d2ab..c1423867d96 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c @@ -63,7 +63,6 @@ void register_node_type_sh_bsdf_anisotropic(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_ANISOTROPIC, "Anisotropic BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_anisotropic_in, sh_node_bsdf_anisotropic_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_anisotropic); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c index be7012712cc..58a37b0e81d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c @@ -55,7 +55,6 @@ void register_node_type_sh_bsdf_diffuse(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_DIFFUSE, "Diffuse BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_diffuse_in, sh_node_bsdf_diffuse_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c index 3d3173f6862..7b060bc68aa 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c @@ -61,7 +61,6 @@ void register_node_type_sh_bsdf_glass(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_GLASS, "Glass BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_glass_in, sh_node_bsdf_glass_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_glass); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c index eb5bd7b57d8..c3fb43c0ce8 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c @@ -60,7 +60,6 @@ void register_node_type_sh_bsdf_glossy(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_GLOSSY, "Glossy BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_glossy_in, sh_node_bsdf_glossy_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_glossy); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_hair.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_hair.c index 9db0e3284b9..d97344ad6a7 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_hair.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_hair.c @@ -54,7 +54,6 @@ void register_node_type_sh_bsdf_hair(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_HAIR, "Hair BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_hair_in, sh_node_bsdf_hair_out); node_type_size(&ntype, 150, 60, 200); node_type_init(&ntype, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c index b4a83c847be..7f02295d45f 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c @@ -143,7 +143,6 @@ void register_node_type_sh_bsdf_principled(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_PRINCIPLED, "Principled BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_principled_in, sh_node_bsdf_principled_out); node_type_size_preset(&ntype, NODE_SIZE_LARGE); node_type_init(&ntype, node_shader_init_principled); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c index 949f6a90de5..41dd3f8af3c 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c @@ -61,7 +61,6 @@ void register_node_type_sh_bsdf_refraction(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_REFRACTION, "Refraction BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_refraction_in, sh_node_bsdf_refraction_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_refraction); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_toon.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_toon.c index 0470795930b..0754a7e5a3b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_toon.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_toon.c @@ -58,7 +58,6 @@ void register_node_type_sh_bsdf_toon(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_TOON, "Toon BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_toon_in, sh_node_bsdf_toon_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c index 7757ae38efd..2c0949f275c 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c @@ -54,7 +54,6 @@ void register_node_type_sh_bsdf_translucent(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_TRANSLUCENT, "Translucent BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_translucent_in, sh_node_bsdf_translucent_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c index 441a7c50305..08ddf221804 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.c @@ -50,7 +50,6 @@ void register_node_type_sh_bsdf_transparent(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_TRANSPARENT, "Transparent BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_transparent_in, sh_node_bsdf_transparent_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c b/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c index fec106a131a..ce331f03d4e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c @@ -55,7 +55,6 @@ void register_node_type_sh_bsdf_velvet(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BSDF_VELVET, "Velvet BSDF", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bsdf_velvet_in, sh_node_bsdf_velvet_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_bump.c b/source/blender/nodes/shader/nodes/node_shader_bump.c index 6274d132bc7..08b50a886c5 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bump.c +++ b/source/blender/nodes/shader/nodes/node_shader_bump.c @@ -68,7 +68,6 @@ void register_node_type_sh_bump(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_BUMP, "Bump", NODE_CLASS_OP_VECTOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_bump_in, sh_node_bump_out); node_type_storage(&ntype, "", NULL, NULL); node_type_gpu(&ntype, gpu_shader_bump); diff --git a/source/blender/nodes/shader/nodes/node_shader_camera.c b/source/blender/nodes/shader/nodes/node_shader_camera.c index dfd712afb29..9089d415759 100644 --- a/source/blender/nodes/shader/nodes/node_shader_camera.c +++ b/source/blender/nodes/shader/nodes/node_shader_camera.c @@ -54,7 +54,6 @@ void register_node_type_sh_camera(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_CAMERA, "Camera Data", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_camera_out); node_type_storage(&ntype, "", NULL, NULL); node_type_gpu(&ntype, gpu_shader_camera); diff --git a/source/blender/nodes/shader/nodes/node_shader_common.c b/source/blender/nodes/shader/nodes/node_shader_common.c index 09fc10a4c71..23b27fc5008 100644 --- a/source/blender/nodes/shader/nodes/node_shader_common.c +++ b/source/blender/nodes/shader/nodes/node_shader_common.c @@ -238,7 +238,6 @@ void register_node_type_sh_group(void) BLI_assert(ntype.ext.srna != NULL); RNA_struct_blender_type_set(ntype.ext.srna, &ntype); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, NULL); node_type_size(&ntype, 140, 60, 400); node_type_label(&ntype, node_group_label); diff --git a/source/blender/nodes/shader/nodes/node_shader_curves.c b/source/blender/nodes/shader/nodes/node_shader_curves.c index 4f3dc92ad02..d5932ff233a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_curves.c +++ b/source/blender/nodes/shader/nodes/node_shader_curves.c @@ -74,7 +74,6 @@ void register_node_type_sh_curve_vec(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_CURVE_VEC, "Vector Curves", NODE_CLASS_OP_VECTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_curve_vec_in, sh_node_curve_vec_out); node_type_init(&ntype, node_shader_init_curve_vec); node_type_size_preset(&ntype, NODE_SIZE_LARGE); @@ -133,7 +132,6 @@ void register_node_type_sh_curve_rgb(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_curve_rgb_in, sh_node_curve_rgb_out); node_type_init(&ntype, node_shader_init_curve_rgb); node_type_size_preset(&ntype, NODE_SIZE_LARGE); diff --git a/source/blender/nodes/shader/nodes/node_shader_displacement.c b/source/blender/nodes/shader/nodes/node_shader_displacement.c index c26968e8d14..4480cbdf56b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_displacement.c +++ b/source/blender/nodes/shader/nodes/node_shader_displacement.c @@ -74,7 +74,6 @@ void register_node_type_sh_displacement(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_DISPLACEMENT, "Displacement", NODE_CLASS_OP_VECTOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_displacement_in, sh_node_displacement_out); node_type_storage(&ntype, "", NULL, NULL); node_type_init(&ntype, node_shader_init_displacement); diff --git a/source/blender/nodes/shader/nodes/node_shader_eevee_specular.c b/source/blender/nodes/shader/nodes/node_shader_eevee_specular.c index cd912a4b4cb..e05b0be1e62 100644 --- a/source/blender/nodes/shader/nodes/node_shader_eevee_specular.c +++ b/source/blender/nodes/shader/nodes/node_shader_eevee_specular.c @@ -77,7 +77,6 @@ void register_node_type_sh_eevee_specular(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_EEVEE_SPECULAR, "Specular", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_eevee_specular_in, sh_node_eevee_specular_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_emission.c b/source/blender/nodes/shader/nodes/node_shader_emission.c index f2ab4a119da..7a7c89be3a0 100644 --- a/source/blender/nodes/shader/nodes/node_shader_emission.c +++ b/source/blender/nodes/shader/nodes/node_shader_emission.c @@ -51,7 +51,6 @@ void register_node_type_sh_emission(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_EMISSION, "Emission", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_emission_in, sh_node_emission_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_fresnel.c b/source/blender/nodes/shader/nodes/node_shader_fresnel.c index 072abed6c16..cb6b35ac4a7 100644 --- a/source/blender/nodes/shader/nodes/node_shader_fresnel.c +++ b/source/blender/nodes/shader/nodes/node_shader_fresnel.c @@ -61,7 +61,6 @@ void register_node_type_sh_fresnel(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_FRESNEL, "Fresnel", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING | NODE_OLD_SHADING); node_type_socket_templates(&ntype, sh_node_fresnel_in, sh_node_fresnel_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_gamma.c b/source/blender/nodes/shader/nodes/node_shader_gamma.c index e536d198ed0..4a946e92778 100644 --- a/source/blender/nodes/shader/nodes/node_shader_gamma.c +++ b/source/blender/nodes/shader/nodes/node_shader_gamma.c @@ -62,7 +62,6 @@ void register_node_type_sh_gamma(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_GAMMA, "Gamma", NODE_CLASS_OP_COLOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_gamma_in, sh_node_gamma_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_geometry.c b/source/blender/nodes/shader/nodes/node_shader_geometry.c index 2af3e3e259a..dfeebcea305 100644 --- a/source/blender/nodes/shader/nodes/node_shader_geometry.c +++ b/source/blender/nodes/shader/nodes/node_shader_geometry.c @@ -55,7 +55,6 @@ void register_node_type_sh_geometry(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_NEW_GEOMETRY, "Geometry", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_geometry_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_hair_info.c b/source/blender/nodes/shader/nodes/node_shader_hair_info.c index 13259dce9d1..8b2f4b479ad 100644 --- a/source/blender/nodes/shader/nodes/node_shader_hair_info.c +++ b/source/blender/nodes/shader/nodes/node_shader_hair_info.c @@ -48,7 +48,6 @@ void register_node_type_sh_hair_info(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_HAIR_INFO, "Hair Info", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, outputs); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_holdout.c b/source/blender/nodes/shader/nodes/node_shader_holdout.c index 42563f2bfa8..6109022fddf 100644 --- a/source/blender/nodes/shader/nodes/node_shader_holdout.c +++ b/source/blender/nodes/shader/nodes/node_shader_holdout.c @@ -45,7 +45,6 @@ void register_node_type_sh_holdout(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_HOLDOUT, "Holdout", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_holdout_in, sh_node_holdout_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c index 07f1e9e3233..c017765c8e2 100644 --- a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c +++ b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c @@ -92,7 +92,6 @@ void register_node_type_sh_hue_sat(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_hue_sat_in, sh_node_hue_sat_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_exec(&ntype, NULL, NULL, node_shader_exec_hue_sat); diff --git a/source/blender/nodes/shader/nodes/node_shader_ies_light.c b/source/blender/nodes/shader/nodes/node_shader_ies_light.c index 8084f445e34..2714d560862 100644 --- a/source/blender/nodes/shader/nodes/node_shader_ies_light.c +++ b/source/blender/nodes/shader/nodes/node_shader_ies_light.c @@ -52,7 +52,6 @@ void register_node_type_sh_tex_ies(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_IES, "IES Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_ies_in, sh_node_tex_ies_out); node_type_init(&ntype, node_shader_init_tex_ies); node_type_storage(&ntype, "NodeShaderTexIES", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_invert.c b/source/blender/nodes/shader/nodes/node_shader_invert.c index b1805946f65..448d305b44e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_invert.c +++ b/source/blender/nodes/shader/nodes/node_shader_invert.c @@ -75,7 +75,6 @@ void register_node_type_sh_invert(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_invert_in, sh_node_invert_out); node_type_exec(&ntype, NULL, NULL, node_shader_exec_invert); node_type_gpu(&ntype, gpu_shader_invert); diff --git a/source/blender/nodes/shader/nodes/node_shader_layer_weight.c b/source/blender/nodes/shader/nodes/node_shader_layer_weight.c index 53bfad833eb..9c0b0a2f5f6 100644 --- a/source/blender/nodes/shader/nodes/node_shader_layer_weight.c +++ b/source/blender/nodes/shader/nodes/node_shader_layer_weight.c @@ -63,7 +63,6 @@ void register_node_type_sh_layer_weight(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_LAYER_WEIGHT, "Layer Weight", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING | NODE_OLD_SHADING); node_type_socket_templates(&ntype, sh_node_layer_weight_in, sh_node_layer_weight_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_light_falloff.c b/source/blender/nodes/shader/nodes/node_shader_light_falloff.c index 1dd7a945259..f32570eaeaa 100644 --- a/source/blender/nodes/shader/nodes/node_shader_light_falloff.c +++ b/source/blender/nodes/shader/nodes/node_shader_light_falloff.c @@ -55,7 +55,6 @@ void register_node_type_sh_light_falloff(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_LIGHT_FALLOFF, "Light Falloff", NODE_CLASS_OP_COLOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_light_falloff_in, sh_node_light_falloff_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_light_path.c b/source/blender/nodes/shader/nodes/node_shader_light_path.c index 0e87da2215b..23d01ad4417 100644 --- a/source/blender/nodes/shader/nodes/node_shader_light_path.c +++ b/source/blender/nodes/shader/nodes/node_shader_light_path.c @@ -57,7 +57,6 @@ void register_node_type_sh_light_path(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_LIGHT_PATH, "Light Path", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_light_path_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_mapping.c b/source/blender/nodes/shader/nodes/node_shader_mapping.c index fdbf23618ef..a84e88e9551 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mapping.c +++ b/source/blender/nodes/shader/nodes/node_shader_mapping.c @@ -107,7 +107,6 @@ void register_node_type_sh_mapping(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_MAPPING, "Mapping", NODE_CLASS_OP_VECTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_mapping_in, sh_node_mapping_out); node_type_size(&ntype, 320, 160, 360); node_type_init(&ntype, node_shader_init_mapping); diff --git a/source/blender/nodes/shader/nodes/node_shader_math.c b/source/blender/nodes/shader/nodes/node_shader_math.c index bf594325119..e3c52a9bc03 100644 --- a/source/blender/nodes/shader/nodes/node_shader_math.c +++ b/source/blender/nodes/shader/nodes/node_shader_math.c @@ -299,7 +299,6 @@ void register_node_type_sh_math(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_MATH, "Math", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_math_in, sh_node_math_out); node_type_label(&ntype, node_math_label); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_mixRgb.c b/source/blender/nodes/shader/nodes/node_shader_mixRgb.c index 054b02b220d..b598859ab8e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mixRgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_mixRgb.c @@ -87,7 +87,6 @@ void register_node_type_sh_mix_rgb(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_MIX_RGB, "Mix", NODE_CLASS_OP_COLOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_mix_rgb_in, sh_node_mix_rgb_out); node_type_label(&ntype, node_blend_label); node_type_exec(&ntype, NULL, NULL, node_shader_exec_mix_rgb); diff --git a/source/blender/nodes/shader/nodes/node_shader_mix_shader.c b/source/blender/nodes/shader/nodes/node_shader_mix_shader.c index 892b41ab058..1d6c76766b3 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mix_shader.c +++ b/source/blender/nodes/shader/nodes/node_shader_mix_shader.c @@ -52,7 +52,6 @@ void register_node_type_sh_mix_shader(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_MIX_SHADER, "Mix Shader", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_mix_shader_in, sh_node_mix_shader_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_normal.c b/source/blender/nodes/shader/nodes/node_shader_normal.c index 265f6ac6fab..121cb9cc1a5 100644 --- a/source/blender/nodes/shader/nodes/node_shader_normal.c +++ b/source/blender/nodes/shader/nodes/node_shader_normal.c @@ -69,7 +69,6 @@ void register_node_type_sh_normal(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_NORMAL, "Normal", NODE_CLASS_OP_VECTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_normal_in, sh_node_normal_out); node_type_exec(&ntype, NULL, NULL, node_shader_exec_normal); node_type_gpu(&ntype, gpu_shader_normal); diff --git a/source/blender/nodes/shader/nodes/node_shader_normal_map.c b/source/blender/nodes/shader/nodes/node_shader_normal_map.c index 0d58be76030..3c0fb145987 100644 --- a/source/blender/nodes/shader/nodes/node_shader_normal_map.c +++ b/source/blender/nodes/shader/nodes/node_shader_normal_map.c @@ -111,7 +111,6 @@ void register_node_type_sh_normal_map(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_NORMAL_MAP, "Normal Map", NODE_CLASS_OP_VECTOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING | NODE_OLD_SHADING); node_type_socket_templates(&ntype, sh_node_normal_map_in, sh_node_normal_map_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_normal_map); diff --git a/source/blender/nodes/shader/nodes/node_shader_object_info.c b/source/blender/nodes/shader/nodes/node_shader_object_info.c index 623df319690..713e2f749f7 100644 --- a/source/blender/nodes/shader/nodes/node_shader_object_info.c +++ b/source/blender/nodes/shader/nodes/node_shader_object_info.c @@ -52,7 +52,6 @@ void register_node_type_sh_object_info(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_OBJECT_INFO, "Object Info", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_object_info_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); 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..f44f5d332cf 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output_lamp.c +++ b/source/blender/nodes/shader/nodes/node_shader_output_lamp.c @@ -39,8 +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); - node_type_compatibility(&ntype, NODE_NEW_SHADING); + sh_node_type_base(&ntype, SH_NODE_OUTPUT_LIGHT, "Light Output", NODE_CLASS_OUTPUT, 0); node_type_socket_templates(&ntype, sh_node_output_lamp_in, NULL); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_output_linestyle.c b/source/blender/nodes/shader/nodes/node_shader_output_linestyle.c index 2eb68f23912..b56d6eca44b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output_linestyle.c +++ b/source/blender/nodes/shader/nodes/node_shader_output_linestyle.c @@ -43,7 +43,6 @@ void register_node_type_sh_output_linestyle(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_OUTPUT_LINESTYLE, "Line Style Output", NODE_CLASS_OUTPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_output_linestyle_in, NULL); node_type_init(&ntype, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_output_material.c b/source/blender/nodes/shader/nodes/node_shader_output_material.c index 05837e79f82..81a89177351 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output_material.c +++ b/source/blender/nodes/shader/nodes/node_shader_output_material.c @@ -55,7 +55,6 @@ void register_node_type_sh_output_material(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_OUTPUT_MATERIAL, "Material Output", NODE_CLASS_OUTPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_output_material_in, NULL); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_output_world.c b/source/blender/nodes/shader/nodes/node_shader_output_world.c index 2c115bdda20..1980e6be5a3 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output_world.c +++ b/source/blender/nodes/shader/nodes/node_shader_output_world.c @@ -51,7 +51,6 @@ void register_node_type_sh_output_world(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_OUTPUT_WORLD, "World Output", NODE_CLASS_OUTPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_output_world_in, NULL); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_particle_info.c b/source/blender/nodes/shader/nodes/node_shader_particle_info.c index 73c95fa2ba7..34c4d364fac 100644 --- a/source/blender/nodes/shader/nodes/node_shader_particle_info.c +++ b/source/blender/nodes/shader/nodes/node_shader_particle_info.c @@ -62,7 +62,6 @@ void register_node_type_sh_particle_info(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_PARTICLE_INFO, "Particle Info", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING | NODE_OLD_SHADING); node_type_socket_templates(&ntype, NULL, outputs); node_type_exec(&ntype, NULL, NULL, node_shader_exec_particle_info); node_type_gpu(&ntype, gpu_shader_particle_info); diff --git a/source/blender/nodes/shader/nodes/node_shader_rgb.c b/source/blender/nodes/shader/nodes/node_shader_rgb.c index dce7e5354e1..0ddad803270 100644 --- a/source/blender/nodes/shader/nodes/node_shader_rgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_rgb.c @@ -49,7 +49,6 @@ void register_node_type_sh_rgb(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_RGB, "RGB", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_rgb_out); node_type_gpu(&ntype, gpu_shader_rgb); diff --git a/source/blender/nodes/shader/nodes/node_shader_script.c b/source/blender/nodes/shader/nodes/node_shader_script.c index 888e502a7f6..2d13fc214be 100644 --- a/source/blender/nodes/shader/nodes/node_shader_script.c +++ b/source/blender/nodes/shader/nodes/node_shader_script.c @@ -68,7 +68,6 @@ void register_node_type_sh_script(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_SCRIPT, "Script", NODE_CLASS_SCRIPT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_init(&ntype, init); node_type_storage(&ntype, "NodeShaderScript", node_free_script, node_copy_script); diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcombHSV.c b/source/blender/nodes/shader/nodes/node_shader_sepcombHSV.c index 148f8e99c8f..09cd997f86b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_sepcombHSV.c +++ b/source/blender/nodes/shader/nodes/node_shader_sepcombHSV.c @@ -63,7 +63,6 @@ void register_node_type_sh_sephsv(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_SEPHSV, "Separate HSV", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_sephsv_in, sh_node_sephsv_out); node_type_exec(&ntype, NULL, NULL, node_shader_exec_sephsv); node_type_gpu(&ntype, gpu_shader_sephsv); @@ -104,7 +103,6 @@ void register_node_type_sh_combhsv(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_COMBHSV, "Combine HSV", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_combhsv_in, sh_node_combhsv_out); node_type_exec(&ntype, NULL, NULL, node_shader_exec_combhsv); node_type_gpu(&ntype, gpu_shader_combhsv); diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c b/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c index bd914399a28..b4810b95d4b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c +++ b/source/blender/nodes/shader/nodes/node_shader_sepcombRGB.c @@ -64,7 +64,6 @@ void register_node_type_sh_seprgb(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_SEPRGB, "Separate RGB", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_seprgb_in, sh_node_seprgb_out); node_type_exec(&ntype, NULL, NULL, node_shader_exec_seprgb); node_type_gpu(&ntype, gpu_shader_seprgb); @@ -108,7 +107,6 @@ void register_node_type_sh_combrgb(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_COMBRGB, "Combine RGB", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_combrgb_in, sh_node_combrgb_out); node_type_exec(&ntype, NULL, NULL, node_shader_exec_combrgb); node_type_gpu(&ntype, gpu_shader_combrgb); diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcombXYZ.c b/source/blender/nodes/shader/nodes/node_shader_sepcombXYZ.c index ba8bf565ca8..bff8e38b8c8 100644 --- a/source/blender/nodes/shader/nodes/node_shader_sepcombXYZ.c +++ b/source/blender/nodes/shader/nodes/node_shader_sepcombXYZ.c @@ -54,7 +54,6 @@ void register_node_type_sh_sepxyz(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_SEPXYZ, "Separate XYZ", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_sepxyz_in, sh_node_sepxyz_out); node_type_gpu(&ntype, gpu_shader_sepxyz); @@ -85,7 +84,6 @@ void register_node_type_sh_combxyz(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_COMBXYZ, "Combine XYZ", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_combxyz_in, sh_node_combxyz_out); node_type_gpu(&ntype, gpu_shader_combxyz); diff --git a/source/blender/nodes/shader/nodes/node_shader_shaderToRgb.c b/source/blender/nodes/shader/nodes/node_shader_shaderToRgb.c index c565c311efc..8617e3414b5 100644 --- a/source/blender/nodes/shader/nodes/node_shader_shaderToRgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_shaderToRgb.c @@ -51,7 +51,6 @@ void register_node_type_sh_shadertorgb(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_SHADERTORGB, "Shader to RGB", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_shadertorgb_in, sh_node_shadertorgb_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_squeeze.c b/source/blender/nodes/shader/nodes/node_shader_squeeze.c index e46494efd34..51167db857b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_squeeze.c +++ b/source/blender/nodes/shader/nodes/node_shader_squeeze.c @@ -66,7 +66,6 @@ void register_node_type_sh_squeeze(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_SQUEEZE, "Squeeze Value", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING); node_type_socket_templates(&ntype, sh_node_squeeze_in, sh_node_squeeze_out); node_type_storage(&ntype, "", NULL, NULL); node_type_exec(&ntype, NULL, NULL, node_shader_exec_squeeze); diff --git a/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c b/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c index 60442a46da1..57fb9026595 100644 --- a/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c +++ b/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c @@ -90,7 +90,6 @@ void register_node_type_sh_subsurface_scattering(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_SUBSURFACE_SCATTERING, "Subsurface Scattering", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_subsurface_scattering_in, sh_node_subsurface_scattering_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_subsurface_scattering); diff --git a/source/blender/nodes/shader/nodes/node_shader_tangent.c b/source/blender/nodes/shader/nodes/node_shader_tangent.c index f2c59ec8fd8..da3a8e39ccb 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tangent.c +++ b/source/blender/nodes/shader/nodes/node_shader_tangent.c @@ -69,7 +69,6 @@ void register_node_type_sh_tangent(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TANGENT, "Tangent", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_tangent_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_tangent); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_brick.c b/source/blender/nodes/shader/nodes/node_shader_tex_brick.c index 67fe6d08ffd..227df5e8e56 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_brick.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_brick.c @@ -92,7 +92,6 @@ void register_node_type_sh_tex_brick(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_BRICK, "Brick Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_brick_in, sh_node_tex_brick_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_tex_brick); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_checker.c b/source/blender/nodes/shader/nodes/node_shader_tex_checker.c index 633cc9a1d0e..4e065ffde23 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_checker.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_checker.c @@ -70,7 +70,6 @@ void register_node_type_sh_tex_checker(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_CHECKER, "Checker Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_checker_in, sh_node_tex_checker_out); node_type_init(&ntype, node_shader_init_tex_checker); node_type_storage(&ntype, "NodeTexChecker", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_coord.c b/source/blender/nodes/shader/nodes/node_shader_tex_coord.c index 360b28d768a..002fdc6d3ae 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_coord.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_coord.c @@ -70,7 +70,6 @@ void register_node_type_sh_tex_coord(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_COORD, "Texture Coordinate", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_tex_coord_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c index 02b784ca540..3e52a6c3d7d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c @@ -97,7 +97,6 @@ void register_node_type_sh_tex_environment(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_ENVIRONMENT, "Environment Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_environment_in, sh_node_tex_environment_out); node_type_init(&ntype, node_shader_init_tex_environment); node_type_storage(&ntype, "NodeTexEnvironment", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c b/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c index 0721a24688f..06f3773e6d8 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c @@ -70,7 +70,6 @@ void register_node_type_sh_tex_gradient(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_GRADIENT, "Gradient Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_gradient_in, sh_node_tex_gradient_out); node_type_init(&ntype, node_shader_init_tex_gradient); node_type_storage(&ntype, "NodeTexGradient", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_image.c b/source/blender/nodes/shader/nodes/node_shader_tex_image.c index e27cf02f445..55669b57998 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_image.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_image.c @@ -121,7 +121,6 @@ void register_node_type_sh_tex_image(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_IMAGE, "Image Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_image_in, sh_node_tex_image_out); node_type_init(&ntype, node_shader_init_tex_image); node_type_storage(&ntype, "NodeTexImage", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_magic.c b/source/blender/nodes/shader/nodes/node_shader_tex_magic.c index 14e6cbf337e..deb81b7b78f 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_magic.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_magic.c @@ -73,7 +73,6 @@ void register_node_type_sh_tex_magic(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_MAGIC, "Magic Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_magic_in, sh_node_tex_magic_out); node_type_init(&ntype, node_shader_init_tex_magic); node_type_storage(&ntype, "NodeTexMagic", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c index 48ab45895bc..03f401e7f01 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c @@ -77,7 +77,6 @@ void register_node_type_sh_tex_musgrave(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_MUSGRAVE, "Musgrave Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_musgrave_in, sh_node_tex_musgrave_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_tex_musgrave); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_noise.c b/source/blender/nodes/shader/nodes/node_shader_tex_noise.c index 2f6994c6533..e2879528a5f 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_noise.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_noise.c @@ -70,7 +70,6 @@ void register_node_type_sh_tex_noise(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_NOISE, "Noise Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_noise_in, sh_node_tex_noise_out); node_type_init(&ntype, node_shader_init_tex_noise); node_type_storage(&ntype, "NodeTexNoise", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.c b/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.c index 436eeeefb4a..1c5f53132bd 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.c @@ -85,7 +85,6 @@ void register_node_type_sh_tex_pointdensity(void) "Point Density", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_pointdensity_in, sh_node_tex_pointdensity_out); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_sky.c b/source/blender/nodes/shader/nodes/node_shader_tex_sky.c index 8a17ee1e0d2..821d4b41d09 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_sky.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_sky.c @@ -70,7 +70,6 @@ void register_node_type_sh_tex_sky(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_SKY, "Sky Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_sky_in, sh_node_tex_sky_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_tex_sky); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c index 7f30d244da6..36b6174059a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c @@ -72,7 +72,6 @@ void register_node_type_sh_tex_voronoi(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_VORONOI, "Voronoi Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_voronoi_in, sh_node_tex_voronoi_out); node_type_init(&ntype, node_shader_init_tex_voronoi); node_type_storage(&ntype, "NodeTexVoronoi", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_wave.c b/source/blender/nodes/shader/nodes/node_shader_tex_wave.c index a9071fdbdd4..2b06f66eb63 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_wave.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_wave.c @@ -76,7 +76,6 @@ void register_node_type_sh_tex_wave(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_TEX_WAVE, "Wave Texture", NODE_CLASS_TEXTURE, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_tex_wave_in, sh_node_tex_wave_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_tex_wave); diff --git a/source/blender/nodes/shader/nodes/node_shader_uvAlongStroke.c b/source/blender/nodes/shader/nodes/node_shader_uvAlongStroke.c index 67342e1e836..023f5417e22 100644 --- a/source/blender/nodes/shader/nodes/node_shader_uvAlongStroke.c +++ b/source/blender/nodes/shader/nodes/node_shader_uvAlongStroke.c @@ -40,7 +40,6 @@ void register_node_type_sh_uvalongstroke(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_UVALONGSTROKE, "UV Along Stroke", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_uvalongstroke_out); node_type_init(&ntype, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_uvmap.c b/source/blender/nodes/shader/nodes/node_shader_uvmap.c index c47bb9022b6..9da1056b47f 100644 --- a/source/blender/nodes/shader/nodes/node_shader_uvmap.c +++ b/source/blender/nodes/shader/nodes/node_shader_uvmap.c @@ -56,7 +56,6 @@ void register_node_type_sh_uvmap(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_UVMAP, "UV Map", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_uvmap_out); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, node_shader_init_uvmap); diff --git a/source/blender/nodes/shader/nodes/node_shader_valToRgb.c b/source/blender/nodes/shader/nodes/node_shader_valToRgb.c index a1879df3a18..b6581cb18cb 100644 --- a/source/blender/nodes/shader/nodes/node_shader_valToRgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_valToRgb.c @@ -77,7 +77,6 @@ void register_node_type_sh_valtorgb(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_valtorgb_in, sh_node_valtorgb_out); node_type_init(&ntype, node_shader_init_valtorgb); node_type_size_preset(&ntype, NODE_SIZE_LARGE); @@ -120,7 +119,6 @@ void register_node_type_sh_rgbtobw(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_rgbtobw_in, sh_node_rgbtobw_out); node_type_exec(&ntype, NULL, NULL, node_shader_exec_rgbtobw); node_type_gpu(&ntype, gpu_shader_rgbtobw); diff --git a/source/blender/nodes/shader/nodes/node_shader_value.c b/source/blender/nodes/shader/nodes/node_shader_value.c index a1b8717cebc..a143b0118e7 100644 --- a/source/blender/nodes/shader/nodes/node_shader_value.c +++ b/source/blender/nodes/shader/nodes/node_shader_value.c @@ -49,7 +49,6 @@ void register_node_type_sh_value(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_VALUE, "Value", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, NULL, sh_node_value_out); node_type_gpu(&ntype, gpu_shader_value); diff --git a/source/blender/nodes/shader/nodes/node_shader_vectMath.c b/source/blender/nodes/shader/nodes/node_shader_vectMath.c index ca5291e6041..8087e1cab41 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vectMath.c +++ b/source/blender/nodes/shader/nodes/node_shader_vectMath.c @@ -141,7 +141,6 @@ void register_node_type_sh_vect_math(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_VECT_MATH, "Vector Math", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_vect_math_in, sh_node_vect_math_out); node_type_label(&ntype, node_vect_math_label); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_vectTransform.c b/source/blender/nodes/shader/nodes/node_shader_vectTransform.c index d0b16dd5886..63964e27d20 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vectTransform.c +++ b/source/blender/nodes/shader/nodes/node_shader_vectTransform.c @@ -136,7 +136,6 @@ void register_node_type_sh_vect_transform(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_VECT_TRANSFORM, "Vector Transform", NODE_CLASS_OP_VECTOR, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING | NODE_NEW_SHADING); node_type_init(&ntype, node_shader_init_vect_transform); node_type_socket_templates(&ntype, sh_node_vect_transform_in, sh_node_vect_transform_out); node_type_storage(&ntype, "NodeShaderVectTransform", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_vector_displacement.c b/source/blender/nodes/shader/nodes/node_shader_vector_displacement.c index 79b41509fcc..2a40d98baf9 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vector_displacement.c +++ b/source/blender/nodes/shader/nodes/node_shader_vector_displacement.c @@ -73,7 +73,6 @@ void register_node_type_sh_vector_displacement(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_VECTOR_DISPLACEMENT, "Vector Displacement", NODE_CLASS_OP_VECTOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_vector_displacement_in, sh_node_vector_displacement_out); node_type_storage(&ntype, "", NULL, NULL); node_type_init(&ntype, node_shader_init_vector_displacement); diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_absorption.c b/source/blender/nodes/shader/nodes/node_shader_volume_absorption.c index 518ab6587b2..d0ba43d1a15 100644 --- a/source/blender/nodes/shader/nodes/node_shader_volume_absorption.c +++ b/source/blender/nodes/shader/nodes/node_shader_volume_absorption.c @@ -51,7 +51,6 @@ void register_node_type_sh_volume_absorption(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_VOLUME_ABSORPTION, "Volume Absorption", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_volume_absorption_in, sh_node_volume_absorption_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_principled.c b/source/blender/nodes/shader/nodes/node_shader_volume_principled.c index 40d24df6845..a88a7ebb21a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_volume_principled.c +++ b/source/blender/nodes/shader/nodes/node_shader_volume_principled.c @@ -153,7 +153,6 @@ void register_node_type_sh_volume_principled(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_VOLUME_PRINCIPLED, "Principled Volume", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_volume_principled_in, sh_node_volume_principled_out); node_type_size_preset(&ntype, NODE_SIZE_LARGE); node_type_init(&ntype, node_shader_init_volume_principled); diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_scatter.c b/source/blender/nodes/shader/nodes/node_shader_volume_scatter.c index 34ba179b4a3..0f97d08803a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_volume_scatter.c +++ b/source/blender/nodes/shader/nodes/node_shader_volume_scatter.c @@ -52,7 +52,6 @@ void register_node_type_sh_volume_scatter(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_VOLUME_SCATTER, "Volume Scatter", NODE_CLASS_SHADER, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_volume_scatter_in, sh_node_volume_scatter_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_wavelength.c b/source/blender/nodes/shader/nodes/node_shader_wavelength.c index f903e314edf..edc4333c000 100644 --- a/source/blender/nodes/shader/nodes/node_shader_wavelength.c +++ b/source/blender/nodes/shader/nodes/node_shader_wavelength.c @@ -44,7 +44,6 @@ void register_node_type_sh_wavelength(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_WAVELENGTH, "Wavelength", NODE_CLASS_CONVERTOR, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_socket_templates(&ntype, sh_node_wavelength_in, sh_node_wavelength_out); node_type_init(&ntype, NULL); diff --git a/source/blender/nodes/shader/nodes/node_shader_wireframe.c b/source/blender/nodes/shader/nodes/node_shader_wireframe.c index 0b9f3ac347a..11d889def31 100644 --- a/source/blender/nodes/shader/nodes/node_shader_wireframe.c +++ b/source/blender/nodes/shader/nodes/node_shader_wireframe.c @@ -44,7 +44,6 @@ void register_node_type_sh_wireframe(void) static bNodeType ntype; sh_node_type_base(&ntype, SH_NODE_WIREFRAME, "Wireframe", NODE_CLASS_INPUT, 0); - node_type_compatibility(&ntype, NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_wireframe_in, sh_node_wireframe_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); diff --git a/source/blender/python/gawain/gwn_py_types.c b/source/blender/python/gawain/gwn_py_types.c index 9ddad009a12..bdf0be9f7e1 100644 --- a/source/blender/python/gawain/gwn_py_types.c +++ b/source/blender/python/gawain/gwn_py_types.c @@ -210,7 +210,7 @@ static void fill_format_elem(void *data_dst_void, PyObject *py_src, const Gwn_Ve /* No error checking, callers must run PyErr_Occurred */ static void fill_format_tuple(void *data_dst_void, PyObject *py_src, const Gwn_VertAttr *attr) { - const uint len = attr->comp_ct; + const uint len = attr->comp_len; /** * Args are constants, so range checks will be optimized out if they're nop's. @@ -247,15 +247,15 @@ static bool bpygwn_vertbuf_fill_impl( const uint seq_len = PySequence_Fast_GET_SIZE(seq_fast); - if (seq_len != vbo->vertex_ct) { + if (seq_len != vbo->vertex_len) { PyErr_Format(PyExc_ValueError, "Expected a sequence of size %d, got %d", - vbo->vertex_ct, seq_len); + vbo->vertex_len, seq_len); } PyObject **seq_items = PySequence_Fast_ITEMS(seq_fast); - if (attr->comp_ct == 1) { + if (attr->comp_len == 1) { for (uint i = 0; i < seq_len; i++) { uchar *data = (uchar *)GWN_vertbuf_raw_step(&data_step); PyObject *item = seq_items[i]; @@ -273,10 +273,10 @@ static bool bpygwn_vertbuf_fill_impl( ok = false; goto finally; } - if (PyTuple_GET_SIZE(item) != attr->comp_ct) { + if (PyTuple_GET_SIZE(item) != attr->comp_len) { PyErr_Format(PyExc_ValueError, "expected a tuple of size %d, got %d", - attr->comp_ct, PyTuple_GET_SIZE(item)); + attr->comp_len, PyTuple_GET_SIZE(item)); ok = false; goto finally; } @@ -300,8 +300,8 @@ finally: #if 0 static int bpygwn_find_id(const Gwn_VertFormat *fmt, const char *id) { - for (int i = 0; i < fmt->attrib_ct; i++) { - for (uint j = 0; j < fmt->name_ct; j++) { + for (int i = 0; i < fmt->attr_len; i++) { + for (uint j = 0; j < fmt->name_len; j++) { if (STREQ(fmt->attribs[i].name[j], id)) { return i; } @@ -346,7 +346,7 @@ static PyObject *bpygwn_VertFormat_attr_add(BPyGwn_VertFormat *self, PyObject *a Gwn_VertFetchMode fetch_mode; } params; - if (self->fmt.attrib_ct == GWN_VERT_ATTR_MAX_LEN) { + if (self->fmt.attr_len == GWN_VERT_ATTR_MAX_LEN) { PyErr_SetString(PyExc_ValueError, "Maxumum attr reached " STRINGIFY(GWN_VERT_ATTR_MAX_LEN)); return NULL; } @@ -440,7 +440,7 @@ static PyObject *bpygwn_VertBuf_fill(BPyGwn_VertBuf *self, PyObject *args, PyObj return NULL; } - if (params.id >= self->buf->format.attrib_ct) { + if (params.id >= self->buf->format.attr_len) { PyErr_Format(PyExc_ValueError, "Format id %d out of range", params.id); @@ -532,10 +532,10 @@ static PyObject *bpygwn_VertBatch_vertbuf_add(BPyGwn_Batch *self, BPyGwn_VertBuf return NULL; } - if (self->batch->verts[0]->vertex_ct != py_buf->buf->vertex_ct) { + if (self->batch->verts[0]->vertex_len != py_buf->buf->vertex_len) { PyErr_Format(PyExc_TypeError, "Expected %d length, got %d", - self->batch->verts[0]->vertex_ct, py_buf->buf->vertex_ct); + self->batch->verts[0]->vertex_len, py_buf->buf->vertex_len); return NULL; } diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index b8c71d4e054..d3464ea5841 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -255,7 +255,6 @@ static void pydriver_error(ChannelDriver *driver) #define OK_OP(op) [op] = 1 const char secure_opcodes[255] = { - OK_OP(0), OK_OP(POP_TOP), OK_OP(ROT_TWO), OK_OP(ROT_THREE), @@ -349,15 +348,14 @@ static bool bpy_driver_secure_bytecode_validate(PyObject *expr_code, PyObject *d /* Check opcodes. */ { - const char *codestr; + const _Py_CODEUNIT *codestr; Py_ssize_t code_len; PyBytes_AsStringAndSize(py_code->co_code, (char **)&codestr, &code_len); + code_len /= sizeof(*codestr); -#define CODESIZE(op) (HAS_ARG(op) ? 3 : 1) - - for (Py_ssize_t i = 0; i < code_len; i += CODESIZE(codestr[i])) { - const int opcode = codestr[i]; + for (Py_ssize_t i = 0; i < code_len; i++) { + const int opcode = _Py_OPCODE(codestr[i]); if (secure_opcodes[opcode] == 0) { fprintf(stderr, "\tBPY_driver_eval() - restructed access disallows opcode '%d', " "enable auto-execution to support\n", opcode); diff --git a/source/blender/python/simple_enum_gen.py b/source/blender/python/simple_enum_gen.py index 6094154050b..3a9c1847fc7 100644 --- a/source/blender/python/simple_enum_gen.py +++ b/source/blender/python/simple_enum_gen.py @@ -1,22 +1,22 @@ - # ***** 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. - # - # Contributor(s): Campbell Barton - # - # #**** END GPL LICENSE BLOCK #**** +# ***** 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> defs = """ SPACE_EMPTY, diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 0a61747e590..ccbed11e6e8 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -609,7 +609,8 @@ bool WM_event_is_ime_switch(const struct wmEvent *event); const char *WM_window_cursor_keymap_status_get(const struct wmWindow *win, int button_index, int type_index); void WM_window_cursor_keymap_status_refresh(struct bContext *C, struct wmWindow *win); -struct ScrArea *WM_window_find_area_status(struct wmWindow *win, struct bScreen *sc); +void WM_window_status_area_tag_redraw(struct wmWindow *win); +struct ScrArea *WM_window_status_area_find(struct wmWindow *win, struct bScreen *sc); bool WM_window_modal_keymap_status_draw( struct bContext *C, struct wmWindow *win, struct uiLayout *layout); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 19889f57261..8469dc9da0e 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1973,11 +1973,7 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand if (op->type->modalkeymap) { wmWindow *win = CTX_wm_window(C); - bScreen *sc = WM_window_get_active_screen(win); - ScrArea *sa = WM_window_find_area_status(win, sc); - if (sa != NULL) { - ED_area_tag_redraw(sa); - } + WM_window_status_area_tag_redraw(win); } } else { @@ -3211,11 +3207,7 @@ wmEventHandler *WM_event_add_modal_handler(bContext *C, wmOperator *op) BLI_addhead(&win->modalhandlers, handler); if (op->type->modalkeymap) { - bScreen *sc = WM_window_get_active_screen(win); - ScrArea *sa = WM_window_find_area_status(win, sc); - if (sa != NULL) { - ED_area_tag_redraw(sa); - } + WM_window_status_area_tag_redraw(win); } return handler; @@ -4352,7 +4344,7 @@ const char *WM_window_cursor_keymap_status_get(const wmWindow *win, int button_i * Similar to #BKE_screen_area_map_find_area_xy and related functions, * use here since the ara is stored in the window manager. */ -ScrArea *WM_window_find_area_status(wmWindow *win, bScreen *screen) +ScrArea *WM_window_status_area_find(wmWindow *win, bScreen *screen) { if (screen->state == SCREENFULL) { return NULL; @@ -4367,10 +4359,19 @@ ScrArea *WM_window_find_area_status(wmWindow *win, bScreen *screen) return sa_statusbar; } +void WM_window_status_area_tag_redraw(wmWindow *win) +{ + bScreen *sc = WM_window_get_active_screen(win); + ScrArea *sa = WM_window_status_area_find(win, sc); + if (sa != NULL) { + ED_area_tag_redraw(sa); + } +} + void WM_window_cursor_keymap_status_refresh(bContext *C, wmWindow *win) { bScreen *screen = WM_window_get_active_screen(win); - ScrArea *sa_statusbar = WM_window_find_area_status(win, screen); + ScrArea *sa_statusbar = WM_window_status_area_find(win, screen); if (sa_statusbar == NULL) { return; } @@ -4524,14 +4525,14 @@ bool WM_window_modal_keymap_status_draw( uiLayout *layout) { wmKeyMap *keymap = NULL; - wmOperatorType *ot = NULL; + wmOperator *op = NULL; for (wmEventHandler *handler = win->modalhandlers.first; handler; handler = handler->next) { if (handler->op) { /* 'handler->keymap' could be checked too, seems not to be used. */ wmKeyMap *keymap_test = handler->op->type->modalkeymap; if (keymap_test && keymap_test->modal_items) { keymap = keymap_test; - ot = handler->op->type; + op = handler->op; break; } } @@ -4546,14 +4547,49 @@ bool WM_window_modal_keymap_status_draw( if (!items[i].identifier[0]) { continue; } - char buf[UI_MAX_DRAW_STR]; - int available_len = sizeof(buf); - char *p = buf; - WM_modalkeymap_operator_items_to_string_buf(ot, items[i].value, true, UI_MAX_SHORTCUT_STR, &available_len, &p); - p -= 1; - if (p > buf) { - BLI_snprintf(p, available_len, ": %s", items[i].name); - uiItemL(row, buf, 0); + if ((keymap->poll_modal_item != NULL) && + (keymap->poll_modal_item(op, items[i].value) == false)) + { + continue; + } + + bool show_text = true; + + { + /* warning: O(n^2) */ + wmKeyMapItem *kmi = NULL; + for (kmi = keymap->items.first; kmi; kmi = kmi->next) { + if (kmi->propvalue == items[i].value) { + break; + } + } + if (kmi != NULL) { + if (kmi->val == KM_RELEASE) { + /* Assume release events just disable something which was toggled on. */ + continue; + } + int icon_mod[4]; + int icon = UI_icon_from_keymap_item(kmi, icon_mod); + if (icon != 0) { + for (int j = 0; j < ARRAY_SIZE(icon_mod) && icon_mod[j]; j++) { + uiItemL(row, "", icon_mod[j]); + } + uiItemL(row, items[i].name, icon); + show_text = false; + } + } + } + if (show_text) { + char buf[UI_MAX_DRAW_STR]; + int available_len = sizeof(buf); + char *p = buf; + WM_modalkeymap_operator_items_to_string_buf( + op->type, items[i].value, true, UI_MAX_SHORTCUT_STR, &available_len, &p); + p -= 1; + if (p > buf) { + BLI_snprintf(p, available_len, ": %s", items[i].name); + uiItemL(row, buf, 0); + } } } return true; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 1983c0e6b84..926169e77fd 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -2569,11 +2569,11 @@ static void radial_control_paint_tex(RadialControl *rc, float radius, float alph } Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); if (rc->gltex) { - unsigned int texCoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint texCoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, rc->gltex); @@ -2701,7 +2701,7 @@ static void radial_control_paint_cursor(bContext *UNUSED(C), int x, int y, void RNA_property_float_get_array(&rc->col_ptr, rc->col_prop, col); Gwn_VertFormat *format = immVertexFormat(); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3fvAlpha(col, 0.5f); @@ -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", ""}, @@ -3996,6 +3996,11 @@ void wm_window_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "WM_OT_quit_blender", QKEY, KM_PRESS, KM_CTRL, 0); + /* F-Keys are a hassle on some macos systems. */ +#ifdef __APPLE__ + WM_keymap_add_item(keymap, "WM_OT_search_menu", FKEY, KM_PRESS, KM_OSKEY, 0); +#endif + #ifdef USE_WM_KEYMAP_27X WM_keymap_add_item(keymap, "WM_OT_doc_view_manual_ui_context", F1KEY, KM_PRESS, KM_ALT, 0); @@ -4010,8 +4015,6 @@ void wm_window_keymap(wmKeyConfig *keyconf) #endif /* menus that can be accessed anywhere in blender */ - WM_keymap_add_item(keymap, "WM_OT_search_menu", ACCENTGRAVEKEY, KM_CLICK, 0, 0); - WM_keymap_add_menu(keymap, "SCREEN_MT_user_menu", QKEY, KM_PRESS, 0, 0); #ifdef WITH_INPUT_NDOF diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index 8c062be2a00..ef7992dcb8c 100644 --- a/source/blender/windowmanager/intern/wm_playanim.c +++ b/source/blender/windowmanager/intern/wm_playanim.c @@ -139,6 +139,9 @@ typedef struct PlayState { /* restarts player for file drop */ char dropped_file[FILE_MAX]; + + bool need_frame_update; + int frame_cursor_x; } PlayState; /* for debugging */ @@ -368,7 +371,7 @@ static void playanim_toscreen(PlayState *ps, PlayAnimPict *picture, struct ImBuf gpuPushMatrix(); gpuLoadIdentity(); - unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3ub(0, 255, 0); @@ -558,8 +561,18 @@ static void update_sound_fps(void) #endif } -static void change_frame(PlayState *ps, int cx) +static void tag_change_frame(PlayState *ps, int cx) +{ + ps->need_frame_update = true; + ps->frame_cursor_x = cx; +} + +static void change_frame(PlayState *ps) { + if (!ps->need_frame_update) { + return; + } + int sizex, sizey; int i, i_last; @@ -569,7 +582,7 @@ static void change_frame(PlayState *ps, int cx) playanim_window_get_size(&sizex, &sizey); i_last = ((struct PlayAnimPict *)picsbase.last)->frame; - i = (i_last * cx) / sizex; + i = (i_last * ps->frame_cursor_x) / sizex; CLAMP(i, 0, i_last); #ifdef WITH_AUDASPACE @@ -610,6 +623,8 @@ static void change_frame(PlayState *ps, int cx) ps->sstep = true; ps->wait2 = false; ps->next_frame = 0; + + ps->need_frame_update = false; } static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void) @@ -961,7 +976,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void) if (type == GHOST_kEventButtonDown) { if (inside_window) { g_WS.qual |= WS_QUAL_LMOUSE; - change_frame(ps, cx); + tag_change_frame(ps, cx); } } else @@ -1006,7 +1021,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void) GHOST_ScreenToClient(g_WS.ghost_window, cd->x, cd->y, &cx, &cy); - change_frame(ps, cx); + tag_change_frame(ps, cx); } break; } @@ -1442,23 +1457,18 @@ static char *wm_main_playanim_intern(int argc, const char **argv) ps.next_frame = ps.direction; - while ((hasevent = GHOST_ProcessEvents(g_WS.ghost_system, ps.wait2))) { - if (hasevent) { - GHOST_DispatchEvents(g_WS.ghost_system); - } - /* Note, this still draws for mousemoves on pause */ - if (ps.wait2) { - if (hasevent) { - if (ibuf) { - while (pupdate_time()) PIL_sleep_ms(1); - ptottime -= swaptime; - playanim_toscreen(&ps, ps.picture, ibuf, ps.fontid, ps.fstep); - } - } - } - if (ps.go == false) { - break; - } + while ((hasevent = GHOST_ProcessEvents(g_WS.ghost_system, 0))) { + GHOST_DispatchEvents(g_WS.ghost_system); + } + if (ps.go == false) { + break; + } + change_frame(&ps); + if (!hasevent) { + PIL_sleep_ms(1); + } + if (ps.wait2) { + continue; } ps.wait2 = ps.sstep; diff --git a/source/blender/windowmanager/intern/wm_stereo.c b/source/blender/windowmanager/intern/wm_stereo.c index 2c779ba9c7c..1e9f6d6231b 100644 --- a/source/blender/windowmanager/intern/wm_stereo.c +++ b/source/blender/windowmanager/intern/wm_stereo.c @@ -88,8 +88,8 @@ void wm_stereo3d_draw_interlace(wmWindow *win, ARegion *ar) float halfy = GLA_PIXEL_OFS / ar->winy; Gwn_VertFormat *format = immVertexFormat(); - unsigned int texcoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint texcoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); /* leave GL_TEXTURE0 as the latest active texture */ for (int view = 1; view >= 0; view--) { @@ -164,8 +164,8 @@ void wm_stereo3d_draw_sidebyside(wmWindow *win, int view) bool cross_eyed = (win->stereo3d_format->flag & S3D_SIDEBYSIDE_CROSSEYED) != 0; Gwn_VertFormat *format = immVertexFormat(); - unsigned int texcoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint texcoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_IMAGE); @@ -210,8 +210,8 @@ void wm_stereo3d_draw_sidebyside(wmWindow *win, int view) void wm_stereo3d_draw_topbottom(wmWindow *win, int view) { Gwn_VertFormat *format = immVertexFormat(); - unsigned int texcoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); - unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint texcoord = GWN_vertformat_attr_add(format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_IMAGE); 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)) |