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)
This commit is contained in:
2010-06-14 03:52:10 +00:00
parent aa97b4362b
commit c2f36a4d6a
69 changed files with 340 additions and 353 deletions

View File

@@ -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= ""), # 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'}) check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'})
def execute(self, context): def execute(self, context):
save_3ds(self.properties.path, context) save_3ds(self.properties.filepath, context)
return {'FINISHED'} return {'FINISHED'}
def invoke(self, context, event): def invoke(self, context, event):
@@ -1142,7 +1142,7 @@ class Export3DS(bpy.types.Operator):
# Add to a menu # Add to a menu
def menu_func(self, context): def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".3ds") 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(): def register():

View File

@@ -3335,7 +3335,7 @@ class ExportFBX(bpy.types.Operator):
# to the class instance from the operator settings before calling. # 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'}) 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) 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 return context.active_object
def execute(self, context): def execute(self, context):
if not self.properties.path: if not self.properties.filepath:
raise Exception("path not set") raise Exception("filepath not set")
GLOBAL_MATRIX = mtx4_identity GLOBAL_MATRIX = mtx4_identity
GLOBAL_MATRIX[0][0] = GLOBAL_MATRIX[1][1] = GLOBAL_MATRIX[2][2] = self.properties.TX_SCALE 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_YROT90: GLOBAL_MATRIX = mtx4_y90n * GLOBAL_MATRIX
if self.properties.TX_ZROT90: GLOBAL_MATRIX = mtx4_z90n * GLOBAL_MATRIX if self.properties.TX_ZROT90: GLOBAL_MATRIX = mtx4_z90n * GLOBAL_MATRIX
write(self.properties.path, write(self.properties.filepath,
None, # XXX None, # XXX
context, context,
self.properties.EXP_OBS_SELECTED, self.properties.EXP_OBS_SELECTED,
@@ -3411,7 +3411,7 @@ class ExportFBX(bpy.types.Operator):
# if __name__ == "__main__": # 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) # 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): def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".fbx") 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(): def register():

View File

@@ -159,7 +159,7 @@ class ExportMDD(bpy.types.Operator):
# List of operator properties, the attributes will be assigned # List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling. # 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'}) 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) 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) 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') return (ob and ob.type == 'MESH')
def execute(self, context): def execute(self, context):
if not self.properties.path: if not self.properties.filepath:
raise Exception("filename not set") 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) self.properties.frame_start, self.properties.frame_end, self.properties.fps)
return {'FINISHED'} return {'FINISHED'}
@@ -184,7 +184,7 @@ class ExportMDD(bpy.types.Operator):
def menu_func(self, context): def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".mdd") 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(): def register():

View File

@@ -900,7 +900,7 @@ class ExportOBJ(bpy.types.Operator):
# List of operator properties, the attributes will be assigned # List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling. # 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'}) check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'})
# context group # context group
@@ -932,11 +932,11 @@ class ExportOBJ(bpy.types.Operator):
def execute(self, context): def execute(self, context):
path = self.properties.path filepath = self.properties.filepath
if not path.lower().endswith(".obj"): if not filepath.lower().endswith(".obj"):
path += ".obj" filepath += ".obj"
do_export(path, context, do_export(filepath, context,
EXPORT_TRI=self.properties.use_triangles, EXPORT_TRI=self.properties.use_triangles,
EXPORT_EDGES=self.properties.use_edges, EXPORT_EDGES=self.properties.use_edges,
EXPORT_NORMALS=self.properties.use_normals, EXPORT_NORMALS=self.properties.use_normals,
@@ -965,7 +965,7 @@ class ExportOBJ(bpy.types.Operator):
def menu_func(self, context): def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".obj") 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(): def register():

View File

@@ -267,7 +267,7 @@ class ExportPLY(bpy.types.Operator):
# to the class instance from the operator settings before calling. # 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'}) 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_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) 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): def execute(self, context):
# print("Selected: " + context.active_object.name) # print("Selected: " + context.active_object.name)
if not self.properties.path: if not self.properties.filepath:
raise Exception("filename not set") 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_APPLY_MODIFIERS=self.properties.use_modifiers,
EXPORT_NORMALS=self.properties.use_normals, EXPORT_NORMALS=self.properties.use_normals,
EXPORT_UV=self.properties.use_uvs, EXPORT_UV=self.properties.use_uvs,
@@ -311,7 +311,7 @@ class ExportPLY(bpy.types.Operator):
def menu_func(self, context): def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".ply") 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(): def register():

View File

@@ -1224,7 +1224,7 @@ class ExportX3D(bpy.types.Operator):
# List of operator properties, the attributes will be assigned # List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling. # 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'}) 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) 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) compress = BoolProperty(name="Compress", description="GZip the resulting file, requires a full python install", default=False)
def execute(self, context): 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'} return {'FINISHED'}
def invoke(self, context, event): def invoke(self, context, event):
@@ -1243,7 +1243,7 @@ class ExportX3D(bpy.types.Operator):
def menu_func(self, context): def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".x3d") 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(): def register():

View File

@@ -561,7 +561,7 @@ class BvhImporter(bpy.types.Operator):
bl_idname = "import_anim.bvh" bl_idname = "import_anim.bvh"
bl_label = "Import 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) 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) 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) loop = BoolProperty(name="Loop", description="Loop the animation playback", default=False)
@@ -585,7 +585,7 @@ class BvhImporter(bpy.types.Operator):
t1 = time.time() t1 = time.time()
print('\tparsing bvh...', end="") 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, ROT_MODE=self.properties.rotate_mode,
GLOBAL_SCALE=self.properties.scale) GLOBAL_SCALE=self.properties.scale)

View File

@@ -1012,7 +1012,7 @@ class IMPORT_OT_autodesk_3ds(bpy.types.Operator):
# List of operator properties, the attributes will be assigned # List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling. # 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.") filename = StringProperty(name="File Name", description="Name of the file.")
directory = StringProperty(name="Directory", description="Directory 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), # apply_matrix = BoolProperty(name="Transform Fix", description="Workaround for object transformations importing incorrectly", default=False),
def execute(self, context): 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'} return {'FINISHED'}
def invoke(self, context, event): def invoke(self, context, event):

View File

@@ -65,19 +65,6 @@ from geometry import PolyFill
# try: import os # try: import os
# except: os= False # 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 def stripExt(name): # name is a string
'''Strips the prefix off the name before writing''' '''Strips the prefix off the name before writing'''
index= name.rfind('.') 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, Create all the used materials in this obj,
assign colors and images to the materials from all referenced material libs 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 # # 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. # 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 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: # 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) (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: if not SPLIT_OB_OR_GROUP and not SPLIT_MATERIALS:
# use the filename for the object name since we arnt chopping up the mesh. # 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. # 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_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) 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): def execute(self, context):
# print("Selected: " + context.active_object.name) # print("Selected: " + context.active_object.name)
load_obj(self.properties.path, load_obj(self.properties.filepath,
context, context,
self.properties.CLAMP_SIZE, self.properties.CLAMP_SIZE,
self.properties.CREATE_FGONS, self.properties.CREATE_FGONS,

View File

@@ -116,7 +116,7 @@ class importMDD(bpy.types.Operator):
# List of operator properties, the attributes will be assigned # List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling. # 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) #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) 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') return (ob and ob.type == 'MESH')
def execute(self, context): def execute(self, context):
if not self.properties.path: if not self.properties.filepath:
raise Exception("filename not set") 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'} return {'FINISHED'}

View File

@@ -77,7 +77,7 @@ class RENDER_OT_netslave_bake(bpy.types.Operator):
bpy.ops.ptcache.bake_all() 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'} return {'FINISHED'}

View File

@@ -215,7 +215,7 @@ def thumbnail(filename):
scene = bpy.data.scenes[0] # FIXME, this is dodgy! scene = bpy.data.scenes[0] # FIXME, this is dodgy!
scene.render.file_format = "JPEG" scene.render.file_format = "JPEG"
scene.render.file_quality = 90 scene.render.file_quality = 90
bpy.ops.image.open(path = filename) bpy.ops.image.open(filepath=filename)
img = bpy.data.images[imagename] img = bpy.data.images[imagename]
img.save_render(thumbname, scene=scene) img.save_render(thumbname, scene=scene)

View File

@@ -614,7 +614,7 @@ class Menu(StructRNA, _GenericUI):
def path_menu(self, searchpaths, operator, props_default={}): def path_menu(self, searchpaths, operator, props_default={}):
layout = self.layout 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 os
import bpy.utils import bpy.utils
@@ -623,12 +623,12 @@ class Menu(StructRNA, _GenericUI):
# collect paths # collect paths
files = [] files = []
for path in searchpaths: for directory in searchpaths:
files.extend([(f, os.path.join(path, f)) for f in os.listdir(path)]) files.extend([(f, os.path.join(directory, f)) for f in os.listdir(directory)])
files.sort() files.sort()
for f, path in files: for f, filepath in files:
if f.startswith("."): if f.startswith("."):
continue continue
@@ -639,7 +639,7 @@ class Menu(StructRNA, _GenericUI):
for attr, value in props_default.items(): for attr, value in props_default.items():
setattr(props, attr, value) setattr(props, attr, value)
props.path = path props.filepath = filepath
if operator == "script.execute_preset": if operator == "script.execute_preset":
props.menu_idname = self.bl_idname props.menu_idname = self.bl_idname
props.preset_name = preset_name props.preset_name = preset_name

View File

@@ -51,10 +51,10 @@ def compat_str(text, line_length=0):
return text 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 CONSTRAINTS = DRIVERS = True
fileobject = open(path, "w") fileobject = open(filepath, "w")
fw = fileobject.write fw = fileobject.write
fw(header) fw(header)
fw('label = "%s::%s" ;' % (bpy.data.filepath.split("/")[-1].split("\\")[-1], obj.name)) 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 import sys
sys.stdout.flush() sys.stdout.flush()
''' '''
print("\nSaved:", path) print("\nSaved:", filepath)
return True return True
if __name__ == "__main__": if __name__ == "__main__":

View File

@@ -61,7 +61,7 @@ def rna_idprop_ui_prop_clear(item, prop):
def draw(layout, context, context_member, use_edit=True): def draw(layout, context, context_member, use_edit=True):
def assign_props(prop, val, key): def assign_props(prop, val, key):
prop.path = context_member prop.data_path = context_member
prop.property = key prop.property = key
try: try:
@@ -81,7 +81,7 @@ def draw(layout, context, context_member, use_edit=True):
if use_edit: if use_edit:
row = layout.row() row = layout.row()
props = row.operator("wm.properties_add", text="Add") props = row.operator("wm.properties_add", text="Add")
props.path = context_member props.data_path = context_member
del row del row
for key, val in items: for key, val in items:
@@ -140,7 +140,7 @@ from bpy.props import *
rna_path = StringProperty(name="Property Edit", 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", rna_value = StringProperty(name="Property Value",
description="Property value edit", maxlen=1024, default="") 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): 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_idname = "wm.properties_edit"
bl_label = "Edit Property" bl_label = "Edit Property"
path = rna_path data_path = rna_path
property = rna_property property = rna_property
value = rna_value value = rna_value
min = rna_min min = rna_min
@@ -165,7 +165,7 @@ class WM_OT_properties_edit(bpy.types.Operator):
description = StringProperty(name="Tip", default="") description = StringProperty(name="Tip", default="")
def execute(self, context): def execute(self, context):
path = self.properties.path data_path = self.properties.data_path
value = self.properties.value value = self.properties.value
prop = self.properties.property prop = self.properties.property
prop_old = self._last_prop[0] prop_old = self._last_prop[0]
@@ -176,7 +176,7 @@ class WM_OT_properties_edit(bpy.types.Operator):
value_eval = value value_eval = value
# First remove # First remove
item = eval("context.%s" % path) item = eval("context.%s" % data_path)
rna_idprop_ui_prop_clear(item, prop_old) rna_idprop_ui_prop_clear(item, prop_old)
exec_str = "del item['%s']" % 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] self._last_prop = [self.properties.property]
item = eval("context.%s" % self.properties.path) item = eval("context.%s" % self.properties.data_path)
# setup defaults # setup defaults
prop_ui = rna_idprop_ui_prop_get(item, self.properties.property, False) # dont create 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): 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_idname = "wm.properties_add"
bl_label = "Add Property" bl_label = "Add Property"
path = rna_path data_path = rna_path
def execute(self, context): def execute(self, context):
item = eval("context.%s" % self.properties.path) item = eval("context.%s" % self.properties.data_path)
def unique_name(names): def unique_name(names):
prop = 'prop' prop = 'prop'
@@ -251,14 +251,14 @@ class WM_OT_properties_add(bpy.types.Operator):
class WM_OT_properties_remove(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_idname = "wm.properties_remove"
bl_label = "Remove Property" bl_label = "Remove Property"
path = rna_path data_path = rna_path
property = rna_property property = rna_property
def execute(self, context): def execute(self, context):
item = eval("context.%s" % self.properties.path) item = eval("context.%s" % self.properties.data_path)
del item[self.properties.property] del item[self.properties.property]
return {'FINISHED'} return {'FINISHED'}

View File

@@ -28,7 +28,7 @@ class EditExternally(bpy.types.Operator):
bl_label = "Image Edit Externally" bl_label = "Image Edit Externally"
bl_options = {'REGISTER'} 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): def _editor_guess(self, context):
import platform import platform
@@ -57,12 +57,12 @@ class EditExternally(bpy.types.Operator):
def execute(self, context): def execute(self, context):
import subprocess import subprocess
path = self.properties.path filepath = self.properties.filepath
image_editor = self._editor_guess(context) image_editor = self._editor_guess(context)
cmd = [] cmd = []
cmd.extend(image_editor) cmd.extend(image_editor)
cmd.append(bpy.utils.expandpath(path)) cmd.append(bpy.utils.expandpath(filepath))
subprocess.Popen(cmd) subprocess.Popen(cmd)
@@ -70,12 +70,12 @@ class EditExternally(bpy.types.Operator):
def invoke(self, context, event): def invoke(self, context, event):
try: try:
path = context.space_data.image.filepath filepath = context.space_data.image.filepath
except: except:
self.report({'ERROR'}, "Image not found on disk") self.report({'ERROR'}, "Image not found on disk")
return {'CANCELLED'} return {'CANCELLED'}
self.properties.path = path self.properties.filepath = filepath
self.execute(context) self.execute(context)
return {'FINISHED'} return {'FINISHED'}
@@ -91,13 +91,13 @@ class SaveDirty(bpy.types.Operator):
unique_paths = set() unique_paths = set()
for image in bpy.data.images: for image in bpy.data.images:
if image.dirty: if image.dirty:
path = bpy.utils.expandpath(image.filepath) filepath = bpy.utils.expandpath(image.filepath)
if "\\" not in path and "/" not in path: if "\\" not in filepath and "/" not in filepath:
self.report({'WARNING'}, "Invalid path: " + path) self.report({'WARNING'}, "Invalid path: " + filepath)
elif path in unique_paths: elif filepath in unique_paths:
self.report({'WARNING'}, "Path used by more then one image: " + path) self.report({'WARNING'}, "Path used by more then one image: " + filepath)
else: else:
unique_paths.add(path) unique_paths.add(filepath)
image.save() image.save()
return {'FINISHED'} return {'FINISHED'}
@@ -161,7 +161,7 @@ class ProjectEdit(bpy.types.Operator):
image_new.file_format = 'PNG' image_new.file_format = 'PNG'
image_new.save() image_new.save()
bpy.ops.image.external_edit(path=filepath_final) bpy.ops.image.external_edit(filepath=filepath_final)
return {'FINISHED'} return {'FINISHED'}

View File

@@ -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 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): if getattr(self, "save_keyconfig", True):
bpy.ops.wm.keyconfig_export(path=path, kc_name=self.properties.name) bpy.ops.wm.keyconfig_export(filepath=filepath, kc_name=self.properties.name)
file_preset = open(path, 'a') file_preset = open(filepath, 'a')
file_preset.write("wm.active_keyconfig = kc\n\n") file_preset.write("wm.active_keyconfig = kc\n\n")
else: else:
file_preset = open(path, 'w') file_preset = open(filepath, 'w')
for rna_path in self.preset_values: for rna_path in self.preset_values:
value = eval(rna_path) value = eval(rna_path)
@@ -79,7 +79,7 @@ class ExecutePreset(bpy.types.Operator):
bl_idname = "script.execute_preset" bl_idname = "script.execute_preset"
bl_label = "Execute a Python 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="") 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="") 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 preset_class.bl_label = self.properties.preset_name
# execute the preset using script.python_file_run # 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'} return {'FINISHED'}

