@@ -199,7 +199,8 @@ PyObject *py_unreal_engine_import_asset(PyObject * self, PyObject * args) {
199199 PyObject * assetsObject = nullptr ;
200200 char *destination;
201201 PyObject *obj = nullptr ;
202- if (!PyArg_ParseTuple (args, " Os|O:import_asset" , &assetsObject, &destination, &obj)) {
202+ PyObject *py_sync = nullptr ;
203+ if (!PyArg_ParseTuple (args, " Os|OO:import_asset" , &assetsObject, &destination, &obj, &py_sync)) {
203204 return NULL ;
204205 }
205206
@@ -211,6 +212,7 @@ PyObject *py_unreal_engine_import_asset(PyObject * self, PyObject * args) {
211212
212213 UClass *factory_class = nullptr ;
213214 UFactory *factory = nullptr ;
215+ bool sync_to_browser = false ;
214216
215217 if (!obj || obj == Py_None) {
216218 factory_class = nullptr ;
@@ -279,13 +281,17 @@ PyObject *py_unreal_engine_import_asset(PyObject * self, PyObject * args) {
279281 char * filename = PyString_AsString (PyObject_Str (assetsObject));
280282#endif
281283 files.Add (UTF8_TO_TCHAR (filename));
282- }
284+ }
283285 else {
284286 return PyErr_Format (PyExc_Exception, " Not a string nor valid list of string" );
285287 }
286288
289+ if (py_sync && PyObject_IsTrue (py_sync)) {
290+ sync_to_browser = true ;
291+ }
292+
287293 FAssetToolsModule& AssetToolsModule = FModuleManager::LoadModuleChecked<FAssetToolsModule>(" AssetTools" );
288- TArray<UObject *> objects = AssetToolsModule.Get ().ImportAssets (files, UTF8_TO_TCHAR (destination), factory, false );
294+ TArray<UObject *> objects = AssetToolsModule.Get ().ImportAssets (files, UTF8_TO_TCHAR (destination), factory, sync_to_browser );
289295
290296 if (objects.Num () == 1 ) {
291297
0 commit comments