misc small changes:

- rename rna collection structs Main prefix to BlendData: eg, MainObjects --> BlendDataObjects
- printing python collection now prints its type (when available)
- renamed shadowed vars in bpy_rna.c.
- when making functions static I also made debugging/test functions static, reverse and add definitions to headers instead.
This commit is contained in:
Campbell Barton 2011-02-14 03:15:55 +00:00
parent 35abb674b2
commit 8ea0b4685c
13 changed files with 114 additions and 102 deletions

@ -227,6 +227,7 @@ if(UNIX AND NOT APPLE)
# find_package(PythonLibs)
set(PYTHON /usr)
set(PYTHON_VERSION 3.1 CACHE STRING "")
mark_as_advanced(PYTHON_VERSION)
set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
mark_as_advanced(PYTHON_INCLUDE_DIRS)
# set(PYTHON_BINARY python) # not used yet

@ -109,5 +109,8 @@ void brush_set_unprojected_radius(struct Brush *brush, float value);
float brush_alpha(struct Brush *brush);
void brush_set_alpha(struct Brush *brush, float value);
/* debugging only */
void brush_debug_print_state(struct Brush *br);
#endif

@ -227,7 +227,7 @@ void make_local_brush(Brush *brush)
}
}
static void brush_debug_print_state(Brush *br)
void brush_debug_print_state(Brush *br)
{
/* create a fake brush and set it to the defaults */
Brush def= {{NULL}};

@ -269,7 +269,7 @@ TimeMarker *ED_markers_get_first_selected(ListBase *markers)
/* Print debugging prints of list of markers
* BSI's: do NOT make static or put in if-defs as "unused code". That's too much trouble when we need to use for quick debuggging!
*/
static void debug_markers_print_list(ListBase *markers)
void debug_markers_print_list(ListBase *markers)
{
TimeMarker *marker;

@ -64,6 +64,8 @@ void ED_operatortypes_marker(void);
/* called in screen_ops.c:ED_keymap_screen() */
void ED_marker_keymap(struct wmKeyConfig *keyconf);
/* debugging only */
void debug_markers_print_list(struct ListBase *markers);
#endif /* ED_MARKERS_H */

@ -2776,7 +2776,7 @@ int view_autodist_depth_segment(struct ARegion *ar, short mval_sta[2], short mva
// speed and os, i changed the scaling values, but
// those are still not ok
#if 0
static float ndof_axis_scale[6] = {
+0.01, // Tx
+0.01, // Tz
@ -2799,7 +2799,6 @@ static void filterNDOFvalues(float *sbval)
sbval[i]=0.0;
}
#if 0
// statics for controlling rv3d->dist corrections.
// viewmoveNDOF zeros and adjusts rv3d->ofs.
// viewmove restores based on dz_flag state.

@ -350,31 +350,31 @@ typedef struct ExtensionRNA {
/* fake struct definitions, needed otherwise collections end up owning the C
* structs like 'Object' when defined first */
#define MainActions Main
#define MainArmatures Main
#define MainBrushes Main
#define MainCameras Main
#define MainCurves Main
#define MainFonts Main
#define MainGreasePencils Main
#define MainGroups Main
#define MainImages Main
#define MainLamps Main
#define MainLattices Main
#define MainLibraries Main
#define MainMaterials Main
#define MainMeshes Main
#define MainMetaBalls Main
#define MainNodeTrees Main
#define MainObjects Main
#define MainParticles Main
#define MainScenes Main
#define MainScreens Main
#define MainSounds Main
#define MainTexts Main
#define MainTextures Main
#define MainWindowManagers Main
#define MainWorlds Main
#define BlendDataActions Main
#define BlendDataArmatures Main
#define BlendDataBrushes Main
#define BlendDataCameras Main
#define BlendDataCurves Main
#define BlendDataFonts Main
#define BlendDataGreasePencils Main
#define BlendDataGroups Main
#define BlendDataImages Main
#define BlendDataLamps Main
#define BlendDataLattices Main
#define BlendDataLibraries Main
#define BlendDataMaterials Main
#define BlendDataMeshes Main
#define BlendDataMetaBalls Main
#define BlendDataNodeTrees Main
#define BlendDataObjects Main
#define BlendDataParticles Main
#define BlendDataScenes Main
#define BlendDataScreens Main
#define BlendDataSounds Main
#define BlendDataTexts Main
#define BlendDataTextures Main
#define BlendDataWindowManagers Main
#define BlendDataWorlds Main
#ifdef __cplusplus
}

@ -530,8 +530,8 @@ void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainCameras");
srna= RNA_def_struct(brna, "MainCameras", NULL);
RNA_def_property_srna(cprop, "BlendDataCameras");
srna= RNA_def_struct(brna, "BlendDataCameras", NULL);
RNA_def_struct_ui_text(srna, "Main Cameras", "Collection of cameras");
func= RNA_def_function(srna, "new", "rna_Main_cameras_new");
@ -559,8 +559,8 @@ void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainScenes");
srna= RNA_def_struct(brna, "MainScenes", NULL);
RNA_def_property_srna(cprop, "BlendDataScenes");
srna= RNA_def_struct(brna, "BlendDataScenes", NULL);
RNA_def_struct_ui_text(srna, "Main Scenes", "Collection of scenes");
func= RNA_def_function(srna, "new", "rna_Main_scenes_new");
@ -584,8 +584,8 @@ void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainObjects");
srna= RNA_def_struct(brna, "MainObjects", NULL);
RNA_def_property_srna(cprop, "BlendDataObjects");
srna= RNA_def_struct(brna, "BlendDataObjects", NULL);
RNA_def_struct_ui_text(srna, "Main Objects", "Collection of objects");
func= RNA_def_function(srna, "new", "rna_Main_objects_new");
@ -617,8 +617,8 @@ void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainMaterials");
srna= RNA_def_struct(brna, "MainMaterials", NULL);
RNA_def_property_srna(cprop, "BlendDataMaterials");
srna= RNA_def_struct(brna, "BlendDataMaterials", NULL);
RNA_def_struct_ui_text(srna, "Main Material", "Collection of materials");
func= RNA_def_function(srna, "new", "rna_Main_materials_new");
@ -651,8 +651,8 @@ void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop)
{2, "TEXTURE", 0, "Texture", ""},
{0, NULL, 0, NULL, NULL}};
RNA_def_property_srna(cprop, "MainNodeTrees");
srna= RNA_def_struct(brna, "MainNodeTrees", NULL);
RNA_def_property_srna(cprop, "BlendDataNodeTrees");
srna= RNA_def_struct(brna, "BlendDataNodeTrees", NULL);
RNA_def_struct_ui_text(srna, "Main Node Trees", "Collection of node trees");
func= RNA_def_function(srna, "new", "rna_Main_nodetree_new");
@ -681,8 +681,8 @@ void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainMeshes");
srna= RNA_def_struct(brna, "MainMeshes", NULL);
RNA_def_property_srna(cprop, "BlendDataMeshes");
srna= RNA_def_struct(brna, "BlendDataMeshes", NULL);
RNA_def_struct_ui_text(srna, "Main Meshes", "Collection of meshes");
func= RNA_def_function(srna, "new", "rna_Main_meshes_new");
@ -709,8 +709,8 @@ void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainLamps");
srna= RNA_def_struct(brna, "MainLamps", NULL);
RNA_def_property_srna(cprop, "BlendDataLamps");
srna= RNA_def_struct(brna, "BlendDataLamps", NULL);
RNA_def_struct_ui_text(srna, "Main Lamps", "Collection of lamps");
func= RNA_def_function(srna, "new", "rna_Main_lamps_new");
@ -740,8 +740,8 @@ void RNA_def_main_libraries(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainLibraries");
srna= RNA_def_struct(brna, "MainLibraries", NULL);
RNA_def_property_srna(cprop, "BlendDataLibraries");
srna= RNA_def_struct(brna, "BlendDataLibraries", NULL);
RNA_def_struct_ui_text(srna, "Main Libraries", "Collection of libraries");
func= RNA_def_function(srna, "tag", "rna_Main_libraries_tag");
@ -755,8 +755,8 @@ void RNA_def_main_screens(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainScreens");
srna= RNA_def_struct(brna, "MainScreens", NULL);
RNA_def_property_srna(cprop, "BlendDataScreens");
srna= RNA_def_struct(brna, "BlendDataScreens", NULL);
RNA_def_struct_ui_text(srna, "Main Screens", "Collection of screens");
func= RNA_def_function(srna, "tag", "rna_Main_screens_tag");
@ -770,8 +770,8 @@ void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainWindowManagers");
srna= RNA_def_struct(brna, "MainWindowManagers", NULL);
RNA_def_property_srna(cprop, "BlendDataWindowManagers");
srna= RNA_def_struct(brna, "BlendDataWindowManagers", NULL);
RNA_def_struct_ui_text(srna, "Main Window Managers", "Collection of window managers");
func= RNA_def_function(srna, "tag", "rna_Main_window_managers_tag");
@ -784,8 +784,8 @@ void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainImages");
srna= RNA_def_struct(brna, "MainImages", NULL);
RNA_def_property_srna(cprop, "BlendDataImages");
srna= RNA_def_struct(brna, "BlendDataImages", NULL);
RNA_def_struct_ui_text(srna, "Main Images", "Collection of images");
func= RNA_def_function(srna, "new", "rna_Main_images_new");
@ -828,8 +828,8 @@ void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainLattices");
srna= RNA_def_struct(brna, "MainLattices", NULL);
RNA_def_property_srna(cprop, "BlendDataLattices");
srna= RNA_def_struct(brna, "BlendDataLattices", NULL);
RNA_def_struct_ui_text(srna, "Main Lattices", "Collection of lattices");
func= RNA_def_function(srna, "new", "rna_Main_lattices_new");
@ -856,8 +856,8 @@ void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainCurves");
srna= RNA_def_struct(brna, "MainCurves", NULL);
RNA_def_property_srna(cprop, "BlendDataCurves");
srna= RNA_def_struct(brna, "BlendDataCurves", NULL);
RNA_def_struct_ui_text(srna, "Main Curves", "Collection of curves");
func= RNA_def_function(srna, "new", "rna_Main_curves_new");
@ -886,8 +886,8 @@ void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainMetaBalls");
srna= RNA_def_struct(brna, "MainMetaBalls", NULL);
RNA_def_property_srna(cprop, "BlendDataMetaBalls");
srna= RNA_def_struct(brna, "BlendDataMetaBalls", NULL);
RNA_def_struct_ui_text(srna, "Main MetaBall", "Collection of metaballs");
func= RNA_def_function(srna, "new", "rna_Main_metaballs_new");
@ -914,8 +914,8 @@ void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainFonts");
srna= RNA_def_struct(brna, "MainFonts", NULL);
RNA_def_property_srna(cprop, "BlendDataFonts");
srna= RNA_def_struct(brna, "BlendDataFonts", NULL);
RNA_def_struct_ui_text(srna, "Main Fonts", "Collection of fonts");
func= RNA_def_function(srna, "load", "rna_Main_fonts_load");
@ -943,8 +943,8 @@ void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainTextures");
srna= RNA_def_struct(brna, "MainTextures", NULL);
RNA_def_property_srna(cprop, "BlendDataTextures");
srna= RNA_def_struct(brna, "BlendDataTextures", NULL);
RNA_def_struct_ui_text(srna, "Main Textures", "Collection of groups");
func= RNA_def_function(srna, "new", "rna_Main_textures_new");
@ -973,8 +973,8 @@ void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainBrushes");
srna= RNA_def_struct(brna, "MainBrushes", NULL);
RNA_def_property_srna(cprop, "BlendDataBrushes");
srna= RNA_def_struct(brna, "BlendDataBrushes", NULL);
RNA_def_struct_ui_text(srna, "Main Brushes", "Collection of brushes");
func= RNA_def_function(srna, "new", "rna_Main_brushes_new");
@ -1002,8 +1002,8 @@ void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainWorlds");
srna= RNA_def_struct(brna, "MainWorlds", NULL);
RNA_def_property_srna(cprop, "BlendDataWorlds");
srna= RNA_def_struct(brna, "BlendDataWorlds", NULL);
RNA_def_struct_ui_text(srna, "Main Worlds", "Collection of worlds");
func= RNA_def_function(srna, "new", "rna_Main_worlds_new");
@ -1031,8 +1031,8 @@ void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainGroups");
srna= RNA_def_struct(brna, "MainGroups", NULL);
RNA_def_property_srna(cprop, "BlendDataGroups");
srna= RNA_def_struct(brna, "BlendDataGroups", NULL);
RNA_def_struct_ui_text(srna, "Main Groups", "Collection of groups");
func= RNA_def_function(srna, "new", "rna_Main_groups_new");
@ -1059,8 +1059,8 @@ void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainTexts");
srna= RNA_def_struct(brna, "MainTexts", NULL);
RNA_def_property_srna(cprop, "BlendDataTexts");
srna= RNA_def_struct(brna, "BlendDataTexts", NULL);
RNA_def_struct_ui_text(srna, "Main Texts", "Collection of texts");
func= RNA_def_function(srna, "new", "rna_Main_texts_new");
@ -1098,8 +1098,8 @@ void RNA_def_main_sounds(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainSounds");
srna= RNA_def_struct(brna, "MainSounds", NULL);
RNA_def_property_srna(cprop, "BlendDataSounds");
srna= RNA_def_struct(brna, "BlendDataSounds", NULL);
RNA_def_struct_ui_text(srna, "Main Sounds", "Collection of sounds");
/* TODO, 'load' */
@ -1115,8 +1115,8 @@ void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainArmatures");
srna= RNA_def_struct(brna, "MainArmatures", NULL);
RNA_def_property_srna(cprop, "BlendDataArmatures");
srna= RNA_def_struct(brna, "BlendDataArmatures", NULL);
RNA_def_struct_ui_text(srna, "Main Armatures", "Collection of armatures");
func= RNA_def_function(srna, "new", "rna_Main_armatures_new");
@ -1143,8 +1143,8 @@ void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainActions");
srna= RNA_def_struct(brna, "MainActions", NULL);
RNA_def_property_srna(cprop, "BlendDataActions");
srna= RNA_def_struct(brna, "BlendDataActions", NULL);
RNA_def_struct_ui_text(srna, "Main Actions", "Collection of actions");
func= RNA_def_function(srna, "new", "rna_Main_actions_new");
@ -1171,8 +1171,8 @@ void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainParticles");
srna= RNA_def_struct(brna, "MainParticles", NULL);
RNA_def_property_srna(cprop, "BlendDataParticles");
srna= RNA_def_struct(brna, "BlendDataParticles", NULL);
RNA_def_struct_ui_text(srna, "Main Particle Settings", "Collection of particle settings");
func= RNA_def_function(srna, "new", "rna_Main_particles_new");
@ -1200,8 +1200,8 @@ void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA *func;
PropertyRNA *parm;
RNA_def_property_srna(cprop, "MainGreasePencils");
srna= RNA_def_struct(brna, "MainGreasePencils", NULL);
RNA_def_property_srna(cprop, "BlendDataGreasePencils");
srna= RNA_def_struct(brna, "BlendDataGreasePencils", NULL);
RNA_def_struct_ui_text(srna, "Main Grease Pencils", "Collection of grease pencils");
func= RNA_def_function(srna, "tag", "rna_Main_gpencil_tag");

@ -595,6 +595,12 @@ static PyObject *pyrna_prop_str( BPy_PropertyRNA *self )
return ret;
}
}
if(RNA_property_type(self->prop) == PROP_COLLECTION) {
PointerRNA r_ptr;
if(RNA_property_collection_type_get(&self->ptr, self->prop, &r_ptr)) {
return PyUnicode_FromFormat( "<bpy_%.200s, %.200s>", type_fmt, RNA_struct_identifier(r_ptr.type));
}
}
return PyUnicode_FromFormat( "<bpy_%.200s, %.200s.%.200s>", type_fmt, RNA_struct_identifier(self->ptr.type), RNA_property_identifier(self->prop));
}
@ -802,14 +808,14 @@ static PyObject *pyrna_enum_to_py(PointerRNA *ptr, PropertyRNA *prop, int val)
if (RNA_property_enum_identifier(BPy_GetContext(), ptr, prop, val, &identifier)) {
ret = PyUnicode_FromString(identifier);
} else {
EnumPropertyItem *item;
EnumPropertyItem *enum_item;
int free= FALSE;
/* don't throw error here, can't trust blender 100% to give the
* right values, python code should not generate error for that */
RNA_property_enum_items(BPy_GetContext(), ptr, prop, &item, NULL, &free);
if(item && item->identifier) {
ret= PyUnicode_FromString(item->identifier);
RNA_property_enum_items(BPy_GetContext(), ptr, prop, &enum_item, NULL, &free);
if(enum_item && enum_item->identifier) {
ret= PyUnicode_FromString(enum_item->identifier);
}
else {
const char *ptr_name= RNA_struct_name_get_alloc(ptr, NULL, FALSE);
@ -830,7 +836,7 @@ static PyObject *pyrna_enum_to_py(PointerRNA *ptr, PropertyRNA *prop, int val)
}
if(free)
MEM_freeN(item);
MEM_freeN(enum_item);
/*PyErr_Format(PyExc_AttributeError, "RNA Error: Current value \"%d\" matches no enum", val);
ret = NULL;*/
@ -1145,7 +1151,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
{
PyObject *value_new= NULL;
StructRNA *ptype= RNA_property_pointer_type(ptr, prop);
StructRNA *ptr_type= RNA_property_pointer_type(ptr, prop);
int flag = RNA_property_flag(prop);
/* this is really nasty!, so we can fake the operator having direct properties eg:
@ -1159,7 +1165,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
* this is so bad that its almost a good reason to do away with fake 'self.properties -> self' class mixing
* if this causes problems in the future it should be removed.
*/
if( (ptype == &RNA_AnyType) &&
if( (ptr_type == &RNA_AnyType) &&
(BPy_StructRNA_Check(value)) &&
(RNA_struct_is_a(((BPy_StructRNA *)value)->ptr.type, &RNA_Operator))
) {
@ -1169,7 +1175,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
/* if property is an OperatorProperties pointer and value is a map, forward back to pyrna_pydict_to_props */
if (RNA_struct_is_a(ptype, &RNA_OperatorProperties) && PyDict_Check(value)) {
if (RNA_struct_is_a(ptr_type, &RNA_OperatorProperties) && PyDict_Check(value)) {
PointerRNA opptr = RNA_property_pointer_get(ptr, prop);
return pyrna_pydict_to_props(&opptr, value, 0, error_prefix);
}
@ -1183,16 +1189,16 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
value_new= value;
}
else {
PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s collection has no type, cant be used as a %.200s type", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), RNA_struct_identifier(ptype));
PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s collection has no type, cant be used as a %.200s type", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), RNA_struct_identifier(ptr_type));
return -1;
}
}
if(!BPy_StructRNA_Check(value) && value != Py_None) {
PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s expected a %.200s type", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), RNA_struct_identifier(ptype));
PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s expected a %.200s type", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), RNA_struct_identifier(ptr_type));
Py_XDECREF(value_new); return -1;
} else if((flag & PROP_NEVER_NULL) && value == Py_None) {
PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s does not support a 'None' assignment %.200s type", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), RNA_struct_identifier(ptype));
PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s does not support a 'None' assignment %.200s type", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), RNA_struct_identifier(ptr_type));
Py_XDECREF(value_new); return -1;
} else if(value != Py_None && ((flag & PROP_ID_SELF_CHECK) && ptr->id.data == ((BPy_StructRNA*)value)->ptr.id.data)) {
PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s ID type does not support assignment to its self", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop));
@ -1211,7 +1217,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
else if(value == Py_None) {
*((void**)data)= NULL;
}
else if(RNA_struct_is_a(param->ptr.type, ptype)) {
else if(RNA_struct_is_a(param->ptr.type, ptr_type)) {
*((void**)data)= param->ptr.data;
}
else {
@ -1224,12 +1230,12 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
PointerRNA valueptr= {{NULL}};
RNA_property_pointer_set(ptr, prop, valueptr);
}
else if(RNA_struct_is_a(param->ptr.type, ptype)) {
else if(RNA_struct_is_a(param->ptr.type, ptr_type)) {
RNA_property_pointer_set(ptr, prop, param->ptr);
}
else {
PointerRNA tmp;
RNA_pointer_create(NULL, ptype, NULL, &tmp);
RNA_pointer_create(NULL, ptr_type, NULL, &tmp);
PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s expected a %.200s type", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), RNA_struct_identifier(tmp.type));
Py_XDECREF(value_new); return -1;
}
@ -1237,7 +1243,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
if(raise_error) {
PointerRNA tmp;
RNA_pointer_create(NULL, ptype, NULL, &tmp);
RNA_pointer_create(NULL, ptr_type, NULL, &tmp);
PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s expected a %.200s type", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), RNA_struct_identifier(tmp.type));
Py_XDECREF(value_new); return -1;
}
@ -3829,21 +3835,21 @@ static PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *dat
case PROP_POINTER:
{
PointerRNA newptr;
StructRNA *type= RNA_property_pointer_type(ptr, prop);
StructRNA *ptype= RNA_property_pointer_type(ptr, prop);
if(flag & PROP_RNAPTR) {
/* in this case we get the full ptr */
newptr= *(PointerRNA*)data;
}
else {
if(RNA_struct_is_ID(type)) {
if(RNA_struct_is_ID(ptype)) {
RNA_id_pointer_create(*(void**)data, &newptr);
} else {
/* note: this is taken from the function's ID pointer
* and will break if a function returns a pointer from
* another ID block, watch this! - it should at least be
* easy to debug since they are all ID's */
RNA_pointer_create(ptr->id.data, type, *(void**)data, &newptr);
RNA_pointer_create(ptr->id.data, ptype, *(void**)data, &newptr);
}
}

@ -351,6 +351,9 @@ void WM_progress_clear(struct wmWindow *win);
void WM_toggle_console(struct bContext *C, short show);
#endif
/* debugging only, convenience function to write on crash */
int write_crash_blend(void);
#ifdef __cplusplus
}
#endif

@ -446,7 +446,7 @@ int WM_read_homefile_exec(bContext *C, wmOperator *op)
return WM_read_homefile(C, op->reports, from_memory) ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
}
void read_history(void)
void WM_read_history(void)
{
char name[FILE_MAX];
LinkNode *l, *lines;

@ -175,7 +175,7 @@ void WM_init(bContext *C, int argc, char **argv)
G.ndofdevice = -1; /* XXX bad initializer, needs set otherwise buttons show! */
read_history();
WM_read_history();
/* allow a path of "", this is what happens when making a new file */
/*

@ -28,9 +28,7 @@
#ifndef WM_FILES_H
#define WM_FILES_H
extern void read_history(void);
extern void delete_autosave(void);
extern void WM_read_history(void);
#endif /* WM_FILES_H */