View File

@@ -29,7 +29,7 @@ class ExportUVLayout(bpy.types.Operator):
bl_label = "Export UV Layout" bl_label = "Export UV Layout"
bl_options = {'REGISTER', 'UNDO'} 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'}) 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) export_all = BoolProperty(name="All UV's", description="Export all UVs in this mesh (not just the visible ones)", default=False)
mode = EnumProperty(items=( mode = EnumProperty(items=(
@@ -113,7 +113,7 @@ class ExportUVLayout(bpy.types.Operator):
mode = self.properties.mode mode = self.properties.mode
file = open(self.properties.path, "w") file = open(self.properties.filepath, "w")
fw = file.write fw = file.write
if mode == 'SVG': if mode == 'SVG':
@@ -211,7 +211,7 @@ class ExportUVLayout(bpy.types.Operator):
def menu_func(self, context): def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".svg") 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(): def register():

View File

@@ -46,10 +46,10 @@ rna_relative_prop = BoolProperty(name="Relative",
default=False) default=False)
def context_path_validate(context, path): def context_path_validate(context, data_path):
import sys import sys
try: try:
value = eval("context.%s" % path) value = eval("context.%s" % data_path)
except AttributeError: except AttributeError:
if "'NoneType'" in str(sys.exc_info()[1]): if "'NoneType'" in str(sys.exc_info()[1]):
# One of the items in the rna path is None, just ignore this # 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): 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'} return {'PASS_THROUGH'}
if getattr(self.properties, "relative", False): 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: else:
exec("context.%s=self.properties.value" % self.properties.path) exec("context.%s=self.properties.value" % self.properties.data_path)
return {'FINISHED'} return {'FINISHED'}
@@ -79,7 +79,7 @@ class WM_OT_context_set_boolean(bpy.types.Operator):
bl_label = "Context Set Boolean" bl_label = "Context Set Boolean"
bl_options = {'UNDO'} bl_options = {'UNDO'}
path = rna_path_prop data_path = rna_path_prop
value = BoolProperty(name="Value", value = BoolProperty(name="Value",
description="Assignment value", default=True) 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_label = "Context Set"
bl_options = {'UNDO'} bl_options = {'UNDO'}
path = rna_path_prop data_path = rna_path_prop
value = IntProperty(name="Value", description="Assign value", default=0) value = IntProperty(name="Value", description="Assign value", default=0)
relative = rna_relative_prop 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_label = "Context Set"
bl_options = {'UNDO'} bl_options = {'UNDO'}
path = rna_path_prop data_path = rna_path_prop
value = FloatProperty(name="Value", description="Assign value", default=1.0) value = FloatProperty(name="Value", description="Assign value", default=1.0)
always_step = BoolProperty(name="Always Step", always_step = BoolProperty(name="Always Step",
description="Always adjust the value by a minimum of 1 when 'value' is not 1.0.", description="Always adjust the value by a minimum of 1 when 'value' is not 1.0.",
default=True) default=True)
def execute(self, context): 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'} return {'PASS_THROUGH'}
value = self.properties.value value = self.properties.value
path = self.properties.path data_path = self.properties.data_path
if value == 1.0: # nothing to do if value == 1.0: # nothing to do
return {'CANCELLED'} return {'CANCELLED'}
@@ -128,9 +128,9 @@ class WM_OT_context_scale_int(bpy.types.Operator): # same as enum
else: else:
add = "-1" add = "-1"
func = "min" 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: else:
exec("context.%s *= value" % self.properties.path) exec("context.%s *= value" % self.properties.data_path)
return {'FINISHED'} return {'FINISHED'}
@@ -141,7 +141,7 @@ class WM_OT_context_set_float(bpy.types.Operator): # same as enum
bl_label = "Context Set Float" bl_label = "Context Set Float"
bl_options = {'UNDO'} bl_options = {'UNDO'}
path = rna_path_prop data_path = rna_path_prop
value = FloatProperty(name="Value", value = FloatProperty(name="Value",
description="Assignment value", default=0.0) description="Assignment value", default=0.0)
relative = rna_relative_prop 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_label = "Context Set String"
bl_options = {'UNDO'} bl_options = {'UNDO'}
path = rna_path_prop data_path = rna_path_prop
value = StringProperty(name="Value", value = StringProperty(name="Value",
description="Assign value", maxlen=1024, default="") 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_label = "Context Set Enum"
bl_options = {'UNDO'} bl_options = {'UNDO'}
path = rna_path_prop data_path = rna_path_prop
value = StringProperty(name="Value", value = StringProperty(name="Value",
description="Assignment value (as a string)", description="Assignment value (as a string)",
maxlen=1024, default="") maxlen=1024, default="")
@@ -182,15 +182,15 @@ class WM_OT_context_set_value(bpy.types.Operator):
bl_label = "Context Set Value" bl_label = "Context Set Value"
bl_options = {'UNDO'} bl_options = {'UNDO'}
path = rna_path_prop data_path = rna_path_prop
value = StringProperty(name="Value", value = StringProperty(name="Value",
description="Assignment value (as a string)", description="Assignment value (as a string)",
maxlen=1024, default="") maxlen=1024, default="")
def execute(self, context): 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'} 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'} return {'FINISHED'}
@@ -200,15 +200,15 @@ class WM_OT_context_toggle(bpy.types.Operator):
bl_label = "Context Toggle" bl_label = "Context Toggle"
bl_options = {'UNDO'} bl_options = {'UNDO'}
path = rna_path_prop data_path = rna_path_prop
def execute(self, context): 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'} return {'PASS_THROUGH'}
exec("context.%s=not (context.%s)" % exec("context.%s=not (context.%s)" %
(self.properties.path, self.properties.path)) (self.properties.data_path, self.properties.data_path))
return {'FINISHED'} return {'FINISHED'}
@@ -219,7 +219,7 @@ class WM_OT_context_toggle_enum(bpy.types.Operator):
bl_label = "Context Toggle Values" bl_label = "Context Toggle Values"
bl_options = {'UNDO'} bl_options = {'UNDO'}
path = rna_path_prop data_path = rna_path_prop
value_1 = StringProperty(name="Value", \ value_1 = StringProperty(name="Value", \
description="Toggle enum", maxlen=1024, default="") description="Toggle enum", maxlen=1024, default="")
@@ -228,12 +228,12 @@ class WM_OT_context_toggle_enum(bpy.types.Operator):
def execute(self, context): 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'} return {'PASS_THROUGH'}
exec("context.%s = ['%s', '%s'][context.%s!='%s']" % \ exec("context.%s = ['%s', '%s'][context.%s!='%s']" % \
(self.properties.path, self.properties.value_1,\ (self.properties.data_path, self.properties.value_1,\
self.properties.value_2, self.properties.path, self.properties.value_2, self.properties.data_path,
self.properties.value_2)) self.properties.value_2))
return {'FINISHED'} return {'FINISHED'}
@@ -246,12 +246,12 @@ class WM_OT_context_cycle_int(bpy.types.Operator):
bl_label = "Context Int Cycle" bl_label = "Context Int Cycle"
bl_options = {'UNDO'} bl_options = {'UNDO'}
path = rna_path_prop data_path = rna_path_prop
reverse = rna_reverse_prop reverse = rna_reverse_prop
def execute(self, context): def execute(self, context):
path = self.properties.path data_path = self.properties.data_path
value = context_path_validate(context, path) value = context_path_validate(context, data_path)
if value is Ellipsis: if value is Ellipsis:
return {'PASS_THROUGH'} return {'PASS_THROUGH'}
@@ -260,16 +260,16 @@ class WM_OT_context_cycle_int(bpy.types.Operator):
else: else:
value += 1 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 # relies on rna clamping int's out of the range
if self.properties.reverse: if self.properties.reverse:
value = (1 << 32) value = (1 << 32)
else: else:
value = - (1 << 32) value = - (1 << 32)
exec("context.%s=value" % path) exec("context.%s=value" % data_path)
return {'FINISHED'} return {'FINISHED'}
@@ -280,19 +280,19 @@ class WM_OT_context_cycle_enum(bpy.types.Operator):
bl_label = "Context Enum Cycle" bl_label = "Context Enum Cycle"
bl_options = {'UNDO'} bl_options = {'UNDO'}
path = rna_path_prop data_path = rna_path_prop
reverse = rna_reverse_prop reverse = rna_reverse_prop
def execute(self, context): 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: if value is Ellipsis:
return {'PASS_THROUGH'} return {'PASS_THROUGH'}
orig_value = value orig_value = value
# Have to get rna enum values # 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('[') i = rna_prop_str.find('[')
# just incse we get "context.foo.bar[0]" # 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] advance_enum = enums[orig_index + 1]
# set the new value # set the new value
exec("context.%s=advance_enum" % self.properties.path) exec("context.%s=advance_enum" % self.properties.data_path)
return {'FINISHED'} return {'FINISHED'}
doc_id = StringProperty(name="Doc ID", 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_idname = "wm.context_modal_mouse"
bl_label = "Context Modal Mouse" bl_label = "Context Modal Mouse"
path_iter = StringProperty(description="The path relative to the context, must point to an iterable.") data_path_iter = StringProperty(description="The data 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_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") 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") invert = BoolProperty(default=False, description="Invert the mouse input")
initial_x = IntProperty(options={'HIDDEN'}) initial_x = IntProperty(options={'HIDDEN'})
def _values_store(self, context): def _values_store(self, context):
path_iter = self.properties.path_iter data_path_iter = self.properties.data_path_iter
path_item = self.properties.path_item data_path_item = self.properties.data_path_item
self._values = values = {} self._values = values = {}
for item in getattr(context, path_iter): for item in getattr(context, data_path_iter):
try: try:
value_orig = eval("item." + path_item) value_orig = eval("item." + data_path_item)
except: except:
continue continue
# check this can be set, maybe this is library data. # check this can be set, maybe this is library data.
try: try:
exec("item.%s = %s" % (path_item, value_orig)) exec("item.%s = %s" % (data_path_item, value_orig))
except: except:
continue continue
@@ -368,17 +368,17 @@ class WM_OT_context_modal_mouse(bpy.types.Operator):
if self.properties.invert: if self.properties.invert:
delta = - delta delta = - delta
path_item = self.properties.path_item data_path_item = self.properties.data_path_item
for item, value_orig in self._values.items(): for item, value_orig in self._values.items():
if type(value_orig) == int: 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: else:
exec("item.%s = %f" % (path_item, value_orig + delta)) exec("item.%s = %f" % (data_path_item, value_orig + delta))
def _values_restore(self): 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(): 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() self._values.clear()
@@ -407,7 +407,7 @@ class WM_OT_context_modal_mouse(bpy.types.Operator):
if not self._values: if not self._values:
self.report({'WARNING'}, "Nothing to operate on: %s[ ].%s" % 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'} return {'CANCELLED'}
else: else:

View File

@@ -1,7 +1,7 @@
import bpy 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...") print("running write_some_data...")
pass pass
@@ -16,7 +16,7 @@ class ExportSomeData(bpy.types.Operator):
# to the class instance from the operator settings before calling. # to the class instance from the operator settings before calling.
# TODO, add better example props # 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) 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.")), 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): def execute(self, context):
# # Bug, currently isnt working # # Bug, currently isnt working
#if not self.is_property_set("path"): #if not self.is_property_set("filepath"):
# raise Exception("filename not set") # 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'} 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) bpy.types.INFO_MT_file_export.append(menu_func)
if __name__ == "__main__": 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")

View File

@@ -232,14 +232,14 @@ class AsScript(bpy.types.Operator):
bl_label = "Write Metarig to Script" bl_label = "Write Metarig to Script"
bl_options = {'REGISTER', 'UNDO'} 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): def execute(self, context):
import rigify_utils import rigify_utils
reload(rigify_utils) reload(rigify_utils)
obj = context.object obj = context.object
code = rigify_utils.write_meta_rig(obj) code = rigify_utils.write_meta_rig(obj)
path = self.properties.path path = self.properties.filepath
file = open(path, "w") file = open(path, "w")
file.write(code) file.write(code)
file.close() file.close()
@@ -249,7 +249,7 @@ class AsScript(bpy.types.Operator):
def invoke(self, context, event): def invoke(self, context, event):
import os import os
obj = context.object 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 = context.manager
wm.add_fileselect(self) wm.add_fileselect(self)
return {'RUNNING_MODAL'} return {'RUNNING_MODAL'}

View File

@@ -480,10 +480,10 @@ class DATA_PT_modifiers(DataButtonsPanel):
layout.separator() layout.separator()
layout.prop(md, "path", text="Create Along Paths") layout.prop(md, "use_path", text="Create Along Paths")
split = layout.split() split = layout.split()
split.active = md.path split.active = md.use_path
col = split.column() col = split.column()
col.row().prop(md, "axis", expand=True) col.row().prop(md, "axis", expand=True)
col.prop(md, "keep_shape") col.prop(md, "keep_shape")

View File

@@ -182,7 +182,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
col.prop(group, "dupli_offset", text="") col.prop(group, "dupli_offset", text="")
prop = col.operator("wm.context_set_value", text="From Cursor") 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 prop.value = value
index += 1 index += 1

View File

@@ -105,7 +105,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel):
subcol = col.column() subcol = col.column()
subcol.operator_context = 'INVOKE_DEFAULT' subcol.operator_context = 'INVOKE_DEFAULT'
op = subcol.operator("anim.keying_set_export", text="Export to File") op = subcol.operator("anim.keying_set_export", text="Export to File")
op.path = "keyingset.py" op.filepath = "keyingset.py"
if wide_ui: if wide_ui:
col = row.column() col = row.column()
@@ -229,7 +229,7 @@ class ANIM_OT_keying_set_export(bpy.types.Operator):
bl_idname = "anim.keying_set_export" bl_idname = "anim.keying_set_export"
bl_label = "Export Keying Set..." 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.") filename = bpy.props.StringProperty(name="File Name", description="Name of the file.")
directory = bpy.props.StringProperty(name="Directory", description="Directory 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'}) 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'}) filter_python = bpy.props.BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'})
def execute(self, context): def execute(self, context):
if not self.properties.path: if not self.properties.filepath:
raise Exception("File path not set.") raise Exception("Filepath not set.")
f = open(self.properties.path, "w") f = open(self.properties.filepath, "w")
if not f: if not f:
raise Exception("Could not open file.") raise Exception("Could not open file.")
@@ -301,7 +301,7 @@ class ANIM_OT_keying_set_export(bpy.types.Operator):
for ksp in ks.paths: for ksp in ks.paths:
f.write("ksp = ks.paths.add(") f.write("ksp = ks.paths.add(")
# id-block + RNA-path # id-block + data_path
if ksp.id: if ksp.id:
# find the relevant shorthand from the cache # find the relevant shorthand from the cache
id_bpy_path = id_to_paths_cache[ksp.id][0] id_bpy_path = id_to_paths_cache[ksp.id][0]

View File

@@ -133,13 +133,13 @@ class INFO_MT_file_open_recent(bpy.types.Menu):
layout = self.layout layout = self.layout
layout.operator_context = 'EXEC_AREA' 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): if os.path.isfile(filepath):
file = open(path, "rU") file = open(filepath, "rU")
for line in file: for line in file:
line = line.rstrip() 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() file.close()
else: else:
layout.label(text='No recent files') layout.label(text='No recent files')

View File

@@ -83,12 +83,12 @@ class USERPREF_HT_header(bpy.types.Header):
if userpref.active_section == 'INPUT': if userpref.active_section == 'INPUT':
op = layout.operator("wm.keyconfig_export") op = layout.operator("wm.keyconfig_export")
op.path = "keymap.py" op.filepath = "keymap.py"
op = layout.operator("wm.keyconfig_import") op = layout.operator("wm.keyconfig_import")
op.path = "keymap.py" op.filepath = "keymap.py"
elif userpref.active_section == 'ADDONS': elif userpref.active_section == 'ADDONS':
op = layout.operator("wm.addon_install") op = layout.operator("wm.addon_install")
op.path = "*.py" op.filepath = "*.py"
elif userpref.active_section == 'THEMES': elif userpref.active_section == 'THEMES':
op = layout.operator("ui.reset_default_theme") 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") 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") filename = StringProperty(name="File Name", description="Name of the file")
directory = StringProperty(name="Directory", description="Directory of the file") directory = StringProperty(name="Directory", description="Directory of the file")
filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'}) 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): def execute(self, context):
import traceback import traceback
import zipfile import zipfile
pyfile = self.properties.path pyfile = self.properties.filepath
path_addons = bpy.utils.script_paths("addons")[-1] path_addons = bpy.utils.script_paths("addons")[-1]

View File

@@ -508,7 +508,7 @@ class WM_OT_keyconfig_import(bpy.types.Operator):
bl_idname = "wm.keyconfig_import" bl_idname = "wm.keyconfig_import"
bl_label = "Import Key Configuration..." 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") filename = StringProperty(name="File Name", description="Name of the file")
directory = StringProperty(name="Directory", description="Directory of the file") directory = StringProperty(name="Directory", description="Directory of the file")
filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'}) 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) keep_original = BoolProperty(name="Keep original", description="Keep original file after copying to configuration folder", default=True)
def execute(self, context): def execute(self, context):
if not self.properties.path: if not self.properties.filepath:
raise Exception("File path not set") raise Exception("Filepath not set")
f = open(self.properties.path, "r") f = open(self.properties.filepath, "r")
if not f: if not f:
raise Exception("Could not open file") 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") path = os.path.join(path, config_name + ".py")
if self.properties.keep_original: if self.properties.keep_original:
shutil.copy(self.properties.path, path) shutil.copy(self.properties.filepath, path)
else: else:
shutil.move(self.properties.path, path) shutil.move(self.properties.filepath, path)
exec("import " + config_name) exec("import " + config_name)
@@ -569,7 +569,7 @@ class WM_OT_keyconfig_export(bpy.types.Operator):
bl_idname = "wm.keyconfig_export" bl_idname = "wm.keyconfig_export"
bl_label = "Export Key Configuration..." 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") filename = StringProperty(name="File Name", description="Name of the file")
directory = StringProperty(name="Directory", description="Directory of the file") directory = StringProperty(name="Directory", description="Directory of the file")
filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'}) 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") kc_name = StringProperty(name="KeyConfig Name", description="Name to save the key config as")
def execute(self, context): def execute(self, context):
if not self.properties.path: if not self.properties.filepath:
raise Exception("File path not set") raise Exception("Filepath not set")
f = open(self.properties.path, "w") f = open(self.properties.filepath, "w")
if not f: if not f:
raise Exception("Could not open file") raise Exception("Could not open file")
@@ -591,7 +591,7 @@ class WM_OT_keyconfig_export(bpy.types.Operator):
if self.properties.kc_name != '': if self.properties.kc_name != '':
name = self.properties.kc_name name = self.properties.kc_name
elif kc.name == 'Blender': 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: else:
name = kc.name name = kc.name

View File

@@ -721,23 +721,23 @@ class VIEW3D_MT_object_specials(bpy.types.Menu):
layout.operator_context = 'INVOKE_REGION_WIN' layout.operator_context = 'INVOKE_REGION_WIN'
props = layout.operator("wm.context_modal_mouse", text="Spot Size") props = layout.operator("wm.context_modal_mouse", text="Spot Size")
props.path_iter = "selected_editable_objects" props.data_path_iter = "selected_editable_objects"
props.path_item = "data.spot_size" props.data_path_item = "data.spot_size"
props.input_scale = 0.01 props.input_scale = 0.01
props = layout.operator("wm.context_modal_mouse", text="Distance") props = layout.operator("wm.context_modal_mouse", text="Distance")
props.path_iter = "selected_editable_objects" props.data_path_iter = "selected_editable_objects"
props.path_item = "data.distance" props.data_path_item = "data.distance"
props.input_scale = 0.1 props.input_scale = 0.1
props = layout.operator("wm.context_modal_mouse", text="Clip Start") props = layout.operator("wm.context_modal_mouse", text="Clip Start")
props.path_iter = "selected_editable_objects" props.data_path_iter = "selected_editable_objects"
props.path_item = "data.shadow_buffer_clip_start" props.data_path_item = "data.shadow_buffer_clip_start"
props.input_scale = 0.05 props.input_scale = 0.05
props = layout.operator("wm.context_modal_mouse", text="Clip End") props = layout.operator("wm.context_modal_mouse", text="Clip End")
props.path_iter = "selected_editable_objects" props.data_path_iter = "selected_editable_objects"
props.path_item = "data.shadow_buffer_clip_end" props.data_path_item = "data.shadow_buffer_clip_end"
props.input_scale = 0.05 props.input_scale = 0.05
layout.separator() 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 = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL')
prop.value = "(True, False, False)" 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 = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL')
prop.value = "(False, True, False)" 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 = layout.operator("wm.context_set_value", text="Face", icon='FACESEL')
prop.value = "(False, False, True)" 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): class VIEW3D_MT_edit_mesh_extrude(bpy.types.Menu):

View File

@@ -948,7 +948,7 @@ class VIEW3D_MT_tools_projectpaint_clone(bpy.types.Menu):
layout = self.layout layout = self.layout
for i, tex in enumerate(context.active_object.data.uv_textures): for i, tex in enumerate(context.active_object.data.uv_textures):
prop = layout.operator("wm.context_set_int", text=tex.name) 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 prop.value = i
@@ -959,7 +959,7 @@ class VIEW3D_MT_tools_projectpaint_stencil(bpy.types.Menu):
layout = self.layout layout = self.layout
for i, tex in enumerate(context.active_object.data.uv_textures): for i, tex in enumerate(context.active_object.data.uv_textures):
prop = layout.operator("wm.context_set_int", text=tex.name) 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 prop.value = i

View File

@@ -475,7 +475,7 @@ void calc_curvepath(Object *ob)
bl= cu->bev.first; bl= cu->bev.first;
if(bl==NULL || !bl->nr) return; if(bl==NULL || !bl->nr) return;
cu->path=path= MEM_callocN(sizeof(Path), "path"); cu->path=path= MEM_callocN(sizeof(Path), "calc_curvepath");
/* if POLY: last vertice != first vertice */ /* if POLY: last vertice != first vertice */
cycl= (bl->poly!= -1); cycl= (bl->poly!= -1);

View File

@@ -384,7 +384,7 @@ static int paste_file_exec(bContext *C, wmOperator *op)
char *path; char *path;
int retval; int retval;
path= RNA_string_get_alloc(op->ptr, "path", NULL, 0); path= RNA_string_get_alloc(op->ptr, "filepath", NULL, 0);
retval= paste_file(C, op->reports, path); retval= paste_file(C, op->reports, path);
MEM_freeN(path); MEM_freeN(path);
@@ -393,7 +393,7 @@ static int paste_file_exec(bContext *C, wmOperator *op)
static int paste_file_invoke(bContext *C, wmOperator *op, wmEvent *event) static int paste_file_invoke(bContext *C, wmOperator *op, wmEvent *event)
{ {
if(RNA_property_is_set(op->ptr, "path")) if(RNA_property_is_set(op->ptr, "filepath"))
return paste_file_exec(C, op); return paste_file_exec(C, op);
WM_event_add_fileselect(C, op); WM_event_add_fileselect(C, op);
@@ -1564,7 +1564,7 @@ static int open_exec(bContext *C, wmOperator *op)
PointerRNA idptr; PointerRNA idptr;
char str[FILE_MAX]; char str[FILE_MAX];
RNA_string_get(op->ptr, "path", str); RNA_string_get(op->ptr, "filepath", str);
font = load_vfont(str); font = load_vfont(str);
@@ -1613,12 +1613,12 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *event)
} }
path = (font && font->name)? font->name: U.fontdir; path = (font && font->name)? font->name: U.fontdir;
if(RNA_property_is_set(op->ptr, "path")) if(RNA_property_is_set(op->ptr, "filepath"))
return open_exec(C, op); return open_exec(C, op);
open_init(C, op); open_init(C, op);
RNA_string_set(op->ptr, "path", path); RNA_string_set(op->ptr, "filepath", path);
WM_event_add_fileselect(C, op); WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL; return OPERATOR_RUNNING_MODAL;

