Blender  V2.93
gpencil_mesh.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) 2008, Blender Foundation
17  * This is a new part of Blender
18  * Operator for converting Grease Pencil data to geometry
19  */
20 
25 #include "MEM_guardedalloc.h"
26 
27 #include "BLI_blenlib.h"
28 #include "BLI_ghash.h"
29 #include "BLI_math.h"
30 
31 #include "DNA_anim_types.h"
32 #include "DNA_gpencil_types.h"
33 #include "DNA_scene_types.h"
34 #include "DNA_screen_types.h"
35 
36 #include "BKE_anim_data.h"
37 #include "BKE_context.h"
38 #include "BKE_duplilist.h"
39 #include "BKE_gpencil_geom.h"
40 #include "BKE_layer.h"
41 #include "BKE_main.h"
42 #include "BKE_material.h"
43 #include "BKE_object.h"
44 #include "BKE_report.h"
45 #include "BKE_scene.h"
46 
47 #include "DEG_depsgraph.h"
48 #include "DEG_depsgraph_query.h"
49 
50 #include "WM_api.h"
51 #include "WM_types.h"
52 
53 #include "RNA_access.h"
54 #include "RNA_define.h"
55 
56 #include "ED_gpencil.h"
58 
59 #include "gpencil_intern.h"
60 
61 /* Check frame_end is always > start frame! */
63  struct Scene *UNUSED(scene),
64  struct PointerRNA *ptr)
65 {
66  int frame_start = RNA_int_get(ptr, "frame_start");
67  int frame_end = RNA_int_get(ptr, "frame_end");
68 
69  if (frame_end <= frame_start) {
70  RNA_int_set(ptr, "frame_end", frame_start + 1);
71  }
72 }
73 
74 /* Extract mesh animation to Grease Pencil. */
76 {
78  return false;
79  }
80 
81  /* Only if the current view is 3D View. */
83  return (area && area->spacetype);
84 }
85 
86 typedef struct GpBakeOb {
87  struct GpBakeOb *next, *prev;
90 
91 /* Get list of keyframes used by selected objects. */
92 static void animdata_keyframe_list_get(ListBase *ob_list,
93  const bool only_selected,
94  GHash *r_keyframes)
95 {
96  /* Loop all objects to get the list of keyframes used. */
97  LISTBASE_FOREACH (GpBakeOb *, elem, ob_list) {
98  Object *ob = elem->ob;
100  if ((adt == NULL) || (adt->action == NULL)) {
101  continue;
102  }
103  LISTBASE_FOREACH (FCurve *, fcurve, &adt->action->curves) {
104  int i;
105  BezTriple *bezt;
106  for (i = 0, bezt = fcurve->bezt; i < fcurve->totvert; i++, bezt++) {
107  /* Keyframe number is x value of point. */
108  if ((bezt->f2 & SELECT) || (!only_selected)) {
109  /* Insert only one key for each keyframe number. */
110  int key = (int)bezt->vec[1][0];
111  if (!BLI_ghash_haskey(r_keyframes, POINTER_FROM_INT(key))) {
112  BLI_ghash_insert(r_keyframes, POINTER_FROM_INT(key), POINTER_FROM_INT(key));
113  }
114  }
115  }
116  }
117  }
118 }
119 
121 {
122  GpBakeOb *elem = NULL;
123  ListBase *lb;
124  DupliObject *dob;
126  for (dob = lb->first; dob; dob = dob->next) {
127  if (dob->ob->type != OB_MESH) {
128  continue;
129  }
130  elem = MEM_callocN(sizeof(GpBakeOb), __func__);
131  elem->ob = dob->ob;
132  BLI_addtail(list, elem);
133  }
134 
136 }
137 
139 {
140  GpBakeOb *elem = NULL;
141  bool simple_material = false;
142 
143  /* Add active object. In some files this could not be in selected array. */
144  Object *obact = CTX_data_active_object(C);
145 
146  if (obact->type == OB_MESH) {
147  elem = MEM_callocN(sizeof(GpBakeOb), __func__);
148  elem->ob = obact;
149  BLI_addtail(list, elem);
150  }
151  /* Add duplilist. */
152  else if (obact->type == OB_EMPTY) {
153  gpencil_bake_duplilist(depsgraph, scene, obact, list);
154  simple_material |= true;
155  }
156 
157  /* Add other selected objects. */
158  CTX_DATA_BEGIN (C, Object *, ob, selected_objects) {
159  if (ob == obact) {
160  continue;
161  }
162  /* Add selected meshes.*/
163  if (ob->type == OB_MESH) {
164  elem = MEM_callocN(sizeof(GpBakeOb), __func__);
165  elem->ob = ob;
166  BLI_addtail(list, elem);
167  }
168 
169  /* Add duplilist. */
170  if (ob->type == OB_EMPTY) {
171  gpencil_bake_duplilist(depsgraph, scene, obact, list);
172  }
173  }
174  CTX_DATA_END;
175 
176  return simple_material;
177 }
178 
180 {
181  LISTBASE_FOREACH_MUTABLE (GpBakeOb *, elem, list) {
182  MEM_SAFE_FREE(elem);
183  }
184 }
185 
187 {
188  Main *bmain = CTX_data_main(C);
191  ARegion *region = CTX_wm_region(C);
192  View3D *v3d = CTX_wm_view3d(C);
193 
194  ListBase ob_selected_list = {NULL, NULL};
195  gpencil_bake_ob_list(C, depsgraph, scene, &ob_selected_list);
196 
197  /* Cannot check this in poll because the active object changes. */
198  if (ob_selected_list.first == NULL) {
199  BKE_report(op->reports, RPT_INFO, "No valid object selected");
200  gpencil_bake_free_ob_list(&ob_selected_list);
201  return OPERATOR_CANCELLED;
202  }
203 
204  /* Grab all relevant settings. */
205  const int step = RNA_int_get(op->ptr, "step");
206 
207  const int frame_start = (scene->r.sfra > RNA_int_get(op->ptr, "frame_start")) ?
208  scene->r.sfra :
209  RNA_int_get(op->ptr, "frame_start");
210 
211  const int frame_end = (scene->r.efra < RNA_int_get(op->ptr, "frame_end")) ?
212  scene->r.efra :
213  RNA_int_get(op->ptr, "frame_end");
214 
215  const float angle = RNA_float_get(op->ptr, "angle");
216  const int thickness = RNA_int_get(op->ptr, "thickness");
217  const bool use_seams = RNA_boolean_get(op->ptr, "seams");
218  const bool use_faces = RNA_boolean_get(op->ptr, "faces");
219  const bool only_selected = RNA_boolean_get(op->ptr, "only_selected");
220  const float offset = RNA_float_get(op->ptr, "offset");
221  const int frame_offset = RNA_int_get(op->ptr, "frame_target") - frame_start;
222  const int project_type = RNA_enum_get(op->ptr, "project_type");
223  eGP_TargetObjectMode target = RNA_enum_get(op->ptr, "target");
224 
225  /* Create a new grease pencil object in origin or reuse selected. */
226  Object *ob_gpencil = NULL;
227  bool newob = false;
228 
229  if (target == GP_TARGET_OB_SELECTED) {
231  if (ob_gpencil != NULL) {
232  if (ob_gpencil->type != OB_GPENCIL) {
233  BKE_report(op->reports, RPT_WARNING, "Target object not a grease pencil, ignoring!");
234  ob_gpencil = NULL;
235  }
236  else if (BKE_object_obdata_is_libdata(ob_gpencil)) {
237  BKE_report(op->reports, RPT_WARNING, "Target object library-data, ignoring!");
238  ob_gpencil = NULL;
239  }
240  }
241  }
242 
243  if (ob_gpencil == NULL) {
244  ushort local_view_bits = (v3d && v3d->localvd) ? v3d->local_view_uuid : 0;
245  const float loc[3] = {0.0f, 0.0f, 0.0f};
246  ob_gpencil = ED_gpencil_add_object(C, loc, local_view_bits);
247  newob = true;
248  }
249 
250  bGPdata *gpd = (bGPdata *)ob_gpencil->data;
251  gpd->draw_mode = (project_type == GP_REPROJECT_KEEP) ? GP_DRAWMODE_3D : GP_DRAWMODE_2D;
252 
253  /* Set cursor to indicate working. */
254  WM_cursor_wait(true);
255 
256  GP_SpaceConversion gsc = {NULL};
257  SnapObjectContext *sctx = NULL;
258  if (project_type != GP_REPROJECT_KEEP) {
259  /* Init space conversion stuff. */
261  /* Move the grease pencil object to conversion data. */
262  gsc.ob = ob_gpencil;
263 
264  /* Init snap context for geometry projection. */
266 
267  /* Tag all existing strokes to avoid reprojections. */
268  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
269  LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
270  LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
271  gps->flag |= GP_STROKE_TAG;
272  }
273  }
274  }
275  }
276 
277  /* Loop all frame range. */
278  int oldframe = (int)DEG_get_ctime(depsgraph);
279  int key = -1;
280 
281  /* Get list of keyframes. */
282  GHash *keyframe_list = BLI_ghash_int_new(__func__);
283  if (only_selected) {
284  animdata_keyframe_list_get(&ob_selected_list, only_selected, keyframe_list);
285  }
286 
287  for (int i = frame_start; i < frame_end + 1; i++) {
288  key++;
289  /* Jump if not step limit but include last frame always. */
290  if ((key % step != 0) && (i != frame_end)) {
291  continue;
292  }
293 
294  /* Check if frame is in the list of frames to be exported. */
295  if ((only_selected) && (!BLI_ghash_haskey(keyframe_list, POINTER_FROM_INT(i)))) {
296  continue;
297  }
298 
299  /* Move scene to new frame. */
300  CFRA = i;
302 
303  /* Loop all objects in the list. */
304  LISTBASE_FOREACH (GpBakeOb *, elem, &ob_selected_list) {
305  Object *ob_eval = (Object *)DEG_get_evaluated_object(depsgraph, elem->ob);
306 
307  /* Generate strokes. */
309  depsgraph,
310  scene,
311  ob_gpencil,
312  elem->ob,
313  angle,
314  thickness,
315  offset,
316  ob_eval->obmat,
317  frame_offset,
318  use_seams,
319  use_faces);
320 
321  /* Reproject all un-tagged created strokes. */
322  if (project_type != GP_REPROJECT_KEEP) {
323  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
324  bGPDframe *gpf = gpl->actframe;
325  if (gpf == NULL) {
326  continue;
327  }
328  LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
329  if ((gps->flag & GP_STROKE_TAG) == 0) {
331  depsgraph, &gsc, sctx, gpl, gpf, gps, project_type, false);
332  gps->flag |= GP_STROKE_TAG;
333  }
334  }
335  }
336  }
337  }
338  }
339 
340  /* Return scene frame state and DB to original state. */
341  CFRA = oldframe;
343 
344  /* Remove unused materials. */
345  int actcol = ob_gpencil->actcol;
346  for (int slot = 1; slot <= ob_gpencil->totcol; slot++) {
347  while (slot <= ob_gpencil->totcol && !BKE_object_material_slot_used(ob_gpencil->data, slot)) {
348  ob_gpencil->actcol = slot;
350 
351  if (actcol >= slot) {
352  actcol--;
353  }
354  }
355  }
356  ob_gpencil->actcol = actcol;
357 
358  /* Untag all strokes. */
359  if (project_type != GP_REPROJECT_KEEP) {
360  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
361  LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
362  LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
363  gps->flag &= ~GP_STROKE_TAG;
364  }
365  }
366  }
367  }
368 
369  /* Free memory. */
370  gpencil_bake_free_ob_list(&ob_selected_list);
371  if (sctx != NULL) {
373  }
374  /* Free temp hash table. */
375  if (keyframe_list != NULL) {
376  BLI_ghash_free(keyframe_list, NULL, NULL);
377  }
378 
379  /* notifiers */
380  if (newob) {
382  }
386 
387  /* Reset cursor. */
388  WM_cursor_wait(false);
389 
390  /* done */
391  return OPERATOR_FINISHED;
392 }
393 
395  wmOperator *op,
396  const wmEvent *UNUSED(event))
397 {
398  /* Show popup dialog to allow editing. */
399  /* FIXME: hard-coded dimensions here are just arbitrary. */
400  return WM_operator_props_dialog_popup(C, op, 250);
401 }
402 
404 {
405  static const EnumPropertyItem reproject_type[] = {
406  {GP_REPROJECT_KEEP, "KEEP", 0, "No Reproject", ""},
407  {GP_REPROJECT_FRONT, "FRONT", 0, "Front", "Reproject the strokes using the X-Z plane"},
408  {GP_REPROJECT_SIDE, "SIDE", 0, "Side", "Reproject the strokes using the Y-Z plane"},
409  {GP_REPROJECT_TOP, "TOP", 0, "Top", "Reproject the strokes using the X-Y plane"},
411  "VIEW",
412  0,
413  "View",
414  "Reproject the strokes to end up on the same plane, as if drawn from the current viewpoint "
415  "using 'Cursor' Stroke Placement"},
417  "CURSOR",
418  0,
419  "Cursor",
420  "Reproject the strokes using the orientation of 3D cursor"},
421  {0, NULL, 0, NULL, NULL},
422  };
423 
424  static const EnumPropertyItem target_object_modes[] = {
425  {GP_TARGET_OB_NEW, "NEW", 0, "New Object", ""},
426  {GP_TARGET_OB_SELECTED, "SELECTED", 0, "Selected Object", ""},
427  {0, NULL, 0, NULL, NULL},
428  };
429 
430  PropertyRNA *prop;
431 
432  /* identifiers */
433  ot->name = "Bake Mesh Animation to Grease Pencil";
434  ot->idname = "GPENCIL_OT_bake_mesh_animation";
435  ot->description = "Bake mesh animation to grease pencil strokes";
436 
437  /* callbacks */
441 
442  /* flags */
444 
445  /* properties */
446  ot->prop = RNA_def_enum(ot->srna,
447  "target",
448  target_object_modes,
450  "Target Object",
451  "Target grease pencil");
453 
454  prop = RNA_def_int(
455  ot->srna, "frame_start", 1, 1, 100000, "Start Frame", "The start frame", 1, 100000);
456 
457  prop = RNA_def_int(
458  ot->srna, "frame_end", 250, 1, 100000, "End Frame", "The end frame of animation", 1, 100000);
460 
461  prop = RNA_def_int(ot->srna, "step", 1, 1, 100, "Step", "Step between generated frames", 1, 100);
462 
463  RNA_def_int(ot->srna, "thickness", 1, 1, 100, "Thickness", "", 1, 100);
464 
466  "angle",
467  0,
468  NULL,
469  DEG2RADF(0.0f),
470  DEG2RADF(180.0f),
471  "Threshold Angle",
472  "Threshold to determine ends of the strokes",
473  DEG2RADF(0.0f),
474  DEG2RADF(180.0f));
476 
478  "offset",
479  0.001f,
480  0.0,
481  100.0,
482  "Stroke Offset",
483  "Offset strokes from fill",
484  0.0,
485  100.00);
486 
487  RNA_def_boolean(ot->srna, "seams", 0, "Only Seam Edges", "Convert only seam edges");
488  RNA_def_boolean(ot->srna, "faces", 1, "Export Faces", "Export faces as filled strokes");
490  ot->srna, "only_selected", 0, "Only Selected Keyframes", "Convert only selected keyframes");
491  RNA_def_int(
492  ot->srna, "frame_target", 1, 1, 100000, "Target Frame", "Destination frame", 1, 100000);
493 
494  RNA_def_enum(ot->srna, "project_type", reproject_type, GP_REPROJECT_VIEW, "Projection Type", "");
495 }
struct AnimData * BKE_animdata_from_id(struct ID *id)
Definition: anim_data.c:96
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:714
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
#define CTX_DATA_BEGIN(C, Type, instance, member)
Definition: BKE_context.h:252
@ CTX_MODE_OBJECT
Definition: BKE_context.h:128
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1044
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
Definition: context.c:1424
struct Object * CTX_data_active_object(const bContext *C)
Definition: context.c:1279
struct View3D * CTX_wm_view3d(const bContext *C)
Definition: context.c:760
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:725
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1018
#define CTX_DATA_END
Definition: BKE_context.h:260
enum eContextObjectMode CTX_data_mode_enum(const bContext *C)
Definition: context.c:1174
struct ListBase * object_duplilist(struct Depsgraph *depsgraph, struct Scene *sce, struct Object *ob)
void free_object_duplilist(struct ListBase *lb)
bool BKE_gpencil_convert_mesh(struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob_gp, struct Object *ob_mesh, const float angle, const int thickness, const float offset, const float matrix[4][4], const int frame_offset, const bool use_seams, const bool use_faces)
struct Object * BKE_view_layer_non_active_selected_object(struct ViewLayer *view_layer, const struct View3D *v3d)
Definition: layer_utils.c:202
General operations, lookup, etc. for materials.
bool BKE_object_material_slot_remove(struct Main *bmain, struct Object *ob)
Definition: material.c:1107
bool BKE_object_material_slot_used(struct ID *id, short actcol)
Definition: material.c:465
General operations, lookup, etc. for blender objects.
bool BKE_object_obdata_is_libdata(const struct Object *ob)
void BKE_report(ReportList *reports, ReportType type, const char *message)
Definition: report.c:104
void BKE_scene_graph_update_for_newframe(struct Depsgraph *depsgraph)
Definition: scene.c:2794
bool BLI_ghash_haskey(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.c:941
GHash * BLI_ghash_int_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
Definition: BLI_ghash.c:756
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
Definition: BLI_ghash.c:1008
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
Definition: BLI_listbase.h:188
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:110
#define DEG2RADF(_deg)
unsigned short ushort
Definition: BLI_sys_types.h:84
#define POINTER_FROM_INT(i)
#define UNUSED(x)
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
float DEG_get_ctime(const Depsgraph *graph)
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
@ ID_RECALC_SELECT
Definition: DNA_ID.h:638
@ GP_DRAWMODE_3D
@ GP_DRAWMODE_2D
@ GP_STROKE_TAG
@ OB_EMPTY
@ OB_MESH
@ OB_GPENCIL
#define CFRA
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
eGP_TargetObjectMode
Definition: ED_gpencil.h:84
@ GP_TARGET_OB_SELECTED
Definition: ED_gpencil.h:86
@ GP_TARGET_OB_NEW
Definition: ED_gpencil.h:85
@ GP_REPROJECT_VIEW
Definition: ED_gpencil.h:74
@ GP_REPROJECT_CURSOR
Definition: ED_gpencil.h:78
@ GP_REPROJECT_KEEP
Definition: ED_gpencil.h:80
@ GP_REPROJECT_SIDE
Definition: ED_gpencil.h:71
@ GP_REPROJECT_TOP
Definition: ED_gpencil.h:72
@ GP_REPROJECT_FRONT
Definition: ED_gpencil.h:70
SnapObjectContext * ED_transform_snap_object_context_create_view3d(struct Scene *scene, int flag, const struct ARegion *region, const struct View3D *v3d)
void ED_transform_snap_object_context_destroy(SnapObjectContext *sctx)
Read Guarded memory(de)allocation.
#define MEM_SAFE_FREE(v)
@ PROP_SKIP_SAVE
Definition: RNA_types.h:204
#define C
Definition: RandGen.cpp:39
#define ND_OB_ACTIVE
Definition: WM_types.h:340
@ OPTYPE_UNDO
Definition: WM_types.h:155
@ OPTYPE_REGISTER
Definition: WM_types.h:153
#define NC_SCENE
Definition: WM_types.h:279
#define NA_ADDED
Definition: WM_types.h:464
#define NC_OBJECT
Definition: WM_types.h:280
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition: btVector3.h:356
#define SELECT
Scene scene
const Depsgraph * depsgraph
void gpencil_point_conversion_init(struct bContext *C, GP_SpaceConversion *r_gsc)
struct GpBakeOb GpBakeOb
static int gpencil_bake_mesh_animation_exec(bContext *C, wmOperator *op)
Definition: gpencil_mesh.c:186
static void gpencil_bake_free_ob_list(ListBase *list)
Definition: gpencil_mesh.c:179
static bool gpencil_bake_mesh_animation_poll(bContext *C)
Definition: gpencil_mesh.c:75
static void animdata_keyframe_list_get(ListBase *ob_list, const bool only_selected, GHash *r_keyframes)
Definition: gpencil_mesh.c:92
static void gpencil_bake_set_frame_end(struct Main *UNUSED(main), struct Scene *UNUSED(scene), struct PointerRNA *ptr)
Definition: gpencil_mesh.c:62
static int gpencil_bake_mesh_animation_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
Definition: gpencil_mesh.c:394
void GPENCIL_OT_bake_mesh_animation(wmOperatorType *ot)
Definition: gpencil_mesh.c:403
static void gpencil_bake_duplilist(Depsgraph *depsgraph, Scene *scene, Object *ob, ListBase *list)
Definition: gpencil_mesh.c:120
static bool gpencil_bake_ob_list(bContext *C, Depsgraph *depsgraph, Scene *scene, ListBase *list)
Definition: gpencil_mesh.c:138
Object * ED_gpencil_add_object(bContext *C, const float loc[3], ushort local_view_bits)
void ED_gpencil_stroke_reproject(Depsgraph *depsgraph, const GP_SpaceConversion *gsc, SnapObjectContext *sctx, bGPDlayer *gpl, bGPDframe *gpf, bGPDstroke *gps, const eGP_ReprojectModes mode, const bool keep_original)
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
int main(int argc, char **argv)
Definition: msgfmt.c:457
static void area(int d1, int d2, int e1, int e2, float weights[2])
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
Definition: rna_access.c:6319
int RNA_int_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6308
float RNA_float_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6355
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6261
int RNA_enum_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6402
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3481
void RNA_def_property_float_default(PropertyRNA *prop, float value)
Definition: rna_define.c:2042
PropertyRNA * RNA_def_float_distance(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:4041
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1512
void RNA_def_property_update_runtime(PropertyRNA *prop, const void *func)
Definition: rna_define.c:2938
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
Definition: rna_define.c:3585
PropertyRNA * RNA_def_float_rotation(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:4005
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3771
bAction * action
float vec[3][3]
struct Object * ob
Definition: BKE_duplilist.h:45
struct DupliObject * next
Definition: BKE_duplilist.h:44
struct Object * ob
Object * ob
Definition: gpencil_mesh.c:88
struct GpBakeOb * next
Definition: gpencil_mesh.c:87
struct GpBakeOb * prev
Definition: gpencil_mesh.c:87
void * first
Definition: DNA_listBase.h:47
Definition: BKE_main.h:116
float obmat[4][4]
struct RenderData r
unsigned short local_view_uuid
struct View3D * localvd
ListBase curves
ListBase strokes
ListBase layers
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:752
const char * name
Definition: WM_types.h:721
const char * idname
Definition: WM_types.h:723
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:776
struct StructRNA * srna
Definition: WM_types.h:802
const char * description
Definition: WM_types.h:726
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:736
PropertyRNA * prop
Definition: WM_types.h:814
struct ReportList * reports
struct PointerRNA * ptr
void WM_cursor_wait(bool val)
Definition: wm_cursors.c:226
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3157
wmOperatorType * ot
Definition: wm_files.c:3156
int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width)