USD import: fix prim_path_mask storage.
Now accessing the prm_path_mask string property as an allocated string, as the string is of arbitrary length.
This commit is contained in:
parent
27eea5e69e
commit
edc59cefb6
|
@ -1119,8 +1119,7 @@ static int wm_usd_import_exec(bContext *C, wmOperator *op)
|
|||
|
||||
const bool create_collection = RNA_boolean_get(op->ptr, "create_collection");
|
||||
|
||||
char prim_path_mask[1024];
|
||||
RNA_string_get(op->ptr, "prim_path_mask", prim_path_mask);
|
||||
char *prim_path_mask = RNA_string_get_alloc(op->ptr, "prim_path_mask", NULL, 0, NULL);
|
||||
|
||||
const bool import_guide = RNA_boolean_get(op->ptr, "import_guide");
|
||||
const bool import_proxy = RNA_boolean_get(op->ptr, "import_proxy");
|
||||
|
@ -1198,8 +1197,6 @@ static int wm_usd_import_exec(bContext *C, wmOperator *op)
|
|||
.import_shapes = import_shapes,
|
||||
.import_defined_only = import_defined_only};
|
||||
|
||||
STRNCPY(params.prim_path_mask, prim_path_mask);
|
||||
|
||||
const bool ok = USD_import(C, filename, ¶ms, as_background_job);
|
||||
|
||||
return as_background_job || ok ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
|
||||
|
|
|
@ -648,6 +648,8 @@ static void import_endjob(void *customdata)
|
|||
break;
|
||||
}
|
||||
|
||||
MEM_freeN(data->params.prim_path_mask);
|
||||
|
||||
WM_main_add_notifier(NC_SCENE | ND_FRAME, data->scene);
|
||||
report_job_duration(data);
|
||||
}
|
||||
|
|
|
@ -167,7 +167,7 @@ struct USDImportParams {
|
|||
bool import_blendshapes;
|
||||
bool import_volumes;
|
||||
bool import_skeletons;
|
||||
char prim_path_mask[1024];
|
||||
char *prim_path_mask;
|
||||
bool import_subdiv;
|
||||
bool import_instance_proxies;
|
||||
bool create_collection;
|
||||
|
|
Loading…
Reference in New Issue