View File

@@ -326,10 +326,10 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
} }
/* check input variables */ /* check input variables */
if(RNA_property_is_set(op->ptr, "path")) { if(RNA_property_is_set(op->ptr, "filepath")) {
char path[FILE_MAX]; char path[FILE_MAX];
RNA_string_get(op->ptr, "path", path); RNA_string_get(op->ptr, "filepath", path);
ima= BKE_add_image_file(path, ima= BKE_add_image_file(path,
scene ? scene->r.cfra : 1); scene ? scene->r.cfra : 1);
} }
@@ -385,7 +385,7 @@ void MESH_OT_drop_named_image(wmOperatorType *ot)
/* properties */ /* properties */
RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign."); RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign.");
RNA_def_string(ot->srna, "path", "Path", FILE_MAX, "Filepath", "Path to image file"); RNA_def_string(ot->srna, "filepath", "Path", FILE_MAX, "Filepath", "Path to image file");
} }
static int uv_texture_remove_exec(bContext *C, wmOperator *op) static int uv_texture_remove_exec(bContext *C, wmOperator *op)

View File

@@ -1022,7 +1022,7 @@ static int multires_external_save_exec(bContext *C, wmOperator *op)
if(CustomData_external_test(&me->fdata, CD_MDISPS)) if(CustomData_external_test(&me->fdata, CD_MDISPS))
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
RNA_string_get(op->ptr, "path", path); RNA_string_get(op->ptr, "filepath", path);
if(relative) if(relative)
BLI_path_rel(path, G.sce); BLI_path_rel(path, G.sce);
@@ -1054,13 +1054,13 @@ static int multires_external_save_invoke(bContext *C, wmOperator *op, wmEvent *e
if(!RNA_property_is_set(op->ptr, "relative_path")) if(!RNA_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
if(RNA_property_is_set(op->ptr, "path")) if(RNA_property_is_set(op->ptr, "filepath"))
return multires_external_save_exec(C, op); return multires_external_save_exec(C, op);
op->customdata= me; op->customdata= me;
BLI_snprintf(path, sizeof(path), "//%s.btx", me->id.name+2); BLI_snprintf(path, sizeof(path), "//%s.btx", me->id.name+2);
RNA_string_set(op->ptr, "path", path); RNA_string_set(op->ptr, "filepath", path);
WM_event_add_fileselect(C, op); WM_event_add_fileselect(C, op);

View File

@@ -387,17 +387,17 @@ void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keym
if(do_pet > 0) { if(do_pet > 0) {
/* context ops */ /* context ops */
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_enum", OKEY, KM_PRESS, KM_SHIFT, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_enum", OKEY, KM_PRESS, KM_SHIFT, 0);
RNA_string_set(kmi->ptr, "path", "tool_settings.proportional_editing_falloff"); RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_editing_falloff");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, 0, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", "tool_settings.proportional_editing"); RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_editing");
RNA_string_set(kmi->ptr, "value_1", "DISABLED"); RNA_string_set(kmi->ptr, "value_1", "DISABLED");
RNA_string_set(kmi->ptr, "value_2", "ENABLED"); RNA_string_set(kmi->ptr, "value_2", "ENABLED");
/* for modes/object types that allow 'conencted' mode, add the Alt O key */ /* for modes/object types that allow 'conencted' mode, add the Alt O key */
if (do_pet > 1) { if (do_pet > 1) {
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, KM_ALT, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, KM_ALT, 0);
RNA_string_set(kmi->ptr, "path", "tool_settings.proportional_editing"); RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_editing");
RNA_string_set(kmi->ptr, "value_1", "DISABLED"); RNA_string_set(kmi->ptr, "value_1", "DISABLED");
RNA_string_set(kmi->ptr, "value_2", "CONNECTED"); RNA_string_set(kmi->ptr, "value_2", "CONNECTED");
} }

View File

@@ -847,7 +847,7 @@ static int envmap_save_exec(bContext *C, wmOperator *op)
int imtype = scene->r.imtype; int imtype = scene->r.imtype;
char path[FILE_MAX]; char path[FILE_MAX];
RNA_string_get(op->ptr, "path", path); RNA_string_get(op->ptr, "filepath", path);
if(scene->r.scemode & R_EXTENSION) { if(scene->r.scemode & R_EXTENSION) {
BKE_add_image_extension(path, imtype); BKE_add_image_extension(path, imtype);
@@ -871,12 +871,12 @@ static int envmap_save_invoke(bContext *C, wmOperator *op, wmEvent *event)
if(!RNA_property_is_set(op->ptr, "relative_path")) if(!RNA_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
if(RNA_property_is_set(op->ptr, "path")) if(RNA_property_is_set(op->ptr, "filepath"))
return envmap_save_exec(C, op); return envmap_save_exec(C, op);
//RNA_enum_set(op->ptr, "file_type", scene->r.imtype); //RNA_enum_set(op->ptr, "file_type", scene->r.imtype);
RNA_string_set(op->ptr, "path", G.sce); RNA_string_set(op->ptr, "filepath", G.sce);
WM_event_add_fileselect(C, op); WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL; return OPERATOR_RUNNING_MODAL;

View File

@@ -75,7 +75,7 @@ static int screenshot_exec(bContext *C, wmOperator *op)
ImBuf *ibuf; ImBuf *ibuf;
char path[FILE_MAX]; char path[FILE_MAX];
RNA_string_get(op->ptr, "path", path); RNA_string_get(op->ptr, "filepath", path);
strcpy(G.ima, path); strcpy(G.ima, path);
BLI_path_abs(path, G.sce); BLI_path_abs(path, G.sce);
@@ -147,10 +147,10 @@ static int screenshot_invoke(bContext *C, wmOperator *op, wmEvent *event)
scd->dumprect= dumprect; scd->dumprect= dumprect;
op->customdata= scd; op->customdata= scd;
if(RNA_property_is_set(op->ptr, "path")) if(RNA_property_is_set(op->ptr, "filepath"))
return screenshot_exec(C, op); return screenshot_exec(C, op);
RNA_string_set(op->ptr, "path", G.ima); RNA_string_set(op->ptr, "filepath", G.ima);
WM_event_add_fileselect(C, op); WM_event_add_fileselect(C, op);
@@ -341,7 +341,7 @@ void SCREEN_OT_screencast(wmOperatorType *ot)
ot->flag= 0; ot->flag= 0;
RNA_def_property(ot->srna, "path", PROP_STRING, PROP_FILEPATH); RNA_def_property(ot->srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_boolean(ot->srna, "full", 1, "Full Screen", ""); RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "");
} }

View File

@@ -146,34 +146,34 @@ static void ed_keymap_paint_brush_switch(wmKeyMap *keymap, const char *path)
wmKeyMapItem *kmi; wmKeyMapItem *kmi;
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", ONEKEY, KM_PRESS, 0, 0); kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", ONEKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", path); RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 0); RNA_int_set(kmi->ptr, "value", 0);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", TWOKEY, KM_PRESS, 0, 0); kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", TWOKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", path); RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 1); RNA_int_set(kmi->ptr, "value", 1);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", THREEKEY, KM_PRESS, 0, 0); kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", THREEKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", path); RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 2); RNA_int_set(kmi->ptr, "value", 2);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", FOURKEY, KM_PRESS, 0, 0); kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", FOURKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", path); RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 3); RNA_int_set(kmi->ptr, "value", 3);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", FIVEKEY, KM_PRESS, 0, 0); kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", FIVEKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", path); RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 4); RNA_int_set(kmi->ptr, "value", 4);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", SIXKEY, KM_PRESS, 0, 0); kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", SIXKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", path); RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 5); RNA_int_set(kmi->ptr, "value", 5);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", SEVENKEY, KM_PRESS, 0, 0); kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", SEVENKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", path); RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 6); RNA_int_set(kmi->ptr, "value", 6);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", EIGHTKEY, KM_PRESS, 0, 0); kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", EIGHTKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", path); RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 7); RNA_int_set(kmi->ptr, "value", 7);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", NINEKEY, KM_PRESS, 0, 0); kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", NINEKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", path); RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 8); RNA_int_set(kmi->ptr, "value", 8);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", ZEROKEY, KM_PRESS, 0, 0); kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", ZEROKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", path); RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 9); RNA_int_set(kmi->ptr, "value", 9);
} }
@@ -182,11 +182,11 @@ static void ed_keymap_paint_brush_size(wmKeyMap *keymap, const char *path)
wmKeyMapItem *kmi; wmKeyMapItem *kmi;
kmi= WM_keymap_add_item(keymap, "WM_OT_context_scale_int", LEFTBRACKETKEY, KM_PRESS, 0, 0); kmi= WM_keymap_add_item(keymap, "WM_OT_context_scale_int", LEFTBRACKETKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", path); RNA_string_set(kmi->ptr, "data_path", path);
RNA_float_set(kmi->ptr, "value", 0.9); RNA_float_set(kmi->ptr, "value", 0.9);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_scale_int", RIGHTBRACKETKEY, KM_PRESS, 0, 0); kmi= WM_keymap_add_item(keymap, "WM_OT_context_scale_int", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", path); RNA_string_set(kmi->ptr, "data_path", path);
RNA_float_set(kmi->ptr, "value", 10.0/9.0); // 1.1111.... RNA_float_set(kmi->ptr, "value", 10.0/9.0); // 1.1111....
} }
@@ -223,40 +223,40 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
ed_keymap_paint_brush_size(keymap, "tool_settings.sculpt.brush.size"); ed_keymap_paint_brush_size(keymap, "tool_settings.sculpt.brush.size");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", AKEY, KM_PRESS, 0, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", AKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.use_anchor"); RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.brush.use_anchor");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", SKEY, KM_PRESS, KM_SHIFT, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", SKEY, KM_PRESS, KM_SHIFT, 0);
RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.use_smooth_stroke"); RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.brush.use_smooth_stroke");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", RKEY, KM_PRESS, 0, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", RKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.use_rake"); RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.brush.use_rake");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", AKEY, KM_PRESS, KM_SHIFT, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", AKEY, KM_PRESS, KM_SHIFT, 0);
RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.use_airbrush"); RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.brush.use_airbrush");
/* brush switching */ /* brush switching */
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", DKEY, KM_PRESS, 0, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", DKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.active_brush_name"); RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.active_brush_name");
RNA_string_set(kmi->ptr, "value", "Draw"); RNA_string_set(kmi->ptr, "value", "Draw");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", SKEY, KM_PRESS, 0, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", SKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.active_brush_name"); RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.active_brush_name");
RNA_string_set(kmi->ptr, "value", "Smooth"); RNA_string_set(kmi->ptr, "value", "Smooth");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", PKEY, KM_PRESS, 0, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", PKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.active_brush_name"); RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.active_brush_name");
RNA_string_set(kmi->ptr, "value", "Pinch"); RNA_string_set(kmi->ptr, "value", "Pinch");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", GKEY, KM_PRESS, 0, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", GKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.active_brush_name"); RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.active_brush_name");
RNA_string_set(kmi->ptr, "value", "Grab"); RNA_string_set(kmi->ptr, "value", "Grab");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", LKEY, KM_PRESS, 0, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", LKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.active_brush_name"); RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.active_brush_name");
RNA_string_set(kmi->ptr, "value", "Layer"); RNA_string_set(kmi->ptr, "value", "Layer");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", TKEY, KM_PRESS, KM_SHIFT, 0); // was just T in 2.4x kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", TKEY, KM_PRESS, KM_SHIFT, 0); // was just T in 2.4x
RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.active_brush_name"); RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.active_brush_name");
RNA_string_set(kmi->ptr, "value", "Flatten"); RNA_string_set(kmi->ptr, "value", "Flatten");
@@ -276,7 +276,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
ed_keymap_paint_brush_size(keymap, "tool_settings.vertex_paint.brush.size"); ed_keymap_paint_brush_size(keymap, "tool_settings.vertex_paint.brush.size");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0); /* mask toggle */ kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0); /* mask toggle */
RNA_string_set(kmi->ptr, "path", "vertex_paint_object.data.use_paint_mask"); RNA_string_set(kmi->ptr, "data_path", "vertex_paint_object.data.use_paint_mask");
/* Weight Paint mode */ /* Weight Paint mode */
keymap= WM_keymap_find(keyconf, "Weight Paint", 0, 0); keymap= WM_keymap_find(keyconf, "Weight Paint", 0, 0);
@@ -294,7 +294,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
ed_keymap_paint_brush_size(keymap, "tool_settings.weight_paint.brush.size"); ed_keymap_paint_brush_size(keymap, "tool_settings.weight_paint.brush.size");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0); /* mask toggle */ kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0); /* mask toggle */
RNA_string_set(kmi->ptr, "path", "weight_paint_object.data.use_paint_mask"); RNA_string_set(kmi->ptr, "data_path", "weight_paint_object.data.use_paint_mask");
WM_keymap_verify_item(keymap, "PAINT_OT_weight_from_bones", WKEY, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "PAINT_OT_weight_from_bones", WKEY, KM_PRESS, 0, 0);
@@ -314,7 +314,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
ed_keymap_paint_brush_size(keymap, "tool_settings.image_paint.brush.size"); ed_keymap_paint_brush_size(keymap, "tool_settings.image_paint.brush.size");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0); /* mask toggle */ kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0); /* mask toggle */
RNA_string_set(kmi->ptr, "path", "texture_paint_object.data.use_paint_mask"); RNA_string_set(kmi->ptr, "data_path", "texture_paint_object.data.use_paint_mask");
/* face-mask mode */ /* face-mask mode */
keymap= WM_keymap_find(keyconf, "Face Mask", 0, 0); keymap= WM_keymap_find(keyconf, "Face Mask", 0, 0);

