diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-06-14 07:52:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-06-14 07:52:10 +0400 |
commit | c2f36a4d6abf829f28079c80e7e9dae6b80251cc (patch) | |
tree | 0c85ad35fca0cadbb997a098244debab62a6167a /release | |
parent | aa97b4362be6015b3e7e1d5c72bd5245cfb0960a (diff) |
naming changes
path -> filepath (for rna and operators, as agreed on with elubie)
path -> data_path (for windowmanager context functions, this was alredy used in many places)
Diffstat (limited to 'release')
29 files changed, 181 insertions, 194 deletions
diff --git a/release/scripts/io/export_3ds.py b/release/scripts/io/export_3ds.py index 9cb5f3a077b..e234ab8600c 100644 --- a/release/scripts/io/export_3ds.py +++ b/release/scripts/io/export_3ds.py @@ -1123,11 +1123,11 @@ class Export3DS(bpy.types.Operator): # filename = StringProperty(name="File Name", description="File name used for exporting the 3DS file", maxlen= 1024, default= ""), - path = StringProperty(name="File Path", description="File path used for exporting the 3DS file", maxlen= 1024, default= "") + filepath = StringProperty(name="File Path", description="Filepath used for exporting the 3DS file", maxlen= 1024, default= "") check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'}) def execute(self, context): - save_3ds(self.properties.path, context) + save_3ds(self.properties.filepath, context) return {'FINISHED'} def invoke(self, context, event): @@ -1142,7 +1142,7 @@ class Export3DS(bpy.types.Operator): # Add to a menu def menu_func(self, context): default_path = bpy.data.filepath.replace(".blend", ".3ds") - self.layout.operator(Export3DS.bl_idname, text="3D Studio (.3ds)").path = default_path + self.layout.operator(Export3DS.bl_idname, text="3D Studio (.3ds)").filepath = default_path def register(): diff --git a/release/scripts/io/export_fbx.py b/release/scripts/io/export_fbx.py index c2a93a5089e..967bbf50307 100644 --- a/release/scripts/io/export_fbx.py +++ b/release/scripts/io/export_fbx.py @@ -3335,7 +3335,7 @@ class ExportFBX(bpy.types.Operator): # to the class instance from the operator settings before calling. - path = StringProperty(name="File Path", description="File path used for exporting the FBX file", maxlen= 1024, default="") + filepath = StringProperty(name="File Path", description="Filepath used for exporting the FBX file", maxlen= 1024, default="") check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'}) EXP_OBS_SELECTED = BoolProperty(name="Selected Objects", description="Export selected objects on visible layers", default=True) @@ -3369,8 +3369,8 @@ class ExportFBX(bpy.types.Operator): return context.active_object def execute(self, context): - if not self.properties.path: - raise Exception("path not set") + if not self.properties.filepath: + raise Exception("filepath not set") GLOBAL_MATRIX = mtx4_identity GLOBAL_MATRIX[0][0] = GLOBAL_MATRIX[1][1] = GLOBAL_MATRIX[2][2] = self.properties.TX_SCALE @@ -3378,7 +3378,7 @@ class ExportFBX(bpy.types.Operator): if self.properties.TX_YROT90: GLOBAL_MATRIX = mtx4_y90n * GLOBAL_MATRIX if self.properties.TX_ZROT90: GLOBAL_MATRIX = mtx4_z90n * GLOBAL_MATRIX - write(self.properties.path, + write(self.properties.filepath, None, # XXX context, self.properties.EXP_OBS_SELECTED, @@ -3411,7 +3411,7 @@ class ExportFBX(bpy.types.Operator): # if __name__ == "__main__": -# bpy.ops.EXPORT_OT_ply(path="/tmp/test.ply") +# bpy.ops.EXPORT_OT_ply(filepath="/tmp/test.ply") # NOTES (all line numbers correspond to original export_fbx.py (under release/scripts) @@ -3439,7 +3439,7 @@ class ExportFBX(bpy.types.Operator): def menu_func(self, context): default_path = bpy.data.filepath.replace(".blend", ".fbx") - self.layout.operator(ExportFBX.bl_idname, text="Autodesk FBX (.fbx)").path = default_path + self.layout.operator(ExportFBX.bl_idname, text="Autodesk FBX (.fbx)").filepath = default_path def register(): diff --git a/release/scripts/io/export_mdd.py b/release/scripts/io/export_mdd.py index 3ae6ed3de9b..3c82ff5d497 100644 --- a/release/scripts/io/export_mdd.py +++ b/release/scripts/io/export_mdd.py @@ -159,7 +159,7 @@ class ExportMDD(bpy.types.Operator): # List of operator properties, the attributes will be assigned # to the class instance from the operator settings before calling. - path = StringProperty(name="File Path", description="File path used for exporting the MDD file", maxlen=1024) + filepath = StringProperty(name="File Path", description="Filepath used for exporting the MDD file", maxlen=1024) check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'}) fps = IntProperty(name="Frames Per Second", description="Number of frames/second", min=minfps, max=maxfps, default=25) frame_start = IntProperty(name="Start Frame", description="Start frame for baking", min=minframe, max=maxframe, default=1) @@ -170,9 +170,9 @@ class ExportMDD(bpy.types.Operator): return (ob and ob.type == 'MESH') def execute(self, context): - if not self.properties.path: + if not self.properties.filepath: raise Exception("filename not set") - write(self.properties.path, context.scene, context.active_object, + write(self.properties.filepath, context.scene, context.active_object, self.properties.frame_start, self.properties.frame_end, self.properties.fps) return {'FINISHED'} @@ -184,7 +184,7 @@ class ExportMDD(bpy.types.Operator): def menu_func(self, context): default_path = bpy.data.filepath.replace(".blend", ".mdd") - self.layout.operator(ExportMDD.bl_idname, text="Lightwave Point Cache (.mdd)").path = default_path + self.layout.operator(ExportMDD.bl_idname, text="Lightwave Point Cache (.mdd)").filepath = default_path def register(): diff --git a/release/scripts/io/export_obj.py b/release/scripts/io/export_obj.py index 9c065c6dac9..40ef68041de 100644 --- a/release/scripts/io/export_obj.py +++ b/release/scripts/io/export_obj.py @@ -900,7 +900,7 @@ class ExportOBJ(bpy.types.Operator): # List of operator properties, the attributes will be assigned # to the class instance from the operator settings before calling. - path = StringProperty(name="File Path", description="File path used for exporting the OBJ file", maxlen= 1024, default= "") + filepath = StringProperty(name="File Path", description="Filepath used for exporting the OBJ file", maxlen= 1024, default= "") check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'}) # context group @@ -932,11 +932,11 @@ class ExportOBJ(bpy.types.Operator): def execute(self, context): - path = self.properties.path - if not path.lower().endswith(".obj"): - path += ".obj" + filepath = self.properties.filepath + if not filepath.lower().endswith(".obj"): + filepath += ".obj" - do_export(path, context, + do_export(filepath, context, EXPORT_TRI=self.properties.use_triangles, EXPORT_EDGES=self.properties.use_edges, EXPORT_NORMALS=self.properties.use_normals, @@ -965,7 +965,7 @@ class ExportOBJ(bpy.types.Operator): def menu_func(self, context): default_path = bpy.data.filepath.replace(".blend", ".obj") - self.layout.operator(ExportOBJ.bl_idname, text="Wavefront (.obj)").path = default_path + self.layout.operator(ExportOBJ.bl_idname, text="Wavefront (.obj)").filepath = default_path def register(): diff --git a/release/scripts/io/export_ply.py b/release/scripts/io/export_ply.py index d0f2fab9c3e..aee56550526 100644 --- a/release/scripts/io/export_ply.py +++ b/release/scripts/io/export_ply.py @@ -267,7 +267,7 @@ class ExportPLY(bpy.types.Operator): # to the class instance from the operator settings before calling. - path = StringProperty(name="File Path", description="File path used for exporting the PLY file", maxlen=1024, default="") + filepath = StringProperty(name="File Path", description="Filepath used for exporting the PLY file", maxlen=1024, default="") check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'}) use_modifiers = BoolProperty(name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default=True) use_normals = BoolProperty(name="Normals", description="Export Normals for smooth and hard shaded faces", default=True) @@ -280,10 +280,10 @@ class ExportPLY(bpy.types.Operator): def execute(self, context): # print("Selected: " + context.active_object.name) - if not self.properties.path: + if not self.properties.filepath: raise Exception("filename not set") - write(self.properties.path, context.scene, context.active_object,\ + write(self.properties.filepath, context.scene, context.active_object,\ EXPORT_APPLY_MODIFIERS=self.properties.use_modifiers, EXPORT_NORMALS=self.properties.use_normals, EXPORT_UV=self.properties.use_uvs, @@ -311,7 +311,7 @@ class ExportPLY(bpy.types.Operator): def menu_func(self, context): default_path = bpy.data.filepath.replace(".blend", ".ply") - self.layout.operator(ExportPLY.bl_idname, text="Stanford (.ply)").path = default_path + self.layout.operator(ExportPLY.bl_idname, text="Stanford (.ply)").filepath = default_path def register(): diff --git a/release/scripts/io/export_x3d.py b/release/scripts/io/export_x3d.py index 61f216af833..6dc2340ec93 100644 --- a/release/scripts/io/export_x3d.py +++ b/release/scripts/io/export_x3d.py @@ -1224,7 +1224,7 @@ class ExportX3D(bpy.types.Operator): # List of operator properties, the attributes will be assigned # to the class instance from the operator settings before calling. - path = StringProperty(name="File Path", description="File path used for exporting the X3D file", maxlen= 1024, default= "") + filepath = StringProperty(name="File Path", description="Filepath used for exporting the X3D file", maxlen= 1024, default= "") check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'}) apply_modifiers = BoolProperty(name="Apply Modifiers", description="Use transformed mesh data from each object", default=True) @@ -1232,7 +1232,7 @@ class ExportX3D(bpy.types.Operator): compress = BoolProperty(name="Compress", description="GZip the resulting file, requires a full python install", default=False) def execute(self, context): - x3d_export(self.properties.path, context, self.properties.apply_modifiers, self.properties.triangulate, self.properties.compress) + x3d_export(self.properties.filepath, context, self.properties.apply_modifiers, self.properties.triangulate, self.properties.compress) return {'FINISHED'} def invoke(self, context, event): @@ -1243,7 +1243,7 @@ class ExportX3D(bpy.types.Operator): def menu_func(self, context): default_path = bpy.data.filepath.replace(".blend", ".x3d") - self.layout.operator(ExportX3D.bl_idname, text="X3D Extensible 3D (.x3d)").path = default_path + self.layout.operator(ExportX3D.bl_idname, text="X3D Extensible 3D (.x3d)").filepath = default_path def register(): diff --git a/release/scripts/io/import_anim_bvh.py b/release/scripts/io/import_anim_bvh.py index 4a708d684c8..d497ac47065 100644 --- a/release/scripts/io/import_anim_bvh.py +++ b/release/scripts/io/import_anim_bvh.py @@ -561,7 +561,7 @@ class BvhImporter(bpy.types.Operator): bl_idname = "import_anim.bvh" bl_label = "Import BVH" - path = StringProperty(name="File Path", description="File path used for importing the OBJ file", maxlen=1024, default="") + filepath = StringProperty(name="File Path", description="Filepath used for importing the OBJ file", maxlen=1024, default="") scale = FloatProperty(name="Scale", description="Scale the BVH by this value", min=0.0001, max=1000000.0, soft_min=0.001, soft_max=100.0, default=0.1) frame_start = IntProperty(name="Start Frame", description="Starting frame for the animation", default=1) loop = BoolProperty(name="Loop", description="Loop the animation playback", default=False) @@ -585,7 +585,7 @@ class BvhImporter(bpy.types.Operator): t1 = time.time() print('\tparsing bvh...', end="") - bvh_nodes = read_bvh(context, self.properties.path, + bvh_nodes = read_bvh(context, self.properties.filepath, ROT_MODE=self.properties.rotate_mode, GLOBAL_SCALE=self.properties.scale) diff --git a/release/scripts/io/import_scene_3ds.py b/release/scripts/io/import_scene_3ds.py index ca7ef774a72..c579f876371 100644 --- a/release/scripts/io/import_scene_3ds.py +++ b/release/scripts/io/import_scene_3ds.py @@ -1012,7 +1012,7 @@ class IMPORT_OT_autodesk_3ds(bpy.types.Operator): # List of operator properties, the attributes will be assigned # to the class instance from the operator settings before calling. - path = StringProperty(name="File Path", description="File path used for importing the 3DS file", maxlen= 1024, default= "") + filepath = StringProperty(name="File Path", description="Filepath used for importing the 3DS file", maxlen= 1024, default= "") filename = StringProperty(name="File Name", description="Name of the file.") directory = StringProperty(name="Directory", description="Directory of the file.") @@ -1021,7 +1021,7 @@ class IMPORT_OT_autodesk_3ds(bpy.types.Operator): # apply_matrix = BoolProperty(name="Transform Fix", description="Workaround for object transformations importing incorrectly", default=False), def execute(self, context): - load_3ds(self.properties.path, context, 0.0, False, False) + load_3ds(self.properties.filepath, context, 0.0, False, False) return {'FINISHED'} def invoke(self, context, event): diff --git a/release/scripts/io/import_scene_obj.py b/release/scripts/io/import_scene_obj.py index 736c8fa91c1..942619c49ee 100644 --- a/release/scripts/io/import_scene_obj.py +++ b/release/scripts/io/import_scene_obj.py @@ -65,19 +65,6 @@ from geometry import PolyFill # try: import os # except: os= False -# Generic path functions -def stripFile(path): - '''Return directory, where the file is''' - lastSlash= max(path.rfind('\\'), path.rfind('/')) - if lastSlash != -1: - path= path[:lastSlash] - return '%s%s' % (path, os.sep) -# return '%s%s' % (path, sys.sep) - -def stripPath(path): - '''Strips the slashes from the back of a string''' - return path.split('/')[-1].split('\\')[-1] - def stripExt(name): # name is a string '''Strips the prefix off the name before writing''' index= name.rfind('.') @@ -360,7 +347,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_ Create all the used materials in this obj, assign colors and images to the materials from all referenced material libs ''' - DIR= stripFile(filepath) + DIR= os.path.dirname(filepath) #==================================================================================# # This function sets textures defined in .mtl file # @@ -431,7 +418,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_ # Add an MTL with the same name as the obj if no MTLs are spesified. - temp_mtl= stripExt(stripPath(filepath))+ '.mtl' + temp_mtl = os.path.splitext((os.path.basename(filepath)))[0] + '.mtl' if os.path.exists(DIR + temp_mtl) and temp_mtl not in material_libs: # if sys.exists(DIR + temp_mtl) and temp_mtl not in material_libs: @@ -523,7 +510,7 @@ def split_mesh(verts_loc, faces, unique_materials, filepath, SPLIT_OB_OR_GROUP, (verts_loc, faces, unique_materials, dataname) ''' - filename = stripExt(stripPath(filepath)) + filename = os.path.splitext((os.path.basename(filepath)))[0] if not SPLIT_OB_OR_GROUP and not SPLIT_MATERIALS: # use the filename for the object name since we arnt chopping up the mesh. @@ -1576,7 +1563,7 @@ class IMPORT_OT_obj(bpy.types.Operator): # to the class instance from the operator settings before calling. - path = StringProperty(name="File Path", description="File path used for importing the OBJ file", maxlen= 1024, default= "") + filepath = StringProperty(name="File Path", description="Filepath used for importing the OBJ file", maxlen= 1024, default= "") CREATE_SMOOTH_GROUPS = BoolProperty(name="Smooth Groups", description="Surround smooth groups by sharp edges", default= True) CREATE_FGONS = BoolProperty(name="NGons as FGons", description="Import faces with more then 4 verts as fgons", default= True) @@ -1596,7 +1583,7 @@ class IMPORT_OT_obj(bpy.types.Operator): def execute(self, context): # print("Selected: " + context.active_object.name) - load_obj(self.properties.path, + load_obj(self.properties.filepath, context, self.properties.CLAMP_SIZE, self.properties.CREATE_FGONS, diff --git a/release/scripts/io/import_shape_mdd.py b/release/scripts/io/import_shape_mdd.py index 8fef7672912..ec0e7696630 100644 --- a/release/scripts/io/import_shape_mdd.py +++ b/release/scripts/io/import_shape_mdd.py @@ -116,7 +116,7 @@ class importMDD(bpy.types.Operator): # List of operator properties, the attributes will be assigned # to the class instance from the operator settings before calling. - path = StringProperty(name="File Path", description="File path used for importing the MDD file", maxlen=1024) + filepath = StringProperty(name="File Path", description="Filepath used for importing the MDD file", maxlen=1024) #fps = IntProperty(name="Frames Per Second", description="Number of frames/second", min=minfps, max=maxfps, default=25) frame_start = IntProperty(name="Start Frame", description="Start frame for inserting animation", min=minframe, max=maxframe, default=0) @@ -125,10 +125,10 @@ class importMDD(bpy.types.Operator): return (ob and ob.type == 'MESH') def execute(self, context): - if not self.properties.path: + if not self.properties.filepath: raise Exception("filename not set") - mdd_import(self.properties.path, bpy.context.active_object, context.scene, self.properties.frame_start, 1) + mdd_import(self.properties.filepath, bpy.context.active_object, context.scene, self.properties.frame_start, 1) return {'FINISHED'} diff --git a/release/scripts/io/netrender/operators.py b/release/scripts/io/netrender/operators.py index 02cb864cd1a..858ec800dbc 100644 --- a/release/scripts/io/netrender/operators.py +++ b/release/scripts/io/netrender/operators.py @@ -77,7 +77,7 @@ class RENDER_OT_netslave_bake(bpy.types.Operator): bpy.ops.ptcache.bake_all() - #bpy.ops.wm.save_mainfile(path = path + os.sep + root + "_baked.blend") + #bpy.ops.wm.save_mainfile(filepath = path + os.sep + root + "_baked.blend") return {'FINISHED'} diff --git a/release/scripts/io/netrender/utils.py b/release/scripts/io/netrender/utils.py index f194cdc9559..6288b9747c0 100644 --- a/release/scripts/io/netrender/utils.py +++ b/release/scripts/io/netrender/utils.py @@ -215,7 +215,7 @@ def thumbnail(filename): scene = bpy.data.scenes[0] # FIXME, this is dodgy! scene.render.file_format = "JPEG" scene.render.file_quality = 90 - bpy.ops.image.open(path = filename) + bpy.ops.image.open(filepath=filename) img = bpy.data.images[imagename] img.save_render(thumbname, scene=scene) diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index 0ba36a7c092..2fd4568b59d 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -614,7 +614,7 @@ class Menu(StructRNA, _GenericUI): def path_menu(self, searchpaths, operator, props_default={}): layout = self.layout - # hard coded to set the operators 'path' to the filename. + # hard coded to set the operators 'filepath' to the filename. import os import bpy.utils @@ -623,12 +623,12 @@ class Menu(StructRNA, _GenericUI): # collect paths files = [] - for path in searchpaths: - files.extend([(f, os.path.join(path, f)) for f in os.listdir(path)]) + for directory in searchpaths: + files.extend([(f, os.path.join(directory, f)) for f in os.listdir(directory)]) files.sort() - for f, path in files: + for f, filepath in files: if f.startswith("."): continue @@ -639,7 +639,7 @@ class Menu(StructRNA, _GenericUI): for attr, value in props_default.items(): setattr(props, attr, value) - props.path = path + props.filepath = filepath if operator == "script.execute_preset": props.menu_idname = self.bl_idname props.preset_name = preset_name diff --git a/release/scripts/modules/graphviz_export.py b/release/scripts/modules/graphviz_export.py index 874b79d8ea2..900d69670d5 100644 --- a/release/scripts/modules/graphviz_export.py +++ b/release/scripts/modules/graphviz_export.py @@ -51,10 +51,10 @@ def compat_str(text, line_length=0): return text -def graph_armature(obj, path, FAKE_PARENT=True, CONSTRAINTS=True, DRIVERS=True, XTRA_INFO=True): +def graph_armature(obj, filepath, FAKE_PARENT=True, CONSTRAINTS=True, DRIVERS=True, XTRA_INFO=True): CONSTRAINTS = DRIVERS = True - fileobject = open(path, "w") + fileobject = open(filepath, "w") fw = fileobject.write fw(header) fw('label = "%s::%s" ;' % (bpy.data.filepath.split("/")[-1].split("\\")[-1], obj.name)) @@ -178,7 +178,7 @@ def graph_armature(obj, path, FAKE_PARENT=True, CONSTRAINTS=True, DRIVERS=True, import sys sys.stdout.flush() ''' - print("\nSaved:", path) + print("\nSaved:", filepath) return True if __name__ == "__main__": diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py index 7af57d265b9..3e8662c275f 100644 --- a/release/scripts/modules/rna_prop_ui.py +++ b/release/scripts/modules/rna_prop_ui.py @@ -61,7 +61,7 @@ def rna_idprop_ui_prop_clear(item, prop): def draw(layout, context, context_member, use_edit=True): def assign_props(prop, val, key): - prop.path = context_member + prop.data_path = context_member prop.property = key try: @@ -81,7 +81,7 @@ def draw(layout, context, context_member, use_edit=True): if use_edit: row = layout.row() props = row.operator("wm.properties_add", text="Add") - props.path = context_member + props.data_path = context_member del row for key, val in items: @@ -140,7 +140,7 @@ from bpy.props import * rna_path = StringProperty(name="Property Edit", - description="Property path edit", maxlen=1024, default="", options={'HIDDEN'}) + description="Property data_path edit", maxlen=1024, default="", options={'HIDDEN'}) rna_value = StringProperty(name="Property Value", description="Property value edit", maxlen=1024, default="") @@ -153,11 +153,11 @@ rna_max = FloatProperty(name="Max", default=1.0, precision=3) class WM_OT_properties_edit(bpy.types.Operator): - '''Internal use (edit a property path)''' + '''Internal use (edit a property data_path)''' bl_idname = "wm.properties_edit" bl_label = "Edit Property" - path = rna_path + data_path = rna_path property = rna_property value = rna_value min = rna_min @@ -165,7 +165,7 @@ class WM_OT_properties_edit(bpy.types.Operator): description = StringProperty(name="Tip", default="") def execute(self, context): - path = self.properties.path + data_path = self.properties.data_path value = self.properties.value prop = self.properties.property prop_old = self._last_prop[0] @@ -176,7 +176,7 @@ class WM_OT_properties_edit(bpy.types.Operator): value_eval = value # First remove - item = eval("context.%s" % path) + item = eval("context.%s" % data_path) rna_idprop_ui_prop_clear(item, prop_old) exec_str = "del item['%s']" % prop_old @@ -207,7 +207,7 @@ class WM_OT_properties_edit(bpy.types.Operator): self._last_prop = [self.properties.property] - item = eval("context.%s" % self.properties.path) + item = eval("context.%s" % self.properties.data_path) # setup defaults prop_ui = rna_idprop_ui_prop_get(item, self.properties.property, False) # dont create @@ -225,14 +225,14 @@ class WM_OT_properties_edit(bpy.types.Operator): class WM_OT_properties_add(bpy.types.Operator): - '''Internal use (edit a property path)''' + '''Internal use (edit a property data_path)''' bl_idname = "wm.properties_add" bl_label = "Add Property" - path = rna_path + data_path = rna_path def execute(self, context): - item = eval("context.%s" % self.properties.path) + item = eval("context.%s" % self.properties.data_path) def unique_name(names): prop = 'prop' @@ -251,14 +251,14 @@ class WM_OT_properties_add(bpy.types.Operator): class WM_OT_properties_remove(bpy.types.Operator): - '''Internal use (edit a property path)''' + '''Internal use (edit a property data_path)''' bl_idname = "wm.properties_remove" bl_label = "Remove Property" - path = rna_path + data_path = rna_path property = rna_property def execute(self, context): - item = eval("context.%s" % self.properties.path) + item = eval("context.%s" % self.properties.data_path) del item[self.properties.property] return {'FINISHED'} diff --git a/release/scripts/op/image.py b/release/scripts/op/image.py index 873500d8343..be583012d7a 100644 --- a/release/scripts/op/image.py +++ b/release/scripts/op/image.py @@ -28,7 +28,7 @@ class EditExternally(bpy.types.Operator): bl_label = "Image Edit Externally" bl_options = {'REGISTER'} - path = StringProperty(name="File Path", description="Path to an image file", maxlen=1024, default="") + filepath = StringProperty(name="File Path", description="Path to an image file", maxlen=1024, default="") def _editor_guess(self, context): import platform @@ -57,12 +57,12 @@ class EditExternally(bpy.types.Operator): def execute(self, context): import subprocess - path = self.properties.path + filepath = self.properties.filepath image_editor = self._editor_guess(context) cmd = [] cmd.extend(image_editor) - cmd.append(bpy.utils.expandpath(path)) + cmd.append(bpy.utils.expandpath(filepath)) subprocess.Popen(cmd) @@ -70,12 +70,12 @@ class EditExternally(bpy.types.Operator): def invoke(self, context, event): try: - path = context.space_data.image.filepath + filepath = context.space_data.image.filepath except: self.report({'ERROR'}, "Image not found on disk") return {'CANCELLED'} - self.properties.path = path + self.properties.filepath = filepath self.execute(context) return {'FINISHED'} @@ -91,13 +91,13 @@ class SaveDirty(bpy.types.Operator): unique_paths = set() for image in bpy.data.images: if image.dirty: - path = bpy.utils.expandpath(image.filepath) - if "\\" not in path and "/" not in path: - self.report({'WARNING'}, "Invalid path: " + path) - elif path in unique_paths: - self.report({'WARNING'}, "Path used by more then one image: " + path) + filepath = bpy.utils.expandpath(image.filepath) + if "\\" not in filepath and "/" not in filepath: + self.report({'WARNING'}, "Invalid path: " + filepath) + elif filepath in unique_paths: + self.report({'WARNING'}, "Path used by more then one image: " + filepath) else: - unique_paths.add(path) + unique_paths.add(filepath) image.save() return {'FINISHED'} @@ -161,7 +161,7 @@ class ProjectEdit(bpy.types.Operator): image_new.file_format = 'PNG' image_new.save() - bpy.ops.image.external_edit(path=filepath_final) + bpy.ops.image.external_edit(filepath=filepath_final) return {'FINISHED'} diff --git a/release/scripts/op/presets.py b/release/scripts/op/presets.py index 03d70afc43b..a813cb5339d 100644 --- a/release/scripts/op/presets.py +++ b/release/scripts/op/presets.py @@ -46,13 +46,13 @@ class AddPresetBase(bpy.types.Operator): target_path = bpy.utils.preset_paths(self.preset_subdir)[0] # we need some way to tell the user and system preset path - path = os.path.join(target_path, filename) + filepath = os.path.join(target_path, filename) if getattr(self, "save_keyconfig", True): - bpy.ops.wm.keyconfig_export(path=path, kc_name=self.properties.name) - file_preset = open(path, 'a') + 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") else: - file_preset = open(path, 'w') + file_preset = open(filepath, 'w') for rna_path in self.preset_values: value = eval(rna_path) @@ -79,7 +79,7 @@ class ExecutePreset(bpy.types.Operator): bl_idname = "script.execute_preset" bl_label = "Execute a Python Preset" - path = bpy.props.StringProperty(name="Path", description="Path of the Python file to execute", maxlen=512, default="") + filepath = bpy.props.StringProperty(name="Path", description="Path of the Python file to execute", maxlen=512, default="") preset_name = bpy.props.StringProperty(name="Preset Name", description="Name of the Preset being executed", default="") menu_idname = bpy.props.StringProperty(name="Menu ID Name", description="ID name of the menu this was called from", default="") @@ -89,7 +89,7 @@ class ExecutePreset(bpy.types.Operator): preset_class.bl_label = self.properties.preset_name # execute the preset using script.python_file_run - bpy.ops.script.python_file_run(path=self.properties.path) + bpy.ops.script.python_file_run(filepath=self.properties.filepath) return {'FINISHED'} diff --git a/release/scripts/op/uv.py b/release/scripts/op/uv.py index cd0b7086a70..b9bc54bf264 100644 --- a/release/scripts/op/uv.py +++ b/release/scripts/op/uv.py @@ -29,7 +29,7 @@ class ExportUVLayout(bpy.types.Operator): bl_label = "Export UV Layout" bl_options = {'REGISTER', 'UNDO'} - path = StringProperty(name="File Path", description="File path used for exporting the SVG file", maxlen=1024, default="") + filepath = StringProperty(name="File Path", description="File path used for exporting the SVG file", maxlen=1024, default="") check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'}) export_all = BoolProperty(name="All UV's", description="Export all UVs in this mesh (not just the visible ones)", default=False) mode = EnumProperty(items=( @@ -113,7 +113,7 @@ class ExportUVLayout(bpy.types.Operator): mode = self.properties.mode - file = open(self.properties.path, "w") + file = open(self.properties.filepath, "w") fw = file.write if mode == 'SVG': @@ -211,7 +211,7 @@ class ExportUVLayout(bpy.types.Operator): def menu_func(self, context): default_path = bpy.data.filepath.replace(".blend", ".svg") - self.layout.operator(ExportUVLayout.bl_idname).path = default_path + self.layout.operator(ExportUVLayout.bl_idname).filepath = default_path def register(): diff --git a/release/scripts/op/wm.py b/release/scripts/op/wm.py index 4a587f41aa7..5ef79887228 100644 --- a/release/scripts/op/wm.py +++ b/release/scripts/op/wm.py @@ -46,10 +46,10 @@ rna_relative_prop = BoolProperty(name="Relative", default=False) -def context_path_validate(context, path): +def context_path_validate(context, data_path): import sys try: - value = eval("context.%s" % path) + value = eval("context.%s" % data_path) except AttributeError: if "'NoneType'" in str(sys.exc_info()[1]): # One of the items in the rna path is None, just ignore this @@ -62,13 +62,13 @@ def context_path_validate(context, path): def execute_context_assign(self, context): - if context_path_validate(context, self.properties.path) is Ellipsis: + if context_path_validate(context, self.properties.data_path) is Ellipsis: return {'PASS_THROUGH'} if getattr(self.properties, "relative", False): - exec("context.%s+=self.properties.value" % self.properties.path) + exec("context.%s+=self.properties.value" % self.properties.data_path) else: - exec("context.%s=self.properties.value" % self.properties.path) + exec("context.%s=self.properties.value" % self.properties.data_path) return {'FINISHED'} @@ -79,7 +79,7 @@ class WM_OT_context_set_boolean(bpy.types.Operator): bl_label = "Context Set Boolean" bl_options = {'UNDO'} - path = rna_path_prop + data_path = rna_path_prop value = BoolProperty(name="Value", description="Assignment value", default=True) @@ -92,7 +92,7 @@ class WM_OT_context_set_int(bpy.types.Operator): # same as enum bl_label = "Context Set" bl_options = {'UNDO'} - path = rna_path_prop + data_path = rna_path_prop value = IntProperty(name="Value", description="Assign value", default=0) relative = rna_relative_prop @@ -105,18 +105,18 @@ class WM_OT_context_scale_int(bpy.types.Operator): # same as enum bl_label = "Context Set" bl_options = {'UNDO'} - path = rna_path_prop + data_path = rna_path_prop value = FloatProperty(name="Value", description="Assign value", default=1.0) always_step = BoolProperty(name="Always Step", description="Always adjust the value by a minimum of 1 when 'value' is not 1.0.", default=True) def execute(self, context): - if context_path_validate(context, self.properties.path) is Ellipsis: + if context_path_validate(context, self.properties.data_path) is Ellipsis: return {'PASS_THROUGH'} value = self.properties.value - path = self.properties.path + data_path = self.properties.data_path if value == 1.0: # nothing to do return {'CANCELLED'} @@ -128,9 +128,9 @@ class WM_OT_context_scale_int(bpy.types.Operator): # same as enum else: add = "-1" func = "min" - exec("context.%s = %s(round(context.%s * value), context.%s + %s)" % (path, func, path, path, add)) + exec("context.%s = %s(round(context.%s * value), context.%s + %s)" % (data_path, func, data_path, data_path, add)) else: - exec("context.%s *= value" % self.properties.path) + exec("context.%s *= value" % self.properties.data_path) return {'FINISHED'} @@ -141,7 +141,7 @@ class WM_OT_context_set_float(bpy.types.Operator): # same as enum bl_label = "Context Set Float" bl_options = {'UNDO'} - path = rna_path_prop + data_path = rna_path_prop value = FloatProperty(name="Value", description="Assignment value", default=0.0) relative = rna_relative_prop @@ -155,7 +155,7 @@ class WM_OT_context_set_string(bpy.types.Operator): # same as enum bl_label = "Context Set String" bl_options = {'UNDO'} - path = rna_path_prop + data_path = rna_path_prop value = StringProperty(name="Value", description="Assign value", maxlen=1024, default="") @@ -168,7 +168,7 @@ class WM_OT_context_set_enum(bpy.types.Operator): bl_label = "Context Set Enum" bl_options = {'UNDO'} - path = rna_path_prop + data_path = rna_path_prop value = StringProperty(name="Value", description="Assignment value (as a string)", maxlen=1024, default="") @@ -182,15 +182,15 @@ class WM_OT_context_set_value(bpy.types.Operator): bl_label = "Context Set Value" bl_options = {'UNDO'} - path = rna_path_prop + data_path = rna_path_prop value = StringProperty(name="Value", description="Assignment value (as a string)", maxlen=1024, default="") def execute(self, context): - if context_path_validate(context, self.properties.path) is Ellipsis: + if context_path_validate(context, self.properties.data_path) is Ellipsis: return {'PASS_THROUGH'} - exec("context.%s=%s" % (self.properties.path, self.properties.value)) + exec("context.%s=%s" % (self.properties.data_path, self.properties.value)) return {'FINISHED'} @@ -200,15 +200,15 @@ class WM_OT_context_toggle(bpy.types.Operator): bl_label = "Context Toggle" bl_options = {'UNDO'} - path = rna_path_prop + data_path = rna_path_prop def execute(self, context): - if context_path_validate(context, self.properties.path) is Ellipsis: + if context_path_validate(context, self.properties.data_path) is Ellipsis: return {'PASS_THROUGH'} exec("context.%s=not (context.%s)" % - (self.properties.path, self.properties.path)) + (self.properties.data_path, self.properties.data_path)) return {'FINISHED'} @@ -219,7 +219,7 @@ class WM_OT_context_toggle_enum(bpy.types.Operator): bl_label = "Context Toggle Values" bl_options = {'UNDO'} - path = rna_path_prop + data_path = rna_path_prop value_1 = StringProperty(name="Value", \ description="Toggle enum", maxlen=1024, default="") @@ -228,12 +228,12 @@ class WM_OT_context_toggle_enum(bpy.types.Operator): def execute(self, context): - if context_path_validate(context, self.properties.path) is Ellipsis: + if context_path_validate(context, self.properties.data_path) is Ellipsis: return {'PASS_THROUGH'} exec("context.%s = ['%s', '%s'][context.%s!='%s']" % \ - (self.properties.path, self.properties.value_1,\ - self.properties.value_2, self.properties.path, + (self.properties.data_path, self.properties.value_1,\ + self.properties.value_2, self.properties.data_path, self.properties.value_2)) return {'FINISHED'} @@ -246,12 +246,12 @@ class WM_OT_context_cycle_int(bpy.types.Operator): bl_label = "Context Int Cycle" bl_options = {'UNDO'} - path = rna_path_prop + data_path = rna_path_prop reverse = rna_reverse_prop def execute(self, context): - path = self.properties.path - value = context_path_validate(context, path) + data_path = self.properties.data_path + value = context_path_validate(context, data_path) if value is Ellipsis: return {'PASS_THROUGH'} @@ -260,16 +260,16 @@ class WM_OT_context_cycle_int(bpy.types.Operator): else: value += 1 - exec("context.%s=value" % path) + exec("context.%s=value" % data_path) - if value != eval("context.%s" % path): + if value != eval("context.%s" % data_path): # relies on rna clamping int's out of the range if self.properties.reverse: value = (1 << 32) else: value = - (1 << 32) - exec("context.%s=value" % path) + exec("context.%s=value" % data_path) return {'FINISHED'} @@ -280,19 +280,19 @@ class WM_OT_context_cycle_enum(bpy.types.Operator): bl_label = "Context Enum Cycle" bl_options = {'UNDO'} - path = rna_path_prop + data_path = rna_path_prop reverse = rna_reverse_prop def execute(self, context): - value = context_path_validate(context, self.properties.path) + value = context_path_validate(context, self.properties.data_path) if value is Ellipsis: return {'PASS_THROUGH'} orig_value = value # Have to get rna enum values - rna_struct_str, rna_prop_str = self.properties.path.rsplit('.', 1) + rna_struct_str, rna_prop_str = self.properties.data_path.rsplit('.', 1) i = rna_prop_str.find('[') # just incse we get "context.foo.bar[0]" @@ -322,7 +322,7 @@ class WM_OT_context_cycle_enum(bpy.types.Operator): advance_enum = enums[orig_index + 1] # set the new value - exec("context.%s=advance_enum" % self.properties.path) + exec("context.%s=advance_enum" % self.properties.data_path) return {'FINISHED'} doc_id = StringProperty(name="Doc ID", @@ -337,27 +337,27 @@ class WM_OT_context_modal_mouse(bpy.types.Operator): bl_idname = "wm.context_modal_mouse" bl_label = "Context Modal Mouse" - path_iter = StringProperty(description="The path relative to the context, must point to an iterable.") - path_item = StringProperty(description="The path from each iterable to the value (int or float)") + data_path_iter = StringProperty(description="The data path relative to the context, must point to an iterable.") + data_path_item = StringProperty(description="The data path from each iterable to the value (int or float)") input_scale = FloatProperty(default=0.01, description="Scale the mouse movement by this value before applying the delta") invert = BoolProperty(default=False, description="Invert the mouse input") initial_x = IntProperty(options={'HIDDEN'}) def _values_store(self, context): - path_iter = self.properties.path_iter - path_item = self.properties.path_item + data_path_iter = self.properties.data_path_iter + data_path_item = self.properties.data_path_item self._values = values = {} - for item in getattr(context, path_iter): + for item in getattr(context, data_path_iter): try: - value_orig = eval("item." + path_item) + value_orig = eval("item." + data_path_item) except: continue # check this can be set, maybe this is library data. try: - exec("item.%s = %s" % (path_item, value_orig)) + exec("item.%s = %s" % (data_path_item, value_orig)) except: continue @@ -368,17 +368,17 @@ class WM_OT_context_modal_mouse(bpy.types.Operator): if self.properties.invert: delta = - delta - path_item = self.properties.path_item + data_path_item = self.properties.data_path_item for item, value_orig in self._values.items(): if type(value_orig) == int: - exec("item.%s = int(%d)" % (path_item, round(value_orig + delta))) + exec("item.%s = int(%d)" % (data_path_item, round(value_orig + delta))) else: - exec("item.%s = %f" % (path_item, value_orig + delta)) + exec("item.%s = %f" % (data_path_item, value_orig + delta)) def _values_restore(self): - path_item = self.properties.path_item + data_path_item = self.properties.data_path_item for item, value_orig in self._values.items(): - exec("item.%s = %s" % (path_item, value_orig)) + exec("item.%s = %s" % (data_path_item, value_orig)) self._values.clear() @@ -407,7 +407,7 @@ class WM_OT_context_modal_mouse(bpy.types.Operator): if not self._values: self.report({'WARNING'}, "Nothing to operate on: %s[ ].%s" % - (self.properties.path_iter, self.properties.path_item)) + (self.properties.data_path_iter, self.properties.data_path_item)) return {'CANCELLED'} else: diff --git a/release/scripts/templates/operator.py b/release/scripts/templates/operator.py index 23d75607ba3..de181a13c25 100644 --- a/release/scripts/templates/operator.py +++ b/release/scripts/templates/operator.py @@ -1,7 +1,7 @@ import bpy -def write_some_data(context, path, use_some_setting): +def write_some_data(context, filepath, use_some_setting): print("running write_some_data...") pass @@ -16,7 +16,7 @@ class ExportSomeData(bpy.types.Operator): # to the class instance from the operator settings before calling. # TODO, add better example props - path = StringProperty(name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= "") + filepath = StringProperty(name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= "") use_setting = BoolProperty(name="Example Boolean", description="Example Tooltip", default= True) type = bpy.props.EnumProperty(items=(('OPT_A', "First Option", "Description one"), ('OPT_B', "Second Option", "Description two.")), @@ -30,10 +30,10 @@ class ExportSomeData(bpy.types.Operator): def execute(self, context): # # Bug, currently isnt working - #if not self.is_property_set("path"): + #if not self.is_property_set("filepath"): # raise Exception("filename not set") - write_some_data(self.properties.path, context, self.properties.use_setting) + write_some_data(self.properties.filepath, context, self.properties.use_setting) return {'FINISHED'} @@ -63,4 +63,4 @@ menu_func = lambda self, context: self.layout.operator("export.some_data", text= bpy.types.INFO_MT_file_export.append(menu_func) if __name__ == "__main__": - bpy.ops.export.some_data('INVOKE_DEFAULT', path="/tmp/test.ply") + bpy.ops.export.some_data('INVOKE_DEFAULT', filepath="/tmp/test.ply") diff --git a/release/scripts/ui/properties_data_armature_rigify.py b/release/scripts/ui/properties_data_armature_rigify.py index 0eba1fb045b..43021858f9f 100644 --- a/release/scripts/ui/properties_data_armature_rigify.py +++ b/release/scripts/ui/properties_data_armature_rigify.py @@ -232,14 +232,14 @@ class AsScript(bpy.types.Operator): bl_label = "Write Metarig to Script" bl_options = {'REGISTER', 'UNDO'} - path = StringProperty(name="File Path", description="File path used for exporting the Armature file", maxlen=1024, default="") + filepath = StringProperty(name="File Path", description="File path used for exporting the Armature file", maxlen=1024, default="") def execute(self, context): import rigify_utils reload(rigify_utils) obj = context.object code = rigify_utils.write_meta_rig(obj) - path = self.properties.path + path = self.properties.filepath file = open(path, "w") file.write(code) file.close() @@ -249,7 +249,7 @@ class AsScript(bpy.types.Operator): def invoke(self, context, event): import os obj = context.object - self.properties.path = os.path.splitext(bpy.data.filepath)[0] + "-" + bpy.utils.clean_name(obj.name) + ".py" + self.properties.filepath = os.path.splitext(bpy.data.filepath)[0] + "-" + bpy.utils.clean_name(obj.name) + ".py" wm = context.manager wm.add_fileselect(self) return {'RUNNING_MODAL'} diff --git a/release/scripts/ui/properties_data_modifier.py b/release/scripts/ui/properties_data_modifier.py index c93b4289116..37764e20854 100644 --- a/release/scripts/ui/properties_data_modifier.py +++ b/release/scripts/ui/properties_data_modifier.py @@ -480,10 +480,10 @@ class DATA_PT_modifiers(DataButtonsPanel): layout.separator() - layout.prop(md, "path", text="Create Along Paths") + layout.prop(md, "use_path", text="Create Along Paths") split = layout.split() - split.active = md.path + split.active = md.use_path col = split.column() col.row().prop(md, "axis", expand=True) col.prop(md, "keep_shape") diff --git a/release/scripts/ui/properties_object.py b/release/scripts/ui/properties_object.py index f1b3e63f7ab..a2637f7924b 100644 --- a/release/scripts/ui/properties_object.py +++ b/release/scripts/ui/properties_object.py @@ -182,7 +182,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel): col.prop(group, "dupli_offset", text="") prop = col.operator("wm.context_set_value", text="From Cursor") - prop.path = "object.users_group[%d].dupli_offset" % index + prop.data_path = "object.users_group[%d].dupli_offset" % index prop.value = value index += 1 diff --git a/release/scripts/ui/properties_scene.py b/release/scripts/ui/properties_scene.py index 5e83fad38a0..4319711d05e 100644 --- a/release/scripts/ui/properties_scene.py +++ b/release/scripts/ui/properties_scene.py @@ -105,7 +105,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel): subcol = col.column() subcol.operator_context = 'INVOKE_DEFAULT' op = subcol.operator("anim.keying_set_export", text="Export to File") - op.path = "keyingset.py" + op.filepath = "keyingset.py" if wide_ui: col = row.column() @@ -229,7 +229,7 @@ class ANIM_OT_keying_set_export(bpy.types.Operator): bl_idname = "anim.keying_set_export" bl_label = "Export Keying Set..." - path = bpy.props.StringProperty(name="File Path", description="File path to write file to.") + filepath = bpy.props.StringProperty(name="File Path", description="Filepath to write file to.") filename = bpy.props.StringProperty(name="File Name", description="Name of the file.") directory = bpy.props.StringProperty(name="Directory", description="Directory of the file.") filter_folder = bpy.props.BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'}) @@ -237,10 +237,10 @@ class ANIM_OT_keying_set_export(bpy.types.Operator): filter_python = bpy.props.BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'}) def execute(self, context): - if not self.properties.path: - raise Exception("File path not set.") + if not self.properties.filepath: + raise Exception("Filepath not set.") - f = open(self.properties.path, "w") + f = open(self.properties.filepath, "w") if not f: raise Exception("Could not open file.") @@ -301,7 +301,7 @@ class ANIM_OT_keying_set_export(bpy.types.Operator): for ksp in ks.paths: f.write("ksp = ks.paths.add(") - # id-block + RNA-path + # id-block + data_path if ksp.id: # find the relevant shorthand from the cache id_bpy_path = id_to_paths_cache[ksp.id][0] diff --git a/release/scripts/ui/space_info.py b/release/scripts/ui/space_info.py index 702dc97f3fc..5ed6043cbe7 100644 --- a/release/scripts/ui/space_info.py +++ b/release/scripts/ui/space_info.py @@ -133,13 +133,13 @@ class INFO_MT_file_open_recent(bpy.types.Menu): layout = self.layout layout.operator_context = 'EXEC_AREA' - path = os.path.join(bpy.app.home, ".Blog") + filepath = os.path.join(bpy.app.home, ".Blog") - if os.path.isfile(path): - file = open(path, "rU") + if os.path.isfile(filepath): + file = open(filepath, "rU") for line in file: line = line.rstrip() - layout.operator("wm.open_mainfile", text=line, icon='FILE_BLEND').path = line + layout.operator("wm.open_mainfile", text=line, icon='FILE_BLEND').filepath = line file.close() else: layout.label(text='No recent files') diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index a55d60eb55c..066c0f2f60a 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -83,12 +83,12 @@ class USERPREF_HT_header(bpy.types.Header): if userpref.active_section == 'INPUT': op = layout.operator("wm.keyconfig_export") - op.path = "keymap.py" + op.filepath = "keymap.py" op = layout.operator("wm.keyconfig_import") - op.path = "keymap.py" + op.filepath = "keymap.py" elif userpref.active_section == 'ADDONS': op = layout.operator("wm.addon_install") - op.path = "*.py" + op.filepath = "*.py" elif userpref.active_section == 'THEMES': op = layout.operator("ui.reset_default_theme") @@ -1343,7 +1343,7 @@ class WM_OT_addon_install(bpy.types.Operator): module = StringProperty(name="Module", description="Module name of the addon to disable") - path = StringProperty(name="File Path", description="File path to write file to") + filepath = StringProperty(name="File Path", description="File path to write file to") filename = StringProperty(name="File Name", description="Name of the file") directory = StringProperty(name="Directory", description="Directory of the file") filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'}) @@ -1352,7 +1352,7 @@ class WM_OT_addon_install(bpy.types.Operator): def execute(self, context): import traceback import zipfile - pyfile = self.properties.path + pyfile = self.properties.filepath path_addons = bpy.utils.script_paths("addons")[-1] diff --git a/release/scripts/ui/space_userpref_keymap.py b/release/scripts/ui/space_userpref_keymap.py index 961b138ab7e..37007c65f7a 100644 --- a/release/scripts/ui/space_userpref_keymap.py +++ b/release/scripts/ui/space_userpref_keymap.py @@ -508,7 +508,7 @@ class WM_OT_keyconfig_import(bpy.types.Operator): bl_idname = "wm.keyconfig_import" bl_label = "Import Key Configuration..." - path = StringProperty(name="File Path", description="File path to write file to") + filepath = StringProperty(name="File Path", description="Filepath to write file to") filename = StringProperty(name="File Name", description="Name of the file") directory = StringProperty(name="Directory", description="Directory of the file") filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'}) @@ -518,10 +518,10 @@ class WM_OT_keyconfig_import(bpy.types.Operator): keep_original = BoolProperty(name="Keep original", description="Keep original file after copying to configuration folder", default=True) def execute(self, context): - if not self.properties.path: - raise Exception("File path not set") + if not self.properties.filepath: + raise Exception("Filepath not set") - f = open(self.properties.path, "r") + f = open(self.properties.filepath, "r") if not f: raise Exception("Could not open file") @@ -545,9 +545,9 @@ class WM_OT_keyconfig_import(bpy.types.Operator): path = os.path.join(path, config_name + ".py") if self.properties.keep_original: - shutil.copy(self.properties.path, path) + shutil.copy(self.properties.filepath, path) else: - shutil.move(self.properties.path, path) + shutil.move(self.properties.filepath, path) exec("import " + config_name) @@ -569,7 +569,7 @@ class WM_OT_keyconfig_export(bpy.types.Operator): bl_idname = "wm.keyconfig_export" bl_label = "Export Key Configuration..." - path = StringProperty(name="File Path", description="File path to write file to") + filepath = StringProperty(name="File Path", description="Filepath to write file to") filename = StringProperty(name="File Name", description="Name of the file") directory = StringProperty(name="Directory", description="Directory of the file") filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'}) @@ -578,10 +578,10 @@ class WM_OT_keyconfig_export(bpy.types.Operator): kc_name = StringProperty(name="KeyConfig Name", description="Name to save the key config as") def execute(self, context): - if not self.properties.path: - raise Exception("File path not set") + if not self.properties.filepath: + raise Exception("Filepath not set") - f = open(self.properties.path, "w") + f = open(self.properties.filepath, "w") if not f: raise Exception("Could not open file") @@ -591,7 +591,7 @@ class WM_OT_keyconfig_export(bpy.types.Operator): if self.properties.kc_name != '': name = self.properties.kc_name elif kc.name == 'Blender': - name = os.path.splitext(os.path.basename(self.properties.path))[0] + name = os.path.splitext(os.path.basename(self.properties.filepath))[0] else: name = kc.name diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py index 8404ee83f16..14312d3c1ad 100644 --- a/release/scripts/ui/space_view3d.py +++ b/release/scripts/ui/space_view3d.py @@ -721,23 +721,23 @@ class VIEW3D_MT_object_specials(bpy.types.Menu): layout.operator_context = 'INVOKE_REGION_WIN' props = layout.operator("wm.context_modal_mouse", text="Spot Size") - props.path_iter = "selected_editable_objects" - props.path_item = "data.spot_size" + props.data_path_iter = "selected_editable_objects" + props.data_path_item = "data.spot_size" props.input_scale = 0.01 props = layout.operator("wm.context_modal_mouse", text="Distance") - props.path_iter = "selected_editable_objects" - props.path_item = "data.distance" + props.data_path_iter = "selected_editable_objects" + props.data_path_item = "data.distance" props.input_scale = 0.1 props = layout.operator("wm.context_modal_mouse", text="Clip Start") - props.path_iter = "selected_editable_objects" - props.path_item = "data.shadow_buffer_clip_start" + props.data_path_iter = "selected_editable_objects" + props.data_path_item = "data.shadow_buffer_clip_start" props.input_scale = 0.05 props = layout.operator("wm.context_modal_mouse", text="Clip End") - props.path_iter = "selected_editable_objects" - props.path_item = "data.shadow_buffer_clip_end" + props.data_path_iter = "selected_editable_objects" + props.data_path_item = "data.shadow_buffer_clip_end" props.input_scale = 0.05 layout.separator() @@ -1277,15 +1277,15 @@ class VIEW3D_MT_edit_mesh_selection_mode(bpy.types.Menu): prop = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL') prop.value = "(True, False, False)" - prop.path = "tool_settings.mesh_selection_mode" + prop.data_path = "tool_settings.mesh_selection_mode" prop = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL') prop.value = "(False, True, False)" - prop.path = "tool_settings.mesh_selection_mode" + prop.data_path = "tool_settings.mesh_selection_mode" prop = layout.operator("wm.context_set_value", text="Face", icon='FACESEL') prop.value = "(False, False, True)" - prop.path = "tool_settings.mesh_selection_mode" + prop.data_path = "tool_settings.mesh_selection_mode" class VIEW3D_MT_edit_mesh_extrude(bpy.types.Menu): diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py index 11a7fae894b..6984bbeea41 100644 --- a/release/scripts/ui/space_view3d_toolbar.py +++ b/release/scripts/ui/space_view3d_toolbar.py @@ -948,7 +948,7 @@ class VIEW3D_MT_tools_projectpaint_clone(bpy.types.Menu): layout = self.layout for i, tex in enumerate(context.active_object.data.uv_textures): prop = layout.operator("wm.context_set_int", text=tex.name) - prop.path = "active_object.data.uv_texture_clone_index" + prop.data_path = "active_object.data.uv_texture_clone_index" prop.value = i @@ -959,7 +959,7 @@ class VIEW3D_MT_tools_projectpaint_stencil(bpy.types.Menu): layout = self.layout for i, tex in enumerate(context.active_object.data.uv_textures): prop = layout.operator("wm.context_set_int", text=tex.name) - prop.path = "active_object.data.uv_texture_stencil_index" + prop.data_path = "active_object.data.uv_texture_stencil_index" prop.value = i |