[Bf-blender-cvs] [606f8fb] compositor-2016: Fix T48487: Physics cache names allow (back)slashes, which breaks its handling.

Bastien Montagne noreply at git.blender.org
Wed Jun 8 21:49:40 CEST 2016


Commit: 606f8fbb91a85885e5b0705abd3dd9691cde3924
Author: Bastien Montagne
Date:   Mon May 23 17:45:44 2016 +0200
Branches: compositor-2016
https://developer.blender.org/rB606f8fbb91a85885e5b0705abd3dd9691cde3924

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