View File

@@ -80,7 +80,7 @@ static int open_exec(bContext *C, wmOperator *op)
PointerRNA idptr; PointerRNA idptr;
AUD_SoundInfo info; AUD_SoundInfo info;
RNA_string_get(op->ptr, "path", path); RNA_string_get(op->ptr, "filepath", path);
sound = sound_new_file(CTX_data_main(C), path); sound = sound_new_file(CTX_data_main(C), path);
if(!op->customdata) if(!op->customdata)
@@ -127,7 +127,7 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *event)
if(!RNA_property_is_set(op->ptr, "relative_path")) if(!RNA_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
if(RNA_property_is_set(op->ptr, "path")) if(RNA_property_is_set(op->ptr, "filepath"))
return open_exec(C, op); return open_exec(C, op);
open_init(C, op); open_init(C, op);

View File

@@ -88,10 +88,10 @@ static int file_browse_exec(bContext *C, wmOperator *op)
FileBrowseOp *fbo= op->customdata; FileBrowseOp *fbo= op->customdata;
char *str; char *str;
if (RNA_property_is_set(op->ptr, "path")==0 || fbo==NULL) if (RNA_property_is_set(op->ptr, "filepath")==0 || fbo==NULL)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
str= RNA_string_get_alloc(op->ptr, "path", 0, 0); str= RNA_string_get_alloc(op->ptr, "filepath", 0, 0);
RNA_property_string_set(&fbo->ptr, fbo->prop, str); RNA_property_string_set(&fbo->ptr, fbo->prop, str);
RNA_property_update(C, &fbo->ptr, fbo->prop); RNA_property_update(C, &fbo->ptr, fbo->prop);
MEM_freeN(str); MEM_freeN(str);
@@ -126,7 +126,7 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event)
op->customdata= fbo; op->customdata= fbo;
str= RNA_property_string_get_alloc(&ptr, prop, 0, 0); str= RNA_property_string_get_alloc(&ptr, prop, 0, 0);
RNA_string_set(op->ptr, "path", str); RNA_string_set(op->ptr, "filepath", str);
MEM_freeN(str); MEM_freeN(str);
WM_event_add_fileselect(C, op); WM_event_add_fileselect(C, op);

