Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-08-13 18:42:45 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-13 18:42:45 +0400
commitf35efbc95af7bb85adeb19c451e492daf477683d (patch)
tree2477d6301022f832b5541556580c371511602e85
parentab56b4b5b9226698483e662c17241b1274898126 (diff)
- remove WM_operatortype_exists since its almost the same as WM_operatortype_find
- hopefully fix reported problem with MSVC.
-rw-r--r--source/blender/makesrna/intern/rna_access.c2
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c19
-rw-r--r--source/blender/makesrna/intern/rna_particle.c7
-rw-r--r--source/blender/makesrna/intern/rna_wm.c6
-rw-r--r--source/blender/python/intern/bpy_operator.c2
-rw-r--r--source/blender/python/intern/bpy_operator_wrap.c4
-rw-r--r--source/blender/windowmanager/WM_api.h1
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c20
8 files changed, 27 insertions, 34 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 8e7a2a8cab3..050f00b6a38 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -574,7 +574,7 @@ FunctionRNA *RNA_struct_find_function(PointerRNA *ptr, const char *identifier)
FunctionRNA *func;
StructRNA *type;
for(type= ptr->type; type; type= type->base) {
- func= BLI_findstring_ptr(&type->functions, identifier, offsetof(FunctionRNA, identifier));
+ func= (FunctionRNA *)BLI_findstring_ptr(&type->functions, identifier, offsetof(FunctionRNA, identifier));
if(func) {
return func;
}
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index cdab225f09c..b6563ec067d 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -57,22 +57,29 @@ static void rna_Mesh_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
{
ID *id= ptr->id.data;
- DAG_id_flush_update(id, OB_RECALC_DATA);
- WM_main_add_notifier(NC_GEOM|ND_DATA, id);
+ /* cheating way for importers to avoid slow updates */
+ if(id->us > 0) {
+ DAG_id_flush_update(id, OB_RECALC_DATA);
+ WM_main_add_notifier(NC_GEOM|ND_DATA, id);
+ }
}
static void rna_Mesh_update_select(Main *bmain, Scene *scene, PointerRNA *ptr)
{
ID *id= ptr->id.data;
-
- WM_main_add_notifier(NC_GEOM|ND_SELECT, id);
+ /* cheating way for importers to avoid slow updates */
+ if(id->us > 0) {
+ WM_main_add_notifier(NC_GEOM|ND_SELECT, id);
+ }
}
void rna_Mesh_update_draw(Main *bmain, Scene *scene, PointerRNA *ptr)
{
ID *id= ptr->id.data;
-
- WM_main_add_notifier(NC_GEOM|ND_DATA, id);
+ /* cheating way for importers to avoid slow updates */
+ if(id->us > 0) {
+ WM_main_add_notifier(NC_GEOM|ND_DATA, id);
+ }
}
static void rna_MeshVertex_normal_get(PointerRNA *ptr, float *value)
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 700b817f7ce..1ed3adb24b3 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -1059,13 +1059,14 @@ static void rna_def_particle_settings(BlenderRNA *brna)
};
//TODO: names, tooltips
+#if 0
static EnumPropertyItem rot_from_items[] = {
{PART_ROT_KEYS, "KEYS", 0, "keys", ""},
{PART_ROT_ZINCR, "ZINCR", 0, "zincr", ""},
{PART_ROT_IINCR, "IINCR", 0, "iincr", ""},
{0, NULL, 0, NULL, NULL}
};
-
+#endif
static EnumPropertyItem integrator_type_items[] = {
{PART_INT_EULER, "EULER", 0, "Euler", ""},
{PART_INT_VERLET, "VERLET", 0, "Verlet", ""},
@@ -1433,11 +1434,13 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Particle_redo");
- //TODO: is this read only/internal?
+ // not used anywhere, why is this in DNA???
+#if 0
prop= RNA_def_property(srna, "rotate_from", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rotfrom");
RNA_def_property_enum_items(prop, rot_from_items);
RNA_def_property_ui_text(prop, "Rotate From", "");
+#endif
prop= RNA_def_property(srna, "integrator", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, integrator_type_items);
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index eeac6813f78..7bf2db486c4 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -361,7 +361,7 @@ static PointerRNA rna_Operator_properties_get(PointerRNA *ptr)
static PointerRNA rna_OperatorTypeMacro_properties_get(PointerRNA *ptr)
{
wmOperatorTypeMacro *otmacro= (wmOperatorTypeMacro*)ptr->data;
- wmOperatorType *ot = WM_operatortype_exists(otmacro->idname);
+ wmOperatorType *ot = WM_operatortype_find(otmacro->idname, TRUE);
return rna_pointer_inherit_refine(ptr, ot->srna, otmacro->properties);
}
@@ -796,7 +796,7 @@ static StructRNA *rna_Operator_register(const bContext *C, ReportList *reports,
/* check if we have registered this operator type before, and remove it */
{
- wmOperatorType *ot= WM_operatortype_exists(dummyot.idname);
+ wmOperatorType *ot= WM_operatortype_find(dummyot.idname, TRUE);
if(ot && ot->ext.srna)
rna_Operator_unregister(C, ot->ext.srna);
}
@@ -865,7 +865,7 @@ static StructRNA *rna_MacroOperator_register(const bContext *C, ReportList *repo
/* check if we have registered this operator type before, and remove it */
{
- wmOperatorType *ot= WM_operatortype_exists(dummyot.idname);
+ wmOperatorType *ot= WM_operatortype_find(dummyot.idname, TRUE);
if(ot && ot->ext.srna)
rna_Operator_unregister(C, ot->ext.srna);
}
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c
index 0e54f158ac4..d92044b027e 100644
--- a/source/blender/python/intern/bpy_operator.c
+++ b/source/blender/python/intern/bpy_operator.c
@@ -63,7 +63,7 @@ static PyObject *pyop_call( PyObject * self, PyObject * args)
if (!PyArg_ParseTuple(args, "sO|O!s:_bpy.ops.call", &opname, &context_dict, &PyDict_Type, &kw, &context_str))
return NULL;
- ot= WM_operatortype_exists(opname);
+ ot= WM_operatortype_find(opname, TRUE);
if (ot == NULL) {
PyErr_Format( PyExc_SystemError, "Calling operator \"bpy.ops.%s\" error, could not be found", opname);
diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c
index 0c1eafb4948..1e521aea438 100644
--- a/source/blender/python/intern/bpy_operator_wrap.c
+++ b/source/blender/python/intern/bpy_operator_wrap.c
@@ -105,7 +105,7 @@ PyObject *PYOP_wrap_macro_define(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "Os:_bpy.ops.macro_define", &macro, &opname))
return NULL;
- if (WM_operatortype_exists(opname) == NULL) {
+ if (WM_operatortype_find(opname, TRUE) == NULL) {
PyErr_Format(PyExc_ValueError, "Macro Define: '%s' is not a valid operator id", opname);
return NULL;
}
@@ -114,7 +114,7 @@ PyObject *PYOP_wrap_macro_define(PyObject *self, PyObject *args)
srna= srna_from_self(macro, "Macro Define:");
macroname = RNA_struct_identifier(srna);
- ot = WM_operatortype_exists(macroname);
+ ot = WM_operatortype_find(macroname, TRUE);
if (!ot) {
PyErr_Format(PyExc_ValueError, "Macro Define: '%s' is not a valid macro or hasn't been registered yet", macroname);
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 46d42b300bf..c562d7a0aeb 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -201,7 +201,6 @@ void WM_operator_free (struct wmOperator *op);
void WM_operator_stack_clear(struct bContext *C);
struct wmOperatorType *WM_operatortype_find(const char *idnamem, int quiet);
-struct wmOperatorType *WM_operatortype_exists(const char *idname);
struct wmOperatorType *WM_operatortype_first(void);
void WM_operatortype_append (void (*opfunc)(struct wmOperatorType*));
void WM_operatortype_append_ptr (void (*opfunc)(struct wmOperatorType*, void *), void *userdata);
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 23994905b96..414db3a1bc9 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -105,7 +105,7 @@ wmOperatorType *WM_operatortype_find(const char *idname, int quiet)
WM_operator_bl_idname(idname_bl, idname);
if (idname_bl[0]) {
- ot= BLI_findstring_ptr(&global_ops, idname_bl, offsetof(wmOperatorType, idname));
+ ot= (wmOperatorType *)BLI_findstring_ptr(&global_ops, idname_bl, offsetof(wmOperatorType, idname));
if(ot) {
return ot;
}
@@ -117,22 +117,6 @@ wmOperatorType *WM_operatortype_find(const char *idname, int quiet)
return NULL;
}
-wmOperatorType *WM_operatortype_exists(const char *idname)
-{
- wmOperatorType *ot;
-
- char idname_bl[OP_MAX_TYPENAME]; // XXX, needed to support python style names without the _OT_ syntax
- WM_operator_bl_idname(idname_bl, idname);
-
- if(idname_bl[0]) {
- for(ot= global_ops.first; ot; ot= ot->next) {
- if(strncmp(ot->idname, idname_bl, OP_MAX_TYPENAME)==0)
- return ot;
- }
- }
- return NULL;
-}
-
wmOperatorType *WM_operatortype_first(void)
{
return global_ops.first;
@@ -333,7 +317,7 @@ wmOperatorType *WM_operatortype_append_macro(char *idname, char *name, int flag)
{
wmOperatorType *ot;
- if(WM_operatortype_exists(idname)) {
+ if(WM_operatortype_find(idname, TRUE)) {
printf("Macro error: operator %s exists\n", idname);
return NULL;
}