Blender  V2.93
MOD_gpencilarray.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2017, Blender Foundation
17  * This is a new part of Blender
18  */
19 
24 #include <stdio.h>
25 
26 #include "MEM_guardedalloc.h"
27 
28 #include "BLI_utildefines.h"
29 
30 #include "BLI_hash.h"
31 #include "BLI_rand.h"
32 
33 #include "BLI_blenlib.h"
34 #include "BLI_math.h"
35 #include "BLI_rand.h"
36 
37 #include "BLT_translation.h"
38 
39 #include "DNA_defaults.h"
41 #include "DNA_gpencil_types.h"
42 #include "DNA_object_types.h"
43 #include "DNA_scene_types.h"
44 #include "DNA_screen_types.h"
45 
46 #include "BKE_context.h"
47 #include "BKE_gpencil.h"
48 #include "BKE_gpencil_geom.h"
49 #include "BKE_gpencil_modifier.h"
50 #include "BKE_lib_query.h"
51 #include "BKE_main.h"
52 #include "BKE_modifier.h"
53 #include "BKE_object.h"
54 #include "BKE_screen.h"
55 
56 #include "UI_interface.h"
57 #include "UI_resources.h"
58 
59 #include "RNA_access.h"
60 
61 #include "DEG_depsgraph.h"
62 #include "DEG_depsgraph_build.h"
63 #include "DEG_depsgraph_query.h"
64 
66 #include "MOD_gpencil_ui_common.h"
67 #include "MOD_gpencil_util.h"
68 
69 typedef struct tmpStrokes {
70  struct tmpStrokes *next, *prev;
74 
75 static void initData(GpencilModifierData *md)
76 {
78 
79  BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(gpmd, modifier));
80 
82 
83  /* Open the first subpanel too, because it's activated by default. */
85 }
86 
87 static void copyData(const GpencilModifierData *md, GpencilModifierData *target)
88 {
90 }
91 
92 /* -------------------------------- */
93 /* helper function for per-instance positioning */
96  const int elem_idx,
97  float r_mat[4][4],
98  float r_offset[4][4])
99 {
100  float offset[3], rot[3], scale[3];
101  ARRAY_SET_ITEMS(scale, 1.0f, 1.0f, 1.0f);
102  zero_v3(rot);
103 
104  if (mmd->flag & GP_ARRAY_USE_OFFSET) {
105  offset[0] = mmd->offset[0] * elem_idx;
106  offset[1] = mmd->offset[1] * elem_idx;
107  offset[2] = mmd->offset[2] * elem_idx;
108  }
109  else {
110  zero_v3(offset);
111  }
112 
113  /* Calculate matrix */
114  loc_eul_size_to_mat4(r_mat, offset, rot, scale);
115  copy_m4_m4(r_offset, r_mat);
116 
117  /* offset object */
118  if ((mmd->flag & GP_ARRAY_USE_OB_OFFSET) && (mmd->object)) {
119  float mat_offset[4][4];
120  float obinv[4][4];
121 
122  unit_m4(mat_offset);
123  add_v3_v3(mat_offset[3], mmd->offset);
124  invert_m4_m4(obinv, ob->obmat);
125 
126  mul_m4_series(r_offset, mat_offset, obinv, mmd->object->obmat);
127  copy_m4_m4(mat_offset, r_offset);
128 
129  /* clear r_mat locations to avoid double transform */
130  zero_v3(r_mat[3]);
131  }
132 }
133 
134 /* array modifier - generate geometry callback (for viewport/rendering) */
137  Scene *scene,
138  Object *ob)
139 {
141  ListBase stroke_cache = {NULL, NULL};
142  /* Load the strokes to be duplicated. */
143  bGPdata *gpd = (bGPdata *)ob->data;
144  bool found = false;
145 
146  /* Get bounbox for relative offset. */
147  float size[3] = {0.0f, 0.0f, 0.0f};
148  if (mmd->flag & GP_ARRAY_USE_RELATIVE) {
150  const float min[3] = {-1.0f, -1.0f, -1.0f}, max[3] = {1.0f, 1.0f, 1.0f};
153  mul_v3_fl(size, 2.0f);
154  /* Need a minimum size (for flat drawings). */
155  CLAMP3_MIN(size, 0.01f);
156  }
157 
158  int seed = mmd->seed;
159  /* Make sure different modifiers get different seeds. */
160  seed += BLI_hash_string(ob->id.name + 2);
161  seed += BLI_hash_string(md->name);
162 
163  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
165  if (gpf == NULL) {
166  continue;
167  }
170  mmd->layername,
171  mmd->material,
172  mmd->pass_index,
173  mmd->layer_pass,
174  1,
175  gpl,
176  gps,
178  mmd->flag & GP_ARRAY_INVERT_PASS,
179  mmd->flag & GP_ARRAY_INVERT_LAYERPASS,
180  mmd->flag & GP_ARRAY_INVERT_MATERIAL)) {
181  tmpStrokes *tmp = MEM_callocN(sizeof(tmpStrokes), __func__);
182  tmp->gpf = gpf;
183  tmp->gps = gps;
184  BLI_addtail(&stroke_cache, tmp);
185 
186  found = true;
187  }
188  }
189  }
190 
191  if (found) {
192  /* Generate new instances of all existing strokes,
193  * keeping each instance together so they maintain
194  * the correct ordering relative to each other
195  */
196  float current_offset[4][4];
197  unit_m4(current_offset);
198 
199  float rand_offset = BLI_hash_int_01(seed);
200 
201  for (int x = 0; x < mmd->count; x++) {
202  /* original strokes are at index = 0 */
203  if (x == 0) {
204  continue;
205  }
206 
207  /* Compute transforms for this instance */
208  float mat[4][4];
209  float mat_offset[4][4];
210  BKE_gpencil_instance_modifier_instance_tfm(ob, mmd, x, mat, mat_offset);
211 
212  if ((mmd->flag & GP_ARRAY_USE_OB_OFFSET) && (mmd->object)) {
213  /* recalculate cumulative offset here */
214  mul_m4_m4m4(current_offset, current_offset, mat_offset);
215  }
216  else {
217  copy_m4_m4(current_offset, mat);
218  }
219 
220  /* Apply relative offset. */
221  if (mmd->flag & GP_ARRAY_USE_RELATIVE) {
222  float relative[3];
223  mul_v3_v3v3(relative, mmd->shift, size);
224  madd_v3_v3fl(current_offset[3], relative, x);
225  }
226 
227  float rand[3][3];
228  for (int j = 0; j < 3; j++) {
229  const uint primes[3] = {2, 3, 7};
230  double offset[3] = {0.0, 0.0, 0.0};
231  double r[3];
232  /* To ensure a nice distribution, we use halton sequence and offset using the seed. */
233  BLI_halton_3d(primes, offset, x, r);
234 
235  if ((mmd->flag & GP_ARRAY_UNIFORM_RANDOM_SCALE) && j == 2) {
236  float rand_value;
237  rand_value = fmodf(r[0] * 2.0 - 1.0 + rand_offset, 1.0f);
238  rand_value = fmodf(sin(rand_value * 12.9898 + j * 78.233) * 43758.5453, 1.0f);
239  copy_v3_fl(rand[j], rand_value);
240  }
241  else {
242  for (int i = 0; i < 3; i++) {
243  rand[j][i] = fmodf(r[i] * 2.0 - 1.0 + rand_offset, 1.0f);
244  rand[j][i] = fmodf(sin(rand[j][i] * 12.9898 + j * 78.233) * 43758.5453, 1.0f);
245  }
246  }
247  }
248  /* Calculate Random matrix. */
249  float mat_rnd[4][4];
250  float loc[3], rot[3];
251  float scale[3] = {1.0f, 1.0f, 1.0f};
252  mul_v3_v3v3(loc, mmd->rnd_offset, rand[0]);
253  mul_v3_v3v3(rot, mmd->rnd_rot, rand[1]);
254  madd_v3_v3v3(scale, mmd->rnd_scale, rand[2]);
255 
256  loc_eul_size_to_mat4(mat_rnd, loc, rot, scale);
257 
258  /* Duplicate original strokes to create this instance. */
259  LISTBASE_FOREACH_BACKWARD (tmpStrokes *, iter, &stroke_cache) {
260  /* Duplicate stroke */
261  bGPDstroke *gps_dst = BKE_gpencil_stroke_duplicate(iter->gps, true, true);
262 
263  /* Move points */
264  for (int i = 0; i < iter->gps->totpoints; i++) {
265  bGPDspoint *pt = &gps_dst->points[i];
266  /* Apply randomness matrix. */
267  mul_m4_v3(mat_rnd, &pt->x);
268 
269  /* Apply object local transform (Rot/Scale). */
270  if ((mmd->flag & GP_ARRAY_USE_OB_OFFSET) && (mmd->object)) {
271  mul_m4_v3(mat, &pt->x);
272  }
273  /* Global Rotate and scale. */
274  mul_mat3_m4_v3(current_offset, &pt->x);
275  /* Global translate. */
276  add_v3_v3(&pt->x, current_offset[3]);
277  }
278 
279  /* If replace material, use new one. */
280  if ((mmd->mat_rpl > 0) && (mmd->mat_rpl <= ob->totcol)) {
281  gps_dst->mat_nr = mmd->mat_rpl - 1;
282  }
283 
284  /* Add new stroke. */
285  BLI_addhead(&iter->gpf->strokes, gps_dst);
286  /* Calc bounding box. */
288  }
289  }
290 
291  /* Free temp data. */
292  LISTBASE_FOREACH_MUTABLE (tmpStrokes *, tmp, &stroke_cache) {
293  BLI_freelinkN(&stroke_cache, tmp);
294  }
295  }
296 }
297 
298 static void bakeModifier(Main *UNUSED(bmain),
301  Object *ob)
302 {
305 }
306 
307 /* -------------------------------- */
308 
309 /* Generic "generateStrokes" callback */
311 {
314 }
315 
318  const int UNUSED(mode))
319 {
321  if (lmd->object != NULL) {
322  DEG_add_object_relation(ctx->node, lmd->object, DEG_OB_COMP_GEOMETRY, "Array Modifier");
323  DEG_add_object_relation(ctx->node, lmd->object, DEG_OB_COMP_TRANSFORM, "Array Modifier");
324  }
325  DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Array Modifier");
326 }
327 
328 static void foreachIDLink(GpencilModifierData *md, Object *ob, IDWalkFunc walk, void *userData)
329 {
331 
332  walk(userData, ob, (ID **)&mmd->material, IDWALK_CB_USER);
333  walk(userData, ob, (ID **)&mmd->object, IDWALK_CB_NOP);
334 }
335 
336 static void panel_draw(const bContext *UNUSED(C), Panel *panel)
337 {
338  uiLayout *layout = panel->layout;
339 
341 
342  uiLayoutSetPropSep(layout, true);
343 
344  uiItemR(layout, ptr, "count", 0, NULL, ICON_NONE);
345  uiItemR(layout, ptr, "replace_material", 0, IFACE_("Material Override"), ICON_NONE);
346 
348 }
349 
350 static void relative_offset_header_draw(const bContext *UNUSED(C), Panel *panel)
351 {
352  uiLayout *layout = panel->layout;
353 
355 
356  uiItemR(layout, ptr, "use_relative_offset", 0, IFACE_("Relative Offset"), ICON_NONE);
357 }
358 
359 static void relative_offset_draw(const bContext *UNUSED(C), Panel *panel)
360 {
361  uiLayout *layout = panel->layout;
362 
364 
365  uiLayoutSetPropSep(layout, true);
366 
367  uiLayout *col = uiLayoutColumn(layout, false);
368 
369  uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_relative_offset"));
370  uiItemR(col, ptr, "relative_offset", 0, IFACE_("Factor"), ICON_NONE);
371 }
372 
373 static void constant_offset_header_draw(const bContext *UNUSED(C), Panel *panel)
374 {
375  uiLayout *layout = panel->layout;
376 
378 
379  uiItemR(layout, ptr, "use_constant_offset", 0, IFACE_("Constant Offset"), ICON_NONE);
380 }
381 
382 static void constant_offset_draw(const bContext *UNUSED(C), Panel *panel)
383 {
384  uiLayout *layout = panel->layout;
385 
387 
388  uiLayoutSetPropSep(layout, true);
389 
390  uiLayout *col = uiLayoutColumn(layout, false);
391 
392  uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_constant_offset"));
393  uiItemR(col, ptr, "constant_offset", 0, IFACE_("Distance"), ICON_NONE);
394 }
395 
399 static void object_offset_header_draw(const bContext *UNUSED(C), Panel *panel)
400 {
401  uiLayout *layout = panel->layout;
402 
404 
405  uiItemR(layout, ptr, "use_object_offset", 0, NULL, ICON_NONE);
406 }
407 
408 static void object_offset_draw(const bContext *UNUSED(C), Panel *panel)
409 {
410  uiLayout *layout = panel->layout;
411 
413 
414  uiLayoutSetPropSep(layout, true);
415 
416  uiLayout *col = uiLayoutColumn(layout, false);
417 
418  uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_object_offset"));
419  uiItemR(col, ptr, "offset_object", 0, NULL, ICON_NONE);
420 }
421 
422 static void random_panel_draw(const bContext *UNUSED(C), Panel *panel)
423 {
424  uiLayout *layout = panel->layout;
425 
427 
428  uiLayoutSetPropSep(layout, true);
429 
430  uiItemR(layout, ptr, "random_offset", 0, IFACE_("Offset"), ICON_NONE);
431  uiItemR(layout, ptr, "random_rotation", 0, IFACE_("Rotation"), ICON_NONE);
432  uiItemR(layout, ptr, "random_scale", 0, IFACE_("Scale"), ICON_NONE);
433  uiItemR(layout, ptr, "use_uniform_random_scale", 0, NULL, ICON_NONE);
434  uiItemR(layout, ptr, "seed", 0, NULL, ICON_NONE);
435 }
436 
437 static void mask_panel_draw(const bContext *UNUSED(C), Panel *panel)
438 {
439  gpencil_modifier_masking_panel_draw(panel, true, false);
440 }
441 
442 static void panelRegister(ARegionType *region_type)
443 {
445  region_type, eGpencilModifierType_Array, panel_draw);
447  "relative_offset",
448  "",
451  panel_type);
453  "constant_offset",
454  "",
457  panel_type);
459  region_type, "object_offset", "", object_offset_header_draw, object_offset_draw, panel_type);
461  region_type, "randomize", "Randomize", NULL, random_panel_draw, panel_type);
463  region_type, "mask", "Influence", NULL, mask_panel_draw, panel_type);
464 }
465 
467  /* name */ "Array",
468  /* structName */ "ArrayGpencilModifierData",
469  /* structSize */ sizeof(ArrayGpencilModifierData),
472 
473  /* copyData */ copyData,
474 
475  /* deformStroke */ NULL,
476  /* generateStrokes */ generateStrokes,
477  /* bakeModifier */ bakeModifier,
478  /* remapTime */ NULL,
479 
480  /* initData */ initData,
481  /* freeData */ NULL,
482  /* isDisabled */ NULL,
483  /* updateDepsgraph */ updateDepsgraph,
484  /* dependsOnTime */ NULL,
485  /* foreachIDLink */ foreachIDLink,
486  /* foreachTexLink */ NULL,
487  /* panelRegister */ panelRegister,
488 };
struct bGPDstroke * BKE_gpencil_stroke_duplicate(struct bGPDstroke *gps_src, const bool dup_points, const bool dup_curve)
Definition: gpencil.c:957
void BKE_gpencil_stroke_boundingbox_calc(struct bGPDstroke *gps)
Definition: gpencil_geom.c:144
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:87
@ IDWALK_CB_NOP
Definition: BKE_lib_query.h:47
void(* IDWalkFunc)(void *userData, struct Object *ob, struct ID **idpoin, int cb_flag)
Definition: BKE_modifier.h:120
General operations, lookup, etc. for blender objects.
void BKE_boundbox_calc_size_aabb(const struct BoundBox *bb, float r_size[3])
void BKE_boundbox_init_from_minmax(struct BoundBox *bb, const float min[3], const float max[3])
Definition: object.c:3778
struct BoundBox * BKE_object_boundbox_get(struct Object *ob)
Definition: object.c:3817
#define BLI_assert(a)
Definition: BLI_assert.h:58
BLI_INLINE float BLI_hash_int_01(unsigned int k)
Definition: BLI_hash.h:108
BLI_INLINE unsigned int BLI_hash_string(const char *str)
Definition: BLI_hash.h:83
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:87
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:281
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
Definition: BLI_listbase.h:188
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
Definition: BLI_listbase.h:184
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:110
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
Definition: math_matrix.c:262
void unit_m4(float m[4][4])
Definition: rct.c:1140
void mul_mat3_m4_v3(const float M[4][4], float r[3])
Definition: math_matrix.c:794
bool invert_m4_m4(float R[4][4], const float A[4][4])
Definition: math_matrix.c:1278
void mul_m4_v3(const float M[4][4], float r[3])
Definition: math_matrix.c:732
#define mul_m4_series(...)
void copy_m4_m4(float m1[4][4], const float m2[4][4])
Definition: math_matrix.c:95
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:2653
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 mul_v3_fl(float r[3], float f)
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:323
unsigned int uint
Definition: BLI_sys_types.h:83
#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:51
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:44
@ 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 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:39
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
#define fmodf(x, y)
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
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:6261
#define min(a, b)
Definition: sort.c:51
Definition: DNA_ID.h:273
Definition: BKE_main.h:116
struct DepsNodeHandle * node
Definition: BKE_modifier.h:147
float obmat[4][4]
void * data
struct uiLayout * layout
ListBase strokes
bGPDspoint * points
struct tmpStrokes * next
bGPDframe * gpf
bGPDstroke * gps
struct tmpStrokes * prev
float max
PointerRNA * ptr
Definition: wm_files.c:3157