View File

@@ -289,19 +289,19 @@ void console_keymap(struct wmKeyConfig *keyconf)
RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", ENDKEY, KM_PRESS, 0, 0)->ptr, "type", LINE_END); RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", ENDKEY, KM_PRESS, 0, 0)->ptr, "type", LINE_END);
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0);
RNA_string_set(kmi->ptr, "path", "space_data.font_size"); RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
RNA_boolean_set(kmi->ptr, "reverse", 0); RNA_boolean_set(kmi->ptr, "reverse", 0);
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL, 0);
RNA_string_set(kmi->ptr, "path", "space_data.font_size"); RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
RNA_boolean_set(kmi->ptr, "reverse", 1); RNA_boolean_set(kmi->ptr, "reverse", 1);
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADPLUSKEY, KM_PRESS, KM_CTRL, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
RNA_string_set(kmi->ptr, "path", "space_data.font_size"); RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
RNA_boolean_set(kmi->ptr, "reverse", 0); RNA_boolean_set(kmi->ptr, "reverse", 0);
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADMINUS, KM_PRESS, KM_CTRL, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADMINUS, KM_PRESS, KM_CTRL, 0);
RNA_string_set(kmi->ptr, "path", "space_data.font_size"); RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
RNA_boolean_set(kmi->ptr, "reverse", 1); RNA_boolean_set(kmi->ptr, "reverse", 1);
RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", LEFTARROWKEY, KM_PRESS, 0, 0)->ptr, "type", PREV_CHAR); RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", LEFTARROWKEY, KM_PRESS, 0, 0)->ptr, "type", PREV_CHAR);

View File

