2.5: fix "repeat last", and display of operator properties
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 3 Jan 2009 20:03:39 +0000 (20:03 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 3 Jan 2009 20:03:39 +0000 (20:03 +0000)
in rna outliner.

source/blender/editors/space_outliner/outliner.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/windowmanager/intern/wm.c
source/blender/windowmanager/intern/wm_event_system.c

index 5d85c8622e5ba4ef086083b594eb5d40d9b2649a..97f54b40361604acdb0e3b37941576cf5b434e74 100644 (file)
@@ -4184,6 +4184,7 @@ static uiBut *outliner_draw_rnabut(uiBlock *block, PointerRNA *ptr, PropertyRNA
 
                        if(nameprop) {
                                text= RNA_property_string_get_alloc(&pptr, nameprop, textbuf, sizeof(textbuf));
+                               descr= (char*)RNA_property_ui_description(&pptr, prop);
                                but= uiDefIconTextBut(block, LABEL, 0, icon, text, x1, y1, x2, y2, NULL, 0, 0, 0, 0, descr);
                                if(text != textbuf)
                                        MEM_freeN(text);
index 8f8448759d274cc5191a26e5e326c09885cd5d4f..ba367310286d1869e29d7cbb2e6cb4037a24ca01 100644 (file)
@@ -875,7 +875,6 @@ static void rna_def_modifier_cast(BlenderRNA *brna)
        srna= RNA_def_struct(brna, "CastModifier", "Modifier");
        RNA_def_struct_ui_text(srna, "Cast Modifier", "Cast Modifier.");
        RNA_def_struct_sdna(srna, "CastModifierData");
-       RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update");
 
        prop= RNA_def_property(srna, "cast_type", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "type");
index 2008c3c1c6f2f90e20c6e81b2c92c4decc952df4..1533cc636db7566763b92e035d3da076c751ef2a 100644 (file)
@@ -80,12 +80,6 @@ void wm_operator_register(wmWindowManager *wm, wmOperator *op)
 {
        int tot;
 
-       if(op->ptr) {
-               op->properties= op->ptr->data;
-               MEM_freeN(op->ptr);
-               op->ptr= NULL;
-       }
-
        BLI_addtail(&wm->operators, op);
        tot= BLI_countlist(&wm->operators);
        
index 308887f71f39959841a02eb172931df28f2dfa6f..6cc29921bc60d84d2982a8192882d2b034b561e1 100644 (file)
@@ -367,11 +367,18 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P
                op->type= ot;
                BLI_strncpy(op->idname, ot->idname, OP_MAX_TYPENAME);
                
+               /* initialize properties, either copy or create */
                op->ptr= MEM_callocN(sizeof(PointerRNA), "wmOperatorPtrRNA");
-               if(properties && properties->data)
-                       op->ptr->data= IDP_CopyProperty(properties->data);
-               RNA_pointer_create(&RNA_WindowManager, &wm->id, ot->srna, op->ptr->data, op->ptr);
+               if(properties && properties->data) {
+                       op->properties= IDP_CopyProperty(properties->data);
+               }
+               else {
+                       IDPropertyTemplate val = {0};
+                       op->properties= IDP_New(IDP_GROUP, val, "wmOperatorProperties");
+               }
+               RNA_pointer_create(&RNA_WindowManager, &wm->id, ot->srna, op->properties, op->ptr);
 
+               /* initialize error reports */
                if (reports) {
                        op->reports= reports; /* must be initialized alredy */
                }