[Bf-blender-cvs] [58a70542e01] hair_guides: Merge branch 'blender2.8' into hair_guides
Lukas Tönne
noreply at git.blender.org
Sat Apr 21 13:36:59 CEST 2018
Commit: 58a70542e014d95b6dbe0190aa8bc4cf9cf4c393
Author: Lukas Tönne
Date: Sat Apr 21 12:36:52 2018 +0100
Branches: hair_guides
https://developer.blender.org/rB58a70542e014d95b6dbe0190aa8bc4cf9cf4c393
Merge branch 'blender2.8' into hair_guides
===================================================================
===================================================================
diff --cc release/scripts/startup/bl_ui/__init__.py
index 62ce0712915,2c0b1ab12be..0728698baf4
--- a/release/scripts/startup/bl_ui/__init__.py
+++ b/release/scripts/startup/bl_ui/__init__.py
@@@ -44,8 -43,6 +44,7 @@@ _modules =
"properties_data_lightprobe",
"properties_data_speaker",
"properties_data_workspace",
- "properties_game",
+ "properties_hair",
"properties_mask_common",
"properties_material",
"properties_object",
diff --cc source/blender/blenkernel/BKE_groom.h
index e88513b5480,00000000000..ef15223dd45
mode 100644,000000..100644
--- a/source/blender/blenkernel/BKE_groom.h
+++ b/source/blender/blenkernel/BKE_groom.h
@@@ -1,125 -1,0 +1,125 @@@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) Blender Foundation
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Lukas Toenne
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef __BKE_GROOM_H__
+#define __BKE_GROOM_H__
+
+/** \file BKE_groom.h
+ * \ingroup bke
+ */
+
- struct EvaluationContext;
++struct Depsgraph;
+struct Groom;
+struct GroomBundle;
+struct Main;
+struct Object;
+struct Scene;
+
+void BKE_groom_init(struct Groom *groom);
+void *BKE_groom_add(struct Main *bmain, const char *name);
+
+void BKE_groom_free(struct Groom *groom);
+void BKE_groom_bundle_curve_cache_clear(struct GroomBundle *bundle);
+
+void BKE_groom_copy_data(struct Main *bmain, struct Groom *groom_dst, const struct Groom *groom_src, const int flag);
+struct Groom *BKE_groom_copy(struct Main *bmain, const struct Groom *groom);
+
+void BKE_groom_make_local(struct Main *bmain, struct Groom *groom, const bool lib_local);
+
+bool BKE_groom_minmax(struct Groom *groom, float min[3], float max[3]);
+void BKE_groom_boundbox_calc(struct Groom *groom, float r_loc[3], float r_size[3]);
+
+
+/* === Curve cache === */
+
+void BKE_groom_curve_cache_update(struct Groom *groom);
+void BKE_groom_curve_cache_clear(struct Groom *groom);
+
+
+/* === Scalp regions === */
+
+/* Try to bind bundles to their scalp regions */
+void BKE_groom_bind_scalp_regions(struct Groom *groom, bool force_rebind);
+
+bool BKE_groom_bundle_bind(struct Groom *groom, struct GroomBundle *bundle, bool force_rebind);
+void BKE_groom_bundle_unbind(struct GroomBundle *bundle);
+
+
+/* === Hair System === */
+
+/* Create follicles and guide curve origins on the scalp surface for hair fiber rendering */
+void BKE_groom_hair_distribute(struct Groom *groom, unsigned int seed, int hair_count, int guide_curve_count);
+
+/* Calculate guide curve shapes based on groom bundle deformation */
+void BKE_groom_hair_update_guide_curves(struct Groom *groom);
+
+
+/* === Depsgraph evaluation === */
+
- void BKE_groom_eval_geometry(const struct EvaluationContext *eval_ctx, struct Groom *groom);
++void BKE_groom_eval_geometry(struct Depsgraph *depsgraph, struct Groom *groom);
+
+
+/* === Draw Cache === */
+
+enum {
+ BKE_GROOM_BATCH_DIRTY_ALL = 0,
+ BKE_GROOM_BATCH_DIRTY_SELECT,
+};
+void BKE_groom_batch_cache_dirty(struct Groom *groom, int mode);
+void BKE_groom_batch_cache_free(struct Groom *groom);
+
+/* === Iterators === */
+
+/* Utility class for iterating over groom elements */
+typedef struct GroomIterator
+{
+ int isection; /* section index */
+ struct GroomSection *section; /* section data pointer */
+
+ int ivertex; /* vertex index */
+ int isectionvertex; /* vertex index for the inner loop */
+ struct GroomSectionVertex *vertex; /* vertex data pointer */
+} GroomIterator;
+
+#define GROOM_ITER_SECTIONS(iter, bundle) \
+ for (iter.isection = 0, iter.section = (bundle)->sections; \
+ iter.isection < (bundle)->totsections; \
+ ++iter.isection, ++iter.section)
+
+#define GROOM_ITER_SECTION_LOOPS(iter, sectionvar, vertexvar, bundle) \
+ for (iter.isection = 0, iter.section = (bundle)->sections, iter.ivertex = 0, iter.vertex = (bundle)->verts; \
+ iter.isection < (bundle)->totsections; \
+ ++iter.isection, ++iter.section) \
+ for (iter.isectionvertex = 0; \
+ iter.isectionvertex < (bundle)->numloopverts; \
+ ++iter.isectionvertex, ++iter.vertex)
+
+/* === Utility functions (DerivedMesh SOON TO BE DEPRECATED!) === */
+struct DerivedMesh;
+struct DerivedMesh* BKE_groom_get_scalp(struct Groom *groom);
+
+#endif /* __BKE_GROOM_H__ */
diff --cc source/blender/blenkernel/BKE_hair.h
index be526233ac6,00000000000..3c5ba7803a4
mode 100644,000000..100644
--- a/source/blender/blenkernel/BKE_hair.h
+++ b/source/blender/blenkernel/BKE_hair.h
@@@ -1,136 -1,0 +1,137 @@@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) Blender Foundation
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Lukas Toenne
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef __BKE_HAIR_H__
+#define __BKE_HAIR_H__
+
+/** \file blender/blenkernel/BKE_hair.h
+ * \ingroup bke
+ */
+
+#include "BLI_utildefines.h"
+
+static const unsigned int HAIR_STRAND_INDEX_NONE = 0xFFFFFFFF;
+
+struct HairFollicle;
+struct HairPattern;
+struct HairSystem;
+struct HairDrawSettings;
++struct HairGuideData;
+struct DerivedMesh;
+struct MeshSample;
+struct Object;
+
+/* Create a new hair system instance */
+struct HairSystem* BKE_hair_new(void);
+/* Copy an existing hair system */
+struct HairSystem* BKE_hair_copy(struct HairSystem *hsys);
+/* Delete a hair system */
+void BKE_hair_free(struct HairSystem *hsys);
+
+/* === Guide Strands === */
+
+/* Allocate buffers for defining guide curves
+ * \param totcurves Number of guide curves to allocate
+ */
+void BKE_hair_guide_curves_begin(struct HairSystem *hsys, int totcurves);
+
+/* Set properties of a guide curve
+ * \param index Index of the guide guide curve
+ * \param mesh_sample Origin of the guide curve on the scalp mesh.
+ * \param numverts Number of vertices in this guide curve
+ */
+void BKE_hair_set_guide_curve(struct HairSystem *hsys, int index, const struct MeshSample *mesh_sample, int numverts);
+
+/* Finalize guide curve update */
+void BKE_hair_guide_curves_end(struct HairSystem *hsys);
+
+/* Set properties of a guide curve vertex
+ * \param index Index of the guide curve vertex.
+ * \param flag Flags to set on the vertex.
+ * \param co Location of the vertex in object space.
+ */
+void BKE_hair_set_guide_vertex(struct HairSystem *hsys, int index, int flag, const float co[3]);
+
+/* Set the hair guide data used by the hair system.
+ */
+void BKE_hair_set_hair_guides(struct HairSystem *hsys, struct HairGuideData *guides);
+
+/* === Follicles === */
+
+/* Calculate surface area of a scalp mesh */
+float BKE_hair_calc_surface_area(struct DerivedMesh *scalp);
+
+/* Calculate a density value based on surface area and sample count */
+float BKE_hair_calc_density_from_count(float area, int count);
+/* Calculate maximum sample count based on surface area and density */
+int BKE_hair_calc_max_count_from_density(float area, float density);
+
+/* Calculate a density value based on a minimum distance */
+float BKE_hair_calc_density_from_min_distance(float min_distance);
+/* Calculate a minimum distance based on density */
+float BKE_hair_calc_min_distance_from_density(float density);
+
+/* Distribute hair follicles on a scalp mesh */
+void BKE_hair_generate_follicles(
+ struct HairSystem* hsys,
+ struct DerivedMesh *scalp,
+ unsigned int seed,
+ int count);
+
+void BKE_hair_bind_follicles(struct HairSystem *hsys, struct DerivedMesh *scalp);
+
+/* === Draw Settings === */
+
+struct HairDrawSettings* BKE_hair_draw_settings_new(void);
+struct HairDrawSettings* BKE_hair_draw_settings_copy(struct HairDrawSettings *draw_settings);
+void BKE_hair_draw_settings_free(struct HairDrawSettings *draw_settings);
+
+/* === Draw Cache === */
+
+enum {
+ BKE_HAIR_BATCH_DIRTY_FIBERS = (1 << 0),
+ BKE_HAIR_BATCH_DIRTY_STRANDS = (1 << 1),
+ BKE_HAIR_BATCH_DIRTY_ALL = 0xFFFF,
+};
+void BKE_hair_batch_cache_dirty(struct HairSystem* hsys, int mode);
+void BKE_hair_batch_cache_free(struct HairSystem* hsys);
+
+int* BKE_hair_get_fiber_lengths(const struct HairSystem* hsys, int subdiv);
+void BKE_hair_get_texture_buffer_size(
+ const struct HairSystem* hsys,
+ int subdiv,
+ int *r_size,
+ int *r_strand_map_start,
+ int *r_strand_vertex_start,
+ int *r_fiber_start);
+void BKE_hair_get_texture_buffer(
+ const struct HairSys
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list