@@ -576,7 +576,7 @@ int file_exec(bContext *C, wmOperator *exec_op)
if(RNA_boolean_get(op->ptr, "relative_path")) if(RNA_boolean_get(op->ptr, "relative_path"))
BLI_path_rel(name, G.sce); BLI_path_rel(name, G.sce);
RNA_string_set(op->ptr, "path", name); RNA_string_set(op->ptr, "filepath", name);
/* some ops have multiple files to select */ /* some ops have multiple files to select */
{ {

View File

@@ -182,7 +182,7 @@ static void file_panel_operator(const bContext *C, Panel *pa)
if(flag & PROP_HIDDEN) if(flag & PROP_HIDDEN)
continue; continue;
if(strcmp(RNA_property_identifier(prop), "path") == 0) if(strcmp(RNA_property_identifier(prop), "filepath") == 0)
continue; continue;
if(strcmp(RNA_property_identifier(prop), "directory") == 0) if(strcmp(RNA_property_identifier(prop), "directory") == 0)
continue; continue;

View File

@@ -127,8 +127,8 @@ short ED_fileselect_set_params(SpaceFile *sfile)
else else
params->type = FILE_SPECIAL; params->type = FILE_SPECIAL;
if (RNA_property_is_set(op->ptr, "path")) { if (RNA_property_is_set(op->ptr, "filepath")) {
RNA_string_get(op->ptr, "path", name); RNA_string_get(op->ptr, "filepath", name);
if (params->type == FILE_LOADLIB) { if (params->type == FILE_LOADLIB) {
BLI_strncpy(params->dir, name, sizeof(params->dir)); BLI_strncpy(params->dir, name, sizeof(params->dir));
BLI_cleanup_dir(G.sce, params->dir); BLI_cleanup_dir(G.sce, params->dir);

View File

@@ -1037,7 +1037,7 @@ static int graphkeys_sound_bake_exec(bContext *C, wmOperator *op)
if (ANIM_animdata_get_context(C, &ac) == 0) if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
RNA_string_get(op->ptr, "path", path); RNA_string_get(op->ptr, "filepath", path);
scene= ac.scene; /* current scene */ scene= ac.scene; /* current scene */

View File

@@ -654,7 +654,7 @@ static const EnumPropertyItem image_file_type_items[] = {
static void image_filesel(bContext *C, wmOperator *op, const char *path) static void image_filesel(bContext *C, wmOperator *op, const char *path)
{ {
RNA_string_set(op->ptr, "path", path); RNA_string_set(op->ptr, "filepath", path);
WM_event_add_fileselect(C, op); WM_event_add_fileselect(C, op);
} }
@@ -685,7 +685,7 @@ static int open_exec(bContext *C, wmOperator *op)
Image *ima= NULL; Image *ima= NULL;
char str[FILE_MAX]; char str[FILE_MAX];
RNA_string_get(op->ptr, "path", str); RNA_string_get(op->ptr, "filepath", str);
/* default to frame 1 if there's no scene in context */ /* default to frame 1 if there's no scene in context */
ima= BKE_add_image_file(str, scene ? scene->r.cfra : 1); ima= BKE_add_image_file(str, scene ? scene->r.cfra : 1);
@@ -729,7 +729,7 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *event)
if(!RNA_property_is_set(op->ptr, "relative_path")) if(!RNA_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
if(RNA_property_is_set(op->ptr, "path")) if(RNA_property_is_set(op->ptr, "filepath"))
return open_exec(C, op); return open_exec(C, op);
open_init(C, op); open_init(C, op);
@@ -767,7 +767,7 @@ static int replace_exec(bContext *C, wmOperator *op)
if(!sima->image) if(!sima->image)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
RNA_string_get(op->ptr, "path", str); RNA_string_get(op->ptr, "filepath", str);
BLI_strncpy(sima->image->name, str, sizeof(sima->image->name)-1); /* we cant do much if the str is longer then 240 :/ */ BLI_strncpy(sima->image->name, str, sizeof(sima->image->name)-1); /* we cant do much if the str is longer then 240 :/ */
BKE_image_signal(sima->image, &sima->iuser, IMA_SIGNAL_RELOAD); BKE_image_signal(sima->image, &sima->iuser, IMA_SIGNAL_RELOAD);
@@ -784,7 +784,7 @@ static int replace_invoke(bContext *C, wmOperator *op, wmEvent *event)
if(!sima->image) if(!sima->image)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
if(RNA_property_is_set(op->ptr, "path")) if(RNA_property_is_set(op->ptr, "filepath"))
return replace_exec(C, op); return replace_exec(C, op);
image_filesel(C, op, path); image_filesel(C, op, path);
@@ -918,7 +918,7 @@ static int save_as_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
sima->imtypenr= RNA_enum_get(op->ptr, "file_type"); sima->imtypenr= RNA_enum_get(op->ptr, "file_type");
RNA_string_get(op->ptr, "path", str); RNA_string_get(op->ptr, "filepath", str);
save_image_doit(C, sima, scene, op, str); save_image_doit(C, sima, scene, op, str);
@@ -936,7 +936,7 @@ static int save_as_invoke(bContext *C, wmOperator *op, wmEvent *event)
if(!RNA_property_is_set(op->ptr, "relative_path")) if(!RNA_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
if(RNA_property_is_set(op->ptr, "path")) if(RNA_property_is_set(op->ptr, "filepath"))
return save_as_exec(C, op); return save_as_exec(C, op);
if(!ima) if(!ima)

View File

@@ -540,7 +540,7 @@ static int image_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
static void image_drop_copy(wmDrag *drag, wmDropBox *drop) static void image_drop_copy(wmDrag *drag, wmDropBox *drop)
{ {
/* copy drag path to properties */ /* copy drag path to properties */
RNA_string_set(drop->ptr, "path", drag->path); RNA_string_set(drop->ptr, "filepath", drag->path);
} }
/* area+region dropbox definition */ /* area+region dropbox definition */

View File

@@ -271,7 +271,7 @@ static int find_missing_files_exec(bContext *C, wmOperator *op)
{ {
char *path; char *path;
path= RNA_string_get_alloc(op->ptr, "path", NULL, 0); path= RNA_string_get_alloc(op->ptr, "filepath", NULL, 0);
findMissingFiles(path, G.sce); findMissingFiles(path, G.sce);
MEM_freeN(path); MEM_freeN(path);

View File

@@ -2244,10 +2244,10 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
int ntype=0; int ntype=0;
/* check input variables */ /* check input variables */
if (RNA_property_is_set(op->ptr, "path")) if (RNA_property_is_set(op->ptr, "filepath"))
{ {
char path[FILE_MAX]; char path[FILE_MAX];
RNA_string_get(op->ptr, "path", path); RNA_string_get(op->ptr, "filepath", path);
ima= BKE_add_image_file(path, scene ? scene->r.cfra : 1); ima= BKE_add_image_file(path, scene ? scene->r.cfra : 1);
} }
else if(RNA_property_is_set(op->ptr, "name")) else if(RNA_property_is_set(op->ptr, "name"))
@@ -2291,7 +2291,7 @@ static int node_add_file_invoke(bContext *C, wmOperator *op, wmEvent *event)
UI_view2d_region_to_view(&ar->v2d, event->x - ar->winrct.xmin, event->y - ar->winrct.ymin, UI_view2d_region_to_view(&ar->v2d, event->x - ar->winrct.xmin, event->y - ar->winrct.ymin,
&snode->mx, &snode->my); &snode->mx, &snode->my);
if (RNA_property_is_set(op->ptr, "path") || RNA_property_is_set(op->ptr, "name")) if (RNA_property_is_set(op->ptr, "filepath") || RNA_property_is_set(op->ptr, "name"))
return node_add_file_exec(C, op); return node_add_file_exec(C, op);
else else
return WM_operator_filesel(C, op, event); return WM_operator_filesel(C, op, event);

View File

@@ -313,7 +313,7 @@ static void node_id_path_drop_copy(wmDrag *drag, wmDropBox *drop)
RNA_string_set(drop->ptr, "name", id->name+2); RNA_string_set(drop->ptr, "name", id->name+2);
} }
if (drag->path[0]) { if (drag->path[0]) {
RNA_string_set(drop->ptr, "path", drag->path); RNA_string_set(drop->ptr, "filepath", drag->path);
} }
} }

View File

@@ -58,7 +58,7 @@
static int run_pyfile_exec(bContext *C, wmOperator *op) static int run_pyfile_exec(bContext *C, wmOperator *op)
{ {
char path[512]; char path[512];
RNA_string_get(op->ptr, "path", path); RNA_string_get(op->ptr, "filepath", path);
#ifndef DISABLE_PYTHON #ifndef DISABLE_PYTHON
if(BPY_run_python_script(C, path, NULL, op->reports)) { if(BPY_run_python_script(C, path, NULL, op->reports)) {
ARegion *ar= CTX_wm_region(C); ARegion *ar= CTX_wm_region(C);
@@ -81,7 +81,7 @@ void SCRIPT_OT_python_file_run(wmOperatorType *ot)
ot->exec= run_pyfile_exec; ot->exec= run_pyfile_exec;
ot->poll= ED_operator_areaactive; ot->poll= ED_operator_areaactive;
RNA_def_string_file_path(ot->srna, "path", "", 512, "Path", ""); RNA_def_string_file_path(ot->srna, "filepath", "", 512, "Path", "");
} }

View File

@@ -63,6 +63,6 @@ void script_keymap(wmKeyConfig *keyconf)
wmKeyMap *keymap= WM_keymap_find(keyconf, "Script", SPACE_SCRIPT, 0); wmKeyMap *keymap= WM_keymap_find(keyconf, "Script", SPACE_SCRIPT, 0);
/* TODO - this is just while we have no way to load a text datablock */ /* TODO - this is just while we have no way to load a text datablock */
RNA_string_set(WM_keymap_add_item(keymap, "SCRIPT_OT_python_file_run", PKEY, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0)->ptr, "path", "test.py"); RNA_string_set(WM_keymap_add_item(keymap, "SCRIPT_OT_python_file_run", PKEY, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0)->ptr, "filepath", "test.py");
} }

View File

@@ -135,7 +135,7 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op)
RNA_string_get(op->ptr, "name", seq_load->name+2); RNA_string_get(op->ptr, "name", seq_load->name+2);
RNA_string_get(op->ptr, "path", seq_load->path); /* full path, file is set by the caller */ RNA_string_get(op->ptr, "filepath", seq_load->path); /* full path, file is set by the caller */
if (RNA_struct_find_property(op->ptr, "frame_end")) { if (RNA_struct_find_property(op->ptr, "frame_end")) {
seq_load->end_frame = RNA_int_get(op->ptr, "frame_end"); seq_load->end_frame = RNA_int_get(op->ptr, "frame_end");
@@ -545,7 +545,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
if (seq->type==SEQ_PLUGIN) { if (seq->type==SEQ_PLUGIN) {
char path[FILE_MAX]; char path[FILE_MAX];
RNA_string_get(op->ptr, "path", path); RNA_string_get(op->ptr, "filepath", path);
sh.init_plugin(seq, path); sh.init_plugin(seq, path);

View File

@@ -322,7 +322,7 @@ static int sound_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
static void sequencer_drop_copy(wmDrag *drag, wmDropBox *drop) static void sequencer_drop_copy(wmDrag *drag, wmDropBox *drop)
{ {
/* copy drag path to properties */ /* copy drag path to properties */
RNA_string_set(drop->ptr, "path", drag->path); RNA_string_set(drop->ptr, "filepath", drag->path);
} }
/* this region dropbox definition */ /* this region dropbox definition */

View File

@@ -215,19 +215,19 @@ static void text_keymap(struct wmKeyConfig *keyconf)
#endif #endif
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0);
RNA_string_set(kmi->ptr, "path", "space_data.font_size"); RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
RNA_boolean_set(kmi->ptr, "reverse", 0); RNA_boolean_set(kmi->ptr, "reverse", 0);
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL, 0);
RNA_string_set(kmi->ptr, "path", "space_data.font_size"); RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
RNA_boolean_set(kmi->ptr, "reverse", 1); RNA_boolean_set(kmi->ptr, "reverse", 1);
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADPLUSKEY, KM_PRESS, KM_CTRL, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
RNA_string_set(kmi->ptr, "path", "space_data.font_size"); RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
RNA_boolean_set(kmi->ptr, "reverse", 0); RNA_boolean_set(kmi->ptr, "reverse", 0);
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADMINUS, KM_PRESS, KM_CTRL, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADMINUS, KM_PRESS, KM_CTRL, 0);
RNA_string_set(kmi->ptr, "path", "space_data.font_size"); RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
RNA_boolean_set(kmi->ptr, "reverse", 1); RNA_boolean_set(kmi->ptr, "reverse", 1);
WM_keymap_add_item(keymap, "TEXT_OT_new", NKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_new", NKEY, KM_PRESS, KM_ALT, 0);
@@ -389,7 +389,7 @@ static int text_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
static void text_drop_copy(wmDrag *drag, wmDropBox *drop) static void text_drop_copy(wmDrag *drag, wmDropBox *drop)
{ {
/* copy drag path to properties */ /* copy drag path to properties */
RNA_string_set(drop->ptr, "path", drag->path); RNA_string_set(drop->ptr, "filepath", drag->path);
} }
/* this region dropbox definition */ /* this region dropbox definition */

View File

@@ -220,7 +220,7 @@ static int open_exec(bContext *C, wmOperator *op)
char str[FILE_MAX]; char str[FILE_MAX];
short internal = RNA_int_get(op->ptr, "internal"); short internal = RNA_int_get(op->ptr, "internal");
RNA_string_get(op->ptr, "path", str); RNA_string_get(op->ptr, "filepath", str);
text= add_text(str, G.sce); text= add_text(str, G.sce);
@@ -268,11 +268,11 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *event)
Text *text= CTX_data_edit_text(C); Text *text= CTX_data_edit_text(C);
char *path= (text && text->name)? text->name: G.sce; char *path= (text && text->name)? text->name: G.sce;
if(RNA_property_is_set(op->ptr, "path")) if(RNA_property_is_set(op->ptr, "filepath"))
return open_exec(C, op); return open_exec(C, op);
open_init(C, op); open_init(C, op);
RNA_string_set(op->ptr, "path", path); RNA_string_set(op->ptr, "filepath", path);
WM_event_add_fileselect(C, op); WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL; return OPERATOR_RUNNING_MODAL;
@@ -494,7 +494,7 @@ static int save_as_exec(bContext *C, wmOperator *op)
if(!text) if(!text)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
RNA_string_get(op->ptr, "path", str); RNA_string_get(op->ptr, "filepath", str);
if(text->name) MEM_freeN(text->name); if(text->name) MEM_freeN(text->name);
text->name= BLI_strdup(str); text->name= BLI_strdup(str);
@@ -513,7 +513,7 @@ static int save_as_invoke(bContext *C, wmOperator *op, wmEvent *event)
Text *text= CTX_data_edit_text(C); Text *text= CTX_data_edit_text(C);
char *str; char *str;
if(RNA_property_is_set(op->ptr, "path")) if(RNA_property_is_set(op->ptr, "filepath"))
return save_as_exec(C, op); return save_as_exec(C, op);
if(text->name) if(text->name)
@@ -523,7 +523,7 @@ static int save_as_invoke(bContext *C, wmOperator *op, wmEvent *event)
else else
str= G.sce; str= G.sce;
RNA_string_set(op->ptr, "path", str); RNA_string_set(op->ptr, "filepath", str);
WM_event_add_fileselect(C, op); WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL; return OPERATOR_RUNNING_MODAL;

View File

@@ -454,7 +454,7 @@ static void view3d_id_path_drop_copy(wmDrag *drag, wmDropBox *drop)
if(id) if(id)
RNA_string_set(drop->ptr, "name", id->name+2); RNA_string_set(drop->ptr, "name", id->name+2);
if(drag->path[0]) if(drag->path[0])
RNA_string_set(drop->ptr, "path", drag->path); RNA_string_set(drop->ptr, "filepath", drag->path);
} }

View File

@@ -220,12 +220,12 @@ void view3d_keymap(wmKeyConfig *keyconf)
/* drawtype */ /* drawtype */
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", ZKEY, KM_PRESS, 0, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", ZKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", "space_data.viewport_shading"); RNA_string_set(kmi->ptr, "data_path", "space_data.viewport_shading");
RNA_string_set(kmi->ptr, "value_1", "SOLID"); RNA_string_set(kmi->ptr, "value_1", "SOLID");
RNA_string_set(kmi->ptr, "value_2", "WIREFRAME"); RNA_string_set(kmi->ptr, "value_2", "WIREFRAME");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", ZKEY, KM_PRESS, KM_ALT, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", ZKEY, KM_PRESS, KM_ALT, 0);
RNA_string_set(kmi->ptr, "path", "space_data.viewport_shading"); RNA_string_set(kmi->ptr, "data_path", "space_data.viewport_shading");
RNA_string_set(kmi->ptr, "value_1", "TEXTURED"); RNA_string_set(kmi->ptr, "value_1", "TEXTURED");
RNA_string_set(kmi->ptr, "value_2", "SOLID"); RNA_string_set(kmi->ptr, "value_2", "SOLID");
@@ -266,29 +266,29 @@ void view3d_keymap(wmKeyConfig *keyconf)
/* context ops */ /* context ops */
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", COMMAKEY, KM_PRESS, 0, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", COMMAKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", "space_data.pivot_point"); RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point");
RNA_string_set(kmi->ptr, "value", "BOUNDING_BOX_CENTER"); RNA_string_set(kmi->ptr, "value", "BOUNDING_BOX_CENTER");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", COMMAKEY, KM_PRESS, KM_CTRL, 0); /* 2.4x allowed Comma+Shift too, rather not use both */ kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", COMMAKEY, KM_PRESS, KM_CTRL, 0); /* 2.4x allowed Comma+Shift too, rather not use both */
RNA_string_set(kmi->ptr, "path", "space_data.pivot_point"); RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point");
RNA_string_set(kmi->ptr, "value", "MEDIAN_POINT"); RNA_string_set(kmi->ptr, "value", "MEDIAN_POINT");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", COMMAKEY, KM_PRESS, KM_ALT, 0); /* new in 2.5 */ kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", COMMAKEY, KM_PRESS, KM_ALT, 0); /* new in 2.5 */
RNA_string_set(kmi->ptr, "path", "space_data.pivot_point_align"); RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point_align");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", SPACEKEY, KM_PRESS, KM_CTRL, 0); /* new in 2.5 */ kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", SPACEKEY, KM_PRESS, KM_CTRL, 0); /* new in 2.5 */
RNA_string_set(kmi->ptr, "path", "space_data.manipulator"); RNA_string_set(kmi->ptr, "data_path", "space_data.manipulator");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", PERIODKEY, KM_PRESS, 0, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", PERIODKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", "space_data.pivot_point"); RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point");
RNA_string_set(kmi->ptr, "value", "CURSOR"); RNA_string_set(kmi->ptr, "value", "CURSOR");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", PERIODKEY, KM_PRESS, KM_CTRL, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", PERIODKEY, KM_PRESS, KM_CTRL, 0);
RNA_string_set(kmi->ptr, "path", "space_data.pivot_point"); RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point");
RNA_string_set(kmi->ptr, "value", "INDIVIDUAL_ORIGINS"); RNA_string_set(kmi->ptr, "value", "INDIVIDUAL_ORIGINS");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", PERIODKEY, KM_PRESS, KM_ALT, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", PERIODKEY, KM_PRESS, KM_ALT, 0);
RNA_string_set(kmi->ptr, "path", "space_data.pivot_point"); RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point");
RNA_string_set(kmi->ptr, "value", "ACTIVE_ELEMENT"); RNA_string_set(kmi->ptr, "value", "ACTIVE_ELEMENT");
transform_keymap_for_space(keyconf, keymap, SPACE_VIEW3D); transform_keymap_for_space(keyconf, keymap, SPACE_VIEW3D);

