writefile: avoid adding SDNA to every undo step
authorCampbell Barton <ideasman42@gmail.com>
Wed, 6 Jul 2016 12:23:50 +0000 (22:23 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 6 Jul 2016 13:07:37 +0000 (23:07 +1000)
commita0793765ef229b0d93bb9216b57faeb5940c5986
tree986febb1a84980d9ae2bda092901859dd5385fe4
parent94e84f5be41de0f5b222f091e97f9fd0ad959460
writefile: avoid adding SDNA to every undo step

Since SDNA was allocated for each undo step,
the new address meant it was considered different and included again.

Add an option not to duplicate the DNA string when calling DNA_sdna_from_data,
as well as avoiding a redundant copy, it writes the same address each time.
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/makesdna/DNA_genfile.h
source/blender/makesdna/DNA_sdna_types.h
source/blender/makesdna/intern/dna_genfile.c
source/blender/makesrna/intern/rna_define.c