2.5: fix "repeat last", and display of operator properties

in rna outliner.
This commit is contained in:
Brecht Van Lommel
2009-01-03 20:03:39 +00:00
parent 927adad8e2
commit 3f58b37683
4 changed files with 11 additions and 10 deletions

View 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);

View 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");

View 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);

View 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 */
}