View File

@@ -848,7 +848,7 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
km = WM_keymap_add_item(keymap, OP_MIRROR, MKEY, KM_PRESS, KM_CTRL, 0); km = WM_keymap_add_item(keymap, OP_MIRROR, MKEY, KM_PRESS, KM_CTRL, 0);
km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0); km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0);
RNA_string_set(km->ptr, "path", "tool_settings.snap"); RNA_string_set(km->ptr, "data_path", "tool_settings.snap");
km = WM_keymap_add_item(keymap, "TRANSFORM_OT_snap_type", TABKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0); km = WM_keymap_add_item(keymap, "TRANSFORM_OT_snap_type", TABKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
@@ -926,7 +926,7 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
km = WM_keymap_add_item(keymap, "TRANSFORM_OT_mirror", MKEY, KM_PRESS, KM_CTRL, 0); km = WM_keymap_add_item(keymap, "TRANSFORM_OT_mirror", MKEY, KM_PRESS, KM_CTRL, 0);
km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0); km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0);
RNA_string_set(km->ptr, "path", "tool_settings.snap"); RNA_string_set(km->ptr, "data_path", "tool_settings.snap");
break; break;
default: default:
break; break;

View File

@@ -186,7 +186,7 @@ void RNA_api_image(StructRNA *srna)
func= RNA_def_function(srna, "save_render", "rna_Image_save_render"); func= RNA_def_function(srna, "save_render", "rna_Image_save_render");
RNA_def_function_ui_description(func, "Save image to a specific path using a scenes render settings"); RNA_def_function_ui_description(func, "Save image to a specific path using a scenes render settings");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
parm= RNA_def_string(func, "path", "", 0, "", "Save path."); parm= RNA_def_string(func, "filepath", "", 0, "", "Save path.");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene to take image parameters from"); parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene to take image parameters from");

View File

@@ -929,7 +929,7 @@ void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "load", "rna_Main_texts_load"); func= RNA_def_function(srna, "load", "rna_Main_texts_load");
RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add a new text to the main database from a file"); RNA_def_function_ui_description(func, "Add a new text to the main database from a file");
parm= RNA_def_string(func, "path", "Path", FILE_MAXDIR + FILE_MAXFILE, "", "path for the datablock."); parm= RNA_def_string(func, "filepath", "Path", FILE_MAXDIR + FILE_MAXFILE, "", "path for the datablock.");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */ /* return type */
parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock."); parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock.");

View File

@@ -1605,7 +1605,7 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Children", "Create instances from child particles"); RNA_def_property_ui_text(prop, "Children", "Create instances from child particles");
RNA_def_property_update(prop, 0, "rna_Modifier_update"); RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "path", PROP_BOOLEAN, PROP_NONE); prop= RNA_def_property(srna, "use_path", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Path); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Path);
RNA_def_property_ui_text(prop, "Path", "Create instances along particle paths"); RNA_def_property_ui_text(prop, "Path", "Create instances along particle paths");
RNA_def_property_update(prop, 0, "rna_Modifier_update"); RNA_def_property_update(prop, 0, "rna_Modifier_update");

View File

@@ -1854,7 +1854,7 @@ static int pyrna_struct_anim_args_parse(PointerRNA *ptr, const char *error_prefi
static int pyrna_struct_keyframe_parse(PointerRNA *ptr, PyObject *args, PyObject *kw, const char *parse_str, const char *error_prefix, static int pyrna_struct_keyframe_parse(PointerRNA *ptr, PyObject *args, PyObject *kw, const char *parse_str, const char *error_prefix,
char **path_full, int *index, float *cfra, char **group_name) /* return values */ char **path_full, int *index, float *cfra, char **group_name) /* return values */
{ {
static char *kwlist[] = {"path", "index", "frame", "group", NULL}; static char *kwlist[] = {"datapath", "index", "frame", "group", NULL};
char *path; char *path;
/* note, parse_str MUST start with 's|ifs' */ /* note, parse_str MUST start with 's|ifs' */
@@ -1871,12 +1871,12 @@ static int pyrna_struct_keyframe_parse(PointerRNA *ptr, PyObject *args, PyObject
} }
static char pyrna_struct_keyframe_insert_doc[] = static char pyrna_struct_keyframe_insert_doc[] =
".. method:: keyframe_insert(path, index=-1, frame=bpy.context.scene.frame_current, group=\"\")\n" ".. method:: keyframe_insert(datapath, index=-1, frame=bpy.context.scene.frame_current, group=\"\")\n"
"\n" "\n"
" Insert a keyframe on the property given, adding fcurves and animation data when necessary.\n" " Insert a keyframe on the property given, adding fcurves and animation data when necessary.\n"
"\n" "\n"
" :arg path: path to the property to key, analogous to the fcurve's data path.\n" " :arg datapath: path to the property to key, analogous to the fcurve's data path.\n"
" :type path: string\n" " :type datapath: string\n"
" :arg index: array index of the property to key. Defaults to -1 which will key all indicies or a single channel if the property is not an array.\n" " :arg index: array index of the property to key. Defaults to -1 which will key all indicies or a single channel if the property is not an array.\n"
" :type index: int\n" " :type index: int\n"
" :arg frame: The frame on which the keyframe is inserted, defaulting to the current frame.\n" " :arg frame: The frame on which the keyframe is inserted, defaulting to the current frame.\n"
@@ -1905,12 +1905,12 @@ static PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *arg
} }
static char pyrna_struct_keyframe_delete_doc[] = static char pyrna_struct_keyframe_delete_doc[] =
".. method:: keyframe_delete(path, index=-1, frame=bpy.context.scene.frame_current, group=\"\")\n" ".. method:: keyframe_delete(datapath, index=-1, frame=bpy.context.scene.frame_current, group=\"\")\n"
"\n" "\n"
" Remove a keyframe from this properties fcurve.\n" " Remove a keyframe from this properties fcurve.\n"
"\n" "\n"
" :arg path: path to the property to remove a key, analogous to the fcurve's data path.\n" " :arg datapath: path to the property to remove a key, analogous to the fcurve's data path.\n"
" :type path: string\n" " :type datapath: string\n"
" :arg index: array index of the property to remove a key. Defaults to -1 removing all indicies or a single channel if the property is not an array.\n" " :arg index: array index of the property to remove a key. Defaults to -1 removing all indicies or a single channel if the property is not an array.\n"
" :type index: int\n" " :type index: int\n"
" :arg frame: The frame on which the keyframe is deleted, defaulting to the current frame.\n" " :arg frame: The frame on which the keyframe is deleted, defaulting to the current frame.\n"

View File

@@ -184,7 +184,7 @@ int WM_menu_invoke (struct bContext *C, struct wmOperator *op, struct wmEven
int WM_enum_search_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event); int WM_enum_search_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
/* invoke callback, confirm menu + exec */ /* invoke callback, confirm menu + exec */
int WM_operator_confirm (struct bContext *C, struct wmOperator *op, struct wmEvent *event); int WM_operator_confirm (struct bContext *C, struct wmOperator *op, struct wmEvent *event);
/* invoke callback, file selector "path" unset + exec */ /* invoke callback, file selector "filepath" unset + exec */
int WM_operator_filesel (struct bContext *C, struct wmOperator *op, struct wmEvent *event); int WM_operator_filesel (struct bContext *C, struct wmOperator *op, struct wmEvent *event);
/* poll callback, context checks */ /* poll callback, context checks */
int WM_operator_winactive (struct bContext *C); int WM_operator_winactive (struct bContext *C);

View File

