[Bf-blender-cvs] [f3c6cc9] asset-engine: Fix nasty bug preventing any navigation in directories!

Bastien Montagne noreply at git.blender.org
Sun Mar 15 20:36:27 CET 2015


Commit: f3c6cc9f32813ea173ac466beb627aaccdf14481
Author: Bastien Montagne
Date:   Sun Mar 15 20:34:42 2015 +0100
Branches: asset-engine
https://developer.blender.org/rBf3c6cc9f32813ea173ac466beb627aaccdf14481

Fix nasty bug preventing any navigation in directories!

Think issue also exists in master code actually, where some op properties
could be left uninitialized in 'params_to_op' helper func... But it does not
backfire like that for sure.

===================================================================

M	release/scripts/startup/bl_operators/amber.py
M	source/blender/editors/space_file/file_ops.c
M	source/blender/editors/space_file/filelist.c

===================================================================

diff --git a/release/scripts/startup/bl_operators/amber.py b/release/scripts/startup/bl_operators/amber.py
index 16539b0..3848e1b 100644
--- a/release/scripts/startup/bl_operators/amber.py
+++ b/release/scripts/startup/bl_operators/amber.py
@@ -128,7 +128,9 @@ class AssetEngineAmber(AssetEngine):
         self.job_uuid = 1
 
     def __del__(self):
-        self.executor.shutdown(wait=False)
+        pass
+        # XXX This errors, saying self has no executor attribute... :/
+        #~ self.executor.shutdown(wait=False)
 
     def status(self, job_id):
         if job_id:
@@ -157,7 +159,7 @@ class AssetEngineAmber(AssetEngine):
 
     def list_dir(self, job_id, entries):
         job = self.jobs.get(job_id, None)
-        print(entries.root_path, job_id, job)
+        #~ print(entries.root_path, job_id, job)
         if job is not None and isinstance(job, AmberJobList):
             if job.root != entries.root_path:
                 self.jobs[job_id] = AmberJobList(self.executor, job_id, entries.root_path)
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 59263f8..95007df 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -921,6 +921,21 @@ static void file_sfile_to_operator(wmOperator *op, SpaceFile *sfile, char filepa
 			}
 		}
 	}
+	else {
+		/* We have to ensure those are properly reset!!! */
+		if ((prop = RNA_struct_find_property(op->ptr, "filename"))) {
+			RNA_property_reset(op->ptr, prop, 0);
+		}
+		if ((prop = RNA_struct_find_property(op->ptr, "filepath"))) {
+			RNA_property_reset(op->ptr, prop, 0);
+		}
+		if (prop_files) {
+			RNA_property_reset(op->ptr, prop, 0);
+		}
+		if (prop_dirs) {
+			RNA_property_reset(op->ptr, prop, 0);
+		}
+	}
 
 	if (!is_fake && ae && (prop = RNA_struct_find_property(op->ptr, "asset_engine"))) {
 		PointerRNA ptr;
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 33659a6..bc2e43d 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -1884,7 +1884,10 @@ static void filelist_readjob_update(void *flrjv)
 {
 	FileListReadJob *flrj = flrjv;
 
-	if (flrj->filelist->ae) {
+	if (flrj->filelist->force_reset) {
+		*flrj->stop = true;
+	}
+	else if (flrj->filelist->ae) {
 		/* We only communicate with asset engine from main thread! */
 		AssetEngine *ae = flrj->filelist->ae;
 		FileDirEntry *entry;




More information about the Bf-blender-cvs mailing list