[Bf-blender-cvs] [e266d9d2b56] hair_guides: Serialization for groom internals.

Lukas Tönne noreply at git.blender.org
Tue Dec 19 13:56:06 CET 2017


Commit: e266d9d2b566554e84794bb778ba9768b05b703e
Author: Lukas Tönne
Date:   Tue Dec 19 11:46:38 2017 +0000
Branches: hair_guides
https://developer.blender.org/rBe266d9d2b566554e84794bb778ba9768b05b703e

Serialization for groom internals.

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

M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/writefile.c

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

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index f5d2ece52b8..dab6962fced 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -8392,7 +8392,18 @@ static void lib_link_grooms(FileData *fd, Main *bmain)
 
 static void direct_link_groom(FileData *fd, Groom *groom, const Main *main)
 {
-	UNUSED_VARS(fd, groom, main);
+	groom->adt= newdataadr(fd, groom->adt);
+	direct_link_animdata(fd, groom->adt);
+	
+	link_list(fd, &groom->bundles);
+	for (GroomBundle *bundle = groom->bundles.first; bundle; bundle->next)
+	{
+		link_list(fd, &bundle->sections);
+	}
+	
+	groom->bb = NULL;
+	
+	groom->edit_groom = NULL;
 }
 
 /* ************** GENERAL & MAIN ******************** */
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 88326aa7ada..8ef3393d53b 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -3817,6 +3817,16 @@ static void write_workspace(WriteData *wd, WorkSpace *workspace)
 static void write_groom(WriteData *wd, Groom *groom)
 {
 	writestruct(wd, ID_GM, Groom, 1, groom);
+	write_iddata(wd, &groom->id);
+	if (groom->adt) {
+		write_animdata(wd, groom->adt);
+	}
+
+	writelist(wd, DATA, GroomBundle, &groom->bundles);
+	for (GroomBundle *bundle = groom->bundles.first; bundle; bundle = bundle->next)
+	{
+		writelist(wd, DATA, GroomBundleSection, &bundle->sections);
+	}
 }
 
 /* Keep it last of write_foodata functions. */



More information about the Bf-blender-cvs mailing list