[Bf-blender-cvs] [af4a04e] master: Fix T48487: Physics cache names allow (back)slashes, which breaks its handling.

Bastien Montagne noreply at git.blender.org
Mon May 23 17:50:49 CEST 2016


Commit: af4a04eae07184f7437a8c51858a4ddb8a2e3e4c
Author: Bastien Montagne
Date:   Mon May 23 17:45:44 2016 +0200
Branches: master
https://developer.blender.org/rBaf4a04eae07184f7437a8c51858a4ddb8a2e3e4c

Fix T48487: Physics cache names allow (back)slashes, which breaks its handling.

For now, just validate new pointcache names as if they were filnames.

Ideal solution would be rather to validate names in `ptcache_filename()`, but it would
likely break some existing caches - and we'd also have to ensure we still have
uniqueness of name after it has been cleaned up, wich would not be trivial at this stage.

So let's go for simple solution for now, especially since this part of code is to be
fully rewritten in 2.8...

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

M	source/blender/makesrna/intern/rna_object_force.c

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

diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index ed765f1..a8d8407 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -199,6 +199,8 @@ static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), P
 		}
 
 		if (use_new_name) {
+			BLI_filename_make_safe(cache->name);
+
 			if (pid2 && cache->flag & PTCACHE_DISK_CACHE) {
 				char old_name[80];
 				char new_name[80];




More information about the Bf-blender-cvs mailing list