Blender  V3.3
MOD_gpencillength.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2017 Blender Foundation. */
3 
8 #include <stdio.h>
9 #include <string.h>
10 
11 #include "BLI_hash.h"
12 #include "BLI_listbase.h"
13 #include "BLI_math_base.h"
14 #include "BLI_rand.h"
15 #include "BLI_utildefines.h"
16 
17 #include "BLT_translation.h"
18 
19 #include "DNA_defaults.h"
21 #include "DNA_gpencil_types.h"
22 #include "DNA_object_types.h"
23 #include "DNA_scene_types.h"
24 #include "DNA_screen_types.h"
25 
26 #include "BKE_context.h"
27 #include "BKE_gpencil_geom.h"
28 #include "BKE_gpencil_modifier.h"
29 #include "BKE_lib_query.h"
30 #include "BKE_main.h"
31 #include "BKE_modifier.h"
32 #include "BKE_screen.h"
33 
34 #include "MEM_guardedalloc.h"
35 
36 #include "UI_interface.h"
37 #include "UI_resources.h"
38 
39 #include "RNA_access.h"
40 
42 #include "MOD_gpencil_ui_common.h"
43 #include "MOD_gpencil_util.h"
44 
45 #include "DEG_depsgraph.h"
46 #include "DEG_depsgraph_query.h"
47 
48 static void initData(GpencilModifierData *md)
49 {
51 
52  BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(gpmd, modifier));
53 
55 }
56 
57 static void copyData(const GpencilModifierData *md, GpencilModifierData *target)
58 {
60 }
61 
62 static float *noise_table(int len, int offset, int seed)
63 {
64  float *table = MEM_callocN(sizeof(float) * len, __func__);
65  for (int i = 0; i < len; i++) {
66  table[i] = BLI_hash_int_01(BLI_hash_int_2d(seed, i + offset + 1));
67  }
68  return table;
69 }
70 
71 BLI_INLINE float table_sample(float *table, float x)
72 {
73  return interpf(table[(int)ceilf(x)], table[(int)floor(x)], fractf(x));
74 }
75 
77  const float length,
78  const float overshoot_fac,
79  const short len_mode,
80  const bool use_curvature,
81  const int extra_point_count,
82  const float segment_influence,
83  const float max_angle,
84  const bool invert_curvature)
85 {
86  bool changed = false;
87  if (length == 0.0f) {
88  return changed;
89  }
90 
91  if (length > 0.0f) {
92  changed = BKE_gpencil_stroke_stretch(gps,
93  length,
94  overshoot_fac,
95  len_mode,
96  use_curvature,
97  extra_point_count,
98  segment_influence,
99  max_angle,
100  invert_curvature);
101  }
102  else {
103  changed = BKE_gpencil_stroke_shrink(gps, fabs(length), len_mode);
104  }
105 
106  return changed;
107 }
108 
111  bGPdata *gpd,
112  bGPDframe *gpf,
113  bGPDstroke *gps,
114  Object *ob)
115 {
116  bool changed = false;
118  const float len = (lmd->mode == GP_LENGTH_ABSOLUTE) ? 1.0f :
119  BKE_gpencil_stroke_length(gps, true);
120  const int totpoints = gps->totpoints;
121  if (len < FLT_EPSILON) {
122  return;
123  }
124 
125  /* Always do the stretching first since it might depend on points which could be deleted by the
126  * shrink. */
127  float first_fac = lmd->start_fac;
128  int first_mode = 1;
129  float second_fac = lmd->end_fac;
130  int second_mode = 2;
131 
132  float rand[2] = {0.0f, 0.0f};
133  if (lmd->rand_start_fac != 0.0 || lmd->rand_end_fac != 0.0) {
134  int seed = lmd->seed;
135 
136  /* Make sure different modifiers get different seeds. */
137  seed += BLI_hash_string(ob->id.name + 2);
138  seed += BLI_hash_string(md->name);
139 
140  if (lmd->flag & GP_LENGTH_USE_RANDOM) {
141  seed += ((int)DEG_get_ctime(depsgraph)) / lmd->step;
142  }
143 
144  float rand_offset = BLI_hash_int_01(seed);
145 
146  /* Get stroke index for random offset. */
147  int rnd_index = BLI_findindex(&gpf->strokes, gps);
148  const uint primes[2] = {2, 3};
149  double offset[2] = {0.0f, 0.0f};
150  double r[2];
151 
152  float *noise_table_length = noise_table(4, (int)floor(lmd->rand_offset), seed + 2);
153 
154  /* To ensure a nice distribution, we use halton sequence and offset using the seed. */
155  BLI_halton_2d(primes, offset, rnd_index, r);
156  for (int j = 0; j < 2; j++) {
157  float noise = table_sample(noise_table_length, j * 2 + fractf(lmd->rand_offset));
158 
159  rand[j] = fmodf(r[j] + rand_offset, 1.0f);
160  rand[j] = fabs(fmodf(sin(rand[j] * 12.9898f + j * 78.233f) * 43758.5453f, 1.0f) + noise);
161  }
162 
163  MEM_SAFE_FREE(noise_table_length);
164 
165  first_fac = first_fac + rand[0] * lmd->rand_start_fac;
166  second_fac = second_fac + rand[1] * lmd->rand_end_fac;
167  }
168 
169  if (first_fac < 0) {
170  SWAP(float, first_fac, second_fac);
171  SWAP(int, first_mode, second_mode);
172  }
173  const int first_extra_point_count = ceil(first_fac * lmd->point_density);
174  const int second_extra_point_count = ceil(second_fac * lmd->point_density);
175 
176  changed |= gpencil_modify_stroke(gps,
177  len * first_fac,
178  lmd->overshoot_fac,
179  first_mode,
181  first_extra_point_count,
182  lmd->segment_influence,
183  lmd->max_angle,
185  /* HACK: The second #overshoot_fac needs to be adjusted because it is not
186  * done in the same stretch call, because it can have a different length.
187  * The adjustment needs to be stable when
188  * `ceil(overshoot_fac*(gps->totpoints - 2))` is used in stretch and never
189  * produce a result higher than `totpoints - 2`. */
190  const float second_overshoot_fac = lmd->overshoot_fac * (totpoints - 2) /
191  ((float)gps->totpoints - 2) *
192  (1.0f - 0.1f / (totpoints - 1.0f));
193  changed |= gpencil_modify_stroke(gps,
194  len * second_fac,
195  second_overshoot_fac,
196  second_mode,
198  second_extra_point_count,
199  lmd->segment_influence,
200  lmd->max_angle,
202 
203  if (changed) {
205  }
206 }
207 
210  Object *ob,
211  bGPDlayer *gpl,
212  bGPDframe *gpf,
213  bGPDstroke *gps)
214 {
215  bGPdata *gpd = ob->data;
218  lmd->layername,
219  lmd->material,
220  lmd->pass_index,
221  lmd->layer_pass,
222  1,
223  gpl,
224  gps,
229  return;
230  }
231  if ((gps->flag & GP_STROKE_CYCLIC) != 0) {
232  /* Don't affect cyclic strokes as they have no start/end. */
233  return;
234  }
235  applyLength(md, depsgraph, gpd, gpf, gps, ob);
236 }
237 
238 static void bakeModifier(Main *UNUSED(bmain),
241  Object *ob)
242 {
244 }
245 
246 static void foreachIDLink(GpencilModifierData *md, Object *ob, IDWalkFunc walk, void *userData)
247 {
249 
250  walk(userData, ob, (ID **)&mmd->material, IDWALK_CB_USER);
251 }
252 
253 static void random_header_draw(const bContext *UNUSED(C), Panel *panel)
254 {
255  uiLayout *layout = panel->layout;
256 
258 
259  uiItemR(layout, ptr, "use_random", 0, IFACE_("Randomize"), ICON_NONE);
260 }
261 
262 static void random_panel_draw(const bContext *UNUSED(C), Panel *panel)
263 {
264  uiLayout *layout = panel->layout;
265 
267 
268  uiLayoutSetPropSep(layout, true);
269 
270  uiLayoutSetActive(layout, RNA_boolean_get(ptr, "use_random"));
271 
272  uiItemR(layout, ptr, "step", 0, NULL, ICON_NONE);
273 }
274 
275 static void offset_panel_draw(const bContext *UNUSED(C), Panel *panel)
276 {
277  uiLayout *layout = panel->layout;
279  uiLayoutSetPropSep(layout, true);
280  uiItemR(layout, ptr, "random_start_factor", 0, IFACE_("Random Offset Start"), ICON_NONE);
281  uiItemR(layout, ptr, "random_end_factor", 0, IFACE_("Random Offset End"), ICON_NONE);
282  uiItemR(layout, ptr, "random_offset", 0, NULL, ICON_NONE);
283  uiItemR(layout, ptr, "seed", 0, NULL, ICON_NONE);
284 }
285 
286 static void panel_draw(const bContext *UNUSED(C), Panel *panel)
287 {
288  uiLayout *layout = panel->layout;
289 
291 
292  uiLayoutSetPropSep(layout, true);
293  uiItemR(layout, ptr, "mode", 0, NULL, ICON_NONE);
294 
295  uiLayout *col = uiLayoutColumn(layout, true);
296 
297  if (RNA_enum_get(ptr, "mode") == GP_LENGTH_RELATIVE) {
298  uiItemR(col, ptr, "start_factor", 0, IFACE_("Start"), ICON_NONE);
299  uiItemR(col, ptr, "end_factor", 0, IFACE_("End"), ICON_NONE);
300  }
301  else {
302  uiItemR(col, ptr, "start_length", 0, IFACE_("Start"), ICON_NONE);
303  uiItemR(col, ptr, "end_length", 0, IFACE_("End"), ICON_NONE);
304  }
305 
306  uiItemR(layout, ptr, "overshoot_factor", UI_ITEM_R_SLIDER, IFACE_("Used Length"), ICON_NONE);
307 
309 }
310 
311 static void mask_panel_draw(const bContext *UNUSED(C), Panel *panel)
312 {
313  gpencil_modifier_masking_panel_draw(panel, true, false);
314 }
315 
316 static void curvature_header_draw(const bContext *UNUSED(C), Panel *panel)
317 {
318  uiLayout *layout = panel->layout;
319 
321 
322  uiItemR(layout, ptr, "use_curvature", 0, IFACE_("Curvature"), ICON_NONE);
323 }
324 
325 static void curvature_panel_draw(const bContext *UNUSED(C), Panel *panel)
326 {
327  uiLayout *layout = panel->layout;
328 
330 
331  uiLayoutSetPropSep(layout, true);
332 
333  uiLayout *col = uiLayoutColumn(layout, false);
334 
335  uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_curvature"));
336 
337  uiItemR(col, ptr, "point_density", 0, NULL, ICON_NONE);
338  uiItemR(col, ptr, "segment_influence", 0, NULL, ICON_NONE);
339  uiItemR(col, ptr, "max_angle", 0, NULL, ICON_NONE);
340  uiItemR(col, ptr, "invert_curvature", 0, IFACE_("Invert"), ICON_NONE);
341 }
342 
343 static void panelRegister(ARegionType *region_type)
344 {
348  region_type, "curvature", "", curvature_header_draw, curvature_panel_draw, panel_type);
350  region_type, "offset", "Random Offsets", NULL, offset_panel_draw, panel_type);
352  region_type, "randomize", "", random_header_draw, random_panel_draw, offset_panel);
354  region_type, "mask", "Influence", NULL, mask_panel_draw, panel_type);
355 }
356 
358  /* name */ N_("Length"),
359  /* structName */ "LengthGpencilModifierData",
360  /* structSize */ sizeof(LengthGpencilModifierData),
363 
364  /* copyData */ copyData,
365 
366  /* deformStroke */ deformStroke,
367  /* generateStrokes */ NULL,
368  /* bakeModifier */ bakeModifier,
369  /* remapTime */ NULL,
370 
371  /* initData */ initData,
372  /* freeData */ NULL,
373  /* isDisabled */ NULL,
374  /* updateDepsgraph */ NULL,
375  /* dependsOnTime */ NULL,
376  /* foreachIDLink */ foreachIDLink,
377  /* foreachTexLink */ NULL,
378  /* panelRegister */ panelRegister,
379 };
bool BKE_gpencil_stroke_shrink(struct bGPDstroke *gps, float dist, short mode)
bool BKE_gpencil_stroke_stretch(struct bGPDstroke *gps, float dist, float overshoot_fac, short mode, bool follow_curvature, int extra_point_count, float segment_influence, float max_angle, bool invert_curvature)
float BKE_gpencil_stroke_length(const struct bGPDstroke *gps, bool use_3d)
void BKE_gpencil_stroke_geometry_update(struct bGPdata *gpd, struct bGPDstroke *gps)
void BKE_gpencil_modifier_copydata_generic(const struct GpencilModifierData *md_src, struct GpencilModifierData *md_dst)
@ eGpencilModifierTypeFlag_SupportsEditmode
@ eGpencilModifierTypeType_Gpencil
@ IDWALK_CB_USER
Definition: BKE_lib_query.h:73
void(* IDWalkFunc)(void *userData, struct Object *ob, struct ID **idpoin, int cb_flag)
Definition: BKE_modifier.h:107
#define BLI_assert(a)
Definition: BLI_assert.h:46
#define BLI_INLINE
BLI_INLINE float BLI_hash_int_01(unsigned int k)
Definition: BLI_hash.h:94
BLI_INLINE unsigned int BLI_hash_string(const char *str)
Definition: BLI_hash.h:69
BLI_INLINE unsigned int BLI_hash_int_2d(unsigned int kx, unsigned int ky)
Definition: BLI_hash.h:53
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float interpf(float a, float b, float t)
Random number functions.
void BLI_halton_2d(const unsigned int prime[2], double offset[2], int n, double *r)
Definition: rand.cc:298
unsigned int uint
Definition: BLI_sys_types.h:67
#define SWAP(type, a, b)
#define UNUSED(x)
#define MEMCMP_STRUCT_AFTER_IS_ZERO(struct_var, member)
#define MEMCPY_STRUCT_AFTER(struct_dst, struct_src, member)
#define IFACE_(msgid)
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
float DEG_get_ctime(const Depsgraph *graph)
#define DNA_struct_default_get(struct_name)
Definition: DNA_defaults.h:29
@ GP_LENGTH_INVERT_MATERIAL
@ GP_LENGTH_INVERT_CURVATURE
@ GP_LENGTH_INVERT_LAYER
@ GP_LENGTH_USE_CURVATURE
@ GP_LENGTH_INVERT_LAYERPASS
struct LengthGpencilModifierData LengthGpencilModifierData
@ eGpencilModifierType_Length
@ GP_STROKE_CYCLIC
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 GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
Read Guarded memory(de)allocation.
#define MEM_SAFE_FREE(v)
PointerRNA * gpencil_modifier_panel_get_property_pointers(Panel *panel, PointerRNA *r_ob_ptr)
void gpencil_modifier_masking_panel_draw(Panel *panel, bool use_material, bool use_vertex)
void gpencil_modifier_panel_end(uiLayout *layout, PointerRNA *ptr)
PanelType * gpencil_modifier_subpanel_register(ARegionType *region_type, const char *name, const char *label, PanelDrawFn draw_header, PanelDrawFn draw, PanelType *parent)
PanelType * gpencil_modifier_panel_register(ARegionType *region_type, GpencilModifierType type, PanelDrawFn draw)
void generic_bake_deform_stroke(Depsgraph *depsgraph, GpencilModifierData *md, Object *ob, const bool retime, gpBakeCb bake_cb)
bool is_stroke_affected_by_modifier(Object *ob, char *mlayername, Material *material, const int mpassindex, const int gpl_passindex, const int minpoints, bGPDlayer *gpl, bGPDstroke *gps, const bool inv1, const bool inv2, const bool inv3, const bool inv4)
static float * noise_table(int len, int offset, int seed)
BLI_INLINE float table_sample(float *table, float x)
static void curvature_header_draw(const bContext *UNUSED(C), Panel *panel)
static bool gpencil_modify_stroke(bGPDstroke *gps, const float length, const float overshoot_fac, const short len_mode, const bool use_curvature, const int extra_point_count, const float segment_influence, const float max_angle, const bool invert_curvature)
static void offset_panel_draw(const bContext *UNUSED(C), Panel *panel)
static void random_header_draw(const bContext *UNUSED(C), Panel *panel)
static void random_panel_draw(const bContext *UNUSED(C), Panel *panel)
static void mask_panel_draw(const bContext *UNUSED(C), Panel *panel)
static void foreachIDLink(GpencilModifierData *md, Object *ob, IDWalkFunc walk, void *userData)
static void bakeModifier(Main *UNUSED(bmain), Depsgraph *depsgraph, GpencilModifierData *md, Object *ob)
static void applyLength(GpencilModifierData *md, Depsgraph *depsgraph, bGPdata *gpd, bGPDframe *gpf, bGPDstroke *gps, Object *ob)
static void curvature_panel_draw(const bContext *UNUSED(C), Panel *panel)
static void copyData(const GpencilModifierData *md, GpencilModifierData *target)
static void panel_draw(const bContext *UNUSED(C), Panel *panel)
GpencilModifierTypeInfo modifierType_Gpencil_Length
static void deformStroke(GpencilModifierData *md, Depsgraph *depsgraph, Object *ob, bGPDlayer *gpl, bGPDframe *gpf, bGPDstroke *gps)
static void panelRegister(ARegionType *region_type)
static void initData(GpencilModifierData *md)
#define C
Definition: RandGen.cpp:25
void uiLayoutSetActive(uiLayout *layout, bool active)
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
@ UI_ITEM_R_SLIDER
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
static unsigned long seed
Definition: btSoftBody.h:39
const Depsgraph * depsgraph
int len
Definition: draw_manager.c:108
uint col
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
MINLINE float fractf(float a)
ccl_device_inline float2 fabs(const float2 &a)
Definition: math_float2.h:222
ccl_device_inline float3 ceil(const float3 &a)
Definition: math_float3.h:363
#define ceilf(x)
Definition: metal/compat.h:225
#define fmodf(x, y)
Definition: metal/compat.h:230
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
Definition: rall1d.h:311
T length(const vec_base< T, Size > &a)
T floor(const T &a)
static float noise(int n)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:4863
int RNA_enum_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:5004
Definition: DNA_ID.h:368
char name[66]
Definition: DNA_ID.h:378
Definition: BKE_main.h:121
void * data
struct uiLayout * layout
ListBase strokes
#define N_(msgid)
PointerRNA * ptr
Definition: wm_files.c:3480