82 const Hair *hair_src = (
const Hair *)id_src;
109 for (
int i = 0; i < hair->
totcol; i++) {
137 if (players && players != players_buff) {
140 if (clayers && clayers != clayers_buff) {
181 .struct_size =
sizeof(
Hair),
183 .name_plural =
"hairs",
192 .foreach_cache =
NULL,
200 .blend_read_undo_preserve =
NULL,
202 .lib_override_apply_post =
NULL,
207 const int numpoints = 8;
218 for (
int i = 0; i < hair->
totcurve; i++) {
220 curve->firstpoint = i * numpoints;
221 curve->numpoints = numpoints;
233 float *curve_radius = hair->
radius +
curve->firstpoint;
234 for (
int key = 0; key < numpoints; key++) {
235 float t = key / (
float)(numpoints - 1);
237 curve_radius[key] = 0.02f * (1.0f -
t);
273 float *hair_radius = hair->
radius;
275 float *co = hair_co[
a];
276 float radius = (hair_radius) ? hair_radius[
a] : 0.0f;
277 const float co_min[3] = {co[0] - radius, co[1] - radius, co[2] - radius};
278 const float co_max[3] = {co[0] + radius, co[1] + radius, co[2] + radius};
338 Hair *hair = hair_input;
352 for (; md; md = md->
next) {
362 if (hair == hair_input) {
376 if (hair == hair_input) {
382 if (hair_next && hair_next != hair) {
384 if (hair != hair_input) {
401 Hair *hair =
object->data;
405 const bool is_owned = (hair != hair_eval);
typedef float(TangentPoint)[2]
void BKE_animdata_free(struct ID *id, const bool do_id_user)
void BKE_animdata_blend_read_data(struct BlendDataReader *reader, struct AnimData *adt)
void BKE_animdata_blend_write(struct BlendWriter *writer, struct AnimData *adt)
CustomData interface, see also DNA_customdata_types.h.
void CustomData_free(struct CustomData *data, int totelem)
void CustomData_blend_read(struct BlendDataReader *reader, struct CustomData *data, int count)
void CustomData_blend_write(struct BlendWriter *writer, struct CustomData *data, CustomDataLayer *layers, int count, CustomDataMask cddata_mask, struct ID *id)
void * CustomData_duplicate_referenced_layer_named(struct CustomData *data, const int type, const char *name, const int totelem)
void CustomData_blend_write_prepare(struct CustomData *data, struct CustomDataLayer **r_write_layers, struct CustomDataLayer *write_layers_buff, size_t write_layers_size)
void * CustomData_add_layer_named(struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem, const char *name)
void * CustomData_get_layer_named(const struct CustomData *data, int type, const char *name)
void * CustomData_get_layer(const struct CustomData *data, int type)
void * CustomData_add_layer(struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem)
void CustomData_copy(const struct CustomData *source, struct CustomData *dest, CustomDataMask mask, eCDAllocType alloctype, int totelem)
void CustomData_realloc(struct CustomData *data, int totelem)
void CustomData_reset(struct CustomData *data)
General operations for hairs.
void * BKE_id_new_nomain(const short type, const char *name)
@ LIB_ID_COPY_CD_REFERENCE
struct ID * BKE_id_copy_ex(struct Main *bmain, const struct ID *id, struct ID **r_newid, const int flag)
void BKE_id_free(struct Main *bmain, void *idv)
void BKE_id_blend_write(struct BlendWriter *writer, struct ID *id)
void * BKE_id_new(struct Main *bmain, const short type, const char *name)
#define BKE_LIB_FOREACHID_PROCESS(_data, _id_super, _cb_flag)
const ModifierTypeInfo * BKE_modifier_get_info(ModifierType type)
bool BKE_modifier_is_enabled(const struct Scene *scene, struct ModifierData *md, int required_mode)
@ eModifierTypeFlag_AcceptsVertexCosOnly
struct ModifierData * BKE_modifiers_get_virtual_modifierlist(const struct Object *ob, struct VirtualModifierData *data)
@ eModifierTypeType_OnlyDeform
General operations, lookup, etc. for blender objects.
void BKE_boundbox_init_from_minmax(struct BoundBox *bb, const float min[3], const float max[3])
void BKE_object_free_derived_caches(struct Object *ob)
void BKE_object_eval_assign_data(struct Object *object, struct ID *data, bool is_owned)
MINLINE float saacosf(float f)
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE float normalize_v3(float r[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
void BLI_rng_free(struct RNG *rng) ATTR_NONNULL(1)
struct RNG * BLI_rng_new(unsigned int seed)
float BLI_rng_get_float(struct RNG *rng) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define STRNCPY(dst, src)
#define INIT_MINMAX(min, max)
#define MEMCMP_STRUCT_AFTER_IS_ZERO(struct_var, member)
#define MEMCPY_STRUCT_AFTER(struct_dst, struct_src, member)
#define BLO_read_data_address(reader, ptr_p)
#define BLO_write_id_struct(writer, struct_name, id_address, id)
#define BLO_read_id_address(reader, lib, id_ptr_p)
#define BLO_expand(expander, id)
void BLO_read_pointer_array(BlendDataReader *reader, void **ptr_p)
bool BLO_write_is_undo(BlendWriter *writer)
void BLO_write_pointer_array(BlendWriter *writer, uint num, const void *data_ptr)
#define BLT_I18NCONTEXT_ID_HAIR
struct Depsgraph Depsgraph
eEvaluationMode DEG_get_mode(const Depsgraph *graph)
#define CD_TEMP_CHUNK_SIZE
#define DNA_struct_default_get(struct_name)
Object is a sort of wrapper for general info.
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
Read Guarded memory(de)allocation.
static void init_data(ModifierData *md)
const Depsgraph * depsgraph
Hair * BKE_hair_copy_for_eval(Hair *hair_src, bool reference)
static void hair_random(Hair *hair)
void * BKE_hair_add(Main *bmain, const char *name)
static void hair_init_data(ID *id)
static const char * HAIR_ATTR_RADIUS
Hair * BKE_hair_new_for_eval(const Hair *hair_src, int totpoint, int totcurve)
static void hair_free_data(ID *id)
void BKE_hair_update_customdata_pointers(Hair *hair)
static void hair_blend_read_expand(BlendExpander *expander, ID *id)
void BKE_hair_batch_cache_dirty_tag(Hair *hair, int mode)
static void hair_copy_data(Main *UNUSED(bmain), ID *id_dst, const ID *id_src, const int flag)
BoundBox * BKE_hair_boundbox_get(Object *ob)
void(* BKE_hair_batch_cache_free_cb)(Hair *hair)
static const char * HAIR_ATTR_POSITION
static void hair_blend_write(BlendWriter *writer, ID *id, const void *id_address)
void BKE_hair_batch_cache_free(Hair *hair)
static void hair_blend_read_lib(BlendLibReader *reader, ID *id)
bool BKE_hair_customdata_required(Hair *UNUSED(hair), CustomDataLayer *layer)
void BKE_hair_data_update(struct Depsgraph *depsgraph, struct Scene *scene, Object *object)
static void hair_foreach_id(ID *id, LibraryForeachIDData *data)
static void hair_blend_read_data(BlendDataReader *reader, ID *id)
void(* BKE_hair_batch_cache_dirty_tag_cb)(Hair *hair, int mode)
static Hair * hair_evaluate_modifiers(struct Depsgraph *depsgraph, struct Scene *scene, Object *object, Hair *hair_input)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
struct HairCurve * curves
struct HairMaping * mapping
struct ModifierData * next
void(* deformVerts)(struct ModifierData *md, const struct ModifierEvalContext *ctx, struct Mesh *mesh, float(*vertexCos)[3], int numVerts)
struct Hair *(* modifyHair)(struct ModifierData *md, const struct ModifierEvalContext *ctx, struct Hair *hair)