@@ -498,7 +498,7 @@ typedef struct wmDropBox {
typedef struct RecentFile { typedef struct RecentFile {
struct RecentFile *next, *prev; struct RecentFile *next, *prev;
char *filename; char *filepath;
} RecentFile; } RecentFile;

View File

@@ -1212,7 +1212,7 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa
{ {
/* XXX validate area and region? */ /* XXX validate area and region? */
bScreen *screen= CTX_wm_screen(C); bScreen *screen= CTX_wm_screen(C);
char *path= RNA_string_get_alloc(handler->op->ptr, "path", NULL, 0); char *path= RNA_string_get_alloc(handler->op->ptr, "filepath", NULL, 0);
if(screen != handler->filescreen) if(screen != handler->filescreen)
ED_screen_full_prevspace(C, CTX_wm_area(C)); ED_screen_full_prevspace(C, CTX_wm_area(C));

View File

@@ -407,10 +407,10 @@ void read_Blog(void)
recent = (RecentFile*)MEM_mallocN(sizeof(RecentFile),"RecentFile"); recent = (RecentFile*)MEM_mallocN(sizeof(RecentFile),"RecentFile");
BLI_addtail(&(G.recent_files), recent); BLI_addtail(&(G.recent_files), recent);
recent->filename = (char*)MEM_mallocN(sizeof(char)*(strlen(line)+1), "name of file"); recent->filepath = (char*)MEM_mallocN(sizeof(char)*(strlen(line)+1), "name of file");
recent->filename[0] = '\0'; recent->filepath[0] = '\0';
strcpy(recent->filename, line); strcpy(recent->filepath, line);
num++; num++;
} }
} }
@@ -433,29 +433,29 @@ static void writeBlog(void)
recent = G.recent_files.first; recent = G.recent_files.first;
/* refresh .Blog of recent opened files, when current file was changed */ /* refresh .Blog of recent opened files, when current file was changed */
if(!(recent) || (strcmp(recent->filename, G.sce)!=0)) { if(!(recent) || (strcmp(recent->filepath, G.sce)!=0)) {
fp= fopen(name, "w"); fp= fopen(name, "w");
if (fp) { if (fp) {
/* add current file to the beginning of list */ /* add current file to the beginning of list */
recent = (RecentFile*)MEM_mallocN(sizeof(RecentFile),"RecentFile"); recent = (RecentFile*)MEM_mallocN(sizeof(RecentFile),"RecentFile");
recent->filename = (char*)MEM_mallocN(sizeof(char)*(strlen(G.sce)+1), "name of file"); recent->filepath = (char*)MEM_mallocN(sizeof(char)*(strlen(G.sce)+1), "name of file");
recent->filename[0] = '\0'; recent->filepath[0] = '\0';
strcpy(recent->filename, G.sce); strcpy(recent->filepath, G.sce);
BLI_addhead(&(G.recent_files), recent); BLI_addhead(&(G.recent_files), recent);
/* write current file to .Blog */ /* write current file to .Blog */
fprintf(fp, "%s\n", recent->filename); fprintf(fp, "%s\n", recent->filepath);
recent = recent->next; recent = recent->next;
i=1; i=1;
/* write rest of recent opened files to .Blog */ /* write rest of recent opened files to .Blog */
while((i<U.recent_files) && (recent)){ while((i<U.recent_files) && (recent)){
/* this prevents to have duplicities in list */ /* this prevents to have duplicities in list */
if (strcmp(recent->filename, G.sce)!=0) { if (strcmp(recent->filepath, G.sce)!=0) {
fprintf(fp, "%s\n", recent->filename); fprintf(fp, "%s\n", recent->filepath);
recent = recent->next; recent = recent->next;
} }
else { else {
next_recent = recent->next; next_recent = recent->next;
MEM_freeN(recent->filename); MEM_freeN(recent->filepath);
BLI_freelinkN(&(G.recent_files), recent); BLI_freelinkN(&(G.recent_files), recent);
recent = next_recent; recent = next_recent;
} }

View File

@@ -202,7 +202,7 @@ static void free_openrecent(void)
struct RecentFile *recent; struct RecentFile *recent;
for(recent = G.recent_files.first; recent; recent=recent->next) for(recent = G.recent_files.first; recent; recent=recent->next)
MEM_freeN(recent->filename); MEM_freeN(recent->filepath);
BLI_freelistN(&(G.recent_files)); BLI_freelistN(&(G.recent_files));
} }

View File

@@ -774,7 +774,7 @@ int WM_operator_confirm(bContext *C, wmOperator *op, wmEvent *event)
/* op->invoke, opens fileselect if path property not set, otherwise executes */ /* op->invoke, opens fileselect if path property not set, otherwise executes */
int WM_operator_filesel(bContext *C, wmOperator *op, wmEvent *event) int WM_operator_filesel(bContext *C, wmOperator *op, wmEvent *event)
{ {
if (RNA_property_is_set(op->ptr, "path")) { if (RNA_property_is_set(op->ptr, "filepath")) {
return WM_operator_call(C, op); return WM_operator_call(C, op);
} }
else { else {
@@ -788,7 +788,7 @@ void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type,
{ {
PropertyRNA *prop; PropertyRNA *prop;
RNA_def_string_file_path(ot->srna, "path", "", FILE_MAX, "File Path", "Path to file"); RNA_def_string_file_path(ot->srna, "filepath", "", FILE_MAX, "File Path", "Path to file");
RNA_def_string_file_name(ot->srna, "filename", "", FILE_MAX, "File Name", "Name of the file"); RNA_def_string_file_name(ot->srna, "filename", "", FILE_MAX, "File Name", "Name of the file");
RNA_def_string_dir_path(ot->srna, "directory", "", FILE_MAX, "Directory", "Directory of the file"); RNA_def_string_dir_path(ot->srna, "directory", "", FILE_MAX, "Directory", "Directory of the file");
@@ -1215,7 +1215,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unuse
col = uiLayoutColumn(split, 0); col = uiLayoutColumn(split, 0);
uiItemL(col, "Recent", 0); uiItemL(col, "Recent", 0);
for(recent = G.recent_files.first, i=0; (i<5) && (recent); recent = recent->next, i++) { for(recent = G.recent_files.first, i=0; (i<5) && (recent); recent = recent->next, i++) {
uiItemStringO(col, BLI_path_basename(recent->filename), ICON_FILE_BLEND, "WM_OT_open_mainfile", "path", recent->filename); uiItemStringO(col, BLI_path_basename(recent->filepath), ICON_FILE_BLEND, "WM_OT_open_mainfile", "filepath", recent->filepath);
} }
uiItemS(col); uiItemS(col);
uiItemO(col, NULL, ICON_RECOVER_LAST, "WM_OT_recover_last_session"); uiItemO(col, NULL, ICON_RECOVER_LAST, "WM_OT_recover_last_session");
@@ -1429,7 +1429,7 @@ static void open_set_use_scripts(wmOperator *op)
static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event) static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event)
{ {
RNA_string_set(op->ptr, "path", G.sce); RNA_string_set(op->ptr, "filepath", G.sce);
open_set_load_ui(op); open_set_load_ui(op);
open_set_use_scripts(op); open_set_use_scripts(op);
@@ -1442,7 +1442,7 @@ static int wm_open_mainfile_exec(bContext *C, wmOperator *op)
{ {
char path[FILE_MAX]; char path[FILE_MAX];
RNA_string_get(op->ptr, "path", path); RNA_string_get(op->ptr, "filepath", path);
open_set_load_ui(op); open_set_load_ui(op);
open_set_use_scripts(op); open_set_use_scripts(op);
@@ -1488,12 +1488,12 @@ static int wm_link_append_invoke(bContext *C, wmOperator *op, wmEvent *event)
if(!RNA_property_is_set(op->ptr, "relative_path")) if(!RNA_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
if(RNA_property_is_set(op->ptr, "path")) { if(RNA_property_is_set(op->ptr, "filepath")) {
return WM_operator_call(C, op); return WM_operator_call(C, op);
} }
else { else {
/* XXX TODO solve where to get last linked library from */ /* XXX TODO solve where to get last linked library from */
RNA_string_set(op->ptr, "path", G.lib); RNA_string_set(op->ptr, "filepath", G.lib);
WM_event_add_fileselect(C, op); WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL; return OPERATOR_RUNNING_MODAL;
} }
@@ -1693,7 +1693,7 @@ static int wm_recover_auto_save_exec(bContext *C, wmOperator *op)
{ {
char path[FILE_MAX]; char path[FILE_MAX];
RNA_string_get(op->ptr, "path", path); RNA_string_get(op->ptr, "filepath", path);
G.fileflags |= G_FILE_RECOVER; G.fileflags |= G_FILE_RECOVER;
@@ -1714,7 +1714,7 @@ static int wm_recover_auto_save_invoke(bContext *C, wmOperator *op, wmEvent *eve
char filename[FILE_MAX]; char filename[FILE_MAX];
wm_autosave_location(filename); wm_autosave_location(filename);
RNA_string_set(op->ptr, "path", filename); RNA_string_set(op->ptr, "filepath", filename);
WM_event_add_fileselect(C, op); WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL; return OPERATOR_RUNNING_MODAL;
@@ -1765,7 +1765,7 @@ static int wm_save_as_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *even
BLI_strncpy(name, G.sce, FILE_MAX); BLI_strncpy(name, G.sce, FILE_MAX);
untitled(name); untitled(name);
RNA_string_set(op->ptr, "path", name); RNA_string_set(op->ptr, "filepath", name);
WM_event_add_fileselect(C, op); WM_event_add_fileselect(C, op);
@@ -1780,8 +1780,8 @@ static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op)
save_set_compress(op); save_set_compress(op);
if(RNA_property_is_set(op->ptr, "path")) if(RNA_property_is_set(op->ptr, "filepath"))
RNA_string_get(op->ptr, "path", path); RNA_string_get(op->ptr, "filepath", path);
else { else {
BLI_strncpy(path, G.sce, FILE_MAX); BLI_strncpy(path, G.sce, FILE_MAX);
untitled(path); untitled(path);
@@ -1833,7 +1833,7 @@ static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event)
BLI_strncpy(name, G.sce, FILE_MAX); BLI_strncpy(name, G.sce, FILE_MAX);
untitled(name); untitled(name);
RNA_string_set(op->ptr, "path", name); RNA_string_set(op->ptr, "filepath", name);
if (RNA_struct_find_property(op->ptr, "check_existing")) if (RNA_struct_find_property(op->ptr, "check_existing"))
if (RNA_boolean_get(op->ptr, "check_existing")==0) if (RNA_boolean_get(op->ptr, "check_existing")==0)
@@ -1875,9 +1875,9 @@ static void WM_OT_save_mainfile(wmOperatorType *ot)
static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *event) static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *event)
{ {
if(!RNA_property_is_set(op->ptr, "path")) { if(!RNA_property_is_set(op->ptr, "filepath")) {
char *path = BLI_replacestr(G.sce, ".blend", ".dae"); char *path = BLI_replacestr(G.sce, ".blend", ".dae");
RNA_string_set(op->ptr, "path", path); RNA_string_set(op->ptr, "filepath", path);
MEM_freeN(path); MEM_freeN(path);
} }
@@ -1891,12 +1891,12 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
{ {
char filename[FILE_MAX]; char filename[FILE_MAX];
if(!RNA_property_is_set(op->ptr, "path")) { if(!RNA_property_is_set(op->ptr, "filepath")) {
BKE_report(op->reports, RPT_ERROR, "No filename given"); BKE_report(op->reports, RPT_ERROR, "No filename given");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
RNA_string_get(op->ptr, "path", filename); RNA_string_get(op->ptr, "filepath", filename);
collada_export(CTX_data_scene(C), filename); collada_export(CTX_data_scene(C), filename);
return OPERATOR_FINISHED; return OPERATOR_FINISHED;
@@ -1919,12 +1919,12 @@ static int wm_collada_import_exec(bContext *C, wmOperator *op)
{ {
char filename[FILE_MAX]; char filename[FILE_MAX];
if(!RNA_property_is_set(op->ptr, "path")) { if(!RNA_property_is_set(op->ptr, "filepath")) {
BKE_report(op->reports, RPT_ERROR, "No filename given"); BKE_report(op->reports, RPT_ERROR, "No filename given");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
RNA_string_get(op->ptr, "path", filename); RNA_string_get(op->ptr, "filepath", filename);
collada_import(C, filename); collada_import(C, filename);
return OPERATOR_FINISHED; return OPERATOR_FINISHED;
@@ -3201,47 +3201,47 @@ void wm_window_keymap(wmKeyConfig *keyconf)
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F2KEY, KM_PRESS, KM_SHIFT, 0); /* new in 2.5x, was DXF export */ kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F2KEY, KM_PRESS, KM_SHIFT, 0); /* new in 2.5x, was DXF export */
RNA_string_set(kmi->ptr, "path", "area.type"); RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "LOGIC_EDITOR"); RNA_string_set(kmi->ptr, "value", "LOGIC_EDITOR");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F3KEY, KM_PRESS, KM_SHIFT, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F3KEY, KM_PRESS, KM_SHIFT, 0);
RNA_string_set(kmi->ptr, "path", "area.type"); RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "NODE_EDITOR"); RNA_string_set(kmi->ptr, "value", "NODE_EDITOR");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F4KEY, KM_PRESS, KM_SHIFT, 0); /* new in 2.5x, was data browser */ kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F4KEY, KM_PRESS, KM_SHIFT, 0); /* new in 2.5x, was data browser */
RNA_string_set(kmi->ptr, "path", "area.type"); RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "CONSOLE"); RNA_string_set(kmi->ptr, "value", "CONSOLE");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F5KEY, KM_PRESS, KM_SHIFT, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F5KEY, KM_PRESS, KM_SHIFT, 0);
RNA_string_set(kmi->ptr, "path", "area.type"); RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "VIEW_3D"); RNA_string_set(kmi->ptr, "value", "VIEW_3D");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F6KEY, KM_PRESS, KM_SHIFT, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F6KEY, KM_PRESS, KM_SHIFT, 0);
RNA_string_set(kmi->ptr, "path", "area.type"); RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "GRAPH_EDITOR"); RNA_string_set(kmi->ptr, "value", "GRAPH_EDITOR");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F7KEY, KM_PRESS, KM_SHIFT, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F7KEY, KM_PRESS, KM_SHIFT, 0);
RNA_string_set(kmi->ptr, "path", "area.type"); RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "PROPERTIES"); RNA_string_set(kmi->ptr, "value", "PROPERTIES");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F8KEY, KM_PRESS, KM_SHIFT, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F8KEY, KM_PRESS, KM_SHIFT, 0);
RNA_string_set(kmi->ptr, "path", "area.type"); RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "SEQUENCE_EDITOR"); RNA_string_set(kmi->ptr, "value", "SEQUENCE_EDITOR");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F9KEY, KM_PRESS, KM_SHIFT, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F9KEY, KM_PRESS, KM_SHIFT, 0);
RNA_string_set(kmi->ptr, "path", "area.type"); RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "OUTLINER"); RNA_string_set(kmi->ptr, "value", "OUTLINER");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F10KEY, KM_PRESS, KM_SHIFT, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F10KEY, KM_PRESS, KM_SHIFT, 0);
RNA_string_set(kmi->ptr, "path", "area.type"); RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "IMAGE_EDITOR"); RNA_string_set(kmi->ptr, "value", "IMAGE_EDITOR");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F11KEY, KM_PRESS, KM_SHIFT, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F11KEY, KM_PRESS, KM_SHIFT, 0);
RNA_string_set(kmi->ptr, "path", "area.type"); RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "TEXT_EDITOR"); RNA_string_set(kmi->ptr, "value", "TEXT_EDITOR");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F12KEY, KM_PRESS, KM_SHIFT, 0); kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F12KEY, KM_PRESS, KM_SHIFT, 0);
RNA_string_set(kmi->ptr, "path", "area.type"); RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "DOPESHEET_EDITOR"); RNA_string_set(kmi->ptr, "value", "DOPESHEET_EDITOR");
gesture_circle_modal_keymap(keyconf); gesture_circle_modal_keymap(keyconf);

View File

@@ -729,7 +729,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
CTX_wm_window_set(C, win); CTX_wm_window_set(C, win);
WM_operator_properties_create(&props_ptr, "WM_OT_open_mainfile"); WM_operator_properties_create(&props_ptr, "WM_OT_open_mainfile");
RNA_string_set(&props_ptr, "path", path); RNA_string_set(&props_ptr, "filepath", path);
WM_operator_name_call(C, "WM_OT_open_mainfile", WM_OP_EXEC_DEFAULT, &props_ptr); WM_operator_name_call(C, "WM_OT_open_mainfile", WM_OP_EXEC_DEFAULT, &props_ptr);
WM_operator_properties_free(&props_ptr); WM_operator_properties_free(&props_ptr);