Make the image open operator work even if there's no scene in context.
This commit is contained in:
@@ -649,7 +649,8 @@ static int open_exec(bContext *C, wmOperator *op)
|
||||
char str[FILE_MAX];
|
||||
|
||||
RNA_string_get(op->ptr, "path", str);
|
||||
ima= BKE_add_image_file(str, scene->r.cfra);
|
||||
/* default to frame 1 if there's no scene in context */
|
||||
ima= BKE_add_image_file(str, scene ? scene->r.cfra : 1);
|
||||
|
||||
if(!ima) {
|
||||
if(op->customdata) MEM_freeN(op->customdata);
|
||||
|
||||
Reference in New Issue
Block a user