Fix T55260: load Text File with Python from GUI Button results in 0 User

Let's just always ensure user_one when loading text from operator...
This commit is contained in:
Bastien Montagne 2018-06-04 12:46:59 +02:00
parent 44505b38df
commit 7277f8973b
Notes: blender-bot 2023-02-14 19:28:50 +01:00
Referenced by issue blender/blender-addons#55260, load Text File with Python from GUI Button results in 0 User
1 changed files with 2 additions and 2 deletions

View File

@ -247,15 +247,15 @@ static int text_open_exec(bContext *C, wmOperator *op)
/* hook into UI */
pprop = op->customdata;
id_us_ensure_real(&text->id);
if (pprop->prop) {
id_us_ensure_real(&text->id);
RNA_id_pointer_create(&text->id, &idptr);
RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr);
RNA_property_update(C, &pprop->ptr, pprop->prop);
}
else if (st) {
st->text = text;
id_us_ensure_real(&text->id);
st->left = 0;
st->top = 0;
st->scroll_accum[0] = 0.0f;