From 6cc0943c59112e4679dd2e01a8ee75669a05385e Mon Sep 17 00:00:00 2001 From: Campbell Barton <ideasman42@gmail.com> Date: Mon, 30 Aug 2010 14:21:31 +0000 Subject: [PATCH] updates for rna changes --- io_anim_camera.py | 2 +- io_export_unreal_psk_psa.py | 8 ++++---- mesh_surface_sketch.py | 8 ++++---- space_view3d_materials_utils.py | 4 ++-- space_view3d_spacebar_menu.py | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/io_anim_camera.py b/io_anim_camera.py index 1b812eb09..92c473c7b 100644 --- a/io_anim_camera.py +++ b/io_anim_camera.py @@ -102,7 +102,7 @@ def writeCameras(context, filepath, frame_start, frame_end, only_selected=False) # now markers fw("# markers\n") for marker in scene.timeline_markers: - fw("marker = scene.timeline_markers.add('%s')\n" % marker.name) + fw("marker = scene.timeline_markers.new('%s')\n" % marker.name) fw("marker.frame = %d + frame\n" % marker.frame) # will fail if the cameras not selected diff --git a/io_export_unreal_psk_psa.py b/io_export_unreal_psk_psa.py index 91bf74a91..7be383f63 100644 --- a/io_export_unreal_psk_psa.py +++ b/io_export_unreal_psk_psa.py @@ -1140,10 +1140,10 @@ def parse_animation(blender_scene, blender_armatures, psa_file): print("==== Action Set ====") print("Action Name:",action_name) #look for min and max frame that current set keys - framemin, framemax = act.get_frame_range() + framemin, framemax = act.frame_range #print("max frame:",framemax) - start_frame = framemin - end_frame = framemax + start_frame = int(framemin) + end_frame = int(framemax) scene_frames = range(start_frame, end_frame+1) frame_count = len(scene_frames) #=================================================== @@ -1529,7 +1529,7 @@ class VIEW3D_PT_unrealtools_objectmode(bpy.types.Panel): #row.label(text="Action Set(s)(not build)") #for action in bpy.data.actions: #print(dir( action)) - #print(action.get_frame_range()) + #print(action.frame_range) #row = layout.row() #row.prop(action, "name") diff --git a/mesh_surface_sketch.py b/mesh_surface_sketch.py index a7ea84e9e..64787ef3f 100644 --- a/mesh_surface_sketch.py +++ b/mesh_surface_sketch.py @@ -790,8 +790,8 @@ def register(): bpy.types.Scene.IntProperty(attr = "SURFSK_precision", name = "Precision", description = "Precision level of the surface calculation", default = 4, min = 0, max = 100000) bpy.types.Scene.BoolProperty(attr = "SURFSK_keep_strokes", name = "Keep strokes", description = "Keeps the sketched strokes after adding the surface", default = False) - keymap_item_add_surf = bpy.data.window_managers[0].keyconfigs.active.keymaps["3D View"].items.add("GPENCIL_OT_SURFSK_add_surface","E","PRESS", key_modifier="D") - keymap_item_stroke_to_curve = bpy.data.window_managers[0].keyconfigs.active.keymaps["3D View"].items.add("GPENCIL_OT_SURFSK_strokes_to_curves","C","PRESS", key_modifier="D") + keymap_item_add_surf = bpy.data.window_managers[0].keyconfigs.active.keymaps["3D View"].items.new("GPENCIL_OT_SURFSK_add_surface","E","PRESS", key_modifier="D") + keymap_item_stroke_to_curve = bpy.data.window_managers[0].keyconfigs.active.keymaps["3D View"].items.new("GPENCIL_OT_SURFSK_strokes_to_curves","C","PRESS", key_modifier="D") def unregister(): @@ -804,9 +804,9 @@ def unregister(): for kmi in km.items: if kmi.idname == 'wm.call_menu': if kmi.properties.name == "GPENCIL_OT_SURFSK_add_surface": - km.remove_item(kmi) + km.items.remove(kmi) elif kmi.properties.name == "GPENCIL_OT_SURFSK_strokes_to_curves": - km.remove_item(kmi) + km.items.remove(kmi) else: continue diff --git a/space_view3d_materials_utils.py b/space_view3d_materials_utils.py index d3c8252cc..88ac72f55 100644 --- a/space_view3d_materials_utils.py +++ b/space_view3d_materials_utils.py @@ -668,7 +668,7 @@ class VIEW3D_MT_select_material(bpy.types.Menu): def register(): km = bpy.context.manager.keyconfigs.active.keymaps['3D View'] - kmi = km.items.add('wm.call_menu', 'Q', 'PRESS') + kmi = km.items.new('wm.call_menu', 'Q', 'PRESS') kmi.properties.name = "VIEW3D_MT_master_material" def unregister(): @@ -676,7 +676,7 @@ def unregister(): for kmi in km.items: if kmi.idname == 'wm.call_menu': if kmi.properties.name == "VIEW3D_MT_master_material": - km.remove_item(kmi) + km.items.remove(kmi) break if __name__ == "__main__": diff --git a/space_view3d_spacebar_menu.py b/space_view3d_spacebar_menu.py index 64eab7cce..dc4b851ed 100644 --- a/space_view3d_spacebar_menu.py +++ b/space_view3d_spacebar_menu.py @@ -1452,7 +1452,7 @@ class VIEW3D_MT_undoS(bpy.types.Menu): def register(): km = bpy.context.manager.keyconfigs.active.keymaps['3D View'] - kmi = km.items.add('wm.call_menu', 'SPACE', 'PRESS') + kmi = km.items.new('wm.call_menu', 'SPACE', 'PRESS') kmi.properties.name = "VIEW3D_MT_Space_Dynamic_Menu" @@ -1461,7 +1461,7 @@ def unregister(): for kmi in km.items: if kmi.idname == 'wm.call_menu': if kmi.properties.name == "VIEW3D_MT_Space_Dynamic_Menu": - km.remove_item(kmi) + km.items.remove(kmi) break if __name__ == "__main__": -- GitLab