diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-24 02:16:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-24 02:16:45 +0400 |
commit | f6c323aa42e94c4750f52940b47a0d57b503c1b9 (patch) | |
tree | 486b03bf59d3e022443c8e290f354265d0126578 /release/scripts | |
parent | 1be4eda552aa97aa5f5fe43fd34196c57425a7c2 (diff) |
- move more active properties into their collections:
scene.active_keying_set --> scene.keying_sets.active
...same for active_uv_texture. active_vertex_color, active_keyconfig,
- move mesh.add_uv_layer() and mesh.add_vertex_color() into their collections
also have them return the newly created layer and dont set the layer active.
uvtex = mesh.uv_layers.new(name)
vcol = mesh.vertex_colors.new(name)
Diffstat (limited to 'release/scripts')
21 files changed, 70 insertions, 73 deletions
diff --git a/release/scripts/io/export_3ds.py b/release/scripts/io/export_3ds.py index 4a5521bd9e9..706e7eb1516 100644 --- a/release/scripts/io/export_3ds.py +++ b/release/scripts/io/export_3ds.py @@ -567,7 +567,7 @@ def extract_triangles(mesh): f_v = face.vertices # f_v = face.v - uf = mesh.active_uv_texture.data[i] if do_uv else None + uf = mesh.uv_textures.active.data[i] if do_uv else None if do_uv: f_uv = uf.uv @@ -998,7 +998,7 @@ def write(filename, context): if not mat_ls: mat = mat_name = None - for f, uf in zip(data.faces, data.active_uv_texture.data): + for f, uf in zip(data.faces, data.uv_textures.active.data): if mat_ls: mat_index = f.material_index # mat_index = f.mat diff --git a/release/scripts/io/export_fbx.py b/release/scripts/io/export_fbx.py index 60e9e90e11b..486f7d8199b 100644 --- a/release/scripts/io/export_fbx.py +++ b/release/scripts/io/export_fbx.py @@ -1630,7 +1630,7 @@ def write(filename, batch_objects = None, \ # if me.vertexColors: collayers = me.vertex_colors # collayers = me.getColorLayerNames() - collayer_orig = me.active_vertex_color + collayer_orig = me.vertex_colors.active # collayer_orig = me.activeColorLayer for colindex, collayer in enumerate(collayers): # me.activeColorLayer = collayer @@ -1700,7 +1700,7 @@ def write(filename, batch_objects = None, \ if do_uvs: uvlayers = me.uv_textures # uvlayers = me.getUVLayerNames() - uvlayer_orig = me.active_uv_texture + uvlayer_orig = me.uv_textures.active # uvlayer_orig = me.activeUVLayer for uvindex, uvlayer in enumerate(me.uv_textures): # for uvindex, uvlayer in enumerate(uvlayers): @@ -1834,8 +1834,8 @@ def write(filename, batch_objects = None, \ mats = my_mesh.blenMaterialList - if me.active_uv_texture: - uv_faces = me.active_uv_texture.data + if me.uv_textures.active: + uv_faces = me.uv_textures.active.data else: uv_faces = [None] * len(me.faces) @@ -2103,7 +2103,7 @@ def write(filename, batch_objects = None, \ material_mapping_local = {} if len(me.uv_textures) > 0: # if me.faceUV: - uvlayer_orig = me.active_uv_texture + uvlayer_orig = me.uv_textures.active # uvlayer_orig = me.activeUVLayer for uvlayer in me.uv_textures: # for uvlayer in me.getUVLayerNames(): diff --git a/release/scripts/io/export_obj.py b/release/scripts/io/export_obj.py index 53c4a324ed1..68edc561498 100644 --- a/release/scripts/io/export_obj.py +++ b/release/scripts/io/export_obj.py @@ -418,7 +418,7 @@ def write_file(filepath, objects, scene, if EXPORT_UV: faceuv = len(me.uv_textures) > 0 - uv_layer = me.active_uv_texture.data[:] + uv_layer = me.uv_textures.active.data[:] else: faceuv = False @@ -542,7 +542,7 @@ def write_file(filepath, objects, scene, uv_face_mapping = [[0,0,0,0] for i in range(len(face_index_pairs))] # a bit of a waste for tri's :/ uv_dict = {} # could use a set() here - uv_layer = me.active_uv_texture.data + uv_layer = me.uv_textures.active.data for f, f_index in face_index_pairs: for uv_index, uv in enumerate(uv_layer[f_index].uv): uvkey = veckey2d(uv) diff --git a/release/scripts/io/export_ply.py b/release/scripts/io/export_ply.py index 1a4fd7a6ff9..946be68ec41 100644 --- a/release/scripts/io/export_ply.py +++ b/release/scripts/io/export_ply.py @@ -129,7 +129,7 @@ def write(filename, scene, ob, \ vertexColors = False if faceUV: - active_uv_layer = mesh.active_uv_texture + active_uv_layer = mesh.uv_textures.active if not active_uv_layer: EXPORT_UV = False faceUV = None @@ -137,7 +137,7 @@ def write(filename, scene, ob, \ active_uv_layer = active_uv_layer.data if vertexColors: - active_col_layer = mesh.active_vertex_color + active_col_layer = mesh.vertex_colors.active if not active_col_layer: EXPORT_COLORS = False vertexColors = None diff --git a/release/scripts/io/export_x3d.py b/release/scripts/io/export_x3d.py index aafb7c922a1..c98debd5c60 100644 --- a/release/scripts/io/export_x3d.py +++ b/release/scripts/io/export_x3d.py @@ -402,9 +402,9 @@ class x3d_class: if len(mesh.faces) == 0: return mode = [] # mode = 0 - if mesh.active_uv_texture: + if mesh.uv_textures.active: # if mesh.faceUV: - for face in mesh.active_uv_texture.data: + for face in mesh.uv_textures.active.data: # for face in mesh.faces: if face.use_halo and 'HALO' not in mode: mode += ['HALO'] @@ -463,7 +463,7 @@ class x3d_class: hasImageTexture=0 is_smooth = False - if len(maters) > 0 or mesh.active_uv_texture: + if len(maters) > 0 or mesh.uv_textures.active: # if len(maters) > 0 or mesh.faceUV: self.writeIndented("<Appearance>\n", 1) # right now this script can only handle a single material per mesh. @@ -480,9 +480,9 @@ class x3d_class: #-- textures face = None - if mesh.active_uv_texture: + if mesh.uv_textures.active: # if mesh.faceUV: - for face in mesh.active_uv_texture.data: + for face in mesh.uv_textures.active.data: # for face in mesh.faces: if face.image: # if (hasImageTexture == 0) and (face.image): @@ -525,7 +525,7 @@ class x3d_class: self.file.write("creaseAngle=\"%s\" " % (round(creaseAngle,self.cp))) #--- output textureCoordinates if UV texture used - if mesh.active_uv_texture: + if mesh.uv_textures.active: # if mesh.faceUV: if self.matonly == 1 and self.share == 1: self.writeFaceColors(mesh) @@ -540,7 +540,7 @@ class x3d_class: self.writeCoordinates(ob, mesh, meshName, EXPORT_TRI) #--- output textureCoordinates if UV texture used - if mesh.active_uv_texture: + if mesh.uv_textures.active: # if mesh.faceUV: if hasImageTexture == 1: self.writeTextureCoordinates(mesh) @@ -614,7 +614,7 @@ class x3d_class: texIndexList=[] j=0 - for face in mesh.active_uv_texture.data: + for face in mesh.uv_textures.active.data: # for face in mesh.faces: # workaround, since tface.uv iteration is wrong atm uvs = face.uv @@ -646,10 +646,10 @@ class x3d_class: def writeFaceColors(self, mesh): if self.writingcolor == 0: self.file.write("colorPerVertex=\"false\" ") - elif mesh.active_vertex_color: + elif mesh.vertex_colors.active: # else: self.writeIndented("<Color color=\"", 1) - for face in mesh.active_vertex_color.data: + for face in mesh.vertex_colors.active.data: c = face.color1 if self.verbose > 2: print("Debug: face.col r=%d g=%d b=%d" % (c[0], c[1], c[2])) @@ -961,9 +961,9 @@ class x3d_class: faceMap={} nFaceIndx=0 - if mesh.active_uv_texture: + if mesh.uv_textures.active: # if mesh.faceUV: - for face in mesh.active_uv_texture.data: + for face in mesh.uv_textures.active.data: # for face in mesh.faces sidename = "two" if face.use_twoside else "one" diff --git a/release/scripts/io/import_scene_3ds.py b/release/scripts/io/import_scene_3ds.py index 6378d93df62..f956f29b0e7 100644 --- a/release/scripts/io/import_scene_3ds.py +++ b/release/scripts/io/import_scene_3ds.py @@ -346,8 +346,8 @@ def process_next_chunk(file, previous_chunk, importedObjects, IMAGE_SEARCH): bmesh.faces.foreach_set("vertices_raw", eekadoodle_faces) if bmesh.faces and contextMeshUV: - bmesh.add_uv_texture() - uv_faces = bmesh.active_uv_texture.data[:] + bmesh.uv_textures.new() + uv_faces = bmesh.uv_textures.active.data[:] else: uv_faces = None diff --git a/release/scripts/io/import_scene_obj.py b/release/scripts/io/import_scene_obj.py index 655f797750e..f20652a6b0a 100644 --- a/release/scripts/io/import_scene_obj.py +++ b/release/scripts/io/import_scene_obj.py @@ -692,9 +692,7 @@ def create_mesh(new_objects, has_ngons, CREATE_FGONS, CREATE_EDGES, verts_loc, v # face_mapping= me.faces.extend([f[0] for f in faces], indexList=True) if verts_tex and me.faces: - me.add_uv_texture() -# me.faceUV= 1 - # TEXMODE= Mesh.FaceModes['TEX'] + me.uv_textures.new() context_material_old= -1 # avoid a dict lookup mat= 0 # rare case it may be un-initialized. diff --git a/release/scripts/op/object.py b/release/scripts/op/object.py index 56c43c0728c..28f3b226c21 100644 --- a/release/scripts/op/object.py +++ b/release/scripts/op/object.py @@ -427,13 +427,13 @@ class JoinUVs(bpy.types.Operator): if is_editmode: bpy.ops.object.mode_set(mode='OBJECT', toggle=False) - if not mesh.active_uv_texture: + if not mesh.uv_textures: self.report({'WARNING'}, "Object: %s, Mesh: '%s' has no UVs\n" % (obj.name, mesh.name)) else: len_faces = len(mesh.faces) uv_array = array.array('f', [0.0] * 8) * len_faces # seems to be the fastest way to create an array - mesh.active_uv_texture.data.foreach_get("uv_raw", uv_array) + mesh.uv_textures.active.data.foreach_get("uv_raw", uv_array) objects = context.selected_editable_objects[:] @@ -451,10 +451,9 @@ class JoinUVs(bpy.types.Operator): if len(mesh_other.faces) != len_faces: self.report({'WARNING'}, "Object: %s, Mesh: '%s' has %d faces, expected %d\n" % (obj_other.name, mesh_other.name, len(mesh_other.faces), len_faces)) else: - uv_other = mesh_other.active_uv_texture + uv_other = mesh_other.uv_textures.active if not uv_other: - mesh_other.add_uv_texture() # should return the texture it adds - uv_other = mesh_other.active_uv_texture + uv_other = mesh_other.uv_textures.new() # should return the texture it adds # finally do the copy uv_other.data.foreach_set("uv_raw", uv_array) diff --git a/release/scripts/op/presets.py b/release/scripts/op/presets.py index 43e2cda5d53..4d15d94f408 100644 --- a/release/scripts/op/presets.py +++ b/release/scripts/op/presets.py @@ -50,7 +50,7 @@ class AddPresetBase(): if getattr(self, "save_keyconfig", False): bpy.ops.wm.keyconfig_export(filepath=filepath, kc_name=self.properties.name) file_preset = open(filepath, 'a') - file_preset.write("wm.active_keyconfig = kc\n\n") + file_preset.write("wm.keyconfigs.active = kc\n\n") else: file_preset = open(filepath, 'w') file_preset.write("import bpy\n") diff --git a/release/scripts/op/uv.py b/release/scripts/op/uv.py index cf3d68787c0..238c11d6e06 100644 --- a/release/scripts/op/uv.py +++ b/release/scripts/op/uv.py @@ -69,7 +69,7 @@ class ExportUVLayout(bpy.types.Operator): def _face_uv_iter(self, context): obj = context.active_object mesh = obj.data - uv_layer = mesh.active_uv_texture.data + uv_layer = mesh.uv_textures.active.data uv_layer_len = len(uv_layer) if not self.properties.export_all: diff --git a/release/scripts/op/uvcalc_follow_active.py b/release/scripts/op/uvcalc_follow_active.py index 1f80e704f93..9f809dd39f8 100644 --- a/release/scripts/op/uvcalc_follow_active.py +++ b/release/scripts/op/uvcalc_follow_active.py @@ -28,8 +28,8 @@ def extend(obj, operator, EXTEND_MODE): me = obj.data me_verts = me.vertices # script will fail without UVs - if not me.active_uv_texture: - me.add_uv_texture() + if not me.uv_textures: + me.uv_textures.new() # Toggle Edit mode @@ -57,10 +57,10 @@ def extend(obj, operator, EXTEND_MODE): vidx_source = face_source.vertices vidx_target = face_target.vertices - faceUVsource = me.active_uv_texture.data[face_source.index] + faceUVsource = me.uv_textures.active.data[face_source.index] uvs_source = [faceUVsource.uv1, faceUVsource.uv2, faceUVsource.uv3, faceUVsource.uv4] - faceUVtarget = me.active_uv_texture.data[face_target.index] + faceUVtarget = me.uv_textures.active.data[face_target.index] uvs_target = [faceUVtarget.uv1, faceUVtarget.uv2, faceUVtarget.uv3, faceUVtarget.uv4] # vertex index is the key, uv is the value @@ -138,8 +138,8 @@ def extend(obj, operator, EXTEND_MODE): uvs_vhash_target[edgepair_outer_target[iA]][:] = uvs_vhash_source[edgepair_inner_source[1]] + (uvs_vhash_source[edgepair_inner_source[1]] - uvs_vhash_source[edgepair_outer_source[0]]) - if me.active_uv_texture == None: - me.add_uv_texture + if not me.uv_textures: + me.uv_textures.new() face_act = me.faces.active if face_act == -1: diff --git a/release/scripts/op/uvcalc_smart_project.py b/release/scripts/op/uvcalc_smart_project.py index 0589b7e861a..c4e19afc810 100644 --- a/release/scripts/op/uvcalc_smart_project.py +++ b/release/scripts/op/uvcalc_smart_project.py @@ -892,10 +892,10 @@ def main(context, island_margin, projection_limit): # Tag as used me.tag = True - if len(me.uv_textures)==0: # Mesh has no UV Coords, dont bother. - me.add_uv_texture() + if not me.uv_textures: # Mesh has no UV Coords, dont bother. + me.uv_textures.new() - uv_layer = me.active_uv_texture.data + uv_layer = me.uv_textures.active.data me_verts = list(me.vertices) if USER_ONLY_SELECTED_FACES: diff --git a/release/scripts/presets/interaction/maya.py b/release/scripts/presets/interaction/maya.py index ccd95abf75e..4fcf987c9b2 100644 --- a/release/scripts/presets/interaction/maya.py +++ b/release/scripts/presets/interaction/maya.py @@ -375,7 +375,7 @@ kmi.properties.value_2 = 'CONNECTED' kmi = km.items.add('mesh.select_all', 'SELECTMOUSE', 'CLICK') kmi.properties.action = 'DESELECT' -wm.active_keyconfig = kc +wm.keyconfigs.active = kc bpy.context.user_preferences.edit.use_drag_immediately = True bpy.context.user_preferences.edit.use_insertkey_xyz_to_rgb = False diff --git a/release/scripts/templates/operator_uv.py b/release/scripts/templates/operator_uv.py index a18aaf358c8..305496e31ce 100644 --- a/release/scripts/templates/operator_uv.py +++ b/release/scripts/templates/operator_uv.py @@ -9,11 +9,11 @@ def main(context): bpy.ops.object.mode_set(mode='OBJECT', toggle=False) - if not mesh.active_uv_texture: - bpy.ops.mesh.uv_texture_add() + if not mesh.uv_textures: + uvtex = bpy.ops.mesh.uv_texture_add() # adjust UVs - for i, uv in enumerate(mesh.active_uv_texture.data): + for i, uv in enumerate(uvtex.data): uvs = uv.uv1, uv.uv2, uv.uv3, uv.uv4 for j, v_idx in enumerate(mesh.faces[i].vertices): if uv.select_uv[j]: diff --git a/release/scripts/ui/properties_data_armature.py b/release/scripts/ui/properties_data_armature.py index 7de06554751..3931626f0ff 100644 --- a/release/scripts/ui/properties_data_armature.py +++ b/release/scripts/ui/properties_data_armature.py @@ -126,7 +126,7 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, bpy.types.Panel): col.operator("pose.group_add", icon='ZOOMIN', text="") col.operator("pose.group_remove", icon='ZOOMOUT', text="") - group = pose.active_bone_group + group = pose.bone_groups.active if group: col = layout.column() col.active = (ob.proxy is None) diff --git a/release/scripts/ui/properties_data_mesh.py b/release/scripts/ui/properties_data_mesh.py index fd184819143..986d1d2e834 100644 --- a/release/scripts/ui/properties_data_mesh.py +++ b/release/scripts/ui/properties_data_mesh.py @@ -272,7 +272,7 @@ class DATA_PT_uv_texture(MeshButtonsPanel, bpy.types.Panel): col.operator("mesh.uv_texture_add", icon='ZOOMIN', text="") col.operator("mesh.uv_texture_remove", icon='ZOOMOUT', text="") - lay = me.active_uv_texture + lay = me.uv_textures.active if lay: layout.prop(lay, "name") @@ -341,7 +341,7 @@ class DATA_PT_vertex_colors(MeshButtonsPanel, bpy.types.Panel): col.operator("mesh.vertex_color_add", icon='ZOOMIN', text="") col.operator("mesh.vertex_color_remove", icon='ZOOMOUT', text="") - lay = me.active_vertex_color + lay = me.vertex_colors.active if lay: layout.prop(lay, "name") diff --git a/release/scripts/ui/properties_scene.py b/release/scripts/ui/properties_scene.py index c6b9d7522e0..6e25d793683 100644 --- a/release/scripts/ui/properties_scene.py +++ b/release/scripts/ui/properties_scene.py @@ -82,7 +82,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, bpy.types.Panel): col.operator("anim.keying_set_add", icon='ZOOMIN', text="") col.operator("anim.keying_set_remove", icon='ZOOMOUT', text="") - ks = scene.active_keying_set + ks = scene.keying_sets.active if ks and ks.is_path_absolute: row = layout.row() @@ -106,13 +106,14 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, bpy.types.Panel): @classmethod def poll(cls, context): - return (context.scene.active_keying_set and context.scene.active_keying_set.is_path_absolute) + ks = context.scene.keying_sets.active + return (ks and ks.is_path_absolute) def draw(self, context): layout = self.layout scene = context.scene - ks = scene.active_keying_set + ks = scene.keying_sets.active row = layout.row() row.label(text="Paths:") @@ -126,7 +127,7 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, bpy.types.Panel): col.operator("anim.keying_set_path_add", icon='ZOOMIN', text="") col.operator("anim.keying_set_path_remove", icon='ZOOMOUT', text="") - ksp = ks.active_path + ksp = ks.paths.active if ksp: col = layout.column() col.label(text="Target:") @@ -227,7 +228,7 @@ class ANIM_OT_keying_set_export(bpy.types.Operator): raise Exception("Could not open file.") scene = context.scene - ks = scene.active_keying_set + ks = scene.keying_sets.active f.write("# Keying Set: %s\n" % ks.name) diff --git a/release/scripts/ui/space_image.py b/release/scripts/ui/space_image.py index fc21292bc5e..06c04814085 100644 --- a/release/scripts/ui/space_image.py +++ b/release/scripts/ui/space_image.py @@ -316,7 +316,7 @@ class IMAGE_HT_header(bpy.types.Header): row.prop(toolsettings, "snap_element", text="", icon_only=True) # mesh = context.edit_object.data - # row.prop_search(mesh, "active_uv_layer", mesh, "uv_textures") + # row.prop_search_self(mesh, "active", "uv_textures") if ima: # layers diff --git a/release/scripts/ui/space_outliner.py b/release/scripts/ui/space_outliner.py index e2d8db385f6..11760d7bafe 100644 --- a/release/scripts/ui/space_outliner.py +++ b/release/scripts/ui/space_outliner.py @@ -28,7 +28,7 @@ class OUTLINER_HT_header(bpy.types.Header): space = context.space_data scene = context.scene - ks = context.scene.active_keying_set + ks = context.scene.keying_sets.active row = layout.row(align=True) row.template_header() @@ -53,7 +53,7 @@ class OUTLINER_HT_header(bpy.types.Header): if ks: row = layout.row(align=False) - row.prop_search(scene, "active_keying_set", scene, "keying_sets", text="") + row.prop_search_self(scene, "active", "keying_sets", text="") row = layout.row(align=True) row.operator("anim.keyframe_insert", text="", icon='KEY_HLT') diff --git a/release/scripts/ui/space_time.py b/release/scripts/ui/space_time.py index 7745207341a..40d165a8f49 100644 --- a/release/scripts/ui/space_time.py +++ b/release/scripts/ui/space_time.py @@ -77,7 +77,7 @@ class TIME_HT_header(bpy.types.Header): layout.separator() row = layout.row(align=True) - row.prop_search(scene, "active_keying_set", scene, "keying_sets_all", text="") + row.prop_search_self(scene, "active", "keying_sets", text="") row.operator("anim.keyframe_insert", text="", icon='KEY_HLT') row.operator("anim.keyframe_delete", text="", icon='KEY_DEHLT') diff --git a/release/scripts/ui/space_userpref_keymap.py b/release/scripts/ui/space_userpref_keymap.py index b725ba5139c..f8b23df97a6 100644 --- a/release/scripts/ui/space_userpref_keymap.py +++ b/release/scripts/ui/space_userpref_keymap.py @@ -20,7 +20,6 @@ import bpy import os -KM_MOD_PREFIX = "keyconfig_" KM_HIERARCHY = [ ('Window', 'EMPTY', 'WINDOW', []), # file save, window change, exit @@ -354,8 +353,8 @@ class InputKeyMapPanel(bpy.types.Panel): def draw_keymaps(self, context, layout): wm = context.manager - kc = wm.active_keyconfig - defkc = wm.default_keyconfig + kc = wm.keyconfigs.active + defkc = wm.keyconfigs.default col = layout.column() sub = col.column() @@ -364,8 +363,8 @@ class InputKeyMapPanel(bpy.types.Panel): subcol = subsplit.column() row = subcol.row() - row.prop_search(wm, "active_keyconfig", wm, "keyconfigs", text="Key Config:") - layout.set_context_pointer("keyconfig", wm.active_keyconfig) + row.prop_search_self(wm, "active", "keyconfigs", text="Key Config:") + layout.set_context_pointer("keyconfig", wm.keyconfigs.active) row.operator("wm.keyconfig_remove", text="", icon='X') row.prop(context.space_data, "filter_text", icon="VIEWZOOM") @@ -487,7 +486,7 @@ class WM_OT_keyconfig_test(bpy.types.Operator): def execute(self, context): wm = context.manager - kc = wm.default_keyconfig + kc = wm.keyconfigs.default if self.testConfig(kc): print("CONFLICT") @@ -563,7 +562,7 @@ class WM_OT_keyconfig_import(bpy.types.Operator): reload(mod) wm = bpy.context.manager - wm.active_keyconfig = wm.keyconfigs[config_name] + wm.keyconfigs.active = wm.keyconfigs[config_name] return {'FINISHED'} @@ -595,7 +594,7 @@ class WM_OT_keyconfig_export(bpy.types.Operator): raise Exception("Could not open file") wm = context.manager - kc = wm.active_keyconfig + kc = wm.keyconfigs.active if self.properties.kc_name != '': name = self.properties.kc_name @@ -624,7 +623,7 @@ class WM_OT_keyconfig_export(bpy.types.Operator): edited_kc = FakeKeyConfig() edited_kc.keymaps.extend(context.user_preferences.inputs.edited_keymaps) # merge edited keymaps with non-default keyconfig, if it exists - if kc != wm.default_keyconfig: + if kc != wm.keyconfigs.default: export_keymaps = _merge_keymaps(edited_kc, kc) else: export_keymaps = _merge_keymaps(edited_kc, edited_kc) @@ -695,7 +694,7 @@ class WM_OT_keymap_restore(bpy.types.Operator): wm = context.manager if self.properties.all: - for km in wm.default_keyconfig.keymaps: + for km in wm.keyconfigs.default.keymaps: km.restore_to_default() else: km = context.keymap @@ -729,7 +728,7 @@ class WM_OT_keyitem_add(bpy.types.Operator): def execute(self, context): wm = context.manager km = context.keymap - kc = wm.default_keyconfig + kc = wm.keyconfigs.default if km.is_modal: km.items.add_modal("", 'A', 'PRESS') # kmi @@ -768,13 +767,13 @@ class WM_OT_keyconfig_remove(bpy.types.Operator): @classmethod def poll(cls, context): wm = context.manager - return wm.active_keyconfig.is_user_defined + return wm.keyconfigs.active.is_user_defined def execute(self, context): import sys wm = context.manager - keyconfig = wm.active_keyconfig + keyconfig = wm.keyconfigs.active module = sys.modules.get(keyconfig.name) |