Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenloader/intern/writefile.c')
-rw-r--r--source/blender/blenloader/intern/writefile.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 7f4e7fdc646..973fac1d13a 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -118,9 +118,11 @@
#include "DNA_controller_types.h"
#include "DNA_dynamicpaint_types.h"
#include "DNA_genfile.h"
+#include "DNA_groom_types.h"
#include "DNA_group_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_fileglobal_types.h"
+#include "DNA_hair_types.h"
#include "DNA_key_types.h"
#include "DNA_lattice_types.h"
#include "DNA_lamp_types.h"
@@ -1765,6 +1767,18 @@ static void write_fmaps(WriteData *wd, ListBase *fbase)
}
}
+static void write_hair(WriteData *wd, HairSystem *hsys)
+{
+ if ( hsys->pattern )
+ {
+ writestruct(wd, DATA, HairPattern, 1, hsys->pattern);
+ writestruct(wd, DATA, HairFollicle, hsys->pattern->num_follicles, hsys->pattern->follicles);
+ }
+
+ writestruct(wd, DATA, HairGuideCurve, hsys->totcurves, hsys->curves);
+ writestruct(wd, DATA, HairGuideVertex, hsys->totverts, hsys->verts);
+}
+
static void write_modifiers(WriteData *wd, ListBase *modbase)
{
ModifierData *md;
@@ -1936,6 +1950,18 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
}
}
}
+ else if (md->type == eModifierType_Fur) {
+ FurModifierData *fmd = (FurModifierData *)md;
+
+ if (fmd->hair_system) {
+ writestruct(wd, DATA, HairSystem, 1, fmd->hair_system);
+ write_hair(wd, fmd->hair_system);
+ }
+ if (fmd->draw_settings)
+ {
+ writestruct(wd, DATA, HairDrawSettings, 1, fmd->draw_settings);
+ }
+ }
}
}
@@ -3822,6 +3848,32 @@ static void write_workspace(WriteData *wd, WorkSpace *workspace)
writelist(wd, DATA, TransformOrientation, transform_orientations);
}
+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)
+ {
+ writestruct(wd, DATA, GroomSection, bundle->totsections, bundle->sections);
+ writestruct(wd, DATA, GroomSectionVertex, bundle->totverts, bundle->verts);
+ writestruct(wd, DATA, MeshSample, bundle->numshapeverts + 1, bundle->scalp_region);
+ }
+
+ if (groom->hair_system) {
+ writestruct(wd, DATA, HairSystem, 1, groom->hair_system);
+ write_hair(wd, groom->hair_system);
+ }
+ if (groom->hair_draw_settings)
+ {
+ writestruct(wd, DATA, HairDrawSettings, 1, groom->hair_draw_settings);
+ }
+}
+
/* Keep it last of write_foodata functions. */
static void write_libraries(WriteData *wd, Main *main)
{
@@ -4124,6 +4176,9 @@ static bool write_file_handle(
case ID_CF:
write_cachefile(wd, (CacheFile *)id);
break;
+ case ID_GM:
+ write_groom(wd, (Groom *)id);
+ break;
case ID_LI:
/* Do nothing, handled below - and should never be reached. */
BLI_assert(0);