Blender  V3.3
MOD_gpencilarray.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 
10 #include "MEM_guardedalloc.h"
11 
12 #include "BLI_hash.h"
13 #include "BLI_listbase.h"
14 #include "BLI_math_vector.h"
15 #include "BLI_rand.h"
16 #include "BLI_utildefines.h"
17 
18 #include "BLT_translation.h"
19 
20 #include "DNA_defaults.h"
22 #include "DNA_gpencil_types.h"
23 #include "DNA_object_types.h"
24 #include "DNA_scene_types.h"
25 #include "DNA_screen_types.h"
26 
27 #include "BKE_context.h"
28 #include "BKE_gpencil.h"
29 #include "BKE_gpencil_geom.h"
30 #include "BKE_gpencil_modifier.h"
31 #include "BKE_lib_query.h"
32 #include "BKE_main.h"
33 #include "BKE_modifier.h"
34 #include "BKE_object.h"
35 #include "BKE_screen.h"
36 
37 #include "UI_interface.h"
38 #include "UI_resources.h"
39 
40 #include "RNA_access.h"
41 
42 #include "DEG_depsgraph.h"
43 #include "DEG_depsgraph_build.h"
44 #include "DEG_depsgraph_query.h"
45 
47 #include "MOD_gpencil_ui_common.h"
48 #include "MOD_gpencil_util.h"
49 
50 typedef struct tmpStrokes {
51  struct tmpStrokes *next, *prev;
55 
56 static void initData(GpencilModifierData *md)
57 {
59 
60  BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(gpmd, modifier));
61 
63 
64  /* Open the first subpanel too, because it's activated by default. */
66 }
67 
68 static void copyData(const GpencilModifierData *md, GpencilModifierData *target)
69 {
71 }
72 
73 /* -------------------------------- */
74 /* helper function for per-instance positioning */
77  const int elem_idx,
78  float r_mat[4][4],
79  float r_offset[4][4])
80 {
81  float offset[3], rot[3], scale[3];
82  ARRAY_SET_ITEMS(scale, 1.0f, 1.0f, 1.0f);
83  zero_v3(rot);
84 
85  if (mmd->flag & GP_ARRAY_USE_OFFSET) {
86  offset[0] = mmd->offset[0] * elem_idx;
87  offset[1] = mmd->offset[1] * elem_idx;
88  offset[2] = mmd->offset[2] * elem_idx;
89  }
90  else {
91  zero_v3(offset);
92  }
93 
94  /* Calculate matrix */
95  loc_eul_size_to_mat4(r_mat, offset, rot, scale);
96  copy_m4_m4(r_offset, r_mat);
97 
98  /* offset object */
99  if ((mmd->flag & GP_ARRAY_USE_OB_OFFSET) && (mmd->object)) {
100  float mat_offset[4][4];
101  float obinv[4][4];
102 
103  unit_m4(mat_offset);
104  if (mmd->flag & GP_ARRAY_USE_OFFSET) {
105  add_v3_v3(mat_offset[3], mmd->offset);
106  }
107  invert_m4_m4(obinv, ob->obmat);
108 
109  mul_m4_series(r_offset, mat_offset, obinv, mmd->object->obmat);
110  copy_m4_m4(mat_offset, r_offset);
111 
112  /* clear r_mat locations to avoid double transform */
113  zero_v3(r_mat[3]);
114  }
115 }
117  Object *ob,
118  float r_min[3],
119  float r_max[3])
120 {
121  bGPdata *gpd = (bGPdata *)ob->data;
122  bool changed = false;
123 
124  INIT_MINMAX(r_min, r_max);
125 
126  if (gpd == NULL) {
127  return changed;
128  }
129 
130  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
131  bGPDframe *gpf = gpl->actframe;
132 
133  if (gpf != NULL) {
136  mmd->layername,
137  mmd->material,
138  mmd->pass_index,
139  mmd->layer_pass,
140  1,
141  gpl,
142  gps,
144  mmd->flag & GP_ARRAY_INVERT_PASS,
146  mmd->flag & GP_ARRAY_INVERT_MATERIAL)) {
147  changed |= BKE_gpencil_stroke_minmax(gps, false, r_min, r_max);
148  }
149  }
150  }
151  }
152 
153  return changed;
154 }
155 /* array modifier - generate geometry callback (for viewport/rendering) */
158  Scene *scene,
159  Object *ob)
160 {
162  ListBase stroke_cache = {NULL, NULL};
163  /* Load the strokes to be duplicated. */
164  bGPdata *gpd = (bGPdata *)ob->data;
165  bool found = false;
166 
167  /* Get bounbox for relative offset. */
168  float size[3] = {0.0f, 0.0f, 0.0f};
169  if (mmd->flag & GP_ARRAY_USE_RELATIVE) {
170  float min[3];
171  float max[3];
172  if (gpencil_data_selected_minmax(mmd, ob, min, max)) {
173  sub_v3_v3v3(size, max, min);
174  /* Need a minimum size (for flat drawings). */
175  CLAMP3_MIN(size, 0.01f);
176  }
177  }
178 
179  int seed = mmd->seed;
180  /* Make sure different modifiers get different seeds. */
181  seed += BLI_hash_string(ob->id.name + 2);
182  seed += BLI_hash_string(md->name);
183 
184  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
186  if (gpf == NULL) {
187  continue;
188  }
191  mmd->layername,
192  mmd->material,
193  mmd->pass_index,
194  mmd->layer_pass,
195  1,
196  gpl,
197  gps,
199  mmd->flag & GP_ARRAY_INVERT_PASS,
200  mmd->flag & GP_ARRAY_INVERT_LAYERPASS,
201  mmd->flag & GP_ARRAY_INVERT_MATERIAL)) {
202  tmpStrokes *tmp = MEM_callocN(sizeof(tmpStrokes), __func__);
203  tmp->gpf = gpf;
204  tmp->gps = gps;
205  BLI_addtail(&stroke_cache, tmp);
206 
207  found = true;
208  }
209  }
210  }
211 
212  if (found) {
213  /* Generate new instances of all existing strokes,
214  * keeping each instance together so they maintain
215  * the correct ordering relative to each other
216  */
217  float current_offset[4][4];
218  unit_m4(current_offset);
219 
220  float rand_offset = BLI_hash_int_01(seed);
221 
222  for (int x = 0; x < mmd->count; x++) {
223  /* original strokes are at index = 0 */
224  if (x == 0) {
225  continue;
226  }
227 
228  /* Compute transforms for this instance */
229  float mat[4][4];
230  float mat_offset[4][4];
231  BKE_gpencil_instance_modifier_instance_tfm(ob, mmd, x, mat, mat_offset);
232 
233  if ((mmd->flag & GP_ARRAY_USE_OB_OFFSET) && (mmd->object)) {
234  /* recalculate cumulative offset here */
235  mul_m4_m4m4(current_offset, current_offset, mat_offset);
236  }
237  else {
238  copy_m4_m4(current_offset, mat);
239  }
240 
241  /* Apply relative offset. */
242  if (mmd->flag & GP_ARRAY_USE_RELATIVE) {
243  float relative[3];
244  mul_v3_v3v3(relative, mmd->shift, size);
245  madd_v3_v3fl(current_offset[3], relative, x);
246  }
247 
248  float rand[3][3];
249  for (int j = 0; j < 3; j++) {
250  const uint primes[3] = {2, 3, 7};
251  double offset[3] = {0.0, 0.0, 0.0};
252  double r[3];
253  /* To ensure a nice distribution, we use halton sequence and offset using the seed. */
254  BLI_halton_3d(primes, offset, x, r);
255 
256  if ((mmd->flag & GP_ARRAY_UNIFORM_RANDOM_SCALE) && j == 2) {
257  float rand_value;
258  rand_value = fmodf(r[0] * 2.0 - 1.0 + rand_offset, 1.0f);
259  rand_value = fmodf(sin(rand_value * 12.9898 + j * 78.233) * 43758.5453, 1.0f);
260  copy_v3_fl(rand[j], rand_value);
261  }
262  else {
263  for (int i = 0; i < 3; i++) {
264  rand[j][i] = fmodf(r[i] * 2.0 - 1.0 + rand_offset, 1.0f);
265  rand[j][i] = fmodf(sin(rand[j][i] * 12.9898 + j * 78.233) * 43758.5453, 1.0f);
266  }
267  }
268  }
269  /* Calculate Random matrix. */
270  float mat_rnd[4][4];
271  float loc[3], rot[3];
272  float scale[3] = {1.0f, 1.0f, 1.0f};
273  mul_v3_v3v3(loc, mmd->rnd_offset, rand[0]);
274  mul_v3_v3v3(rot, mmd->rnd_rot, rand[1]);
275  madd_v3_v3v3(scale, mmd->rnd_scale, rand[2]);
276 
277  loc_eul_size_to_mat4(mat_rnd, loc, rot, scale);
278 
279  /* Duplicate original strokes to create this instance. */
280  LISTBASE_FOREACH_BACKWARD (tmpStrokes *, iter, &stroke_cache) {
281  /* Duplicate stroke */
282  bGPDstroke *gps_dst = BKE_gpencil_stroke_duplicate(iter->gps, true, true);
283 
284  /* Move points */
285  for (int i = 0; i < iter->gps->totpoints; i++) {
286  bGPDspoint *pt = &gps_dst->points[i];
287  /* Apply randomness matrix. */
288  mul_m4_v3(mat_rnd, &pt->x);
289 
290  /* Apply object local transform (Rot/Scale). */
291  if ((mmd->flag & GP_ARRAY_USE_OB_OFFSET) && (mmd->object)) {
292  mul_m4_v3(mat, &pt->x);
293  }
294  /* Global Rotate and scale. */
295  mul_mat3_m4_v3(current_offset, &pt->x);
296  /* Global translate. */
297  add_v3_v3(&pt->x, current_offset[3]);
298  }
299 
300  /* If replace material, use new one. */
301  if ((mmd->mat_rpl > 0) && (mmd->mat_rpl <= ob->totcol)) {
302  gps_dst->mat_nr = mmd->mat_rpl - 1;
303  }
304 
305  /* Add new stroke. */
306  BLI_addhead(&iter->gpf->strokes, gps_dst);
307  /* Calc bounding box. */
309  }
310  }
311 
312  /* Free temp data. */
313  LISTBASE_FOREACH_MUTABLE (tmpStrokes *, tmp, &stroke_cache) {
314  BLI_freelinkN(&stroke_cache, tmp);
315  }
316  }
317 }
318 
319 static void bakeModifier(Main *UNUSED(bmain),
322  Object *ob)
323 {
326 }
327 
328 /* -------------------------------- */
329 
330 /* Generic "generateStrokes" callback */
332 {
335 }
336 
339  const int UNUSED(mode))
340 {
342  if (lmd->object != NULL) {
343  DEG_add_object_relation(ctx->node, lmd->object, DEG_OB_COMP_GEOMETRY, "Array Modifier");
344  DEG_add_object_relation(ctx->node, lmd->object, DEG_OB_COMP_TRANSFORM, "Array Modifier");
345  }
346  DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Array Modifier");
347 }
348 
349 static void foreachIDLink(GpencilModifierData *md, Object *ob, IDWalkFunc walk, void *userData)
350 {
352 
353  walk(userData, ob, (ID **)&mmd->material, IDWALK_CB_USER);
354  walk(userData, ob, (ID **)&mmd->object, IDWALK_CB_NOP);
355 }
356 
357 static void panel_draw(const bContext *UNUSED(C), Panel *panel)
358 {
359  uiLayout *layout = panel->layout;
360 
362 
363  uiLayoutSetPropSep(layout, true);
364 
365  uiItemR(layout, ptr, "count", 0, NULL, ICON_NONE);
366  uiItemR(layout, ptr, "replace_material", 0, IFACE_("Material Override"), ICON_NONE);
367 
369 }
370 
371 static void relative_offset_header_draw(const bContext *UNUSED(C), Panel *panel)
372 {
373  uiLayout *layout = panel->layout;
374 
376 
377  uiItemR(layout, ptr, "use_relative_offset", 0, IFACE_("Relative Offset"), ICON_NONE);
378 }
379 
380 static void relative_offset_draw(const bContext *UNUSED(C), Panel *panel)
381 {
382  uiLayout *layout = panel->layout;
383 
385 
386  uiLayoutSetPropSep(layout, true);
387 
388  uiLayout *col = uiLayoutColumn(layout, false);
389 
390  uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_relative_offset"));
391  uiItemR(col, ptr, "relative_offset", 0, IFACE_("Factor"), ICON_NONE);
392 }
393 
394 static void constant_offset_header_draw(const bContext *UNUSED(C), Panel *panel)
395 {
396  uiLayout *layout = panel->layout;
397 
399 
400  uiItemR(layout, ptr, "use_constant_offset", 0, IFACE_("Constant Offset"), ICON_NONE);
401 }
402 
403 static void constant_offset_draw(const bContext *UNUSED(C), Panel *panel)
404 {
405  uiLayout *layout = panel->layout;
406 
408 
409  uiLayoutSetPropSep(layout, true);
410 
411  uiLayout *col = uiLayoutColumn(layout, false);
412 
413  uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_constant_offset"));
414  uiItemR(col, ptr, "constant_offset", 0, IFACE_("Distance"), ICON_NONE);
415 }
416 
420 static void object_offset_header_draw(const bContext *UNUSED(C), Panel *panel)
421 {
422  uiLayout *layout = panel->layout;
423 
425 
426  uiItemR(layout, ptr, "use_object_offset", 0, NULL, ICON_NONE);
427 }
428 
429 static void object_offset_draw(const bContext *UNUSED(C), Panel *panel)
430 {
431  uiLayout *layout = panel->layout;
432 
434 
435  uiLayoutSetPropSep(layout, true);
436 
437  uiLayout *col = uiLayoutColumn(layout, false);
438 
439  uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_object_offset"));
440  uiItemR(col, ptr, "offset_object", 0, NULL, ICON_NONE);
441 }
442 
443 static void random_panel_draw(const bContext *UNUSED(C), Panel *panel)
444 {
445  uiLayout *layout = panel->layout;
446 
448 
449  uiLayoutSetPropSep(layout, true);
450 
451  uiItemR(layout, ptr, "random_offset", 0, IFACE_("Offset"), ICON_NONE);
452  uiItemR(layout, ptr, "random_rotation", 0, IFACE_("Rotation"), ICON_NONE);
453  uiItemR(layout, ptr, "random_scale", 0, IFACE_("Scale"), ICON_NONE);
454  uiItemR(layout, ptr, "use_uniform_random_scale", 0, NULL, ICON_NONE);
455  uiItemR(layout, ptr, "seed", 0, NULL, ICON_NONE);
456 }
457 
458 static void mask_panel_draw(const bContext *UNUSED(C), Panel *panel)
459 {
460  gpencil_modifier_masking_panel_draw(panel, true, false);
461 }
462 
463 static void panelRegister(ARegionType *region_type)
464 {
466  region_type, eGpencilModifierType_Array, panel_draw);
468  "relative_offset",
469  "",
472  panel_type);
474  "constant_offset",
475  "",
478  panel_type);
480  region_type, "object_offset", "", object_offset_header_draw, object_offset_draw, panel_type);
482  region_type, "randomize", "Randomize", NULL, random_panel_draw, panel_type);
484  region_type, "mask", "Influence", NULL, mask_panel_draw, panel_type);
485 }
486 
488  /* name */ N_("Array"),
489  /* structName */ "ArrayGpencilModifierData",
490  /* structSize */ sizeof(ArrayGpencilModifierData),
493 
494  /* copyData */ copyData,
495 
496  /* deformStroke */ NULL,
497  /* generateStrokes */ generateStrokes,
498  /* bakeModifier */ bakeModifier,
499  /* remapTime */ NULL,
500 
501  /* initData */ initData,
502  /* freeData */ NULL,
503  /* isDisabled */ NULL,
504  /* updateDepsgraph */ updateDepsgraph,
505  /* dependsOnTime */ NULL,
506  /* foreachIDLink */ foreachIDLink,
507  /* foreachTexLink */ NULL,
508  /* panelRegister */ panelRegister,
509 };
struct bGPDstroke * BKE_gpencil_stroke_duplicate(struct bGPDstroke *gps_src, bool dup_points, bool dup_curve)
Definition: gpencil.c:855
void BKE_gpencil_stroke_boundingbox_calc(struct bGPDstroke *gps)
bool BKE_gpencil_stroke_minmax(const struct bGPDstroke *gps, bool use_select, float r_min[3], float r_max[3])
void BKE_gpencil_modifier_copydata_generic(const struct GpencilModifierData *md_src, struct GpencilModifierData *md_dst)
@ eGpencilModifierTypeFlag_SupportsEditmode
struct bGPDframe * BKE_gpencil_frame_retime_get(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct bGPDlayer *gpl)
@ eGpencilModifierTypeType_Gpencil
@ IDWALK_CB_USER
Definition: BKE_lib_query.h:73
@ IDWALK_CB_NOP
Definition: BKE_lib_query.h:33
void(* IDWalkFunc)(void *userData, struct Object *ob, struct ID **idpoin, int cb_flag)
Definition: BKE_modifier.h:107
General operations, lookup, etc. for blender objects.
#define BLI_assert(a)
Definition: BLI_assert.h:46
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
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:60
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:239
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
Definition: BLI_listbase.h:354
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
Definition: BLI_listbase.h:348
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
Definition: math_matrix.c:259
void unit_m4(float m[4][4])
Definition: rct.c:1090
void mul_mat3_m4_v3(const float M[4][4], float r[3])
Definition: math_matrix.c:790
bool invert_m4_m4(float R[4][4], const float A[4][4])
Definition: math_matrix.c:1287
void mul_m4_v3(const float M[4][4], float r[3])
Definition: math_matrix.c:729
#define mul_m4_series(...)
void copy_m4_m4(float m1[4][4], const float m2[4][4])
Definition: math_matrix.c:77
void loc_eul_size_to_mat4(float R[4][4], const float loc[3], const float eul[3], const float size[3])
Definition: math_matrix.c:2547
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void mul_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void madd_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
Random number functions.
void BLI_halton_3d(const unsigned int prime[3], double offset[3], int n, double *r)
Definition: rand.cc:311
unsigned int uint
Definition: BLI_sys_types.h:67
#define INIT_MINMAX(min, max)
#define ARRAY_SET_ITEMS(...)
#define UNUSED(x)
#define MEMCMP_STRUCT_AFTER_IS_ZERO(struct_var, member)
#define MEMCPY_STRUCT_AFTER(struct_dst, struct_src, member)
#define CLAMP3_MIN(vec, b)
#define IFACE_(msgid)
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
void DEG_add_object_relation(struct DepsNodeHandle *node_handle, struct Object *object, eDepsObjectComponentType component, const char *description)
@ DEG_OB_COMP_GEOMETRY
@ DEG_OB_COMP_TRANSFORM
struct Scene * DEG_get_evaluated_scene(const struct Depsgraph *graph)
#define DNA_struct_default_get(struct_name)
Definition: DNA_defaults.h:29
@ GP_ARRAY_UNIFORM_RANDOM_SCALE
@ GP_ARRAY_INVERT_MATERIAL
@ GP_ARRAY_INVERT_LAYERPASS
@ GP_ARRAY_USE_OB_OFFSET
@ eGpencilModifierType_Array
struct ArrayGpencilModifierData ArrayGpencilModifierData
Object is a sort of wrapper for general info.
@ UI_PANEL_DATA_EXPAND_ROOT
@ UI_SUBPANEL_DATA_EXPAND_1
_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.
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)
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 void constant_offset_draw(const bContext *UNUSED(C), Panel *panel)
static void BKE_gpencil_instance_modifier_instance_tfm(Object *ob, ArrayGpencilModifierData *mmd, const int elem_idx, float r_mat[4][4], float r_offset[4][4])
static void relative_offset_draw(const bContext *UNUSED(C), Panel *panel)
static void relative_offset_header_draw(const bContext *UNUSED(C), Panel *panel)
struct tmpStrokes tmpStrokes
static void updateDepsgraph(GpencilModifierData *md, const ModifierUpdateDepsgraphContext *ctx, const int UNUSED(mode))
static void constant_offset_header_draw(const bContext *UNUSED(C), Panel *panel)
static void object_offset_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 bool gpencil_data_selected_minmax(ArrayGpencilModifierData *mmd, Object *ob, float r_min[3], float r_max[3])
static void bakeModifier(Main *UNUSED(bmain), Depsgraph *depsgraph, GpencilModifierData *md, Object *ob)
static void generate_geometry(GpencilModifierData *md, Depsgraph *depsgraph, Scene *scene, Object *ob)
static void copyData(const GpencilModifierData *md, GpencilModifierData *target)
static void panel_draw(const bContext *UNUSED(C), Panel *panel)
static void panelRegister(ARegionType *region_type)
GpencilModifierTypeInfo modifierType_Gpencil_Array
static void initData(GpencilModifierData *md)
static void generateStrokes(GpencilModifierData *md, Depsgraph *depsgraph, Object *ob)
static void object_offset_header_draw(const bContext *UNUSED(C), Panel *panel)
#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)
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
static unsigned long seed
Definition: btSoftBody.h:39
Scene scene
const Depsgraph * depsgraph
#define rot(x, k)
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
#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
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:4863
#define min(a, b)
Definition: sort.c:35
Definition: DNA_ID.h:368
Definition: BKE_main.h:121
struct DepsNodeHandle * node
Definition: BKE_modifier.h:134
float obmat[4][4]
void * data
struct uiLayout * layout
ListBase strokes
bGPDspoint * points
ListBase layers
struct tmpStrokes * next
bGPDframe * gpf
bGPDstroke * gps
struct tmpStrokes * prev
float max
#define N_(msgid)
PointerRNA * ptr
Definition: wm_files.c:3480