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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-07-19 18:57:20 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-07-19 18:57:20 +0400
commitb96a6e183863e5280a6e48a462593e8df72050ef (patch)
tree5ccdfc74ce002b169941004f7c1d5b7ef13de4bf /source
parentd9a7e5144f816bfa15687e5bd9d55e95f69c0269 (diff)
issues auto generating rna docs
- add a warning when an operator name is NULL, set it to a dummy name to prevent crash. POSE_OT_constraints_clear had its name commented (not sure why) - rna_Object_parent_type_itemf wasnt checking for context being NULL, needed for docs else it crashes. - bpy.ops.add/remove didnt show up in a dir(bpy.ops)
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/object/editconstraint.c2
-rw-r--r--source/blender/makesrna/intern/rna_object.c9
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c7
3 files changed, 15 insertions, 3 deletions
diff --git a/source/blender/editors/object/editconstraint.c b/source/blender/editors/object/editconstraint.c
index 6a88fb5ab51..477d04a818b 100644
--- a/source/blender/editors/object/editconstraint.c
+++ b/source/blender/editors/object/editconstraint.c
@@ -1011,7 +1011,7 @@ static int pose_constraints_clear_exec(bContext *C, wmOperator *op)
void POSE_OT_constraints_clear(wmOperatorType *ot)
{
/* identifiers */
- //ot->name = "Clear Constraints";
+ ot->name = "Clear Constraints";
ot->idname= "POSE_OT_constraints_clear";
ot->description= "Clear all the constraints for the selected bones.";
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 5ec25cfe4c2..05a60f3c0f9 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -184,13 +184,18 @@ static void rna_Object_track_set(PointerRNA *ptr, PointerRNA value)
static EnumPropertyItem *rna_Object_parent_type_itemf(bContext *C, PointerRNA *ptr, int *free)
{
Object *ob= (Object*)ptr->data;
- Object *par= ob->parent;
EnumPropertyItem *item= NULL;
int totitem= 0;
+ if(C==NULL) {
+ return parent_type_items;
+ }
+
RNA_enum_items_add_value(&item, &totitem, parent_type_items, PAROBJECT);
- if(par) {
+ if(ob->parent) {
+ Object *par= ob->parent;
+
if(par->type == OB_CURVE)
RNA_enum_items_add_value(&item, &totitem, parent_type_items, PARCURVE);
else if(par->type == OB_LATTICE)
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 9e8c5dc7ca0..5e60207f62d 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -130,6 +130,13 @@ void WM_operatortype_append(void (*opfunc)(wmOperatorType*))
ot= MEM_callocN(sizeof(wmOperatorType), "operatortype");
ot->srna= RNA_def_struct(&BLENDER_RNA, "", "OperatorProperties");
opfunc(ot);
+
+ if(ot->name==NULL) {
+ static char dummy_name[] = "Dummy Name";
+ fprintf(stderr, "ERROR: Operator %s has no name property!\n", ot->idname);
+ ot->name= dummy_name;
+ }
+
RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description:""); // XXX All ops should have a description but for now allow them not to.
RNA_def_struct_identifier(ot->srna, ot->idname);
BLI_addtail(&global_ops, ot);