Blender V5.0
rna_modifier.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cfloat>
10#include <climits>
11#include <cstdlib>
12
13#include "DNA_armature_types.h"
15#include "DNA_lineart_types.h"
16#include "DNA_modifier_types.h"
17#include "DNA_object_types.h"
18#include "DNA_scene_types.h"
19
20#include "BLI_math_rotation.h"
21
22#include "BLT_translation.hh"
23
24#include "BKE_animsys.h"
25#include "BKE_customdata.hh"
26#include "BKE_data_transfer.h"
27#include "BKE_mesh_remap.hh"
28
29#include "RNA_define.hh"
30#include "RNA_enum_types.hh"
31
32#include "rna_internal.hh"
33
34#include "WM_api.hh"
35#include "WM_types.hh"
36
38
40 RNA_ENUM_ITEM_HEADING(N_("Modify"), nullptr),
42 "GREASE_PENCIL_VERTEX_WEIGHT_PROXIMITY",
43 ICON_MOD_VERTEX_WEIGHT,
44 "Vertex Weight Proximity",
45 "Generate vertex weights based on distance to object"},
46
47 RNA_ENUM_ITEM_HEADING(N_("Modify"), nullptr),
49 "DATA_TRANSFER",
50 ICON_MOD_DATA_TRANSFER,
51 "Data Transfer",
52 "Transfer several types of data (vertex groups, UV maps, vertex colors, custom normals) from "
53 "one mesh to another"},
55 "MESH_CACHE",
56 ICON_MOD_MESHDEFORM,
57 "Mesh Cache",
58 "Deform the mesh using an external frame-by-frame vertex transform cache"},
60 "MESH_SEQUENCE_CACHE",
61 ICON_MOD_MESHDEFORM,
62 "Mesh Sequence Cache",
63 "Deform the mesh or curve using an external mesh cache in Alembic format"},
65 "NORMAL_EDIT",
66 ICON_MOD_NORMALEDIT,
67 "Normal Edit",
68 "Modify the direction of the surface normals"},
70 "WEIGHTED_NORMAL",
71 ICON_MOD_NORMALEDIT,
72 "Weighted Normal",
73 "Modify the direction of the surface normals using a weighting method"},
75 "UV_PROJECT",
76 ICON_MOD_UVPROJECT,
77 "UV Project",
78 "Project the UV map coordinates from the negative Z axis of another object"},
80 "UV_WARP",
81 ICON_MOD_UVPROJECT,
82 "UV Warp",
83 "Transform the UV map using the difference between two objects"},
85 "VERTEX_WEIGHT_EDIT",
86 ICON_MOD_VERTEX_WEIGHT,
87 "Vertex Weight Edit",
88 "Modify of the weights of a vertex group"},
90 "VERTEX_WEIGHT_MIX",
91 ICON_MOD_VERTEX_WEIGHT,
92 "Vertex Weight Mix",
93 "Mix the weights of two vertex groups"},
95 "VERTEX_WEIGHT_PROXIMITY",
96 ICON_MOD_VERTEX_WEIGHT,
97 "Vertex Weight Proximity",
98 "Set the vertex group weights based on the distance to another target object"},
100 "GREASE_PENCIL_COLOR",
101 ICON_MOD_HUE_SATURATION,
102 "Hue/Saturation",
103 "Change hue/saturation/value of the strokes"},
105 "GREASE_PENCIL_TINT",
106 ICON_MOD_TINT,
107 "Tint",
108 "Tint the color of the strokes"},
110 "GREASE_PENCIL_OPACITY",
111 ICON_MOD_OPACITY,
112 "Opacity",
113 "Change the opacity of the strokes"},
115 "GREASE_PENCIL_VERTEX_WEIGHT_ANGLE",
116 ICON_MOD_VERTEX_WEIGHT,
117 "Vertex Weight Angle",
118 "Generate vertex weights based on stroke angle"},
120 "GREASE_PENCIL_TIME",
121 ICON_MOD_TIME,
122 "Time Offset",
123 "Offset keyframes"},
125 "GREASE_PENCIL_TEXTURE",
126 ICON_MOD_UVPROJECT,
127 "Texture Mapping",
128 "Change stroke UV texture values"},
129
130 RNA_ENUM_ITEM_HEADING(N_("Generate"), nullptr),
132 "ARRAY",
133 ICON_MOD_ARRAY,
134 "Array",
135 "Create copies of the shape with offsets"},
137 "BEVEL",
138 ICON_MOD_BEVEL,
139 "Bevel",
140 "Generate sloped corners by adding geometry to the mesh's edges or vertices"},
142 "BOOLEAN",
143 ICON_MOD_BOOLEAN,
144 "Boolean",
145 "Use another shape to cut, combine or perform a difference operation"},
147 "BUILD",
148 ICON_MOD_BUILD,
149 "Build",
150 "Cause the faces of the mesh object to appear or disappear one after the other over time"},
152 "DECIMATE",
153 ICON_MOD_DECIM,
154 "Decimate",
155 "Reduce the geometry density"},
157 "EDGE_SPLIT",
158 ICON_MOD_EDGESPLIT,
159 "Edge Split",
160 "Split away joined faces at the edges"},
161 {eModifierType_Nodes, "NODES", ICON_GEOMETRY_NODES, "Geometry Nodes", ""},
163 "MASK",
164 ICON_MOD_MASK,
165 "Mask",
166 "Dynamically hide vertices based on a vertex group or armature"},
168 "MIRROR",
169 ICON_MOD_MIRROR,
170 "Mirror",
171 "Mirror along the local X, Y and/or Z axes, over the object origin"},
173 "MESH_TO_VOLUME",
174 ICON_VOLUME_DATA,
175 "Mesh to Volume",
176 ""}, /* TODO: Use correct icon. */
178 "MULTIRES",
179 ICON_MOD_MULTIRES,
180 "Multiresolution",
181 "Subdivide the mesh in a way that allows editing the higher subdivision levels"},
183 "REMESH",
184 ICON_MOD_REMESH,
185 "Remesh",
186 "Generate new mesh topology based on the current shape"},
188 "SCREW",
189 ICON_MOD_SCREW,
190 "Screw",
191 "Lathe around an axis, treating the input mesh as a profile"},
193 "SKIN",
194 ICON_MOD_SKIN,
195 "Skin",
196 "Create a solid shape from vertices and edges, using the vertex radius to define the "
197 "thickness"},
198 {eModifierType_Solidify, "SOLIDIFY", ICON_MOD_SOLIDIFY, "Solidify", "Make the surface thick"},
200 "SUBSURF",
201 ICON_MOD_SUBSURF,
202 "Subdivision Surface",
203 "Split the faces into smaller parts, giving it a smoother appearance"},
205 "TRIANGULATE",
206 ICON_MOD_TRIANGULATE,
207 "Triangulate",
208 "Convert all polygons to triangles"},
210 "VOLUME_TO_MESH",
211 ICON_VOLUME_DATA,
212 "Volume to Mesh",
213 ""}, /* TODO: Use correct icon. */
215 "WELD",
216 ICON_AUTOMERGE_OFF,
217 "Weld",
218 "Find groups of vertices closer than dist and merge them together"},
220 "WIREFRAME",
221 ICON_MOD_WIREFRAME,
222 "Wireframe",
223 "Convert faces into thickened edges"},
225 "GREASE_PENCIL_ARRAY",
226 ICON_MOD_ARRAY,
227 "Array",
228 "Duplicate strokes into an array"},
230 "GREASE_PENCIL_BUILD",
231 ICON_MOD_BUILD,
232 "Build",
233 "Grease Pencil build modifier"},
235 "GREASE_PENCIL_LENGTH",
236 ICON_MOD_LENGTH,
237 "Length",
238 "Grease Pencil length modifier"},
240 "LINEART",
241 ICON_MOD_LINEART,
242 "Line Art",
243 "Generate Line Art from scene geometries"},
245 "GREASE_PENCIL_MIRROR",
246 ICON_MOD_MIRROR,
247 "Mirror",
248 "Duplicate strokes like a mirror"},
250 "GREASE_PENCIL_MULTIPLY",
251 ICON_GP_MULTIFRAME_EDITING,
252 "Multiple Strokes",
253 "Generate multiple strokes around original strokes"},
255 "GREASE_PENCIL_SIMPLIFY",
256 ICON_MOD_SIMPLIFY,
257 "Simplify",
258 "Simplify stroke reducing number of points"},
260 "GREASE_PENCIL_SUBDIV",
261 ICON_MOD_SUBSURF,
262 "Subdivide",
263 "Grease Pencil subdivide modifier"},
265 "GREASE_PENCIL_ENVELOPE",
266 ICON_MOD_ENVELOPE,
267 "Envelope",
268 "Create an envelope shape"},
270 "GREASE_PENCIL_OUTLINE",
271 ICON_MOD_OUTLINE,
272 "Outline",
273 "Convert stroke to outline"},
274
275 RNA_ENUM_ITEM_HEADING(N_("Deform"), nullptr),
277 "ARMATURE",
278 ICON_MOD_ARMATURE,
279 "Armature",
280 "Deform the shape using an armature object"},
282 "CAST",
283 ICON_MOD_CAST,
284 "Cast",
285 "Shift the shape towards a predefined primitive"},
286 {eModifierType_Curve, "CURVE", ICON_MOD_CURVE, "Curve", "Bend the mesh using a curve object"},
288 "DISPLACE",
289 ICON_MOD_DISPLACE,
290 "Displace",
291 "Offset vertices based on a texture"},
292 {eModifierType_Hook, "HOOK", ICON_HOOK, "Hook", "Deform specific points using another object"},
294 "LAPLACIANDEFORM",
295 ICON_MOD_MESHDEFORM,
296 "Laplacian Deform",
297 "Deform based a series of anchor points"},
299 "LATTICE",
300 ICON_MOD_LATTICE,
301 "Lattice",
302 "Deform using the shape of a lattice object"},
304 "MESH_DEFORM",
305 ICON_MOD_MESHDEFORM,
306 "Mesh Deform",
307 "Deform using a different mesh, which acts as a deformation cage"},
309 "SHRINKWRAP",
310 ICON_MOD_SHRINKWRAP,
311 "Shrinkwrap",
312 "Project the shape onto another object"},
314 "SIMPLE_DEFORM",
315 ICON_MOD_SIMPLEDEFORM,
316 "Simple Deform",
317 "Deform the shape by twisting, bending, tapering or stretching"},
319 "SMOOTH",
320 ICON_MOD_SMOOTH,
321 "Smooth",
322 "Smooth the mesh by flattening the angles between adjacent faces"},
324 "CORRECTIVE_SMOOTH",
325 ICON_MOD_SMOOTH,
326 "Smooth Corrective",
327 "Smooth the mesh while still preserving the volume"},
329 "LAPLACIANSMOOTH",
330 ICON_MOD_SMOOTH,
331 "Smooth Laplacian",
332 "Reduce the noise on a mesh surface with minimal changes to its shape"},
334 "SURFACE_DEFORM",
335 ICON_MOD_MESHDEFORM,
336 "Surface Deform",
337 "Transfer motion from another mesh"},
339 "WARP",
340 ICON_MOD_WARP,
341 "Warp",
342 "Warp parts of a mesh to a new location in a very flexible way thanks to 2 specified "
343 "objects"},
345 "WAVE",
346 ICON_MOD_WAVE,
347 "Wave",
348 "Adds a ripple-like motion to an object's geometry"},
350 "VOLUME_DISPLACE",
351 ICON_VOLUME_DATA,
352 "Volume Displace",
353 "Deform volume based on noise or other vector fields"}, /* TODO: Use correct icon. */
355 "GREASE_PENCIL_HOOK",
356 ICON_HOOK,
357 "Hook",
358 "Deform stroke points using objects"},
360 "GREASE_PENCIL_NOISE",
361 ICON_MOD_NOISE,
362 "Noise",
363 "Generate noise wobble in Grease Pencil strokes"},
365 "GREASE_PENCIL_OFFSET",
366 ICON_MOD_OFFSET,
367 "Offset",
368 "Change stroke location, rotation, or scale"},
370 "GREASE_PENCIL_SMOOTH",
371 ICON_SMOOTHCURVE,
372 "Smooth",
373 "Smooth Grease Pencil strokes"},
375 "GREASE_PENCIL_THICKNESS",
376 ICON_MOD_THICKNESS,
377 "Thickness",
378 "Change stroke thickness"},
380 "GREASE_PENCIL_LATTICE",
381 ICON_MOD_LATTICE,
382 "Lattice",
383 "Deform strokes using a lattice object"},
385 "GREASE_PENCIL_DASH",
386 ICON_MOD_DASH,
387 "Dot Dash",
388 "Generate dot-dash styled strokes"},
390 "GREASE_PENCIL_ARMATURE",
391 ICON_MOD_ARMATURE,
392 "Armature",
393 "Deform stroke points using armature object"},
395 "GREASE_PENCIL_SHRINKWRAP",
396 ICON_MOD_SHRINKWRAP,
397 "Shrinkwrap",
398 "Project the shape onto another object"},
399
400 RNA_ENUM_ITEM_HEADING(N_("Physics"), nullptr),
401 {eModifierType_Cloth, "CLOTH", ICON_MOD_CLOTH, "Cloth", "Physic simulation for cloth"},
403 "COLLISION",
404 ICON_MOD_PHYSICS,
405 "Collision",
406 "For colliders participating in physics simulation, control which level in the modifier "
407 "stack is used as the collision surface"},
409 "DYNAMIC_PAINT",
410 ICON_MOD_DYNAMICPAINT,
411 "Dynamic Paint",
412 "Turn objects into paint canvases and brushes, creating color attributes, image sequences, "
413 "or displacement"},
415 "EXPLODE",
416 ICON_MOD_EXPLODE,
417 "Explode",
418 "Break apart the mesh faces and let them follow particles"},
420 "FLUID",
421 ICON_MOD_FLUIDSIM,
422 "Fluid",
423 "Physics simulation for fluids, like water, oil and smoke"},
424 {eModifierType_Ocean, "OCEAN", ICON_MOD_OCEAN, "Ocean", "Generate a moving ocean surface"},
426 "PARTICLE_INSTANCE",
427 ICON_MOD_PARTICLE_INSTANCE,
428 "Particle Instance",
429 "Duplicate mesh at the location of particles"},
431 "PARTICLE_SYSTEM",
432 ICON_MOD_PARTICLES,
433 "Particle System",
434 "Spawn particles from the shape"},
436 "SOFT_BODY",
437 ICON_MOD_SOFT,
438 "Soft Body",
439 "Simulate soft deformable objects"},
440 {eModifierType_Surface, "SURFACE", ICON_MODIFIER, "Surface", ""},
441 {0, nullptr, 0, nullptr, nullptr},
442};
443
446 "BEAUTY",
447 0,
448 "Beauty",
449 "Split the quads in nice triangles, slower method"},
451 "FIXED",
452 0,
453 "Fixed",
454 "Split the quads on the first and third vertices"},
456 "FIXED_ALTERNATE",
457 0,
458 "Fixed Alternate",
459 "Split the quads on the 2nd and 4th vertices"},
461 "SHORTEST_DIAGONAL",
462 0,
463 "Shortest Diagonal",
464 "Split the quads along their shortest diagonal"},
466 "LONGEST_DIAGONAL",
467 0,
468 "Longest Diagonal",
469 "Split the quads along their longest diagonal"},
470 {0, nullptr, 0, nullptr, nullptr},
471};
472
475 "BEAUTY",
476 0,
477 "Beauty",
478 "Arrange the new triangles evenly (slow)"},
480 "CLIP",
481 0,
482 "Clip",
483 "Split the polygons with an ear clipping algorithm"},
484 {0, nullptr, 0, nullptr, nullptr},
485};
486
489 "ON_SURFACE",
490 0,
491 "On Surface",
492 "The point is constrained to the surface of the target object, "
493 "with distance offset towards the original point location"},
495 "INSIDE",
496 0,
497 "Inside",
498 "The point is constrained to be inside the target object"},
500 "OUTSIDE",
501 0,
502 "Outside",
503 "The point is constrained to be outside the target object"},
505 "OUTSIDE_SURFACE",
506 0,
507 "Outside Surface",
508 "The point is constrained to the surface of the target object, "
509 "with distance offset always to the outside, towards or away from the original location"},
511 "ABOVE_SURFACE",
512 0,
513 "Above Surface",
514 "The point is constrained to the surface of the target object, "
515 "with distance offset applied exactly along the target normal"},
516 {0, nullptr, 0, nullptr, nullptr},
517};
518
521 "NEAREST_SURFACEPOINT",
522 0,
523 "Nearest Surface Point",
524 "Shrink the mesh to the nearest target surface"},
526 "PROJECT",
527 0,
528 "Project",
529 "Shrink the mesh to the nearest target surface along a given axis"},
531 "NEAREST_VERTEX",
532 0,
533 "Nearest Vertex",
534 "Shrink the mesh to the nearest target vertex"},
536 "TARGET_PROJECT",
537 0,
538 "Target Normal Project",
539 "Shrink the mesh to the nearest target surface "
540 "along the interpolated vertex normals of the target"},
541 {0, nullptr, 0, nullptr, nullptr},
542};
543
545 {0, "OFF", 0, "Off", "No culling"},
547 "FRONT",
548 0,
549 "Front",
550 "No projection when in front of the face"},
551 {MOD_SHRINKWRAP_CULL_TARGET_BACKFACE, "BACK", 0, "Back", "No projection when behind the face"},
552 {0, nullptr, 0, nullptr, nullptr},
553};
554
556 {int(blender::nodes::NodeWarningType::Error), "ERROR", ICON_CANCEL, "Error", ""},
557 {int(blender::nodes::NodeWarningType::Warning), "WARNING", ICON_ERROR, "Warning", ""},
558 {int(blender::nodes::NodeWarningType::Info), "INFO", ICON_INFO, "Info", ""},
559 {0, nullptr, 0, nullptr, nullptr},
560};
561
562#ifndef RNA_RUNTIME
563/* use eWarp_Falloff_*** & eHook_Falloff_***, they're in sync */
565 {eWarp_Falloff_None, "NONE", 0, "No Falloff", ""},
566 {eWarp_Falloff_Curve, "CURVE", 0, "Curve", ""},
567 {eWarp_Falloff_Smooth, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
568 {eWarp_Falloff_Sphere, "SPHERE", ICON_SPHERECURVE, "Sphere", ""},
569 {eWarp_Falloff_Root, "ROOT", ICON_ROOTCURVE, "Root", ""},
570 {eWarp_Falloff_InvSquare, "INVERSE_SQUARE", ICON_ROOTCURVE, "Inverse Square", ""},
571 {eWarp_Falloff_Sharp, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
572 {eWarp_Falloff_Linear, "LINEAR", ICON_LINCURVE, "Linear", ""},
573 {eWarp_Falloff_Const, "CONSTANT", ICON_NOCURVE, "Constant", ""},
574 {0, nullptr, 0, nullptr, nullptr},
575};
576#endif
577
578/* ***** Data Transfer ***** */
579
581 {MREMAP_MODE_TOPOLOGY, "TOPOLOGY", 0, "Topology", "Copy from identical topology meshes"},
582 {MREMAP_MODE_VERT_NEAREST, "NEAREST", 0, "Nearest Vertex", "Copy from closest vertex"},
584 "EDGE_NEAREST",
585 0,
586 "Nearest Edge Vertex",
587 "Copy from closest vertex of closest edge"},
589 "EDGEINTERP_NEAREST",
590 0,
591 "Nearest Edge Interpolated",
592 "Copy from interpolated values of vertices from closest point on closest edge"},
594 "POLY_NEAREST",
595 0,
596 "Nearest Face Vertex",
597 "Copy from closest vertex of closest face"},
599 "POLYINTERP_NEAREST",
600 0,
601 "Nearest Face Interpolated",
602 "Copy from interpolated values of vertices from closest point on closest face"},
604 "POLYINTERP_VNORPROJ",
605 0,
606 "Projected Face Interpolated",
607 "Copy from interpolated values of vertices from point on closest face hit by "
608 "normal-projection"},
609 {0, nullptr, 0, nullptr, nullptr},
610};
611
613 {MREMAP_MODE_TOPOLOGY, "TOPOLOGY", 0, "Topology", "Copy from identical topology meshes"},
615 "VERT_NEAREST",
616 0,
617 "Nearest Vertices",
618 "Copy from most similar edge (edge which vertices are the closest of destination edge's "
619 "ones)"},
621 "NEAREST",
622 0,
623 "Nearest Edge",
624 "Copy from closest edge (using midpoints)"},
626 "POLY_NEAREST",
627 0,
628 "Nearest Face Edge",
629 "Copy from closest edge of closest face (using midpoints)"},
631 "EDGEINTERP_VNORPROJ",
632 0,
633 "Projected Edge Interpolated",
634 "Interpolate all source edges hit by the projection of destination one along its own normal "
635 "(from vertices)"},
636 {0, nullptr, 0, nullptr, nullptr},
637};
638
640 {MREMAP_MODE_TOPOLOGY, "TOPOLOGY", 0, "Topology", "Copy from identical topology meshes"},
642 "NEAREST_NORMAL",
643 0,
644 "Nearest Corner and Best Matching Normal",
645 "Copy from nearest corner which has the best matching normal"},
647 "NEAREST_POLYNOR",
648 0,
649 "Nearest Corner and Best Matching Face Normal",
650 "Copy from nearest corner which has the face with the best matching normal to destination "
651 "corner's face one"},
653 "NEAREST_POLY",
654 0,
655 "Nearest Corner of Nearest Face",
656 "Copy from nearest corner of nearest face"},
658 "POLYINTERP_NEAREST",
659 0,
660 "Nearest Face Interpolated",
661 "Copy from interpolated corners of the nearest source face"},
663 "POLYINTERP_LNORPROJ",
664 0,
665 "Projected Face Interpolated",
666 "Copy from interpolated corners of the source face hit by corner normal projection"},
667 {0, nullptr, 0, nullptr, nullptr},
668};
669
671 {MREMAP_MODE_TOPOLOGY, "TOPOLOGY", 0, "Topology", "Copy from identical topology meshes"},
673 "NEAREST",
674 0,
675 "Nearest Face",
676 "Copy from nearest face (using center points)"},
678 "NORMAL",
679 0,
680 "Best Normal-Matching",
681 "Copy from source face which normal is the closest to destination one"},
683 "POLYINTERP_PNORPROJ",
684 0,
685 "Projected Face Interpolated",
686 "Interpolate all source polygons intersected by the projection of destination one along its "
687 "own normal"},
688 {0, nullptr, 0, nullptr, nullptr},
689};
690
692 {CDT_MIX_TRANSFER, "REPLACE", 0, "Replace", "Overwrite all elements' data"},
694 "ABOVE_THRESHOLD",
695 0,
696 "Above Threshold",
697 "Only replace destination elements where data is above given threshold (exact behavior "
698 "depends on data type)"},
700 "BELOW_THRESHOLD",
701 0,
702 "Below Threshold",
703 "Only replace destination elements where data is below given threshold (exact behavior "
704 "depends on data type)"},
706 "MIX",
707 0,
708 "Mix",
709 "Mix source value into destination one, using given threshold as factor"},
711 "ADD",
712 0,
713 "Add",
714 "Add source value to destination one, using given threshold as factor"},
716 "SUB",
717 0,
718 "Subtract",
719 "Subtract source value to destination one, using given threshold as factor"},
721 "MUL",
722 0,
723 "Multiply",
724 "Multiply source value to destination one, using given threshold as factor"},
725 /* Etc. */
726 {0, nullptr, 0, nullptr, nullptr},
727};
728
730 {DT_LAYERS_ACTIVE_SRC, "ACTIVE", 0, "Active Layer", "Only transfer active data layer"},
731 {DT_LAYERS_ALL_SRC, "ALL", 0, "All Layers", "Transfer all data layers"},
733 "BONE_SELECT",
734 0,
735 "Selected Pose Bones",
736 "Transfer all vertex groups used by selected pose bones"},
738 "BONE_DEFORM",
739 0,
740 "Deform Pose Bones",
741 "Transfer all vertex groups used by deform bones"},
742 {0, nullptr, 0, nullptr, nullptr},
743};
744
746 {DT_LAYERS_ACTIVE_DST, "ACTIVE", 0, "Active Layer", "Affect active data layer of all targets"},
747 {DT_LAYERS_NAME_DST, "NAME", 0, "By Name", "Match target data layers to affect by name"},
749 "INDEX",
750 0,
751 "By Order",
752 "Match target data layers to affect by order (indices)"},
753 {0, nullptr, 0, nullptr, nullptr},
754};
755
757 {0, "X", 0, "X", ""},
758 {1, "Y", 0, "Y", ""},
759 {0, nullptr, 0, nullptr, nullptr},
760};
761
763 {0, "X", 0, "X", ""},
764 {1, "Y", 0, "Y", ""},
765 {2, "Z", 0, "Z", ""},
766 {0, nullptr, 0, nullptr, nullptr},
767};
768
770 {(1 << 0), "X", 0, "X", ""},
771 {(1 << 1), "Y", 0, "Y", ""},
772 {(1 << 2), "Z", 0, "Z", ""},
773 {0, nullptr, 0, nullptr, nullptr},
774};
775
777 {SUBSURF_UV_SMOOTH_NONE, "NONE", 0, "None", "UVs are not smoothed, boundaries are kept sharp"},
779 "PRESERVE_CORNERS",
780 0,
781 "Keep Corners",
782 "UVs are smoothed, corners on discontinuous boundary are kept sharp"},
784 "PRESERVE_CORNERS_AND_JUNCTIONS",
785 0,
786 "Keep Corners, Junctions",
787 "UVs are smoothed, corners on discontinuous boundary and "
788 "junctions of 3 or more regions are kept sharp"},
790 "PRESERVE_CORNERS_JUNCTIONS_AND_CONCAVE",
791 0,
792 "Keep Corners, Junctions, Concave",
793 "UVs are smoothed, corners on discontinuous boundary, "
794 "junctions of 3 or more regions and darts and concave corners are kept sharp"},
796 "PRESERVE_BOUNDARIES",
797 0,
798 "Keep Boundaries",
799 "UVs are smoothed, boundaries are kept sharp"},
800 {SUBSURF_UV_SMOOTH_ALL, "SMOOTH_ALL", 0, "All", "UVs and boundaries are smoothed"},
801 {0, nullptr, 0, nullptr, nullptr},
802};
803
806 "PRESERVE_CORNERS",
807 0,
808 "Keep Corners",
809 "Smooth boundaries, but corners are kept sharp"},
810 {SUBSURF_BOUNDARY_SMOOTH_ALL, "ALL", 0, "All", "Smooth boundaries, including corners"},
811 {0, nullptr, 0, nullptr, nullptr},
812};
813
816 "DRAWSPEED",
817 0,
818 "Natural Drawing Speed",
819 "Use recorded speed multiplied by a factor"},
821 "FRAMES",
822 0,
823 "Number of Frames",
824 "Set a fixed number of frames for all build animations"},
826 "PERCENTAGE",
827 0,
828 "Percentage Factor",
829 "Set a manual percentage to build"},
830 {0, nullptr, 0, nullptr, nullptr},
831};
832
833#ifdef RNA_RUNTIME
834
835# include <algorithm>
836# include <fmt/format.h>
837
838# include "DNA_curve_types.h"
839# include "DNA_fluid_types.h"
840# include "DNA_material_types.h"
841# include "DNA_mesh_types.h"
842# include "DNA_object_force_types.h"
843# include "DNA_particle_types.h"
844
845# include "BKE_cachefile.hh"
846# include "BKE_compute_contexts.hh"
847# include "BKE_context.hh"
848# include "BKE_curveprofile.h"
849# include "BKE_deform.hh"
850# include "BKE_fluid.h"
851# include "BKE_material.hh"
852# include "BKE_mesh_runtime.hh"
853# include "BKE_modifier.hh"
854# include "BKE_multires.hh"
855# include "BKE_object.hh"
856# include "BKE_ocean.h"
857# include "BKE_particle.h"
858
859# include "BLI_sort_utils.h"
860# include "BLI_string_utils.hh"
861
862# include "DEG_depsgraph.hh"
863# include "DEG_depsgraph_build.hh"
864# include "DEG_depsgraph_query.hh"
865
866# include "MOD_nodes.hh"
867
868# include "ED_object.hh"
869
870# ifdef WITH_ALEMBIC
871# include "ABC_alembic.h"
872# endif
873
874static void rna_UVProject_projectors_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
875{
878 iter, ptr, (void *)uvp->projectors, sizeof(Object *), uvp->projectors_num, 0, nullptr);
879}
880
881static StructRNA *rna_Modifier_refine(PointerRNA *ptr)
882{
883 ModifierData *md = (ModifierData *)ptr->data;
884 const ModifierTypeInfo *modifier_type = BKE_modifier_get_info(ModifierType(md->type));
885 if (modifier_type != nullptr) {
886 return modifier_type->srna;
887 }
888 return &RNA_Modifier;
889}
890
891static void rna_Modifier_name_set(PointerRNA *ptr, const char *value)
892{
893 ModifierData *md = static_cast<ModifierData *>(ptr->data);
894 char oldname[sizeof(md->name)];
895
896 /* make a copy of the old name first */
897 STRNCPY(oldname, md->name);
898
899 /* copy the new name into the name slot */
900 STRNCPY_UTF8(md->name, value);
901
902 /* make sure the name is truly unique */
903 if (ptr->owner_id) {
904 Object *ob = (Object *)ptr->owner_id;
905 BKE_modifier_unique_name(&ob->modifiers, md);
906 }
907
908 /* fix all the animation data which may link to this */
909 BKE_animdata_fix_paths_rename_all(nullptr, "modifiers", oldname, md->name);
910}
911
912static void rna_Modifier_name_update(Main *bmain, Scene * /*scene*/, PointerRNA * /*ptr*/)
913{
915}
916
917static std::optional<std::string> rna_Modifier_path(const PointerRNA *ptr)
918{
919 const ModifierData *md = static_cast<const ModifierData *>(ptr->data);
920 char name_esc[sizeof(md->name) * 2];
921
922 BLI_str_escape(name_esc, md->name, sizeof(name_esc));
923 return fmt::format("modifiers[\"{}\"]", name_esc);
924}
925
926static void rna_Modifier_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
927{
930}
931
932static void rna_Modifier_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
933{
934 rna_Modifier_update(bmain, scene, ptr);
936}
937
938static void rna_NodesModifier_bake_update(Main *bmain, Scene *scene, PointerRNA *ptr)
939{
940 rna_Modifier_update(bmain, scene, ptr);
942}
943
944static void rna_Modifier_is_active_set(PointerRNA *ptr, bool value)
945{
946 ModifierData *md = static_cast<ModifierData *>(ptr->data);
947
948 if (value) {
949 /* Disable the active flag of all other modifiers. */
950 for (ModifierData *prev_md = md->prev; prev_md != nullptr; prev_md = prev_md->prev) {
951 prev_md->flag &= ~eModifierFlag_Active;
952 }
953 for (ModifierData *next_md = md->next; next_md != nullptr; next_md = next_md->next) {
954 next_md->flag &= ~eModifierFlag_Active;
955 }
956
959 }
960}
961
962static void rna_Modifier_use_pin_to_last_set(PointerRNA *ptr, bool value)
963{
964 Object *object = reinterpret_cast<Object *>(ptr->owner_id);
965 ModifierData *md = static_cast<ModifierData *>(ptr->data);
967
968 int to_index = BLI_findindex(&object->modifiers, md);
969 if (value) {
970 ModifierData *md_iter = md;
971 while (md_iter->next && (md_iter->next->flag & eModifierFlag_PinLast) == 0) {
972 to_index++;
973 md_iter = md_iter->next;
974 }
975 }
976 else {
977 ModifierData *md_iter = md;
978 while (md_iter->prev && (md_iter->prev->flag & eModifierFlag_PinLast)) {
979 to_index--;
980 md_iter = md_iter->prev;
981 }
982 }
983 blender::ed::object::modifier_move_to_index(nullptr, RPT_ERROR, object, md, to_index, true);
984}
985
986/* Vertex Groups */
987
988# define RNA_MOD_VGROUP_NAME_SET(_type, _prop) \
989 static void rna_##_type##Modifier_##_prop##_set(PointerRNA *ptr, const char *value) \
990 { \
991 _type##ModifierData *tmd = (_type##ModifierData *)ptr->data; \
992 rna_object_vgroup_name_set(ptr, value, tmd->_prop, sizeof(tmd->_prop)); \
993 }
994
995RNA_MOD_VGROUP_NAME_SET(Armature, defgrp_name);
996RNA_MOD_VGROUP_NAME_SET(Bevel, defgrp_name);
997RNA_MOD_VGROUP_NAME_SET(Cast, defgrp_name);
998RNA_MOD_VGROUP_NAME_SET(Curve, name);
999RNA_MOD_VGROUP_NAME_SET(DataTransfer, defgrp_name);
1000RNA_MOD_VGROUP_NAME_SET(Decimate, defgrp_name);
1001RNA_MOD_VGROUP_NAME_SET(CorrectiveSmooth, defgrp_name);
1002RNA_MOD_VGROUP_NAME_SET(Displace, defgrp_name);
1003RNA_MOD_VGROUP_NAME_SET(Hook, name);
1004RNA_MOD_VGROUP_NAME_SET(LaplacianDeform, anchor_grp_name);
1005RNA_MOD_VGROUP_NAME_SET(LaplacianSmooth, defgrp_name);
1006RNA_MOD_VGROUP_NAME_SET(Lattice, name);
1007RNA_MOD_VGROUP_NAME_SET(Mask, vgroup);
1008RNA_MOD_VGROUP_NAME_SET(MeshCache, defgrp_name);
1009RNA_MOD_VGROUP_NAME_SET(MeshDeform, defgrp_name);
1010RNA_MOD_VGROUP_NAME_SET(NormalEdit, defgrp_name);
1011RNA_MOD_VGROUP_NAME_SET(Shrinkwrap, vgroup_name);
1012RNA_MOD_VGROUP_NAME_SET(SimpleDeform, vgroup_name);
1013RNA_MOD_VGROUP_NAME_SET(Smooth, defgrp_name);
1014RNA_MOD_VGROUP_NAME_SET(Solidify, defgrp_name);
1015RNA_MOD_VGROUP_NAME_SET(Solidify, shell_defgrp_name);
1016RNA_MOD_VGROUP_NAME_SET(Solidify, rim_defgrp_name);
1017RNA_MOD_VGROUP_NAME_SET(SurfaceDeform, defgrp_name);
1018RNA_MOD_VGROUP_NAME_SET(UVWarp, vgroup_name);
1019RNA_MOD_VGROUP_NAME_SET(Warp, defgrp_name);
1020RNA_MOD_VGROUP_NAME_SET(Wave, defgrp_name);
1021RNA_MOD_VGROUP_NAME_SET(WeightVGEdit, defgrp_name);
1022RNA_MOD_VGROUP_NAME_SET(WeightVGEdit, mask_defgrp_name);
1023RNA_MOD_VGROUP_NAME_SET(WeightVGMix, defgrp_name_a);
1024RNA_MOD_VGROUP_NAME_SET(WeightVGMix, defgrp_name_b);
1025RNA_MOD_VGROUP_NAME_SET(WeightVGMix, mask_defgrp_name);
1026RNA_MOD_VGROUP_NAME_SET(WeightVGProximity, defgrp_name);
1027RNA_MOD_VGROUP_NAME_SET(WeightVGProximity, mask_defgrp_name);
1028RNA_MOD_VGROUP_NAME_SET(WeightedNormal, defgrp_name);
1029RNA_MOD_VGROUP_NAME_SET(Weld, defgrp_name);
1030RNA_MOD_VGROUP_NAME_SET(Wireframe, defgrp_name);
1031RNA_MOD_VGROUP_NAME_SET(GreasePencilWeightAngle, target_vgname);
1032RNA_MOD_VGROUP_NAME_SET(GreasePencilWeightProximity, target_vgname);
1033RNA_MOD_VGROUP_NAME_SET(GreasePencilLineart, vgname);
1034RNA_MOD_VGROUP_NAME_SET(GreasePencilBuild, target_vgname);
1035
1036static void rna_ExplodeModifier_vgroup_get(PointerRNA *ptr, char *value)
1037{
1039 rna_object_vgroup_name_index_get(ptr, value, emd->vgroup);
1040}
1041
1042static int rna_ExplodeModifier_vgroup_length(PointerRNA *ptr)
1043{
1045 return rna_object_vgroup_name_index_length(ptr, emd->vgroup);
1046}
1047
1048static void rna_ExplodeModifier_vgroup_set(PointerRNA *ptr, const char *value)
1049{
1051 rna_object_vgroup_name_index_set(ptr, value, &emd->vgroup);
1052}
1053
1054# undef RNA_MOD_VGROUP_NAME_SET
1055
1056/* UV layers */
1057
1058# define RNA_MOD_UVLAYER_NAME_SET(_type, _prop) \
1059 static void rna_##_type##Modifier_##_prop##_set(PointerRNA *ptr, const char *value) \
1060 { \
1061 _type##ModifierData *tmd = (_type##ModifierData *)ptr->data; \
1062 rna_object_uvlayer_name_set(ptr, value, tmd->_prop, sizeof(tmd->_prop)); \
1063 }
1064
1065RNA_MOD_UVLAYER_NAME_SET(MappingInfo, uvlayer_name);
1066RNA_MOD_UVLAYER_NAME_SET(UVProject, uvlayer_name);
1067RNA_MOD_UVLAYER_NAME_SET(UVWarp, uvlayer_name);
1068RNA_MOD_UVLAYER_NAME_SET(WeightVGEdit, mask_tex_uvlayer_name);
1069RNA_MOD_UVLAYER_NAME_SET(WeightVGMix, mask_tex_uvlayer_name);
1070RNA_MOD_UVLAYER_NAME_SET(WeightVGProximity, mask_tex_uvlayer_name);
1071
1072# undef RNA_MOD_UVLAYER_NAME_SET
1073
1074/* Objects */
1075
1076static void modifier_object_set(Object *self, Object **ob_p, int type, PointerRNA value)
1077{
1078 Object *ob = static_cast<Object *>(value.data);
1079
1080 if (!self || ob != self) {
1081 if (!ob || type == OB_EMPTY || ob->type == type) {
1082 id_lib_extern((ID *)ob);
1083 *ob_p = ob;
1084 }
1085 }
1086}
1087
1088# define RNA_MOD_OBJECT_SET(_type, _prop, _obtype) \
1089 static void rna_##_type##Modifier_##_prop##_set( \
1090 PointerRNA *ptr, PointerRNA value, ReportList * /*reports*/) \
1091 { \
1092 _type##ModifierData *tmd = (_type##ModifierData *)ptr->data; \
1093 modifier_object_set((Object *)ptr->owner_id, &tmd->_prop, _obtype, value); \
1094 }
1095
1096RNA_MOD_OBJECT_SET(Armature, object, OB_ARMATURE);
1097RNA_MOD_OBJECT_SET(Array, start_cap, OB_MESH);
1098RNA_MOD_OBJECT_SET(Array, end_cap, OB_MESH);
1099RNA_MOD_OBJECT_SET(Array, curve_ob, OB_CURVES_LEGACY);
1100RNA_MOD_OBJECT_SET(Boolean, object, OB_MESH);
1101RNA_MOD_OBJECT_SET(Cast, object, OB_EMPTY);
1102RNA_MOD_OBJECT_SET(Curve, object, OB_CURVES_LEGACY);
1103RNA_MOD_OBJECT_SET(DataTransfer, ob_source, OB_MESH);
1104RNA_MOD_OBJECT_SET(Lattice, object, OB_LATTICE);
1105RNA_MOD_OBJECT_SET(Mask, ob_arm, OB_ARMATURE);
1106RNA_MOD_OBJECT_SET(MeshDeform, object, OB_MESH);
1107RNA_MOD_OBJECT_SET(NormalEdit, target, OB_EMPTY);
1108RNA_MOD_OBJECT_SET(Shrinkwrap, target, OB_MESH);
1109RNA_MOD_OBJECT_SET(Shrinkwrap, auxTarget, OB_MESH);
1110RNA_MOD_OBJECT_SET(SurfaceDeform, target, OB_MESH);
1111RNA_MOD_OBJECT_SET(GreasePencilMirror, object, OB_EMPTY);
1112RNA_MOD_OBJECT_SET(GreasePencilTint, object, OB_EMPTY);
1113RNA_MOD_OBJECT_SET(GreasePencilLattice, object, OB_LATTICE);
1114RNA_MOD_OBJECT_SET(GreasePencilWeightProximity, object, OB_EMPTY);
1115RNA_MOD_OBJECT_SET(GreasePencilHook, object, OB_EMPTY);
1116RNA_MOD_OBJECT_SET(GreasePencilArmature, object, OB_ARMATURE);
1117RNA_MOD_OBJECT_SET(GreasePencilOutline, object, OB_EMPTY);
1118RNA_MOD_OBJECT_SET(GreasePencilShrinkwrap, target, OB_MESH);
1119RNA_MOD_OBJECT_SET(GreasePencilShrinkwrap, aux_target, OB_MESH);
1120RNA_MOD_OBJECT_SET(GreasePencilBuild, object, OB_EMPTY);
1121
1122static void rna_HookModifier_object_set(PointerRNA *ptr,
1123 PointerRNA value,
1124 ReportList * /*reports*/)
1125{
1126 Object *owner = (Object *)ptr->owner_id;
1127 HookModifierData *hmd = static_cast<HookModifierData *>(ptr->data);
1128 Object *ob = (Object *)value.data;
1129
1130 hmd->object = ob;
1131 id_lib_extern((ID *)ob);
1133}
1134
1135static bool rna_HookModifier_object_override_apply(Main *bmain,
1136 RNAPropertyOverrideApplyContext &rnaapply_ctx)
1137{
1138 PointerRNA *ptr_dst = &rnaapply_ctx.ptr_dst;
1139 PointerRNA *ptr_src = &rnaapply_ctx.ptr_src;
1140 PointerRNA *ptr_storage = &rnaapply_ctx.ptr_storage;
1141 PropertyRNA *prop_dst = rnaapply_ctx.prop_dst;
1142 PropertyRNA *prop_src = rnaapply_ctx.prop_src;
1143 const int len_dst = rnaapply_ctx.len_src;
1144 const int len_src = rnaapply_ctx.len_src;
1145 const int len_storage = rnaapply_ctx.len_storage;
1147
1148 BLI_assert(len_dst == len_src && (!ptr_storage || len_dst == len_storage) && len_dst == 0);
1150 "Unsupported RNA override operation on Hook modifier target object pointer");
1151 UNUSED_VARS_NDEBUG(ptr_storage, len_dst, len_src, len_storage, opop);
1152
1153 /* We need a special handling here because setting hook target resets invert parent matrix,
1154 * which is evil in our case. */
1155 HookModifierData *hmd = static_cast<HookModifierData *>(ptr_dst->data);
1156 Object *owner = (Object *)ptr_dst->owner_id;
1157 Object *target_dst = static_cast<Object *>(RNA_property_pointer_get(ptr_dst, prop_dst).data);
1158 Object *target_src = static_cast<Object *>(RNA_property_pointer_get(ptr_src, prop_src).data);
1159
1160 BLI_assert(target_dst == hmd->object);
1161
1162 if (target_src == target_dst) {
1163 return false;
1164 }
1165
1166 hmd->object = target_src;
1167 if (target_src == nullptr) {
1168 /* The only case where we do want default behavior (with matrix reset). */
1170 }
1171 RNA_property_update_main(bmain, nullptr, ptr_dst, prop_dst);
1172 return true;
1173}
1174
1175static void rna_HookModifier_subtarget_set(PointerRNA *ptr, const char *value)
1176{
1177 Object *owner = (Object *)ptr->owner_id;
1178 HookModifierData *hmd = static_cast<HookModifierData *>(ptr->data);
1179
1180 STRNCPY(hmd->subtarget, value);
1182}
1183
1184static int rna_HookModifier_vertex_indices_get_length(const PointerRNA *ptr,
1186{
1187 const HookModifierData *hmd = static_cast<const HookModifierData *>(ptr->data);
1188 int indexar_num = hmd->indexar ? hmd->indexar_num : 0;
1189 return (length[0] = indexar_num);
1190}
1191
1192static void rna_HookModifier_vertex_indices_get(PointerRNA *ptr, int *values)
1193{
1194 HookModifierData *hmd = static_cast<HookModifierData *>(ptr->data);
1195 if (hmd->indexar != nullptr) {
1196 memcpy(values, hmd->indexar, sizeof(int) * hmd->indexar_num);
1197 }
1198}
1199
1200static void rna_HookModifier_vertex_indices_set(HookModifierData *hmd,
1201 ReportList *reports,
1202 const int *indices,
1203 int indices_num)
1204{
1205 if (indices_num <= 0) {
1206 MEM_SAFE_FREE(hmd->indexar);
1207 hmd->indexar_num = 0;
1208 }
1209 else {
1210 /* Reject negative indices. */
1211 for (int i = 0; i < indices_num; i++) {
1212 if (indices[i] < 0) {
1213 BKE_reportf(reports, RPT_ERROR, "Negative vertex index in vertex_indices_set");
1214 return;
1215 }
1216 }
1217
1218 /* Copy and sort the index array. */
1219 size_t size = sizeof(int) * indices_num;
1220 int *buffer = MEM_malloc_arrayN<int>(size_t(indices_num), "hook indexar");
1221 memcpy(buffer, indices, size);
1222
1223 qsort(buffer, indices_num, sizeof(int), BLI_sortutil_cmp_int);
1224
1225 /* Reject duplicate indices. */
1226 for (int i = 1; i < indices_num; i++) {
1227 if (buffer[i] == buffer[i - 1]) {
1228 BKE_reportf(reports, RPT_ERROR, "Duplicate index %d in vertex_indices_set", buffer[i]);
1229 MEM_freeN(buffer);
1230 return;
1231 }
1232 }
1233
1234 /* Success - save the new array. */
1235 MEM_SAFE_FREE(hmd->indexar);
1236 hmd->indexar = buffer;
1237 hmd->indexar_num = indices_num;
1238 }
1239}
1240
1241static PointerRNA rna_UVProjector_object_get(PointerRNA *ptr)
1242{
1243 Object **ob = (Object **)ptr->data;
1244 return RNA_id_pointer_create(reinterpret_cast<ID *>(*ob));
1245}
1246
1247static void rna_UVProjector_object_set(PointerRNA *ptr, PointerRNA value, ReportList * /*reports*/)
1248{
1249 Object **ob_p = (Object **)ptr->data;
1250 Object *ob = (Object *)value.data;
1251 id_lib_extern((ID *)ob);
1252 *ob_p = ob;
1253}
1254
1255# undef RNA_MOD_OBJECT_SET
1256
1257/* Other rna callbacks */
1258
1259static void rna_fluid_set_type(Main *bmain, Scene *scene, PointerRNA *ptr)
1260{
1261 FluidModifierData *fmd = (FluidModifierData *)ptr->data;
1262 Object *ob = (Object *)ptr->owner_id;
1263
1264 /* nothing changed */
1265 if ((fmd->type & MOD_FLUID_TYPE_DOMAIN) && fmd->domain) {
1266 return;
1267 }
1268
1269# ifdef WITH_FLUID
1270 BKE_fluid_modifier_free(fmd); /* XXX TODO: completely free all 3 pointers */
1271 BKE_fluid_modifier_create_type_data(fmd); /* create regarding of selected type */
1272# endif
1273
1274 switch (fmd->type) {
1276 ob->dt = OB_WIRE;
1277 break;
1280 case 0:
1281 default:
1282 break;
1283 }
1284
1285 /* update dependency since a domain - other type switch could have happened */
1286 rna_Modifier_dependency_update(bmain, scene, ptr);
1287}
1288
1289static void rna_MultiresModifier_level_range(
1290 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
1291{
1293
1294 *min = 0;
1295 *max = max_ii(0, mmd->totlvl); /* intentionally _not_ -1 */
1296}
1297
1298static bool rna_MultiresModifier_external_get(PointerRNA *ptr)
1299{
1300 Object *ob = (Object *)ptr->owner_id;
1301 Mesh *mesh = static_cast<Mesh *>(ob->data);
1302
1304}
1305
1306static void rna_MultiresModifier_filepath_get(PointerRNA *ptr, char *value)
1307{
1308 Object *ob = (Object *)ptr->owner_id;
1309 CustomDataExternal *external = ((Mesh *)ob->data)->corner_data.external;
1310
1311 strcpy(value, (external) ? external->filepath : "");
1312}
1313
1314static void rna_MultiresModifier_filepath_set(PointerRNA *ptr, const char *value)
1315{
1316 Object *ob = (Object *)ptr->owner_id;
1317 CustomDataExternal *external = ((Mesh *)ob->data)->corner_data.external;
1318
1319 if (external && !STREQ(external->filepath, value)) {
1320 STRNCPY(external->filepath, value);
1322 }
1323}
1324
1325static int rna_MultiresModifier_filepath_length(PointerRNA *ptr)
1326{
1327 Object *ob = (Object *)ptr->owner_id;
1328 CustomDataExternal *external = ((Mesh *)ob->data)->corner_data.external;
1329
1330 return strlen((external) ? external->filepath : "");
1331}
1332
1333static int rna_ShrinkwrapModifier_face_cull_get(PointerRNA *ptr)
1334{
1336 return swm->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_MASK;
1337}
1338
1339static void rna_ShrinkwrapModifier_face_cull_set(PointerRNA *ptr, int value)
1340{
1342 swm->shrinkOpts = (swm->shrinkOpts & ~MOD_SHRINKWRAP_CULL_TARGET_MASK) | value;
1343}
1344
1345static bool rna_MeshDeformModifier_is_bound_get(PointerRNA *ptr)
1346{
1347 return (((MeshDeformModifierData *)ptr->data)->bindcagecos != nullptr);
1348}
1349
1350static PointerRNA rna_SoftBodyModifier_settings_get(PointerRNA *ptr)
1351{
1352 Object *ob = (Object *)ptr->owner_id;
1353 return RNA_pointer_create_with_parent(*ptr, &RNA_SoftBodySettings, ob->soft);
1354}
1355
1356static PointerRNA rna_SoftBodyModifier_point_cache_get(PointerRNA *ptr)
1357{
1358 Object *ob = (Object *)ptr->owner_id;
1359 return RNA_pointer_create_with_parent(*ptr, &RNA_PointCache, ob->soft->shared->pointcache);
1360}
1361
1362static PointerRNA rna_CollisionModifier_settings_get(PointerRNA *ptr)
1363{
1364 Object *ob = (Object *)ptr->owner_id;
1365 return RNA_pointer_create_with_parent(*ptr, &RNA_CollisionSettings, ob->pd);
1366}
1367
1368/* Special update function for setting the number of segments of the modifier that also resamples
1369 * the segments in the custom profile. */
1370static void rna_BevelModifier_update_segments(Main *bmain, Scene *scene, PointerRNA *ptr)
1371{
1372 BevelModifierData *bmd = (BevelModifierData *)ptr->data;
1373 if (RNA_enum_get(ptr, "profile_type") == MOD_BEVEL_PROFILE_CUSTOM) {
1374 short segments = short(RNA_int_get(ptr, "segments"));
1375 BKE_curveprofile_init(bmd->custom_profile, segments);
1376 }
1377 rna_Modifier_update(bmain, scene, ptr);
1378}
1379
1380static void rna_BevelModifier_weight_attribute_visit_for_search(
1381 const bContext * /*C*/,
1382 PointerRNA *ptr,
1383 PropertyRNA * /*prop*/,
1384 const char * /*edit_text*/,
1386{
1387 Object *ob = (Object *)ptr->owner_id;
1388 if (ob->type != OB_MESH) {
1389 return;
1390 }
1391 PointerRNA mesh_ptr = RNA_id_pointer_create(static_cast<ID *>(ob->data));
1392 PropertyRNA *attributes_prop = RNA_struct_find_property(&mesh_ptr, "attributes");
1393 RNA_PROP_BEGIN (&mesh_ptr, itemptr, attributes_prop) {
1394 const CustomDataLayer *layer = static_cast<const CustomDataLayer *>(itemptr.data);
1396 StringPropertySearchVisitParams visit_params{};
1397 visit_params.text = layer->name;
1398 visit_fn(visit_params);
1399 }
1400 }
1402}
1403
1404static void rna_UVProjectModifier_num_projectors_set(PointerRNA *ptr, int value)
1405{
1407 int a;
1408
1409 md->projectors_num = std::clamp(value, 1, MOD_UVPROJECT_MAXPROJECTORS);
1410 for (a = md->projectors_num; a < MOD_UVPROJECT_MAXPROJECTORS; a++) {
1411 md->projectors[a] = nullptr;
1412 }
1413}
1414
1415static void rna_OceanModifier_init_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1416{
1417 OceanModifierData *omd = (OceanModifierData *)ptr->data;
1418
1420 rna_Modifier_update(bmain, scene, ptr);
1421}
1422
1423static void rna_OceanModifier_ocean_chop_set(PointerRNA *ptr, float value)
1424{
1425 OceanModifierData *omd = (OceanModifierData *)ptr->data;
1426 float old_value = omd->chop_amount;
1427
1428 omd->chop_amount = value;
1429
1430 if ((old_value == 0.0f && value > 0.0f) || (old_value > 0.0f && value == 0.0f)) {
1432 }
1433}
1434
1435static bool rna_LaplacianDeformModifier_is_bind_get(PointerRNA *ptr)
1436{
1438 return ((lmd->flag & MOD_LAPLACIANDEFORM_BIND) && (lmd->vertexco != nullptr));
1439}
1440
1441/* NOTE: Curve and array modifiers requires curve path to be evaluated,
1442 * dependency graph will make sure that curve eval would create such a path,
1443 * but if curve was already evaluated we might miss path.
1444 *
1445 * So what we do here is: if path was not calculated for target curve we
1446 * tag it for update.
1447 */
1448
1449static void rna_CurveModifier_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1450{
1451 CurveModifierData *cmd = (CurveModifierData *)ptr->data;
1452 rna_Modifier_update(bmain, scene, ptr);
1454 if (cmd->object != nullptr) {
1455 Curve *curve = static_cast<Curve *>(cmd->object->data);
1456 if ((curve->flag & CU_PATH) == 0) {
1458 }
1459 }
1460}
1461
1462static void rna_ArrayModifier_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1463{
1464 ArrayModifierData *amd = (ArrayModifierData *)ptr->data;
1465 rna_Modifier_update(bmain, scene, ptr);
1467 if (amd->curve_ob != nullptr) {
1468 Curve *curve = static_cast<Curve *>(amd->curve_ob->data);
1469 if ((curve->flag & CU_PATH) == 0) {
1471 }
1472 }
1473}
1474
1475static void rna_DataTransferModifier_use_data_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1476{
1478
1479 if (!(dtmd->flags & MOD_DATATRANSFER_USE_VERT)) {
1480 dtmd->data_types &= ~DT_TYPE_VERT_ALL;
1481 }
1482 if (!(dtmd->flags & MOD_DATATRANSFER_USE_EDGE)) {
1483 dtmd->data_types &= ~DT_TYPE_EDGE_ALL;
1484 }
1485 if (!(dtmd->flags & MOD_DATATRANSFER_USE_LOOP)) {
1486 dtmd->data_types &= ~DT_TYPE_LOOP_ALL;
1487 }
1488 if (!(dtmd->flags & MOD_DATATRANSFER_USE_POLY)) {
1489 dtmd->data_types &= ~DT_TYPE_POLY_ALL;
1490 }
1491
1492 rna_Modifier_dependency_update(bmain, scene, ptr);
1493}
1494
1495static void rna_DataTransferModifier_data_types_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1496{
1498 const int item_types = BKE_object_data_transfer_get_dttypes_item_types(dtmd->data_types);
1499
1500 if (item_types & ME_VERT) {
1501 dtmd->flags |= MOD_DATATRANSFER_USE_VERT;
1502 }
1503 if (item_types & ME_EDGE) {
1504 dtmd->flags |= MOD_DATATRANSFER_USE_EDGE;
1505 }
1506 if (item_types & ME_LOOP) {
1507 dtmd->flags |= MOD_DATATRANSFER_USE_LOOP;
1508 }
1509 if (item_types & ME_POLY) {
1510 dtmd->flags |= MOD_DATATRANSFER_USE_POLY;
1511 }
1512
1513 rna_Modifier_dependency_update(bmain, scene, ptr);
1514}
1515
1516static const EnumPropertyItem *rna_DataTransferModifier_layers_select_src_itemf(bContext *C,
1517 PointerRNA *ptr,
1518 PropertyRNA *prop,
1519 bool *r_free)
1520{
1521 using namespace blender;
1523 EnumPropertyItem *item = nullptr, tmp_item = {0};
1524 int totitem = 0;
1525
1526 if (!C) { /* needed for docs and i18n tools */
1528 }
1529
1530 /* No active here! */
1533
1534 if (STREQ(RNA_property_identifier(prop), "layers_vgroup_select_src")) {
1535 Object *ob_src = dtmd->ob_source;
1536
1537# if 0 /* XXX Don't think we want this in modifier version... */
1538 if (BKE_object_pose_armature_get(ob_src)) {
1543 }
1544# endif
1545
1546 if (ob_src) {
1547 const bDeformGroup *dg;
1548 int i;
1549
1550 RNA_enum_item_add_separator(&item, &totitem);
1551
1552 const ListBase *defbase = BKE_object_defgroup_list(ob_src);
1553 for (i = 0, dg = static_cast<const bDeformGroup *>(defbase->first); dg; i++, dg = dg->next) {
1554 tmp_item.value = i;
1555 tmp_item.identifier = tmp_item.name = dg->name;
1556 RNA_enum_item_add(&item, &totitem, &tmp_item);
1557 }
1558 }
1559 }
1560 else if (STREQ(RNA_property_identifier(prop), "layers_shapekey_select_src")) {
1561 /* TODO */
1562 }
1563 else if (STREQ(RNA_property_identifier(prop), "layers_uv_select_src")) {
1564 Object *ob_src = dtmd->ob_source;
1565
1566 if (ob_src) {
1567 int num_data, i;
1568
1570 const Object *ob_eval = DEG_get_evaluated(depsgraph, ob_src);
1571 if (!ob_eval) {
1572 RNA_enum_item_end(&item, &totitem);
1573 *r_free = true;
1574 return item;
1575 }
1576 const Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob_eval);
1577 if (!mesh_eval) {
1578 RNA_enum_item_end(&item, &totitem);
1579 *r_free = true;
1580 return item;
1581 }
1582
1584
1585 RNA_enum_item_add_separator(&item, &totitem);
1586
1587 for (i = 0; i < num_data; i++) {
1588 tmp_item.value = i;
1589 tmp_item.identifier = tmp_item.name = CustomData_get_layer_name(
1590 &mesh_eval->corner_data, CD_PROP_FLOAT2, i);
1591 RNA_enum_item_add(&item, &totitem, &tmp_item);
1592 }
1593 }
1594 }
1595 else if (STREQ(RNA_property_identifier(prop), "layers_vcol_vert_select_src") ||
1596 STREQ(RNA_property_identifier(prop), "layers_vcol_loop_select_src"))
1597 {
1598 Object *ob_src = dtmd->ob_source;
1599
1600 if (ob_src) {
1602 "layers_vcol_vert_select_src") ?
1605
1607 const Object *ob_eval = DEG_get_evaluated(depsgraph, ob_src);
1608 if (!ob_eval) {
1609 RNA_enum_item_end(&item, &totitem);
1610 *r_free = true;
1611 return item;
1612 }
1613 const Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob_eval);
1614 if (!mesh_eval) {
1615 RNA_enum_item_end(&item, &totitem);
1616 *r_free = true;
1617 return item;
1618 }
1619
1620 const CustomData *cdata;
1621 if (domain == bke::AttrDomain::Point) {
1622 cdata = &mesh_eval->vert_data;
1623 }
1624 else {
1625 cdata = &mesh_eval->corner_data;
1626 }
1627
1629
1630 int idx = 0;
1631 for (int i = 0; i < 2; i++) {
1632 int num_data = CustomData_number_of_layers(cdata, types[i]);
1633
1634 RNA_enum_item_add_separator(&item, &totitem);
1635
1636 for (int j = 0; j < num_data; j++) {
1637 tmp_item.value = idx++;
1638 tmp_item.identifier = tmp_item.name = CustomData_get_layer_name(cdata, types[i], j);
1639 RNA_enum_item_add(&item, &totitem, &tmp_item);
1640 }
1641 }
1642 }
1643 }
1644
1645 RNA_enum_item_end(&item, &totitem);
1646 *r_free = true;
1647
1648 return item;
1649}
1650
1651static const EnumPropertyItem *rna_DataTransferModifier_layers_select_dst_itemf(bContext *C,
1652 PointerRNA *ptr,
1653 PropertyRNA *prop,
1654 bool *r_free)
1655{
1657 EnumPropertyItem *item = nullptr, tmp_item = {0};
1658 int totitem = 0;
1659
1660 if (!C) { /* needed for docs and i18n tools */
1662 }
1663
1664 /* No active here! */
1669
1670 if (STREQ(RNA_property_identifier(prop), "layers_vgroup_select_dst")) {
1671 /* Only list destination layers if we have a single source! */
1672 if (dtmd->layers_select_src[DT_MULTILAYER_INDEX_MDEFORMVERT] >= 0) {
1673 Object *ob_dst = CTX_data_active_object(C); /* XXX Is this OK? */
1674
1675 if (ob_dst) {
1676 const bDeformGroup *dg;
1677 int i;
1678
1679 RNA_enum_item_add_separator(&item, &totitem);
1680
1681 const ListBase *defbase = BKE_object_defgroup_list(ob_dst);
1682 for (i = 0, dg = static_cast<const bDeformGroup *>(defbase->first); dg; i++, dg = dg->next)
1683 {
1684 tmp_item.value = i;
1685 tmp_item.identifier = tmp_item.name = dg->name;
1686 RNA_enum_item_add(&item, &totitem, &tmp_item);
1687 }
1688 }
1689 }
1690 }
1691 else if (STREQ(RNA_property_identifier(prop), "layers_shapekey_select_dst")) {
1692 /* TODO */
1693 }
1694 else if (STREQ(RNA_property_identifier(prop), "layers_uv_select_dst")) {
1695 /* Only list destination layers if we have a single source! */
1696 if (dtmd->layers_select_src[DT_MULTILAYER_INDEX_UV] >= 0) {
1697 Object *ob_dst = CTX_data_active_object(C); /* XXX Is this OK? */
1698
1699 if (ob_dst && ob_dst->data) {
1700 Mesh *me_dst;
1701 CustomData *corner_data;
1702 int num_data, i;
1703
1704 me_dst = static_cast<Mesh *>(ob_dst->data);
1705 corner_data = &me_dst->corner_data;
1706 num_data = CustomData_number_of_layers(corner_data, CD_PROP_FLOAT2);
1707
1708 RNA_enum_item_add_separator(&item, &totitem);
1709
1710 for (i = 0; i < num_data; i++) {
1711 tmp_item.value = i;
1712 tmp_item.identifier = tmp_item.name = CustomData_get_layer_name(
1713 corner_data, CD_PROP_FLOAT2, i);
1714 RNA_enum_item_add(&item, &totitem, &tmp_item);
1715 }
1716 }
1717 }
1718 }
1719 else if (STREQ(RNA_property_identifier(prop), "layers_vcol_vert_select_dst") ||
1720 STREQ(RNA_property_identifier(prop), "layers_vcol_loop_select_dst"))
1721 {
1722 int multilayer_index = STREQ(RNA_property_identifier(prop), "layers_vcol_vert_select_dst") ?
1725
1726 /* Only list destination layers if we have a single source! */
1727 if (dtmd->layers_select_src[multilayer_index] >= 0) {
1728 Object *ob_dst = CTX_data_active_object(C); /* XXX Is this OK? */
1729
1730 if (ob_dst && ob_dst->data) {
1732
1733 Mesh *me_dst = static_cast<Mesh *>(ob_dst->data);
1734 CustomData *cdata = STREQ(RNA_property_identifier(prop), "layers_vcol_vert_select_dst") ?
1735 &me_dst->vert_data :
1736 &me_dst->corner_data;
1737
1738 int idx = 0;
1739 for (int i = 0; i < 2; i++) {
1740 int num_data = CustomData_number_of_layers(cdata, types[i]);
1741
1742 RNA_enum_item_add_separator(&item, &totitem);
1743
1744 for (int j = 0; j < num_data; j++) {
1745 tmp_item.value = idx++;
1746 tmp_item.identifier = tmp_item.name = CustomData_get_layer_name(cdata, types[i], j);
1747 RNA_enum_item_add(&item, &totitem, &tmp_item);
1748 }
1749 }
1750 }
1751 }
1752 }
1753
1754 RNA_enum_item_end(&item, &totitem);
1755 *r_free = true;
1756
1757 return item;
1758}
1759
1760static const EnumPropertyItem *rna_DataTransferModifier_mix_mode_itemf(bContext *C,
1761 PointerRNA *ptr,
1762 PropertyRNA * /*prop*/,
1763 bool *r_free)
1764{
1766 EnumPropertyItem *item = nullptr;
1767 int totitem = 0;
1768
1769 bool support_advanced_mixing, support_threshold;
1770
1771 if (!C) { /* needed for docs and i18n tools */
1773 }
1774
1776
1778 dtmd->data_types, &support_advanced_mixing, &support_threshold);
1779
1780 if (support_threshold) {
1785 }
1786
1787 if (support_advanced_mixing) {
1788 RNA_enum_item_add_separator(&item, &totitem);
1793 }
1794
1795 RNA_enum_item_end(&item, &totitem);
1796 *r_free = true;
1797
1798 return item;
1799}
1800
1801static void rna_CorrectiveSmoothModifier_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1802{
1804
1805 MEM_SAFE_FREE(csmd->delta_cache.deltas);
1806
1807 rna_Modifier_update(bmain, scene, ptr);
1808}
1809
1810static void rna_CorrectiveSmoothModifier_rest_source_update(Main *bmain,
1811 Scene *scene,
1812 PointerRNA *ptr)
1813{
1815
1816 if (csmd->rest_source != MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND) {
1818 &csmd->bind_coords_sharing_info);
1819 csmd->bind_coords_num = 0;
1820 }
1821
1822 rna_CorrectiveSmoothModifier_update(bmain, scene, ptr);
1823}
1824
1825static bool rna_CorrectiveSmoothModifier_is_bind_get(PointerRNA *ptr)
1826{
1828 return (csmd->bind_coords != nullptr);
1829}
1830
1831static bool rna_SurfaceDeformModifier_is_bound_get(PointerRNA *ptr)
1832{
1833 return (((SurfaceDeformModifierData *)ptr->data)->verts != nullptr);
1834}
1835
1836static bool rna_ParticleInstanceModifier_particle_system_poll(PointerRNA *ptr,
1837 const PointerRNA value)
1838{
1840 ParticleSystem *psys = static_cast<ParticleSystem *>(value.data);
1841
1842 if (!psmd->ob) {
1843 return false;
1844 }
1845
1846 /* make sure psys is in the object */
1847 return BLI_findindex(&psmd->ob->particlesystem, psys) != -1;
1848}
1849
1850static PointerRNA rna_ParticleInstanceModifier_particle_system_get(PointerRNA *ptr)
1851{
1853 ParticleSystem *psys;
1854
1855 if (!psmd->ob) {
1856 return PointerRNA_NULL;
1857 }
1858
1859 psys = static_cast<ParticleSystem *>(BLI_findlink(&psmd->ob->particlesystem, psmd->psys - 1));
1860 PointerRNA rptr = RNA_pointer_create_discrete((ID *)psmd->ob, &RNA_ParticleSystem, psys);
1861 return rptr;
1862}
1863
1864static void rna_ParticleInstanceModifier_particle_system_set(PointerRNA *ptr,
1865 const PointerRNA value,
1866 ReportList * /*reports*/)
1867{
1869
1870 if (!psmd->ob) {
1871 return;
1872 }
1873
1874 psmd->psys = BLI_findindex(&psmd->ob->particlesystem, value.data) + 1;
1875 CLAMP_MIN(psmd->psys, 1);
1876}
1877
1882static void rna_Modifier_show_expanded_set(PointerRNA *ptr, bool value)
1883{
1884 ModifierData *md = static_cast<ModifierData *>(ptr->data);
1886}
1887
1893static bool rna_Modifier_show_expanded_get(PointerRNA *ptr)
1894{
1895 ModifierData *md = static_cast<ModifierData *>(ptr->data);
1897}
1898
1899static bool rna_NodesModifier_node_group_poll(PointerRNA * /*ptr*/, PointerRNA value)
1900{
1901 bNodeTree *ntree = static_cast<bNodeTree *>(value.data);
1902 if (ntree->type != NTREE_GEOMETRY) {
1903 return false;
1904 }
1905 if (!ntree->geometry_node_asset_traits) {
1906 return false;
1907 }
1909 return false;
1910 }
1911 return true;
1912}
1913
1914static void rna_NodesModifier_node_group_update(Main *bmain, Scene *scene, PointerRNA *ptr)
1915{
1916 Object *object = (Object *)ptr->owner_id;
1917 NodesModifierData *nmd = static_cast<NodesModifierData *>(ptr->data);
1918 rna_Modifier_dependency_update(bmain, scene, ptr);
1919 MOD_nodes_update_interface(object, nmd);
1920}
1921
1922static blender::nodes::geo_eval_log::GeoTreeLog *get_nodes_modifier_log(NodesModifierData &nmd)
1923{
1924 if (!nmd.runtime->eval_log) {
1925 return nullptr;
1926 }
1927 blender::bke::ModifierComputeContext compute_context{nullptr, nmd};
1928 return &nmd.runtime->eval_log->get_tree_log(compute_context.hash());
1929}
1930
1931static blender::Span<blender::nodes::geo_eval_log::NodeWarning> get_node_modifier_warnings(
1932 NodesModifierData &nmd)
1933{
1934 if (auto *log = get_nodes_modifier_log(nmd)) {
1935 log->ensure_node_warnings(nmd);
1936 return log->all_warnings;
1937 }
1938 return {};
1939}
1940
1941static void rna_NodesModifier_node_warnings_iterator_begin(CollectionPropertyIterator *iter,
1942 PointerRNA *ptr)
1943{
1944 NodesModifierData *nmd = static_cast<NodesModifierData *>(ptr->data);
1945 iter->internal.count.item = 0;
1946 iter->valid = !get_node_modifier_warnings(*nmd).is_empty();
1947}
1948
1949static void rna_NodesModifier_node_warnings_iterator_next(CollectionPropertyIterator *iter)
1950{
1951 NodesModifierData *nmd = static_cast<NodesModifierData *>(iter->parent.data);
1952 iter->internal.count.item++;
1953 iter->valid = get_node_modifier_warnings(*nmd).size() > iter->internal.count.item;
1954}
1955
1956static PointerRNA rna_NodesModifier_node_warnings_iterator_get(CollectionPropertyIterator *iter)
1957{
1958 NodesModifierData *nmd = static_cast<NodesModifierData *>(iter->parent.data);
1959 blender::Span warnings = get_node_modifier_warnings(*nmd);
1961 iter->parent, &RNA_NodesModifierWarning, (void *)&warnings[iter->internal.count.item]);
1962}
1963
1964static int rna_NodesModifier_node_warnings_length(PointerRNA *ptr)
1965{
1966 NodesModifierData *nmd = static_cast<NodesModifierData *>(ptr->data);
1967 return get_node_modifier_warnings(*nmd).size();
1968}
1969
1970static void rna_NodesModifierWarning_message_get(PointerRNA *ptr, char *r_value)
1971{
1972 const auto *warning = static_cast<const blender::nodes::geo_eval_log::NodeWarning *>(ptr->data);
1973 strcpy(r_value, warning->message.c_str());
1974}
1975
1976static int rna_NodesModifierWarning_message_length(PointerRNA *ptr)
1977{
1978 const auto *warning = static_cast<const blender::nodes::geo_eval_log::NodeWarning *>(ptr->data);
1979 return warning->message.size();
1980}
1981
1982static int rna_NodesModifierWarning_type_get(PointerRNA *ptr)
1983{
1984 const auto *warning = static_cast<const blender::nodes::geo_eval_log::NodeWarning *>(ptr->data);
1985 return int(warning->type);
1986}
1987
1988static IDProperty **rna_NodesModifier_properties(PointerRNA *ptr)
1989{
1990 NodesModifierData *nmd = static_cast<NodesModifierData *>(ptr->data);
1991 NodesModifierSettings *settings = &nmd->settings;
1992 return &settings->properties;
1993}
1994
1995static void rna_Lineart_start_level_set(PointerRNA *ptr, int value)
1996{
1998
1999 value = std::clamp(value, 0, 128);
2000 lmd->level_start = value;
2001 lmd->level_end = std::max(value, int(lmd->level_end));
2002}
2003
2004static void rna_Lineart_end_level_set(PointerRNA *ptr, int value)
2005{
2007
2008 value = std::clamp(value, 0, 128);
2009 lmd->level_end = value;
2010 lmd->level_start = std::min(value, int(lmd->level_start));
2011}
2012
2013static const NodesModifierData *find_nodes_modifier_by_bake(const Object &object,
2014 const NodesModifierBake &bake)
2015{
2016 LISTBASE_FOREACH (const ModifierData *, md, &object.modifiers) {
2017 if (md->type != eModifierType_Nodes) {
2018 continue;
2019 }
2020 const NodesModifierData *nmd = reinterpret_cast<const NodesModifierData *>(md);
2021 const blender::Span<NodesModifierBake> bakes{nmd->bakes, nmd->bakes_num};
2022 if (bakes.contains_ptr(&bake)) {
2023 return nmd;
2024 }
2025 }
2026 return nullptr;
2027}
2028
2029static PointerRNA rna_NodesModifierBake_node_get(PointerRNA *ptr)
2030{
2031 const Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
2032 const NodesModifierBake *bake = static_cast<NodesModifierBake *>(ptr->data);
2033 const NodesModifierData *nmd = find_nodes_modifier_by_bake(*ob, *bake);
2034 if (!nmd->node_group) {
2035 return PointerRNA_NULL;
2036 }
2037 const bNodeTree *tree;
2038 const bNode *node = nmd->node_group->find_nested_node(bake->id, &tree);
2039 if (!node) {
2040 return PointerRNA_NULL;
2041 }
2042 BLI_assert(tree != nullptr);
2044 const_cast<ID *>(&tree->id), &RNA_Node, const_cast<bNode *>(node));
2045}
2046
2047static StructRNA *rna_NodesModifierBake_data_block_typef(PointerRNA *ptr)
2048{
2049 NodesModifierDataBlock *data_block = static_cast<NodesModifierDataBlock *>(ptr->data);
2050 return ID_code_to_RNA_type(data_block->id_type);
2051}
2052
2053bool rna_GreasePencilModifier_material_poll(PointerRNA *ptr, PointerRNA value)
2054{
2055 Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
2056 Material *ma = reinterpret_cast<Material *>(value.owner_id);
2057
2058 return BKE_object_material_index_get(ob, ma) != -1;
2059}
2060
2061/* Write material to a generic target pointer without the final modifier struct. */
2062static void rna_GreasePencilModifier_material_set(PointerRNA *ptr,
2063 PointerRNA value,
2064 ReportList *reports,
2065 Material **ma_target)
2066{
2067 Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
2068 Material *ma_old = *ma_target;
2069 Material *ma = reinterpret_cast<Material *>(value.data);
2070
2071 if (ma == nullptr || BKE_object_material_index_get(ob, ma) != -1) {
2072 id_us_min(&ma_old->id);
2073 id_us_plus_no_lib(&ma->id);
2074 if (!ID_IS_LINKED(&ob->id)) {
2075 id_lib_extern(&ma->id);
2076 }
2077 *ma_target = ma;
2078 }
2079 else {
2081 reports,
2082 RPT_ERROR,
2083 "Cannot assign material '%s', it has to be used by the Grease Pencil object already",
2084 ma->id.name);
2085 }
2086}
2087
2088# define RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(_type) \
2089 static void rna_##_type##Modifier_material_filter_set( \
2090 PointerRNA *ptr, PointerRNA value, ReportList *reports) \
2091 { \
2092 _type##ModifierData *tmd = static_cast<_type##ModifierData *>(ptr->data); \
2093 rna_GreasePencilModifier_material_set(ptr, value, reports, &tmd->influence.material); \
2094 }
2095
2096# define RNA_MOD_GREASE_PENCIL_VERTEX_GROUP_SET(_type) \
2097 static void rna_##_type##Modifier_vertex_group_name_set(PointerRNA *ptr, const char *value) \
2098 { \
2099 _type##ModifierData *tmd = static_cast<_type##ModifierData *>(ptr->data); \
2100 rna_object_vgroup_name_set(ptr, \
2101 value, \
2102 tmd->influence.vertex_group_name, \
2103 sizeof(tmd->influence.vertex_group_name)); \
2104 }
2105
2106RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilColor);
2107RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilMirror);
2108RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilOffset);
2109RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilOpacity);
2110RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilSubdiv);
2111RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilTint);
2112RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilSmooth);
2113RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilNoise);
2114RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilThick);
2115RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilLattice);
2116RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilDash);
2117RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilMulti);
2118RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilLength);
2119RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilWeightAngle);
2120RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilArray);
2121RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilWeightProximity);
2122RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilHook);
2123RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilSimplify);
2124RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilEnvelope);
2125RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilOutline);
2126RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilShrinkwrap);
2127RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilBuild);
2128RNA_MOD_GREASE_PENCIL_MATERIAL_FILTER_SET(GreasePencilTexture);
2129
2130RNA_MOD_GREASE_PENCIL_VERTEX_GROUP_SET(GreasePencilOffset);
2131RNA_MOD_GREASE_PENCIL_VERTEX_GROUP_SET(GreasePencilOpacity);
2132RNA_MOD_GREASE_PENCIL_VERTEX_GROUP_SET(GreasePencilTint);
2133RNA_MOD_GREASE_PENCIL_VERTEX_GROUP_SET(GreasePencilSmooth);
2134RNA_MOD_GREASE_PENCIL_VERTEX_GROUP_SET(GreasePencilNoise);
2135RNA_MOD_GREASE_PENCIL_VERTEX_GROUP_SET(GreasePencilThick);
2136RNA_MOD_GREASE_PENCIL_VERTEX_GROUP_SET(GreasePencilLattice);
2137RNA_MOD_GREASE_PENCIL_VERTEX_GROUP_SET(GreasePencilWeightAngle);
2138RNA_MOD_GREASE_PENCIL_VERTEX_GROUP_SET(GreasePencilWeightProximity);
2139RNA_MOD_GREASE_PENCIL_VERTEX_GROUP_SET(GreasePencilHook);
2140RNA_MOD_GREASE_PENCIL_VERTEX_GROUP_SET(GreasePencilArmature);
2141RNA_MOD_GREASE_PENCIL_VERTEX_GROUP_SET(GreasePencilSimplify);
2142RNA_MOD_GREASE_PENCIL_VERTEX_GROUP_SET(GreasePencilEnvelope);
2143RNA_MOD_GREASE_PENCIL_VERTEX_GROUP_SET(GreasePencilShrinkwrap);
2144
2145static void rna_GreasePencilLineartModifier_material_set(PointerRNA *ptr,
2146 PointerRNA value,
2147 ReportList *reports)
2148{
2150 ptr->data);
2151 Material **ma_target = &lmd->target_material;
2152
2153 rna_GreasePencilModifier_material_set(ptr, value, reports, ma_target);
2154}
2155
2156static void rna_GreasePencilOpacityModifier_opacity_factor_range(
2157 PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax)
2158{
2160
2161 *min = 0.0f;
2162 *softmin = 0.0f;
2163 *softmax = (omd->flag & MOD_GREASE_PENCIL_OPACITY_USE_UNIFORM_OPACITY) ? 1.0f : 2.0f;
2164 *max = *softmax;
2165}
2166
2167static void rna_GreasePencilOpacityModifier_opacity_factor_max_set(PointerRNA *ptr, float value)
2168{
2170
2172 std::min(value, 1.0f) :
2173 value;
2174}
2175
2176static const GreasePencilDashModifierData *find_grease_pencil_dash_modifier_of_segment(
2177 const Object &ob, const GreasePencilDashModifierSegment &dash_segment)
2178{
2179 LISTBASE_FOREACH (const ModifierData *, md, &ob.modifiers) {
2181 const auto *dmd = reinterpret_cast<const GreasePencilDashModifierData *>(md);
2182 if (dmd->segments().contains_ptr(&dash_segment)) {
2183 return dmd;
2184 }
2185 }
2186 }
2187 return nullptr;
2188}
2189
2190static std::optional<std::string> rna_GreasePencilDashModifierSegment_path(const PointerRNA *ptr)
2191
2192{
2193 const Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
2194 const auto *dash_segment = static_cast<GreasePencilDashModifierSegment *>(ptr->data);
2195 const GreasePencilDashModifierData *dmd = find_grease_pencil_dash_modifier_of_segment(
2196 *ob, *dash_segment);
2197 BLI_assert(dmd != nullptr);
2198
2199 char name_esc[sizeof(dmd->modifier.name) * 2];
2200 BLI_str_escape(name_esc, dmd->modifier.name, sizeof(name_esc));
2201
2202 char ds_name_esc[sizeof(dash_segment->name) * 2];
2203 BLI_str_escape(ds_name_esc, dash_segment->name, sizeof(ds_name_esc));
2204
2205 return fmt::format("modifiers[\"{}\"].segments[\"{}\"]", name_esc, ds_name_esc);
2206}
2207
2208static void rna_GreasePencilDashModifierSegment_name_set(PointerRNA *ptr, const char *value)
2209{
2210 const Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
2211 auto *dash_segment = static_cast<GreasePencilDashModifierSegment *>(ptr->data);
2212 const GreasePencilDashModifierData *dmd = find_grease_pencil_dash_modifier_of_segment(
2213 *ob, *dash_segment);
2214 BLI_assert(dmd != nullptr);
2215
2216 const std::string oldname = dash_segment->name;
2217 STRNCPY_UTF8(dash_segment->name, value);
2219 [dmd, dash_segment](const blender::StringRef name) {
2220 for (const GreasePencilDashModifierSegment &ds : dmd->segments()) {
2221 if (&ds != dash_segment && ds.name == name) {
2222 return true;
2223 }
2224 }
2225 return false;
2226 },
2227 '.',
2228 dash_segment->name);
2229
2230 /* Fix all the animation data which may link to this. */
2231 char name_esc[sizeof(dmd->modifier.name) * 2];
2232 BLI_str_escape(name_esc, dmd->modifier.name, sizeof(name_esc));
2233 char rna_path_prefix[36 + sizeof(name_esc) + 1];
2234 SNPRINTF_UTF8(rna_path_prefix, "modifiers[\"%s\"].segments", name_esc);
2235 BKE_animdata_fix_paths_rename_all(nullptr, rna_path_prefix, oldname.c_str(), dash_segment->name);
2236}
2237
2238static void rna_GreasePencilDashModifier_segments_begin(CollectionPropertyIterator *iter,
2239 PointerRNA *ptr)
2240{
2241 auto *dmd = static_cast<GreasePencilDashModifierData *>(ptr->data);
2243 ptr,
2244 dmd->segments_array,
2246 dmd->segments_num,
2247 false,
2248 nullptr);
2249}
2250
2251const EnumPropertyItem *grease_pencil_build_time_mode_filter(bContext * /*C*/,
2252 PointerRNA *ptr,
2253 PropertyRNA * /*prop*/,
2254 bool *r_free)
2255{
2256
2257 auto *md = static_cast<ModifierData *>(ptr->data);
2258 auto *mmd = reinterpret_cast<BuildGpencilModifierData *>(md);
2259 const bool is_concurrent = (mmd->mode == MOD_GREASE_PENCIL_BUILD_MODE_CONCURRENT);
2260
2261 EnumPropertyItem *item_list = nullptr;
2262 int totitem = 0;
2263
2265 item->identifier != nullptr;
2266 item++)
2267 {
2268 if (is_concurrent && (item->value == MOD_GREASE_PENCIL_BUILD_TIMEMODE_DRAWSPEED)) {
2269 continue;
2270 }
2271 RNA_enum_item_add(&item_list, &totitem, item);
2272 }
2273
2274 RNA_enum_item_end(&item_list, &totitem);
2275 *r_free = true;
2276
2277 return item_list;
2278}
2279
2280static const GreasePencilTimeModifierData *find_grease_pencil_time_modifier_of_segment(
2281 const Object &ob, const GreasePencilTimeModifierSegment &time_segment)
2282{
2283 LISTBASE_FOREACH (const ModifierData *, md, &ob.modifiers) {
2285 const auto *tmd = reinterpret_cast<const GreasePencilTimeModifierData *>(md);
2286 if (tmd->segments().contains_ptr(&time_segment)) {
2287 return tmd;
2288 }
2289 }
2290 }
2291 return nullptr;
2292}
2293
2294static std::optional<std::string> rna_GreasePencilTimeModifierSegment_path(const PointerRNA *ptr)
2295
2296{
2297 const Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
2298 const auto *segment = static_cast<GreasePencilTimeModifierSegment *>(ptr->data);
2299 const GreasePencilTimeModifierData *tmd = find_grease_pencil_time_modifier_of_segment(*ob,
2300 *segment);
2301 BLI_assert(tmd != nullptr);
2302
2303 char name_esc[sizeof(tmd->modifier.name) * 2];
2304 BLI_str_escape(name_esc, tmd->modifier.name, sizeof(name_esc));
2305
2306 char ds_name_esc[sizeof(segment->name) * 2];
2307 BLI_str_escape(ds_name_esc, segment->name, sizeof(ds_name_esc));
2308
2309 return fmt::format("modifiers[\"{}\"].segments[\"{}\"]", name_esc, ds_name_esc);
2310}
2311
2312static void rna_GreasePencilTimeModifierSegment_name_set(PointerRNA *ptr, const char *value)
2313{
2314 const Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
2315 auto *segment = static_cast<GreasePencilTimeModifierSegment *>(ptr->data);
2316 const GreasePencilTimeModifierData *tmd = find_grease_pencil_time_modifier_of_segment(*ob,
2317 *segment);
2318 BLI_assert(tmd != nullptr);
2319
2320 const std::string oldname = segment->name;
2321 STRNCPY_UTF8(segment->name, value);
2323 [tmd, segment](const blender::StringRef name) {
2324 for (const GreasePencilTimeModifierSegment &ds : tmd->segments()) {
2325 if (&ds != segment && ds.name == name) {
2326 return true;
2327 }
2328 }
2329 return false;
2330 },
2331 '.',
2332 segment->name);
2333
2334 /* Fix all the animation data which may link to this. */
2335 char name_esc[sizeof(tmd->modifier.name) * 2];
2336 BLI_str_escape(name_esc, tmd->modifier.name, sizeof(name_esc));
2337 char rna_path_prefix[36 + sizeof(name_esc) + 1];
2338 SNPRINTF_UTF8(rna_path_prefix, "modifiers[\"%s\"].segments", name_esc);
2339 BKE_animdata_fix_paths_rename_all(nullptr, rna_path_prefix, oldname.c_str(), segment->name);
2340}
2341
2342static void rna_GreasePencilTimeModifier_segments_begin(CollectionPropertyIterator *iter,
2343 PointerRNA *ptr)
2344{
2345 auto *tmd = static_cast<GreasePencilTimeModifierData *>(ptr->data);
2347 ptr,
2348 tmd->segments_array,
2350 tmd->segments_num,
2351 false,
2352 nullptr);
2353}
2354
2355static void rna_GreasePencilTimeModifier_start_frame_set(PointerRNA *ptr, int value)
2356{
2357 auto *tmd = static_cast<GreasePencilTimeModifierData *>(ptr->data);
2358 CLAMP(value, MINFRAME, MAXFRAME);
2359 tmd->sfra = value;
2360
2361 if (tmd->sfra >= tmd->efra) {
2362 tmd->efra = std::min(tmd->sfra, MAXFRAME);
2363 }
2364}
2365
2366static void rna_GreasePencilTimeModifier_end_frame_set(PointerRNA *ptr, int value)
2367{
2368 auto *tmd = static_cast<GreasePencilTimeModifierData *>(ptr->data);
2369 CLAMP(value, MINFRAME, MAXFRAME);
2370 tmd->efra = value;
2371
2372 if (tmd->sfra >= tmd->efra) {
2373 tmd->sfra = std::max(tmd->efra, MINFRAME);
2374 }
2375}
2376
2377static void rna_GreasePencilOutlineModifier_outline_material_set(PointerRNA *ptr,
2378 PointerRNA value,
2379 ReportList *reports)
2380{
2382 rna_GreasePencilModifier_material_set(ptr, value, reports, &omd->outline_material);
2383}
2384
2385static int rna_GreasePencilShrinkwrapModifier_face_cull_get(PointerRNA *ptr)
2386{
2388 static_cast<GreasePencilShrinkwrapModifierData *>(ptr->data);
2390}
2391
2392static void rna_GreasePencilShrinkwrapModifier_face_cull_set(PointerRNA *ptr, int value)
2393{
2395 ptr->data);
2397}
2398
2399#else
2400
2401static void rna_def_modifier_panel_open_prop(StructRNA *srna, const char *identifier, const int id)
2402{
2403 BLI_assert(id >= 0);
2405
2406 PropertyRNA *prop;
2407 prop = RNA_def_property(srna, identifier, PROP_BOOLEAN, PROP_NONE);
2410 prop, nullptr, "modifier.layout_panel_open_flag", (int64_t(1) << id));
2412}
2413
2415{
2416 PropertyRNA *prop;
2418
2419 prop = RNA_def_property(srna, "uv_smooth", PROP_ENUM, PROP_NONE);
2420 RNA_def_property_enum_sdna(prop, nullptr, "uv_smooth");
2422 RNA_def_property_ui_text(prop, "UV Smooth", "Controls how smoothing is applied to UVs");
2423 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2424
2425 prop = RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED);
2426 RNA_def_property_int_sdna(prop, nullptr, "quality");
2427 RNA_def_property_range(prop, 1, 10);
2428 RNA_def_property_ui_range(prop, 1, 6, 1, -1);
2430 prop, "Quality", "Accuracy of vertex positions, lower value is faster but less precise");
2431 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2432
2433 prop = RNA_def_property(srna, "boundary_smooth", PROP_ENUM, PROP_NONE);
2434 RNA_def_property_enum_sdna(prop, nullptr, "boundary_smooth");
2436 RNA_def_property_ui_text(prop, "Boundary Smooth", "Controls how open boundaries are smoothed");
2437 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2438
2440}
2441
2443{
2444 static const EnumPropertyItem prop_subdivision_type_items[] = {
2446 "CATMULL_CLARK",
2447 0,
2448 "Catmull-Clark",
2449 "Create a smooth curved surface using the Catmull-Clark subdivision scheme"},
2450 {SUBSURF_TYPE_SIMPLE, "SIMPLE", 0, "Simple", "Subdivide faces without changing shape"},
2451 {0, nullptr, 0, nullptr, nullptr},
2452 };
2453
2454 static const EnumPropertyItem prop_adaptive_space_items[] = {
2456 "PIXEL",
2457 0,
2458 "Pixel",
2459 "Subdivide polygons to reach a specified pixel size on screen"},
2461 "OBJECT",
2462 0,
2463 "Object",
2464 "Subdivide to reach a specified edge length in object space. This is required to use "
2465 "adaptive subdivision for instanced meshes"},
2466 {0, nullptr, 0, nullptr, nullptr},
2467 };
2468
2469 StructRNA *srna;
2470 PropertyRNA *prop;
2471
2472 srna = RNA_def_struct(brna, "SubsurfModifier", "Modifier");
2473 RNA_def_struct_ui_text(srna, "Subdivision Surface Modifier", "Subdivision surface modifier");
2474 RNA_def_struct_sdna(srna, "SubsurfModifierData");
2475 RNA_def_struct_ui_icon(srna, ICON_MOD_SUBSURF);
2476
2478
2480
2481 prop = RNA_def_property(srna, "subdivision_type", PROP_ENUM, PROP_NONE);
2482 RNA_def_property_enum_sdna(prop, nullptr, "subdivType");
2483 RNA_def_property_enum_items(prop, prop_subdivision_type_items);
2484 RNA_def_property_ui_text(prop, "Subdivision Type", "Select type of subdivision algorithm");
2485 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2486
2487 /* see CCGSUBSURF_LEVEL_MAX for max limit */
2488 prop = RNA_def_property(srna, "levels", PROP_INT, PROP_UNSIGNED);
2489 RNA_def_property_int_sdna(prop, nullptr, "levels");
2490 RNA_def_property_range(prop, 0, 11);
2491 RNA_def_property_ui_range(prop, 0, 6, 1, -1);
2492 RNA_def_property_ui_text(prop, "Levels", "Number of subdivisions to perform in the 3D viewport");
2493 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2494
2495 prop = RNA_def_property(srna, "render_levels", PROP_INT, PROP_UNSIGNED);
2496 RNA_def_property_int_sdna(prop, nullptr, "renderLevels");
2497 RNA_def_property_range(prop, 0, 11);
2498 RNA_def_property_ui_range(prop, 0, 6, 1, -1);
2500 prop, "Render Levels", "Number of subdivisions to perform when rendering");
2501
2502 prop = RNA_def_property(srna, "show_only_control_edges", PROP_BOOLEAN, PROP_NONE);
2504 RNA_def_property_ui_text(prop, "Optimal Display", "Skip displaying interior subdivided edges");
2505 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2506
2507 prop = RNA_def_property(srna, "use_creases", PROP_BOOLEAN, PROP_NONE);
2510 prop, "Use Creases", "Use mesh crease information to sharpen edges or corners");
2511 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2512
2513 prop = RNA_def_property(srna, "use_custom_normals", PROP_BOOLEAN, PROP_NONE);
2516 prop, "Use Custom Normals", "Interpolates existing custom normals to resulting mesh");
2517 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2518
2519 prop = RNA_def_property(srna, "use_limit_surface", PROP_BOOLEAN, PROP_NONE);
2521 prop, nullptr, "flags", eSubsurfModifierFlag_UseRecursiveSubdivision);
2523 "Use Limit Surface",
2524 "Place vertices at the surface that would be produced with infinite "
2525 "levels of subdivision (smoothest possible shape)");
2526 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2527
2528 prop = RNA_def_property(srna, "use_adaptive_subdivision", PROP_BOOLEAN, PROP_NONE);
2530 prop, nullptr, "flags", eSubsurfModifierFlag_UseAdaptiveSubdivision);
2532 prop, "Use Adaptive Subdivision", "Adaptively subdivide mesh based on camera distance");
2533 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2534
2535 prop = RNA_def_property(srna, "adaptive_space", PROP_ENUM, PROP_NONE);
2536 RNA_def_property_enum_items(prop, prop_adaptive_space_items);
2537 RNA_def_property_ui_text(prop, "Adaptive Space", "How to adaptively subdivide the mesh");
2538 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2539
2540 prop = RNA_def_property(srna, "adaptive_pixel_size", PROP_FLOAT, PROP_PIXEL);
2542 prop, "Pixel Size", "Target polygon pixel size for adaptive subdivision");
2543 RNA_def_property_range(prop, 0.1f, 1000.0f);
2544 RNA_def_property_ui_range(prop, 0.5f, 1000.0f, 10, 3);
2545 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2546
2547 prop = RNA_def_property(srna, "adaptive_object_edge_length", PROP_FLOAT, PROP_DISTANCE);
2549 prop, "Edge Length", "Target object space edge length for adaptive subdivision");
2550 RNA_def_property_range(prop, 0.0001f, 1000.0f);
2551 RNA_def_property_ui_range(prop, 0.001f, 1000.0f, 10, 3);
2552 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2553
2554 rna_def_modifier_panel_open_prop(srna, "open_adaptive_subdivision_panel", 0);
2555 rna_def_modifier_panel_open_prop(srna, "open_advanced_panel", 1);
2556
2558}
2559
2561{
2562 static const EnumPropertyItem prop_texture_coordinates_items[] = {
2564 "LOCAL",
2565 0,
2566 "Local",
2567 "Use the local coordinate system for the texture coordinates"},
2569 "GLOBAL",
2570 0,
2571 "Global",
2572 "Use the global coordinate system for the texture coordinates"},
2574 "OBJECT",
2575 0,
2576 "Object",
2577 "Use the linked object's local coordinate system for the texture coordinates"},
2578 {MOD_DISP_MAP_UV, "UV", 0, "UV", "Use UV coordinates for the texture coordinates"},
2579 {0, nullptr, 0, nullptr, nullptr},
2580 };
2581
2582 PropertyRNA *prop;
2583
2585
2586 prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
2587 RNA_def_property_ui_text(prop, "Texture", "");
2589 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
2590
2591 prop = RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
2592 RNA_def_property_enum_sdna(prop, nullptr, "texmapping");
2593 RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
2594 RNA_def_property_ui_text(prop, "Texture Coordinates", "");
2595 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
2596
2597 prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
2598 RNA_def_property_string_sdna(prop, nullptr, "uvlayer_name");
2599 RNA_def_property_ui_text(prop, "UV Map", "UV map name");
2601 prop, nullptr, nullptr, "rna_MappingInfoModifier_uvlayer_name_set");
2602 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2603
2604 prop = RNA_def_property(srna, "texture_coords_object", PROP_POINTER, PROP_NONE);
2605 RNA_def_property_pointer_sdna(prop, nullptr, "map_object");
2607 prop, "Texture Coordinate Object", "Object to set the texture coordinates");
2609 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
2610
2611 prop = RNA_def_property(srna, "texture_coords_bone", PROP_STRING, PROP_NONE);
2612 RNA_def_property_string_sdna(prop, nullptr, "map_bone");
2613 RNA_def_property_ui_text(prop, "Texture Coordinate Bone", "Bone to set the texture coordinates");
2614 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
2615
2617}
2618
2620{
2621 StructRNA *srna;
2622 PropertyRNA *prop;
2623
2624 srna = RNA_def_struct(brna, "WarpModifier", "Modifier");
2625 RNA_def_struct_ui_text(srna, "Warp Modifier", "Warp modifier");
2626 RNA_def_struct_sdna(srna, "WarpModifierData");
2627 RNA_def_struct_ui_icon(srna, ICON_MOD_WARP);
2628
2630
2631 prop = RNA_def_property(srna, "object_from", PROP_POINTER, PROP_NONE);
2632 RNA_def_property_pointer_sdna(prop, nullptr, "object_from");
2633 RNA_def_property_ui_text(prop, "Object From", "Object to transform from");
2635 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
2636
2637 prop = RNA_def_property(srna, "bone_from", PROP_STRING, PROP_NONE);
2638 RNA_def_property_string_sdna(prop, nullptr, "bone_from");
2639 RNA_def_property_ui_text(prop, "Bone From", "Bone to transform from");
2640 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
2641
2642 prop = RNA_def_property(srna, "object_to", PROP_POINTER, PROP_NONE);
2643 RNA_def_property_pointer_sdna(prop, nullptr, "object_to");
2644 RNA_def_property_ui_text(prop, "Object To", "Object to transform to");
2646 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
2647
2648 prop = RNA_def_property(srna, "bone_to", PROP_STRING, PROP_NONE);
2649 RNA_def_property_string_sdna(prop, nullptr, "bone_to");
2650 RNA_def_property_ui_text(prop, "Bone To", "Bone defining offset");
2651 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
2652
2653 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
2655 RNA_def_property_ui_range(prop, -100, 100, 10, 2);
2656 RNA_def_property_ui_text(prop, "Strength", "");
2657 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2658
2659 prop = RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
2661 RNA_def_property_ui_text(prop, "Falloff Type", "");
2663 BLT_I18NCONTEXT_ID_CURVE_LEGACY); /* Abusing id_curve :/ */
2664 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2665
2666 prop = RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_DISTANCE);
2667 RNA_def_property_ui_text(prop, "Radius", "Radius to apply");
2668 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2669
2670 prop = RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE);
2671 RNA_def_property_pointer_sdna(prop, nullptr, "curfalloff");
2672 RNA_def_property_ui_text(prop, "Falloff Curve", "Custom falloff curve");
2673 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2674
2675 prop = RNA_def_property(srna, "use_volume_preserve", PROP_BOOLEAN, PROP_NONE);
2677 RNA_def_property_ui_text(prop, "Preserve Volume", "Preserve volume when rotations are used");
2678 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2679
2680 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
2681 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
2682 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the deform");
2683 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_WarpModifier_defgrp_name_set");
2684 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2685
2686 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
2688 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
2689 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2690
2692
2694}
2695
2697{
2698 StructRNA *srna;
2699 PropertyRNA *prop;
2700
2701 srna = RNA_def_struct(brna, "MultiresModifier", "Modifier");
2702 RNA_def_struct_ui_text(srna, "Multires Modifier", "Multiresolution mesh modifier");
2703 RNA_def_struct_sdna(srna, "MultiresModifierData");
2704 RNA_def_struct_ui_icon(srna, ICON_MOD_MULTIRES);
2705
2707
2709
2710 prop = RNA_def_property(srna, "levels", PROP_INT, PROP_UNSIGNED);
2711 RNA_def_property_int_sdna(prop, nullptr, "lvl");
2712 RNA_def_property_ui_text(prop, "Levels", "Number of subdivisions to use in the viewport");
2713 RNA_def_property_int_funcs(prop, nullptr, nullptr, "rna_MultiresModifier_level_range");
2714 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2715
2716 prop = RNA_def_property(srna, "sculpt_levels", PROP_INT, PROP_UNSIGNED);
2717 RNA_def_property_int_sdna(prop, nullptr, "sculptlvl");
2718 RNA_def_property_ui_text(prop, "Sculpt Levels", "Number of subdivisions to use in sculpt mode");
2719 RNA_def_property_int_funcs(prop, nullptr, nullptr, "rna_MultiresModifier_level_range");
2720 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2721
2722 prop = RNA_def_property(srna, "render_levels", PROP_INT, PROP_UNSIGNED);
2723 RNA_def_property_int_sdna(prop, nullptr, "renderlvl");
2724 RNA_def_property_ui_text(prop, "Render Levels", "The subdivision level visible at render time");
2725 RNA_def_property_int_funcs(prop, nullptr, nullptr, "rna_MultiresModifier_level_range");
2726
2727 prop = RNA_def_property(srna, "total_levels", PROP_INT, PROP_UNSIGNED);
2728 RNA_def_property_int_sdna(prop, nullptr, "totlvl");
2731 prop, "Total Levels", "Number of subdivisions for which displacements are stored");
2732
2733 prop = RNA_def_property(srna, "is_external", PROP_BOOLEAN, PROP_NONE);
2735 RNA_def_property_boolean_funcs(prop, "rna_MultiresModifier_external_get", nullptr);
2737 prop, "External", "Store multires displacements outside the .blend file, to save memory");
2738
2739 prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
2741 "rna_MultiresModifier_filepath_get",
2742 "rna_MultiresModifier_filepath_length",
2743 "rna_MultiresModifier_filepath_set");
2744 RNA_def_property_ui_text(prop, "File Path", "Path to external displacements file");
2746 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2747
2748 prop = RNA_def_property(srna, "show_only_control_edges", PROP_BOOLEAN, PROP_NONE);
2751 prop, "Optimal Display", "Skip drawing/rendering of interior subdivided edges");
2752 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2753
2754 prop = RNA_def_property(srna, "use_creases", PROP_BOOLEAN, PROP_NONE);
2757 prop, "Use Creases", "Use mesh crease information to sharpen edges or corners");
2758 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2759
2760 prop = RNA_def_property(srna, "use_custom_normals", PROP_BOOLEAN, PROP_NONE);
2763 prop, "Use Custom Normals", "Interpolates existing custom normals to resulting mesh");
2764 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2765
2766 prop = RNA_def_property(srna, "use_sculpt_base_mesh", PROP_BOOLEAN, PROP_NONE);
2769 "Sculpt Base Mesh",
2770 "Make Sculpt Mode tools deform the base mesh while previewing the "
2771 "displacement of higher subdivision levels");
2772 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2773
2775}
2776
2778{
2779 StructRNA *srna;
2780 PropertyRNA *prop;
2781
2782 srna = RNA_def_struct(brna, "LatticeModifier", "Modifier");
2783 RNA_def_struct_ui_text(srna, "Lattice Modifier", "Lattice deformation modifier");
2784 RNA_def_struct_sdna(srna, "LatticeModifierData");
2785 RNA_def_struct_ui_icon(srna, ICON_MOD_LATTICE);
2786
2788
2789 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
2790 RNA_def_property_ui_text(prop, "Object", "Lattice object to deform with");
2792 prop, nullptr, "rna_LatticeModifier_object_set", nullptr, "rna_Lattice_object_poll");
2794 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
2795
2796 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
2797 RNA_def_property_string_sdna(prop, nullptr, "name");
2799 prop,
2800 "Vertex Group",
2801 "Name of Vertex Group which determines influence of modifier per point");
2802 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_LatticeModifier_name_set");
2803 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2804
2805 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
2807 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
2808 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2809
2810 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
2812 RNA_def_property_ui_range(prop, 0, 1, 10, 2);
2813 RNA_def_property_ui_text(prop, "Strength", "Strength of modifier effect");
2814 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2815
2817}
2818
2820{
2821 StructRNA *srna;
2822 PropertyRNA *prop;
2823
2824 static const EnumPropertyItem prop_deform_axis_items[] = {
2825 {MOD_CURVE_POSX, "POS_X", 0, "X", ""},
2826 {MOD_CURVE_POSY, "POS_Y", 0, "Y", ""},
2827 {MOD_CURVE_POSZ, "POS_Z", 0, "Z", ""},
2828 {MOD_CURVE_NEGX, "NEG_X", 0, "-X", ""},
2829 {MOD_CURVE_NEGY, "NEG_Y", 0, "-Y", ""},
2830 {MOD_CURVE_NEGZ, "NEG_Z", 0, "-Z", ""},
2831 {0, nullptr, 0, nullptr, nullptr},
2832 };
2833
2834 srna = RNA_def_struct(brna, "CurveModifier", "Modifier");
2835 RNA_def_struct_ui_text(srna, "Curve Modifier", "Curve deformation modifier");
2836 RNA_def_struct_sdna(srna, "CurveModifierData");
2837 RNA_def_struct_ui_icon(srna, ICON_MOD_CURVE);
2838
2840
2841 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
2842 RNA_def_property_ui_text(prop, "Object", "Curve object to deform with");
2844 prop, nullptr, "rna_CurveModifier_object_set", nullptr, "rna_Curve_object_poll");
2846 RNA_def_property_update(prop, 0, "rna_CurveModifier_dependency_update");
2847
2848 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
2849 RNA_def_property_string_sdna(prop, nullptr, "name");
2851 prop,
2852 "Vertex Group",
2853 "Name of Vertex Group which determines influence of modifier per point");
2854 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_CurveModifier_name_set");
2855 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2856
2857 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
2859 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
2860 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2861
2862 prop = RNA_def_property(srna, "deform_axis", PROP_ENUM, PROP_NONE);
2863 RNA_def_property_enum_sdna(prop, nullptr, "defaxis");
2864 RNA_def_property_enum_items(prop, prop_deform_axis_items);
2865 RNA_def_property_ui_text(prop, "Deform Axis", "The axis that the curve deforms along");
2866 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2867
2869}
2870
2872{
2873 StructRNA *srna;
2874 PropertyRNA *prop;
2875
2876 srna = RNA_def_struct(brna, "BuildModifier", "Modifier");
2877 RNA_def_struct_ui_text(srna, "Build Modifier", "Build effect modifier");
2878 RNA_def_struct_sdna(srna, "BuildModifierData");
2879 RNA_def_struct_ui_icon(srna, ICON_MOD_BUILD);
2880
2882
2883 prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME);
2884 RNA_def_property_float_sdna(prop, nullptr, "start");
2886 RNA_def_property_ui_text(prop, "Start Frame", "Start frame of the effect");
2887 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2888
2889 prop = RNA_def_property(srna, "frame_duration", PROP_FLOAT, PROP_TIME);
2890 RNA_def_property_float_sdna(prop, nullptr, "length");
2892 RNA_def_property_ui_text(prop, "Length", "Total time the build effect requires");
2893 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2894
2895 prop = RNA_def_property(srna, "use_reverse", PROP_BOOLEAN, PROP_NONE);
2897 RNA_def_property_ui_text(prop, "Reversed", "Deconstruct the mesh instead of building it");
2898 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2899
2900 prop = RNA_def_property(srna, "use_random_order", PROP_BOOLEAN, PROP_NONE);
2902 RNA_def_property_ui_text(prop, "Randomize", "Randomize the faces or edges during build");
2903 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2904
2905 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
2907 RNA_def_property_ui_text(prop, "Seed", "Seed for random if used");
2908 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2909
2911}
2912
2914{
2915 StructRNA *srna;
2916 PropertyRNA *prop;
2917
2918 srna = RNA_def_struct(brna, "MirrorModifier", "Modifier");
2919 RNA_def_struct_ui_text(srna, "Mirror Modifier", "Mirroring modifier");
2920 RNA_def_struct_sdna(srna, "MirrorModifierData");
2921 RNA_def_struct_ui_icon(srna, ICON_MOD_MIRROR);
2922
2924
2925 prop = RNA_def_property(srna, "use_axis", PROP_BOOLEAN, PROP_NONE);
2927 RNA_def_property_ui_text(prop, "Mirror Axis", "Enable axis mirror");
2928 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2929
2930 prop = RNA_def_property(srna, "use_bisect_axis", PROP_BOOLEAN, PROP_NONE);
2932 RNA_def_property_ui_text(prop, "Bisect Axis", "Cuts the mesh across the mirror plane");
2933 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2934
2935 prop = RNA_def_property(srna, "use_bisect_flip_axis", PROP_BOOLEAN, PROP_NONE);
2937 RNA_def_property_ui_text(prop, "Bisect Flip Axis", "Flips the direction of the slice");
2938 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2939
2940 prop = RNA_def_property(srna, "use_clip", PROP_BOOLEAN, PROP_NONE);
2941 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_MIR_CLIPPING);
2943 prop, "Clip", "Prevent vertices from going through the mirror during transform");
2944 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2945
2946 prop = RNA_def_property(srna, "use_mirror_vertex_groups", PROP_BOOLEAN, PROP_NONE);
2947 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_MIR_VGROUP);
2948 RNA_def_property_ui_text(prop, "Mirror Vertex Groups", "Mirror vertex groups (e.g. .R->.L)");
2949 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2950
2951 prop = RNA_def_property(srna, "use_mirror_merge", PROP_BOOLEAN, PROP_NONE);
2953 RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices within the merge threshold");
2954 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2955
2956 prop = RNA_def_property(srna, "use_mirror_u", PROP_BOOLEAN, PROP_NONE);
2957 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_MIR_MIRROR_U);
2959 prop, "Mirror U", "Mirror the U texture coordinate around the flip offset point");
2960 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2961
2962 prop = RNA_def_property(srna, "use_mirror_v", PROP_BOOLEAN, PROP_NONE);
2963 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_MIR_MIRROR_V);
2965 prop, "Mirror V", "Mirror the V texture coordinate around the flip offset point");
2966 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2967
2968 prop = RNA_def_property(srna, "use_mirror_udim", PROP_BOOLEAN, PROP_NONE);
2969 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_MIR_MIRROR_UDIM);
2971 prop, "Mirror UDIM", "Mirror the texture coordinate around each tile center");
2972 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2973
2974 prop = RNA_def_property(srna, "mirror_offset_u", PROP_FLOAT, PROP_FACTOR);
2975 RNA_def_property_float_sdna(prop, nullptr, "uv_offset[0]");
2976 RNA_def_property_range(prop, -1, 1);
2977 RNA_def_property_ui_range(prop, -1, 1, 2, 4);
2979 prop,
2980 "Flip U Offset",
2981 "Amount to offset mirrored UVs flipping point from the 0.5 on the U axis");
2982 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2983
2984 prop = RNA_def_property(srna, "mirror_offset_v", PROP_FLOAT, PROP_FACTOR);
2985 RNA_def_property_float_sdna(prop, nullptr, "uv_offset[1]");
2986 RNA_def_property_range(prop, -1, 1);
2987 RNA_def_property_ui_range(prop, -1, 1, 2, 4);
2989 prop,
2990 "Flip V Offset",
2991 "Amount to offset mirrored UVs flipping point from the 0.5 point on the V axis");
2992 RNA_def_property_update(prop, 0, "rna_Modifier_update");
2993
2994 prop = RNA_def_property(srna, "offset_u", PROP_FLOAT, PROP_FACTOR);
2995 RNA_def_property_float_sdna(prop, nullptr, "uv_offset_copy[0]");
2996 RNA_def_property_range(prop, -10000.0f, 10000.0f);
2997 RNA_def_property_ui_range(prop, -1, 1, 2, 4);
2998 RNA_def_property_ui_text(prop, "U Offset", "Mirrored UV offset on the U axis");
2999 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3000
3001 prop = RNA_def_property(srna, "offset_v", PROP_FLOAT, PROP_FACTOR);
3002 RNA_def_property_float_sdna(prop, nullptr, "uv_offset_copy[1]");
3003 RNA_def_property_range(prop, -10000.0f, 10000.0f);
3004 RNA_def_property_ui_range(prop, -1, 1, 2, 4);
3005 RNA_def_property_ui_text(prop, "V Offset", "Mirrored UV offset on the V axis");
3006 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3007
3008 prop = RNA_def_property(srna, "merge_threshold", PROP_FLOAT, PROP_DISTANCE);
3009 RNA_def_property_float_sdna(prop, nullptr, "tolerance");
3011 RNA_def_property_ui_range(prop, 0, 1, 0.01, 6);
3013 prop, "Merge Distance", "Distance within which mirrored vertices are merged");
3014 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3015
3016 prop = RNA_def_property(srna, "bisect_threshold", PROP_FLOAT, PROP_DISTANCE);
3017 RNA_def_property_float_sdna(prop, nullptr, "bisect_threshold");
3019 RNA_def_property_ui_range(prop, 0, 1, 0.01, 6);
3021 prop, "Bisect Distance", "Distance from the bisect plane within which vertices are removed");
3022 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3023
3024 prop = RNA_def_property(srna, "mirror_object", PROP_POINTER, PROP_NONE);
3025 RNA_def_property_pointer_sdna(prop, nullptr, "mirror_ob");
3026 RNA_def_property_ui_text(prop, "Mirror Object", "Object to use as mirror");
3028 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
3029
3031}
3032
3034{
3035 static const EnumPropertyItem modifier_decim_mode_items[] = {
3036 {MOD_DECIM_MODE_COLLAPSE, "COLLAPSE", 0, "Collapse", "Use edge collapsing"},
3037 {MOD_DECIM_MODE_UNSUBDIV, "UNSUBDIV", 0, "Un-Subdivide", "Use un-subdivide face reduction"},
3039 "DISSOLVE",
3040 0,
3041 "Planar",
3042 "Dissolve geometry to form planar polygons"},
3043 {0, nullptr, 0, nullptr, nullptr},
3044 };
3045
3046 /* NOTE: keep in sync with operator `MESH_OT_decimate`. */
3047
3048 StructRNA *srna;
3049 PropertyRNA *prop;
3050
3051 srna = RNA_def_struct(brna, "DecimateModifier", "Modifier");
3052 RNA_def_struct_ui_text(srna, "Decimate Modifier", "Decimation modifier");
3053 RNA_def_struct_sdna(srna, "DecimateModifierData");
3054 RNA_def_struct_ui_icon(srna, ICON_MOD_DECIM);
3055
3057
3058 prop = RNA_def_property(srna, "decimate_type", PROP_ENUM, PROP_NONE);
3059 RNA_def_property_enum_sdna(prop, nullptr, "mode");
3060 RNA_def_property_enum_items(prop, modifier_decim_mode_items);
3061 RNA_def_property_ui_text(prop, "Mode", "");
3063 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3064
3065 /* (mode == MOD_DECIM_MODE_COLLAPSE) */
3066 prop = RNA_def_property(srna, "ratio", PROP_FLOAT, PROP_FACTOR);
3067 RNA_def_property_float_sdna(prop, nullptr, "percent");
3068 RNA_def_property_range(prop, 0, 1);
3069 RNA_def_property_ui_range(prop, 0, 1, 1, 4);
3070 RNA_def_property_ui_text(prop, "Ratio", "Ratio of triangles to reduce to (collapse only)");
3071 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3072
3073 /* (mode == MOD_DECIM_MODE_UNSUBDIV) */
3074 prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_UNSIGNED);
3075 RNA_def_property_int_sdna(prop, nullptr, "iter");
3076 RNA_def_property_range(prop, 0, SHRT_MAX);
3077 RNA_def_property_ui_range(prop, 0, 100, 1, -1);
3079 prop, "Iterations", "Number of times reduce the geometry (unsubdivide only)");
3080 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3081
3082 /* (mode == MOD_DECIM_MODE_DISSOLVE) */
3083 prop = RNA_def_property(srna, "angle_limit", PROP_FLOAT, PROP_ANGLE);
3084 RNA_def_property_float_sdna(prop, nullptr, "angle");
3085 RNA_def_property_range(prop, 0, DEG2RAD(180));
3086 RNA_def_property_ui_range(prop, 0, DEG2RAD(180), 10, 4);
3087 RNA_def_property_ui_text(prop, "Angle Limit", "Only dissolve angles below this (planar only)");
3088 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3089
3090 /* (mode == MOD_DECIM_MODE_COLLAPSE) */
3091 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
3092 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
3093 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name (collapse only)");
3094 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_DecimateModifier_defgrp_name_set");
3095 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3096
3097 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
3099 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence (collapse only)");
3100 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3101
3102 prop = RNA_def_property(srna, "use_collapse_triangulate", PROP_BOOLEAN, PROP_NONE);
3105 prop, "Triangulate", "Keep triangulated faces resulting from decimation (collapse only)");
3106 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3107
3108 prop = RNA_def_property(srna, "use_symmetry", PROP_BOOLEAN, PROP_NONE);
3110 RNA_def_property_ui_text(prop, "Symmetry", "Maintain symmetry on an axis");
3111 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3112
3113 prop = RNA_def_property(srna, "symmetry_axis", PROP_ENUM, PROP_NONE);
3114 RNA_def_property_enum_sdna(prop, nullptr, "symmetry_axis");
3116 RNA_def_property_ui_text(prop, "Axis", "Axis of symmetry");
3117 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3118
3119 prop = RNA_def_property(srna, "vertex_group_factor", PROP_FLOAT, PROP_FACTOR);
3120 RNA_def_property_float_sdna(prop, nullptr, "defgrp_factor");
3121 RNA_def_property_range(prop, 0, 1000);
3122 RNA_def_property_ui_range(prop, 0, 10, 1, 4);
3123 RNA_def_property_ui_text(prop, "Factor", "Vertex group strength");
3124 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3125 /* end collapse-only option */
3126
3127 /* (mode == MOD_DECIM_MODE_DISSOLVE) */
3128 prop = RNA_def_property(srna, "use_dissolve_boundaries", PROP_BOOLEAN, PROP_NONE);
3131 prop, "All Boundaries", "Dissolve all vertices in between face boundaries (planar only)");
3132 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3133
3134 prop = RNA_def_property(srna, "delimit", PROP_ENUM, PROP_NONE);
3135 RNA_def_property_flag(prop, PROP_ENUM_FLAG); /* important to run before default set */
3137 RNA_def_property_ui_text(prop, "Delimit", "Limit merging geometry");
3138 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3139
3140 /* end dissolve-only option */
3141
3142 /* all modes use this */
3143 prop = RNA_def_property(srna, "face_count", PROP_INT, PROP_NONE);
3146 prop, "Face Count", "The current number of faces in the decimated mesh");
3147
3149}
3150
3152{
3153 StructRNA *srna;
3154 PropertyRNA *prop;
3155
3156 srna = RNA_def_struct(brna, "WaveModifier", "Modifier");
3157 RNA_def_struct_ui_text(srna, "Wave Modifier", "Wave effect modifier");
3158 RNA_def_struct_sdna(srna, "WaveModifierData");
3159 RNA_def_struct_ui_icon(srna, ICON_MOD_WAVE);
3160
3162
3163 prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
3164 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_WAVE_X);
3165 RNA_def_property_ui_text(prop, "X", "X axis motion");
3166 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3167
3168 prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
3169 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_WAVE_Y);
3170 RNA_def_property_ui_text(prop, "Y", "Y axis motion");
3171 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3172
3173 prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
3174 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_WAVE_CYCL);
3175 RNA_def_property_ui_text(prop, "Cyclic", "Cyclic wave effect");
3176 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3177
3178 prop = RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
3179 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_WAVE_NORM);
3180 RNA_def_property_ui_text(prop, "Normals", "Displace along normals");
3181 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3182
3183 prop = RNA_def_property(srna, "use_normal_x", PROP_BOOLEAN, PROP_NONE);
3184 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_WAVE_NORM_X);
3185 RNA_def_property_ui_text(prop, "X Normal", "Enable displacement along the X normal");
3186 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3187
3188 prop = RNA_def_property(srna, "use_normal_y", PROP_BOOLEAN, PROP_NONE);
3189 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_WAVE_NORM_Y);
3190 RNA_def_property_ui_text(prop, "Y Normal", "Enable displacement along the Y normal");
3191 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3192
3193 prop = RNA_def_property(srna, "use_normal_z", PROP_BOOLEAN, PROP_NONE);
3194 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_WAVE_NORM_Z);
3195 RNA_def_property_ui_text(prop, "Z Normal", "Enable displacement along the Z normal");
3196 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3197
3198 prop = RNA_def_property(srna, "time_offset", PROP_FLOAT, PROP_TIME);
3199 RNA_def_property_float_sdna(prop, nullptr, "timeoffs");
3202 prop,
3203 "Time Offset",
3204 "Either the starting frame (for positive speed) or ending frame (for negative speed)");
3205 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3206
3207 prop = RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME);
3208 RNA_def_property_float_sdna(prop, nullptr, "lifetime");
3211 prop, "Lifetime", "Lifetime of the wave in frames, zero means infinite");
3212 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3213
3214 prop = RNA_def_property(srna, "damping_time", PROP_FLOAT, PROP_TIME);
3215 RNA_def_property_float_sdna(prop, nullptr, "damp");
3218 prop, "Damping Time", "Number of frames in which the wave damps out after it dies");
3219 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3220
3221 prop = RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_DISTANCE);
3222 RNA_def_property_float_sdna(prop, nullptr, "falloff");
3224 RNA_def_property_ui_range(prop, 0, 100, 100, 2);
3225 RNA_def_property_ui_text(prop, "Falloff Radius", "Distance after which it fades out");
3226 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3227
3228 prop = RNA_def_property(srna, "start_position_x", PROP_FLOAT, PROP_DISTANCE);
3229 RNA_def_property_float_sdna(prop, nullptr, "startx");
3231 RNA_def_property_ui_range(prop, -100, 100, 100, 2);
3232 RNA_def_property_ui_text(prop, "Start Position X", "X coordinate of the start position");
3233 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3234
3235 prop = RNA_def_property(srna, "start_position_y", PROP_FLOAT, PROP_DISTANCE);
3236 RNA_def_property_float_sdna(prop, nullptr, "starty");
3238 RNA_def_property_ui_range(prop, -100, 100, 100, 2);
3239 RNA_def_property_ui_text(prop, "Start Position Y", "Y coordinate of the start position");
3240 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3241
3242 prop = RNA_def_property(srna, "start_position_object", PROP_POINTER, PROP_NONE);
3243 RNA_def_property_pointer_sdna(prop, nullptr, "objectcenter");
3244 RNA_def_property_ui_text(prop, "Start Position Object", "Object which defines the wave center");
3246 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
3247
3248 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
3249 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
3250 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the wave");
3251 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_WaveModifier_defgrp_name_set");
3252 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3253
3254 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
3256 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
3257 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3258
3259 prop = RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE);
3261 RNA_def_property_ui_range(prop, -1, 1, 10, 2);
3263 prop, "Speed", "Speed of the wave, towards the starting point when negative");
3264 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3265
3266 prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
3268 RNA_def_property_ui_range(prop, -2, 2, 10, 2);
3269 RNA_def_property_ui_text(prop, "Height", "Height of the wave");
3270 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3271
3272 prop = RNA_def_property(srna, "width", PROP_FLOAT, PROP_DISTANCE);
3274 RNA_def_property_ui_range(prop, 0, 5, 10, 2);
3275 RNA_def_property_ui_text(prop, "Width", "Distance between the waves");
3276 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3277
3278 prop = RNA_def_property(srna, "narrowness", PROP_FLOAT, PROP_DISTANCE);
3279 RNA_def_property_float_sdna(prop, nullptr, "narrow");
3281 RNA_def_property_ui_range(prop, 0, 10, 10, 2);
3283 prop,
3284 "Narrowness",
3285 "Distance between the top and the base of a wave, the higher the value, "
3286 "the more narrow the wave");
3287 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3288
3290
3292}
3293
3295{
3296 StructRNA *srna;
3297 PropertyRNA *prop;
3298
3299 srna = RNA_def_struct(brna, "ArmatureModifier", "Modifier");
3300 RNA_def_struct_ui_text(srna, "Armature Modifier", "Armature deformation modifier");
3301 RNA_def_struct_sdna(srna, "ArmatureModifierData");
3302 RNA_def_struct_ui_icon(srna, ICON_MOD_ARMATURE);
3303
3305
3306 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
3307 RNA_def_property_ui_text(prop, "Object", "Armature object to deform with");
3309 prop, nullptr, "rna_ArmatureModifier_object_set", nullptr, "rna_Armature_object_poll");
3311 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
3312
3313 prop = RNA_def_property(srna, "use_bone_envelopes", PROP_BOOLEAN, PROP_NONE);
3314 RNA_def_property_boolean_sdna(prop, nullptr, "deformflag", ARM_DEF_ENVELOPE);
3316 RNA_def_property_ui_text(prop, "Use Bone Envelopes", "Bind Bone envelopes to armature modifier");
3317 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
3318
3319 prop = RNA_def_property(srna, "use_vertex_groups", PROP_BOOLEAN, PROP_NONE);
3320 RNA_def_property_boolean_sdna(prop, nullptr, "deformflag", ARM_DEF_VGROUP);
3322 RNA_def_property_ui_text(prop, "Use Vertex Groups", "Bind vertex groups to armature modifier");
3323 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
3324
3325 prop = RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE);
3326 RNA_def_property_boolean_sdna(prop, nullptr, "deformflag", ARM_DEF_QUATERNION);
3328 prop, "Preserve Volume", "Deform rotation interpolation with quaternions");
3329 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3330
3331 prop = RNA_def_property(srna, "use_multi_modifier", PROP_BOOLEAN, PROP_NONE);
3332 RNA_def_property_boolean_sdna(prop, nullptr, "multi", 0);
3334 prop,
3335 "Multi Modifier",
3336 "Use same input as previous modifier, and mix results using overall vgroup");
3337 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3338
3339 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
3340 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
3342 prop,
3343 "Vertex Group",
3344 "Name of Vertex Group which determines influence of modifier per point");
3345 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_ArmatureModifier_defgrp_name_set");
3346 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3347
3348 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
3349 RNA_def_property_boolean_sdna(prop, nullptr, "deformflag", ARM_DEF_INVERT_VGROUP);
3350 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
3351 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3352
3354}
3355
3357{
3358 StructRNA *srna;
3359 PropertyRNA *prop;
3360 FunctionRNA *func;
3361 PropertyRNA *parm;
3362
3363 srna = RNA_def_struct(brna, "HookModifier", "Modifier");
3365 srna, "Hook Modifier", "Hook modifier to modify the location of vertices");
3366 RNA_def_struct_sdna(srna, "HookModifierData");
3367 RNA_def_struct_ui_icon(srna, ICON_HOOK);
3368
3370
3371 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
3372 RNA_def_property_float_sdna(prop, nullptr, "force");
3373 RNA_def_property_range(prop, 0, 1);
3374 RNA_def_property_ui_text(prop, "Strength", "Relative force of the hook");
3375 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3376
3377 prop = RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
3378 RNA_def_property_enum_items(prop, modifier_warp_falloff_items); /* share the enum */
3379 RNA_def_property_ui_text(prop, "Falloff Type", "");
3381 BLT_I18NCONTEXT_ID_CURVE_LEGACY); /* Abusing id_curve :/ */
3382 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3383
3384 prop = RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_DISTANCE);
3385 RNA_def_property_float_sdna(prop, nullptr, "falloff");
3387 RNA_def_property_ui_range(prop, 0, 100, 100, 2);
3389 prop, "Radius", "If not zero, the distance from the hook where influence ends");
3390 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3391
3392 prop = RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE);
3393 RNA_def_property_pointer_sdna(prop, nullptr, "curfalloff");
3394 RNA_def_property_ui_text(prop, "Falloff Curve", "Custom falloff curve");
3395 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3396
3397 prop = RNA_def_property(srna, "center", PROP_FLOAT, PROP_TRANSLATION);
3398 RNA_def_property_float_sdna(prop, nullptr, "cent");
3400 prop, "Hook Center", "Center of the hook, used for falloff and display");
3401 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3402
3403 prop = RNA_def_property(srna, "matrix_inverse", PROP_FLOAT, PROP_MATRIX);
3404 RNA_def_property_float_sdna(prop, nullptr, "parentinv");
3407 prop, "Matrix", "Reverse the transformation between this object and its target");
3408 RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Modifier_update");
3409
3410 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
3412 prop, "Object", "Parent Object for hook, also recalculates and clears offset");
3415 prop, nullptr, nullptr, "rna_HookModifier_object_override_apply");
3416 RNA_def_property_pointer_funcs(prop, nullptr, "rna_HookModifier_object_set", nullptr, nullptr);
3417 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
3418
3419 prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
3420 RNA_def_property_string_sdna(prop, nullptr, "subtarget");
3422 prop,
3423 "Sub-Target",
3424 "Name of Parent Bone for hook (if applicable), also recalculates and clears offset");
3425 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_HookModifier_subtarget_set");
3426 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
3427
3428 prop = RNA_def_property(srna, "use_falloff_uniform", PROP_BOOLEAN, PROP_NONE);
3430 RNA_def_property_ui_text(prop, "Uniform Falloff", "Compensate for non-uniform object scale");
3431 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3432
3433 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
3434 RNA_def_property_string_sdna(prop, nullptr, "name");
3436 prop,
3437 "Vertex Group",
3438 "Name of Vertex Group which determines influence of modifier per point");
3439 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_HookModifier_name_set");
3440 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3441
3442 prop = RNA_def_property(srna, "vertex_indices", PROP_INT, PROP_UNSIGNED);
3446 RNA_def_property_dynamic_array_funcs(prop, "rna_HookModifier_vertex_indices_get_length");
3447 RNA_def_property_int_funcs(prop, "rna_HookModifier_vertex_indices_get", nullptr, nullptr);
3449 "Vertex Indices",
3450 "Indices of vertices bound to the modifier. For Bézier curves, "
3451 "handles count as additional vertices.");
3452
3453 func = RNA_def_function(srna, "vertex_indices_set", "rna_HookModifier_vertex_indices_set");
3455 func, "Validates and assigns the array of vertex indices bound to the modifier");
3457 parm = RNA_def_int_array(
3458 func, "indices", 1, nullptr, INT_MIN, INT_MAX, "", "Vertex Indices", 0, INT_MAX);
3461
3462 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
3464 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
3465 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3466
3468}
3469
3471{
3472 StructRNA *srna;
3473 PropertyRNA *prop;
3474
3475 srna = RNA_def_struct(brna, "SoftBodyModifier", "Modifier");
3476 RNA_def_struct_ui_text(srna, "Soft Body Modifier", "Soft body simulation modifier");
3477 RNA_def_struct_sdna(srna, "SoftbodyModifierData");
3478 RNA_def_struct_ui_icon(srna, ICON_MOD_SOFT);
3479
3480 prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
3482 RNA_def_property_struct_type(prop, "SoftBodySettings");
3484 prop, "rna_SoftBodyModifier_settings_get", nullptr, nullptr, nullptr);
3485 RNA_def_property_ui_text(prop, "Soft Body Settings", "");
3486
3487 prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
3489 RNA_def_property_struct_type(prop, "PointCache");
3491 prop, "rna_SoftBodyModifier_point_cache_get", nullptr, nullptr, nullptr);
3492 RNA_def_property_ui_text(prop, "Soft Body Point Cache", "");
3493}
3494
3496{
3497 StructRNA *srna;
3498 PropertyRNA *prop;
3499
3500 static const EnumPropertyItem prop_operand_items[] = {
3502 "OBJECT",
3503 0,
3504 "Object",
3505 "Use a mesh object as the operand for the Boolean operation"},
3507 "COLLECTION",
3508 0,
3509 "Collection",
3510 "Use a collection of mesh objects as the operand for the Boolean operation"},
3511 {0, nullptr, 0, nullptr, nullptr},
3512 };
3513
3514 static const EnumPropertyItem prop_operation_items[] = {
3516 "INTERSECT",
3517 0,
3518 "Intersect",
3519 "Keep the part of the mesh that is common between all operands"},
3520 {eBooleanModifierOp_Union, "UNION", 0, "Union", "Combine meshes in an additive way"},
3522 "DIFFERENCE",
3523 0,
3524 "Difference",
3525 "Combine meshes in a subtractive way"},
3526 {0, nullptr, 0, nullptr, nullptr},
3527 };
3528
3529 static const EnumPropertyItem prop_solver_items[] = {
3531 "FLOAT",
3532 0,
3533 "Float",
3534 "Simple solver with good performance, without support for overlapping geometry"},
3536 "EXACT",
3537 0,
3538 "Exact",
3539 "Slower solver with the best results for coplanar faces"},
3541 "MANIFOLD",
3542 0,
3543 "Manifold",
3544 "Fastest solver that works only on manifold meshes but gives better results"},
3545 {0, nullptr, 0, nullptr, nullptr},
3546 };
3547
3548 static const EnumPropertyItem material_mode_items[] = {
3550 "INDEX",
3551 0,
3552 "Index Based",
3553 "Set the material on new faces based on the order of the material slot lists. If a "
3554 "material does not exist on the modifier object, the face will use the same material slot "
3555 "or the first if the object does not have enough slots."},
3557 "TRANSFER",
3558 0,
3559 "Transfer",
3560 "Transfer materials from non-empty slots to the result mesh, adding new materials as "
3561 "necessary. For empty slots, fall back to using the same material index as the operand "
3562 "mesh."},
3563 {0, nullptr, 0, nullptr, nullptr},
3564 };
3565
3566 srna = RNA_def_struct(brna, "BooleanModifier", "Modifier");
3567 RNA_def_struct_ui_text(srna, "Boolean Modifier", "Boolean operations modifier");
3568 RNA_def_struct_sdna(srna, "BooleanModifierData");
3569 RNA_def_struct_ui_icon(srna, ICON_MOD_BOOLEAN);
3570
3572
3573 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
3574 RNA_def_property_ui_text(prop, "Object", "Mesh object to use for Boolean operation");
3576 prop, nullptr, "rna_BooleanModifier_object_set", nullptr, "rna_Mesh_object_poll");
3578 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
3579
3580 prop = RNA_def_property(srna, "collection", PROP_POINTER, PROP_NONE);
3581 RNA_def_property_pointer_sdna(prop, nullptr, "collection");
3582 RNA_def_property_struct_type(prop, "Collection");
3585 prop, "Collection", "Use mesh objects in this collection for Boolean operation");
3586 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
3587
3588 prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
3589 RNA_def_property_enum_items(prop, prop_operation_items);
3591 RNA_def_property_ui_text(prop, "Operation", "");
3592 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3593
3594 prop = RNA_def_property(srna, "operand_type", PROP_ENUM, PROP_NONE);
3595 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
3596 RNA_def_property_enum_items(prop, prop_operand_items);
3597 RNA_def_property_ui_text(prop, "Operand Type", "");
3598 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3599
3600 prop = RNA_def_property(srna, "double_threshold", PROP_FLOAT, PROP_DISTANCE);
3601 RNA_def_property_float_sdna(prop, nullptr, "double_threshold");
3602 RNA_def_property_range(prop, 0, 1.0f);
3603 RNA_def_property_ui_range(prop, 0, 1, 1.0, 6);
3606 prop, "Overlap Threshold", "Threshold for checking overlapping geometry");
3607 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3608
3609 prop = RNA_def_property(srna, "solver", PROP_ENUM, PROP_NONE);
3612 RNA_def_property_ui_text(prop, "Solver", "Method for calculating booleans");
3613 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3614
3615 prop = RNA_def_property(srna, "use_self", PROP_BOOLEAN, PROP_NONE);
3617 RNA_def_property_ui_text(prop, "Self Intersection", "Allow self-intersection in operands");
3618 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3619
3620 prop = RNA_def_property(srna, "use_hole_tolerant", PROP_BOOLEAN, PROP_NONE);
3622 RNA_def_property_ui_text(prop, "Hole Tolerant", "Better results when there are holes (slower)");
3623 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3624
3625 prop = RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
3626 RNA_def_property_enum_items(prop, material_mode_items);
3628 RNA_def_property_ui_text(prop, "Material Mode", "Method for setting materials on the new faces");
3629 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3630
3631 /* BMesh debugging options, only used when G_DEBUG is set */
3632
3633 /* BMesh intersection options */
3634 static const EnumPropertyItem debug_items[] = {
3635 {eBooleanModifierBMeshFlag_BMesh_Separate, "SEPARATE", 0, "Separate", ""},
3636 {eBooleanModifierBMeshFlag_BMesh_NoDissolve, "NO_DISSOLVE", 0, "No Dissolve", ""},
3638 "NO_CONNECT_REGIONS",
3639 0,
3640 "No Connect Regions",
3641 ""},
3642 {0, nullptr, 0, nullptr, nullptr},
3643 };
3644
3645 prop = RNA_def_property(srna, "debug_options", PROP_ENUM, PROP_NONE);
3647 RNA_def_property_enum_sdna(prop, nullptr, "bm_flag");
3648 RNA_def_property_enum_items(prop, debug_items);
3649 RNA_def_property_ui_text(prop, "Debug", "Debugging options, only when started with '-d'");
3650 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3651
3653}
3654
3656{
3657 StructRNA *srna;
3658 PropertyRNA *prop;
3659
3660 static const EnumPropertyItem prop_fit_type_items[] = {
3662 "FIXED_COUNT",
3663 0,
3664 "Fixed Count",
3665 "Duplicate the object a certain number of times"},
3667 "FIT_LENGTH",
3668 0,
3669 "Fit Length",
3670 "Duplicate the object as many times as fits in a certain length"},
3671 {MOD_ARR_FITCURVE, "FIT_CURVE", 0, "Fit Curve", "Fit the duplicated objects to a curve"},
3672 {0, nullptr, 0, nullptr, nullptr},
3673 };
3674
3675 srna = RNA_def_struct(brna, "ArrayModifier", "Modifier");
3676 RNA_def_struct_ui_text(srna, "Array Modifier", "Array duplication modifier");
3677 RNA_def_struct_sdna(srna, "ArrayModifierData");
3678 RNA_def_struct_ui_icon(srna, ICON_MOD_ARRAY);
3679
3681
3682 /* Length parameters */
3683 prop = RNA_def_property(srna, "fit_type", PROP_ENUM, PROP_NONE);
3684 RNA_def_property_enum_items(prop, prop_fit_type_items);
3685 RNA_def_property_ui_text(prop, "Fit Type", "Array length calculation method");
3686 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3687
3688 prop = RNA_def_property(srna, "count", PROP_INT, PROP_NONE);
3689 RNA_def_property_range(prop, 1, INT_MAX);
3690 RNA_def_property_ui_range(prop, 1, 1000, 1, -1);
3691 RNA_def_property_ui_text(prop, "Count", "Number of duplicates to make");
3692 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3693
3694 prop = RNA_def_property(srna, "fit_length", PROP_FLOAT, PROP_DISTANCE);
3695 RNA_def_property_float_sdna(prop, nullptr, "length");
3696 RNA_def_property_range(prop, 0, INT_MAX);
3697 RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
3698 RNA_def_property_ui_text(prop, "Length", "Length to fit array within");
3699 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3700
3701 prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
3702 RNA_def_property_pointer_sdna(prop, nullptr, "curve_ob");
3703 RNA_def_property_ui_text(prop, "Curve", "Curve object to fit array length to");
3705 prop, nullptr, "rna_ArrayModifier_curve_ob_set", nullptr, "rna_Curve_object_poll");
3707 RNA_def_property_update(prop, 0, "rna_ArrayModifier_dependency_update");
3708
3709 /* Offset parameters */
3710 prop = RNA_def_property(srna, "use_constant_offset", PROP_BOOLEAN, PROP_NONE);
3711 RNA_def_property_boolean_sdna(prop, nullptr, "offset_type", MOD_ARR_OFF_CONST);
3712 RNA_def_property_ui_text(prop, "Constant Offset", "Add a constant offset");
3713 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3714
3715 prop = RNA_def_property(srna, "constant_offset_displace", PROP_FLOAT, PROP_TRANSLATION);
3716 RNA_def_property_float_sdna(prop, nullptr, "offset");
3718 prop, "Constant Offset Displacement", "Value for the distance between arrayed items");
3720 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3721
3722 prop = RNA_def_property(srna, "use_relative_offset", PROP_BOOLEAN, PROP_NONE);
3723 RNA_def_property_boolean_sdna(prop, nullptr, "offset_type", MOD_ARR_OFF_RELATIVE);
3725 prop, "Relative Offset", "Add an offset relative to the object's bounding box");
3726 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3727
3728 /* PROP_TRANSLATION causes units to be used which we don't want */
3729 prop = RNA_def_property(srna, "relative_offset_displace", PROP_FLOAT, PROP_XYZ);
3730 RNA_def_property_float_sdna(prop, nullptr, "scale");
3732 prop,
3733 "Relative Offset Displacement",
3734 "The size of the geometry will determine the distance between arrayed items");
3735 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3736
3737 /* Vertex merging parameters */
3738 prop = RNA_def_property(srna, "use_merge_vertices", PROP_BOOLEAN, PROP_NONE);
3739 RNA_def_property_boolean_sdna(prop, nullptr, "flags", MOD_ARR_MERGE);
3740 RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices in adjacent duplicates");
3741 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3742
3743 prop = RNA_def_property(srna, "use_merge_vertices_cap", PROP_BOOLEAN, PROP_NONE);
3744 RNA_def_property_boolean_sdna(prop, nullptr, "flags", MOD_ARR_MERGEFINAL);
3746 prop, "Merge End Vertices", "Merge vertices in first and last duplicates");
3747 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3748
3749 prop = RNA_def_property(srna, "merge_threshold", PROP_FLOAT, PROP_DISTANCE);
3750 RNA_def_property_float_sdna(prop, nullptr, "merge_dist");
3752 RNA_def_property_ui_range(prop, 0, 1, 1, 4);
3753 RNA_def_property_ui_text(prop, "Merge Distance", "Limit below which to merge vertices");
3754 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3755
3756 /* Offset object */
3757 prop = RNA_def_property(srna, "use_object_offset", PROP_BOOLEAN, PROP_NONE);
3758 RNA_def_property_boolean_sdna(prop, nullptr, "offset_type", MOD_ARR_OFF_OBJ);
3760 prop, "Object Offset", "Add another object's transformation to the total offset");
3761 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3762
3763 prop = RNA_def_property(srna, "offset_object", PROP_POINTER, PROP_NONE);
3764 RNA_def_property_pointer_sdna(prop, nullptr, "offset_ob");
3766 prop,
3767 "Object Offset",
3768 "Use the location and rotation of another object to determine the distance and "
3769 "rotational change between arrayed items");
3771 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
3772
3773 /* Caps */
3774 prop = RNA_def_property(srna, "start_cap", PROP_POINTER, PROP_NONE);
3775 RNA_def_property_ui_text(prop, "Start Cap", "Mesh object to use as a start cap");
3777 prop, nullptr, "rna_ArrayModifier_start_cap_set", nullptr, "rna_Mesh_object_poll");
3779 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
3780
3781 prop = RNA_def_property(srna, "end_cap", PROP_POINTER, PROP_NONE);
3782 RNA_def_property_ui_text(prop, "End Cap", "Mesh object to use as an end cap");
3784 prop, nullptr, "rna_ArrayModifier_end_cap_set", nullptr, "rna_Mesh_object_poll");
3786 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
3787
3788 prop = RNA_def_property(srna, "offset_u", PROP_FLOAT, PROP_FACTOR);
3789 RNA_def_property_float_sdna(prop, nullptr, "uv_offset[0]");
3790 RNA_def_property_range(prop, -1, 1);
3791 RNA_def_property_ui_range(prop, -1, 1, 2, 4);
3792 RNA_def_property_ui_text(prop, "U Offset", "Amount to offset array UVs on the U axis");
3793 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3794
3795 prop = RNA_def_property(srna, "offset_v", PROP_FLOAT, PROP_FACTOR);
3796 RNA_def_property_float_sdna(prop, nullptr, "uv_offset[1]");
3797 RNA_def_property_range(prop, -1, 1);
3798 RNA_def_property_ui_range(prop, -1, 1, 2, 4);
3799 RNA_def_property_ui_text(prop, "V Offset", "Amount to offset array UVs on the V axis");
3800 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3801
3803}
3804
3806{
3807 StructRNA *srna;
3808 PropertyRNA *prop;
3809
3810 srna = RNA_def_struct(brna, "EdgeSplitModifier", "Modifier");
3812 srna, "EdgeSplit Modifier", "Edge splitting modifier to create sharp edges");
3813 RNA_def_struct_sdna(srna, "EdgeSplitModifierData");
3814 RNA_def_struct_ui_icon(srna, ICON_MOD_EDGESPLIT);
3815
3817
3818 prop = RNA_def_property(srna, "split_angle", PROP_FLOAT, PROP_ANGLE);
3819 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
3820 RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 2);
3821 RNA_def_property_ui_text(prop, "Split Angle", "Angle above which to split edges");
3822 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3823
3824 prop = RNA_def_property(srna, "use_edge_angle", PROP_BOOLEAN, PROP_NONE);
3826 RNA_def_property_ui_text(prop, "Use Edge Angle", "Split edges with high angle between faces");
3827 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3828
3829 prop = RNA_def_property(srna, "use_edge_sharp", PROP_BOOLEAN, PROP_NONE);
3831 RNA_def_property_ui_text(prop, "Use Sharp Edges", "Split edges that are marked as sharp");
3832 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3833
3835}
3836
3838{
3839 StructRNA *srna;
3840 PropertyRNA *prop;
3841
3842 static const EnumPropertyItem prop_direction_items[] = {
3844 "X",
3845 0,
3846 "X",
3847 "Use the texture's intensity value to displace in the X direction"},
3849 "Y",
3850 0,
3851 "Y",
3852 "Use the texture's intensity value to displace in the Y direction"},
3854 "Z",
3855 0,
3856 "Z",
3857 "Use the texture's intensity value to displace in the Z direction"},
3859 "NORMAL",
3860 0,
3861 "Normal",
3862 "Use the texture's intensity value to displace along the vertex normal"},
3864 "CUSTOM_NORMAL",
3865 0,
3866 "Custom Normal",
3867 "Use the texture's intensity value to displace along the (averaged) custom normal (falls "
3868 "back to vertex)"},
3870 "RGB_TO_XYZ",
3871 0,
3872 "RGB to XYZ",
3873 "Use the texture's RGB values to displace the mesh in the XYZ direction"},
3874 {0, nullptr, 0, nullptr, nullptr},
3875 };
3876
3877 static const EnumPropertyItem prop_space_items[] = {
3878 {MOD_DISP_SPACE_LOCAL, "LOCAL", 0, "Local", "Direction is defined in local coordinates"},
3879 {MOD_DISP_SPACE_GLOBAL, "GLOBAL", 0, "Global", "Direction is defined in global coordinates"},
3880 {0, nullptr, 0, nullptr, nullptr},
3881 };
3882
3883 srna = RNA_def_struct(brna, "DisplaceModifier", "Modifier");
3884 RNA_def_struct_ui_text(srna, "Displace Modifier", "Displacement modifier");
3885 RNA_def_struct_sdna(srna, "DisplaceModifierData");
3886 RNA_def_struct_ui_icon(srna, ICON_MOD_DISPLACE);
3887
3889
3890 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
3891 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
3893 prop,
3894 "Vertex Group",
3895 "Name of Vertex Group which determines influence of modifier per point");
3896 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_DisplaceModifier_defgrp_name_set");
3897 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3898
3899 prop = RNA_def_property(srna, "mid_level", PROP_FLOAT, PROP_FACTOR);
3900 RNA_def_property_float_sdna(prop, nullptr, "midlevel");
3902 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
3903 RNA_def_property_ui_text(prop, "Midlevel", "Material value that gives no displacement");
3904 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3905
3906 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
3908 RNA_def_property_ui_range(prop, -100, 100, 10, 3);
3909 RNA_def_property_ui_text(prop, "Strength", "Amount to displace geometry");
3911 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3912
3913 prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
3915 RNA_def_property_ui_text(prop, "Direction", "");
3916 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3917
3918 prop = RNA_def_property(srna, "space", PROP_ENUM, PROP_NONE);
3919 RNA_def_property_enum_items(prop, prop_space_items);
3920 RNA_def_property_ui_text(prop, "Space", "");
3921 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
3922
3923 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
3925 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
3926 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3927
3929
3931}
3932
3934{
3935 StructRNA *srna;
3936 PropertyRNA *prop;
3937
3938 srna = RNA_def_struct(brna, "UVProjectModifier", "Modifier");
3940 srna, "UV Project Modifier", "UV projection modifier to set UVs from a projector");
3941 RNA_def_struct_sdna(srna, "UVProjectModifierData");
3942 RNA_def_struct_ui_icon(srna, ICON_MOD_UVPROJECT);
3943
3945
3946 prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
3947 RNA_def_property_string_sdna(prop, nullptr, "uvlayer_name");
3948 RNA_def_property_ui_text(prop, "UV Map", "UV map name");
3949 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_UVProjectModifier_uvlayer_name_set");
3950 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3951
3952 prop = RNA_def_property(srna, "projector_count", PROP_INT, PROP_NONE);
3953 RNA_def_property_int_sdna(prop, nullptr, "projectors_num");
3954 RNA_def_property_ui_text(prop, "Number of Projectors", "Number of projectors to use");
3955 RNA_def_property_int_funcs(prop, nullptr, "rna_UVProjectModifier_num_projectors_set", nullptr);
3957 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3958
3959 prop = RNA_def_property(srna, "projectors", PROP_COLLECTION, PROP_NONE);
3960 RNA_def_property_struct_type(prop, "UVProjector");
3962 "rna_UVProject_projectors_begin",
3963 "rna_iterator_array_next",
3964 "rna_iterator_array_end",
3965 "rna_iterator_array_get",
3966 nullptr,
3967 nullptr,
3968 nullptr,
3969 nullptr);
3970 RNA_def_property_ui_text(prop, "Projectors", "");
3971
3972 prop = RNA_def_property(srna, "aspect_x", PROP_FLOAT, PROP_NONE);
3973 RNA_def_property_float_sdna(prop, nullptr, "aspectx");
3976 RNA_def_property_ui_range(prop, 1, 1000, 1, 3);
3978 prop, "Aspect X", "Horizontal aspect ratio (only used for camera projectors)");
3979 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3980
3981 prop = RNA_def_property(srna, "aspect_y", PROP_FLOAT, PROP_NONE);
3982 RNA_def_property_float_sdna(prop, nullptr, "aspecty");
3985 RNA_def_property_ui_range(prop, 1, 1000, 1, 3);
3987 prop, "Aspect Y", "Vertical aspect ratio (only used for camera projectors)");
3988 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3989
3990 prop = RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_NONE);
3991 RNA_def_property_float_sdna(prop, nullptr, "scalex");
3994 RNA_def_property_ui_range(prop, 0, 1000, 1, 3);
3995 RNA_def_property_ui_text(prop, "Scale X", "Horizontal scale (only used for camera projectors)");
3996 RNA_def_property_update(prop, 0, "rna_Modifier_update");
3997
3998 prop = RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_NONE);
3999 RNA_def_property_float_sdna(prop, nullptr, "scaley");
4002 RNA_def_property_ui_range(prop, 0, 1000, 1, 3);
4003 RNA_def_property_ui_text(prop, "Scale Y", "Vertical scale (only used for camera projectors)");
4004 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4005
4006 srna = RNA_def_struct(brna, "UVProjector", nullptr);
4007 RNA_def_struct_ui_text(srna, "UVProjector", "UV projector used by the UV project modifier");
4008
4009 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
4010 RNA_def_property_struct_type(prop, "Object");
4012 prop, "rna_UVProjector_object_get", "rna_UVProjector_object_set", nullptr, nullptr);
4014 RNA_def_property_ui_text(prop, "Object", "Object to use as projector transform");
4015 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
4016
4018}
4019
4021{
4022 StructRNA *srna;
4023 PropertyRNA *prop;
4024
4025 srna = RNA_def_struct(brna, "SmoothModifier", "Modifier");
4026 RNA_def_struct_ui_text(srna, "Smooth Modifier", "Smoothing effect modifier");
4027 RNA_def_struct_sdna(srna, "SmoothModifierData");
4028 RNA_def_struct_ui_icon(srna, ICON_MOD_SMOOTH);
4029
4031
4032 prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
4033 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_SMOOTH_X);
4034 RNA_def_property_ui_text(prop, "X", "Smooth object along X axis");
4035 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4036
4037 prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
4038 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_SMOOTH_Y);
4039 RNA_def_property_ui_text(prop, "Y", "Smooth object along Y axis");
4040 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4041
4042 prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
4043 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_SMOOTH_Z);
4044 RNA_def_property_ui_text(prop, "Z", "Smooth object along Z axis");
4045 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4046
4047 prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_FACTOR);
4048 RNA_def_property_float_sdna(prop, nullptr, "fac");
4050 RNA_def_property_ui_range(prop, -10, 10, 1, 3);
4051 RNA_def_property_ui_text(prop, "Factor", "Strength of modifier effect");
4052 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4053
4054 prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_UNSIGNED);
4055 RNA_def_property_int_sdna(prop, nullptr, "repeat");
4056 RNA_def_property_ui_range(prop, 0, 30, 1, -1);
4057 RNA_def_property_ui_text(prop, "Repeat", "");
4058 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4059
4060 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
4061 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
4063 prop,
4064 "Vertex Group",
4065 "Name of Vertex Group which determines influence of modifier per point");
4066 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_SmoothModifier_defgrp_name_set");
4067 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4068
4069 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
4071 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
4072 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4073
4075}
4076
4078{
4079 StructRNA *srna;
4080 PropertyRNA *prop;
4081
4082 static const EnumPropertyItem modifier_smooth_type_items[] = {
4084 "SIMPLE",
4085 0,
4086 "Simple",
4087 "Use the average of adjacent edge-vertices"},
4089 "LENGTH_WEIGHTED",
4090 0,
4091 "Length Weight",
4092 "Use the average of adjacent edge-vertices weighted by their length"},
4093 {0, nullptr, 0, nullptr, nullptr},
4094 };
4095
4096 static const EnumPropertyItem modifier_rest_source_items[] = {
4098 "ORCO",
4099 0,
4100 "Original Coords",
4101 "Use base mesh vertex coordinates as the rest position"},
4103 "BIND",
4104 0,
4105 "Bind Coords",
4106 "Use bind vertex coordinates for rest position"},
4107 {0, nullptr, 0, nullptr, nullptr},
4108 };
4109
4110 srna = RNA_def_struct(brna, "CorrectiveSmoothModifier", "Modifier");
4112 srna, "Corrective Smooth Modifier", "Correct distortion caused by deformation");
4113 RNA_def_struct_sdna(srna, "CorrectiveSmoothModifierData");
4114 RNA_def_struct_ui_icon(srna, ICON_MOD_SMOOTH);
4115
4117
4118 prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_FACTOR);
4119 RNA_def_property_float_sdna(prop, nullptr, "lambda");
4121 RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 3);
4122 RNA_def_property_ui_text(prop, "Lambda Factor", "Smooth effect factor");
4123 RNA_def_property_update(prop, 0, "rna_CorrectiveSmoothModifier_update");
4124
4125 prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_UNSIGNED);
4126 RNA_def_property_int_sdna(prop, nullptr, "repeat");
4127 RNA_def_property_ui_range(prop, 0, 200, 1, -1);
4128 RNA_def_property_ui_text(prop, "Repeat", "");
4129 RNA_def_property_update(prop, 0, "rna_CorrectiveSmoothModifier_update");
4130
4131 prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_FACTOR);
4132 RNA_def_property_float_sdna(prop, nullptr, "scale");
4134 RNA_def_property_ui_range(prop, 0.0, 10.0, 5, 3);
4135 RNA_def_property_ui_text(prop, "Scale", "Compensate for scale applied by other modifiers");
4136 RNA_def_property_update(prop, 0, "rna_CorrectiveSmoothModifier_update");
4137
4138 prop = RNA_def_property(srna, "rest_source", PROP_ENUM, PROP_NONE);
4139 RNA_def_property_enum_sdna(prop, nullptr, "rest_source");
4140 RNA_def_property_enum_items(prop, modifier_rest_source_items);
4141 RNA_def_property_ui_text(prop, "Rest Source", "Select the source of rest positions");
4142 RNA_def_property_update(prop, 0, "rna_CorrectiveSmoothModifier_rest_source_update");
4143
4144 prop = RNA_def_property(srna, "smooth_type", PROP_ENUM, PROP_NONE);
4145 RNA_def_property_enum_sdna(prop, nullptr, "smooth_type");
4146 RNA_def_property_enum_items(prop, modifier_smooth_type_items);
4147 RNA_def_property_ui_text(prop, "Smooth Type", "Method used for smoothing");
4148 RNA_def_property_update(prop, 0, "rna_CorrectiveSmoothModifier_update");
4149
4150 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
4152 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
4153 RNA_def_property_update(prop, 0, "rna_CorrectiveSmoothModifier_update");
4154
4155 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
4156 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
4158 prop,
4159 "Vertex Group",
4160 "Name of Vertex Group which determines influence of modifier per point");
4162 prop, nullptr, nullptr, "rna_CorrectiveSmoothModifier_defgrp_name_set");
4163 RNA_def_property_update(prop, 0, "rna_CorrectiveSmoothModifier_update");
4164
4165 prop = RNA_def_property(srna, "is_bind", PROP_BOOLEAN, PROP_NONE);
4166 RNA_def_property_ui_text(prop, "Bind current shape", "");
4167 RNA_def_property_boolean_funcs(prop, "rna_CorrectiveSmoothModifier_is_bind_get", nullptr);
4169 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4170
4171 prop = RNA_def_property(srna, "use_only_smooth", PROP_BOOLEAN, PROP_NONE);
4174 prop, "Only Smooth", "Apply smoothing without reconstructing the surface");
4175 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4176
4177 prop = RNA_def_property(srna, "use_pin_boundary", PROP_BOOLEAN, PROP_NONE);
4180 prop, "Pin Boundaries", "Excludes boundary vertices from being smoothed");
4181 RNA_def_property_update(prop, 0, "rna_CorrectiveSmoothModifier_update");
4182
4184}
4185
4187{
4188 StructRNA *srna;
4189 PropertyRNA *prop;
4190
4191 srna = RNA_def_struct(brna, "LaplacianSmoothModifier", "Modifier");
4192 RNA_def_struct_ui_text(srna, "Laplacian Smooth Modifier", "Smoothing effect modifier");
4193 RNA_def_struct_sdna(srna, "LaplacianSmoothModifierData");
4194 RNA_def_struct_ui_icon(srna, ICON_MOD_SMOOTH);
4195
4197
4198 prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
4200 RNA_def_property_ui_text(prop, "X", "Smooth object along X axis");
4201 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4202
4203 prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
4205 RNA_def_property_ui_text(prop, "Y", "Smooth object along Y axis");
4206 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4207
4208 prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
4210 RNA_def_property_ui_text(prop, "Z", "Smooth object along Z axis");
4211 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4212
4213 prop = RNA_def_property(srna, "use_volume_preserve", PROP_BOOLEAN, PROP_NONE);
4215 RNA_def_property_ui_text(prop, "Preserve Volume", "Apply volume preservation after smooth");
4216 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4217
4218 prop = RNA_def_property(srna, "use_normalized", PROP_BOOLEAN, PROP_NONE);
4220 RNA_def_property_ui_text(prop, "Normalized", "Improve and stabilize the enhanced shape");
4221 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4222
4223 prop = RNA_def_property(srna, "lambda_factor", PROP_FLOAT, PROP_NONE);
4224 RNA_def_property_float_sdna(prop, nullptr, "lambda");
4226 RNA_def_property_ui_range(prop, -1000.0, 1000.0, 5, 3);
4227 RNA_def_property_ui_text(prop, "Lambda Factor", "Smooth effect factor");
4228 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4229
4230 prop = RNA_def_property(srna, "lambda_border", PROP_FLOAT, PROP_NONE);
4231 RNA_def_property_float_sdna(prop, nullptr, "lambda_border");
4233 RNA_def_property_ui_range(prop, -1000.0, 1000.0, 5, 3);
4234 RNA_def_property_ui_text(prop, "Lambda Border", "Lambda factor in border");
4235 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4236
4237 prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_UNSIGNED);
4238 RNA_def_property_int_sdna(prop, nullptr, "repeat");
4239 RNA_def_property_ui_range(prop, 0, 200, 1, -1);
4240 RNA_def_property_ui_text(prop, "Repeat", "");
4241 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4242
4243 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
4244 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
4246 prop,
4247 "Vertex Group",
4248 "Name of Vertex Group which determines influence of modifier per point");
4250 prop, nullptr, nullptr, "rna_LaplacianSmoothModifier_defgrp_name_set");
4251 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4252
4253 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
4255 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
4256 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4257
4259}
4260
4262{
4263 StructRNA *srna;
4264 PropertyRNA *prop;
4265
4266 static const EnumPropertyItem prop_cast_type_items[] = {
4267 {MOD_CAST_TYPE_SPHERE, "SPHERE", 0, "Sphere", ""},
4268 {MOD_CAST_TYPE_CYLINDER, "CYLINDER", 0, "Cylinder", ""},
4269 {MOD_CAST_TYPE_CUBOID, "CUBOID", 0, "Cuboid", ""},
4270 {0, nullptr, 0, nullptr, nullptr},
4271 };
4272
4273 srna = RNA_def_struct(brna, "CastModifier", "Modifier");
4274 RNA_def_struct_ui_text(srna, "Cast Modifier", "Modifier to cast to other shapes");
4275 RNA_def_struct_sdna(srna, "CastModifierData");
4276 RNA_def_struct_ui_icon(srna, ICON_MOD_CAST);
4277
4279
4280 prop = RNA_def_property(srna, "cast_type", PROP_ENUM, PROP_NONE);
4281 RNA_def_property_enum_sdna(prop, nullptr, "type");
4282 RNA_def_property_enum_items(prop, prop_cast_type_items);
4283 RNA_def_property_ui_text(prop, "Shape", "Target object shape");
4284 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4285
4286 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
4288 prop,
4289 "Object",
4290 "Control object: if available, its location determines the center of the effect");
4291 RNA_def_property_pointer_funcs(prop, nullptr, "rna_CastModifier_object_set", nullptr, nullptr);
4293 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
4294
4295 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
4297 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
4298 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4299
4300 prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE);
4301 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_CAST_X);
4302 RNA_def_property_ui_text(prop, "X", "");
4303 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4304
4305 prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE);
4306 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_CAST_Y);
4307 RNA_def_property_ui_text(prop, "Y", "");
4308 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4309
4310 prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE);
4311 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_CAST_Z);
4312 RNA_def_property_ui_text(prop, "Z", "");
4313 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4314
4315 prop = RNA_def_property(srna, "use_radius_as_size", PROP_BOOLEAN, PROP_NONE);
4318 prop, "Size from Radius", "Use radius as size of projection shape (0 = auto)");
4319 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4320
4321 prop = RNA_def_property(srna, "use_transform", PROP_BOOLEAN, PROP_NONE);
4324 prop, "Use Transform", "Use object transform to control projection shape");
4325 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4326
4327 prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_FACTOR);
4328 RNA_def_property_float_sdna(prop, nullptr, "fac");
4330 RNA_def_property_ui_range(prop, -10, 10, 5, 2);
4331 RNA_def_property_ui_text(prop, "Factor", "");
4332 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4333
4334 prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_DISTANCE);
4336 RNA_def_property_ui_range(prop, 0, 100, 5, 2);
4338 prop,
4339 "Radius",
4340 "Only deform vertices within this distance from the center of the effect "
4341 "(leave as 0 for infinite.)");
4342 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4343
4344 prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
4346 RNA_def_property_ui_range(prop, 0, 100, 5, 2);
4347 RNA_def_property_ui_text(prop, "Size", "Size of projection shape (leave as 0 for auto)");
4348 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4349
4350 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
4351 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
4352 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
4353 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_CastModifier_defgrp_name_set");
4354 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4355
4357}
4358
4360{
4361 StructRNA *srna;
4362 PropertyRNA *prop;
4363# if 0
4364 static const EnumPropertyItem prop_mode_items[] = {
4365 {0, "VOLUME", 0, "Volume", "Bind to volume inside cage mesh"},
4366 {1, "SURFACE", 0, "Surface", "Bind to surface of cage mesh"},
4367 {0, nullptr, 0, nullptr, nullptr},
4368 };
4369# endif
4370
4371 srna = RNA_def_struct(brna, "MeshDeformModifier", "Modifier");
4373 srna, "MeshDeform Modifier", "Mesh deformation modifier to deform with other meshes");
4374 RNA_def_struct_sdna(srna, "MeshDeformModifierData");
4375 RNA_def_struct_ui_icon(srna, ICON_MOD_MESHDEFORM);
4376
4378
4379 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
4380 RNA_def_property_ui_text(prop, "Object", "Mesh object to deform with");
4382 prop, nullptr, "rna_MeshDeformModifier_object_set", nullptr, "rna_Mesh_object_poll");
4384 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
4385
4386 prop = RNA_def_property(srna, "is_bound", PROP_BOOLEAN, PROP_NONE);
4387 RNA_def_property_boolean_funcs(prop, "rna_MeshDeformModifier_is_bound_get", nullptr);
4388 RNA_def_property_ui_text(prop, "Bound", "Whether geometry has been bound to control cage");
4390
4391 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
4393 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
4394 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4395
4396 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
4397 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
4398 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
4399 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_MeshDeformModifier_defgrp_name_set");
4400 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4401
4402 prop = RNA_def_property(srna, "precision", PROP_INT, PROP_NONE);
4403 RNA_def_property_int_sdna(prop, nullptr, "gridsize");
4404 RNA_def_property_range(prop, 2, 10);
4405 RNA_def_property_ui_text(prop, "Precision", "The grid size for binding");
4406 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4407
4408 prop = RNA_def_property(srna, "use_dynamic_bind", PROP_BOOLEAN, PROP_NONE);
4411 "Dynamic",
4412 "Recompute binding dynamically on top of other deformers "
4413 "(slower and more memory consuming)");
4414 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4415
4416# if 0
4417 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
4418 RNA_def_property_enum_items(prop, prop_mode_items);
4419 RNA_def_property_ui_text(prop, "Mode", "Method of binding vertices are bound to cage mesh");
4420 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4421# endif
4422
4424}
4425
4427{
4428 StructRNA *srna;
4429 PropertyRNA *prop;
4430
4431 srna = RNA_def_struct(brna, "ParticleSystemModifier", "Modifier");
4432 RNA_def_struct_ui_text(srna, "ParticleSystem Modifier", "Particle system simulation modifier");
4433 RNA_def_struct_sdna(srna, "ParticleSystemModifierData");
4434 RNA_def_struct_ui_icon(srna, ICON_MOD_PARTICLES);
4435
4437
4438 prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
4440 RNA_def_property_pointer_sdna(prop, nullptr, "psys");
4441 RNA_def_property_ui_text(prop, "Particle System", "Particle System that this modifier controls");
4442
4444}
4445
4447{
4448 StructRNA *srna;
4449 PropertyRNA *prop;
4450
4451 static EnumPropertyItem particleinstance_space[] = {
4453 "LOCAL",
4454 0,
4455 "Local",
4456 "Use offset from the particle object in the instance object"},
4458 "WORLD",
4459 0,
4460 "World",
4461 "Use world space offset in the instance object"},
4462 {0, nullptr, 0, nullptr, nullptr},
4463 };
4464
4465 srna = RNA_def_struct(brna, "ParticleInstanceModifier", "Modifier");
4466 RNA_def_struct_ui_text(srna, "ParticleInstance Modifier", "Particle system instancing modifier");
4467 RNA_def_struct_sdna(srna, "ParticleInstanceModifierData");
4468 RNA_def_struct_ui_icon(srna, ICON_MOD_PARTICLES);
4469
4471
4472 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
4473 RNA_def_property_pointer_sdna(prop, nullptr, "ob");
4474 RNA_def_property_pointer_funcs(prop, nullptr, nullptr, nullptr, "rna_Mesh_object_poll");
4475 RNA_def_property_ui_text(prop, "Object", "Object that has the particle system");
4477 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
4478
4479 prop = RNA_def_property(srna, "particle_system_index", PROP_INT, PROP_NONE);
4480 RNA_def_property_int_sdna(prop, nullptr, "psys");
4481 RNA_def_property_range(prop, 1, SHRT_MAX);
4482 RNA_def_property_ui_text(prop, "Particle System Number", "");
4483 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4484
4485 prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
4486 RNA_def_property_struct_type(prop, "ParticleSystem");
4488 "rna_ParticleInstanceModifier_particle_system_get",
4489 "rna_ParticleInstanceModifier_particle_system_set",
4490 nullptr,
4491 "rna_ParticleInstanceModifier_particle_system_poll");
4493 RNA_def_property_ui_text(prop, "Particle System", "");
4494 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4495
4496 prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
4497 RNA_def_property_enum_sdna(prop, nullptr, "axis");
4499 RNA_def_property_ui_text(prop, "Axis", "Pole axis for rotation");
4500 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4501
4502 prop = RNA_def_property(srna, "space", PROP_ENUM, PROP_NONE);
4503 RNA_def_property_enum_sdna(prop, nullptr, "space");
4504 RNA_def_property_enum_items(prop, particleinstance_space);
4505 RNA_def_property_ui_text(prop, "Space", "Space to use for copying mesh data");
4506 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4507
4508 prop = RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE);
4510 RNA_def_property_ui_text(prop, "Regular", "Create instances from normal particles");
4511 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4512
4513 prop = RNA_def_property(srna, "use_children", PROP_BOOLEAN, PROP_NONE);
4515 RNA_def_property_ui_text(prop, "Children", "Create instances from child particles");
4517 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4518
4519 prop = RNA_def_property(srna, "use_path", PROP_BOOLEAN, PROP_NONE);
4521 RNA_def_property_ui_text(prop, "Path", "Create instances along particle paths");
4522 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4523
4524 prop = RNA_def_property(srna, "show_unborn", PROP_BOOLEAN, PROP_NONE);
4526 RNA_def_property_ui_text(prop, "Unborn", "Show instances when particles are unborn");
4527 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4528
4529 prop = RNA_def_property(srna, "show_alive", PROP_BOOLEAN, PROP_NONE);
4531 RNA_def_property_ui_text(prop, "Alive", "Show instances when particles are alive");
4532 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4533
4534 prop = RNA_def_property(srna, "show_dead", PROP_BOOLEAN, PROP_NONE);
4536 RNA_def_property_ui_text(prop, "Dead", "Show instances when particles are dead");
4537 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4538
4539 prop = RNA_def_property(srna, "use_preserve_shape", PROP_BOOLEAN, PROP_NONE);
4541 RNA_def_property_ui_text(prop, "Keep Shape", "Don't stretch the object");
4542 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4543
4544 prop = RNA_def_property(srna, "use_size", PROP_BOOLEAN, PROP_NONE);
4546 RNA_def_property_ui_text(prop, "Size", "Use particle size to scale the instances");
4547 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4548
4549 prop = RNA_def_property(srna, "position", PROP_FLOAT, PROP_NONE);
4550 RNA_def_property_float_sdna(prop, nullptr, "position");
4551 RNA_def_property_range(prop, 0.0, 1.0);
4552 RNA_def_property_ui_text(prop, "Position", "Position along path");
4553 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4554
4555 prop = RNA_def_property(srna, "random_position", PROP_FLOAT, PROP_NONE);
4556 RNA_def_property_float_sdna(prop, nullptr, "random_position");
4557 RNA_def_property_range(prop, 0.0, 1.0);
4558 RNA_def_property_ui_text(prop, "Random Position", "Randomize position along path");
4559 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4560
4561 prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_FACTOR);
4562 RNA_def_property_float_sdna(prop, nullptr, "rotation");
4563 RNA_def_property_range(prop, 0.0, 1.0);
4564 RNA_def_property_ui_text(prop, "Rotation", "Rotation around path");
4565 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4566
4567 prop = RNA_def_property(srna, "random_rotation", PROP_FLOAT, PROP_FACTOR);
4568 RNA_def_property_float_sdna(prop, nullptr, "random_rotation");
4569 RNA_def_property_range(prop, 0.0, 1.0);
4570 RNA_def_property_ui_text(prop, "Random Rotation", "Randomize rotation around path");
4571 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4572
4573 prop = RNA_def_property(srna, "particle_amount", PROP_FLOAT, PROP_FACTOR);
4574 RNA_def_property_range(prop, 0.0, 1.0);
4575 RNA_def_property_ui_text(prop, "Particle Amount", "Amount of particles to use for instancing");
4576 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4577
4578 prop = RNA_def_property(srna, "particle_offset", PROP_FLOAT, PROP_FACTOR);
4579 RNA_def_property_range(prop, 0.0, 1.0);
4581 "Particle Offset",
4582 "Relative offset of particles to use for instancing, to avoid overlap "
4583 "of multiple instances");
4584 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4585
4586 prop = RNA_def_property(srna, "index_layer_name", PROP_STRING, PROP_NONE);
4587 RNA_def_property_string_sdna(prop, nullptr, "index_layer_name");
4588 RNA_def_property_ui_text(prop, "Index Layer Name", "Custom data layer name for the index");
4589 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4590
4591 prop = RNA_def_property(srna, "value_layer_name", PROP_STRING, PROP_NONE);
4592 RNA_def_property_string_sdna(prop, nullptr, "value_layer_name");
4594 prop, "Value Layer Name", "Custom data layer name for the randomized value");
4595 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4596
4598}
4599
4601{
4602 StructRNA *srna;
4603 PropertyRNA *prop;
4604
4605 srna = RNA_def_struct(brna, "ExplodeModifier", "Modifier");
4607 srna, "Explode Modifier", "Explosion effect modifier based on a particle system");
4608 RNA_def_struct_sdna(srna, "ExplodeModifierData");
4609 RNA_def_struct_ui_icon(srna, ICON_MOD_EXPLODE);
4610
4612
4613 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
4615 "rna_ExplodeModifier_vgroup_get",
4616 "rna_ExplodeModifier_vgroup_length",
4617 "rna_ExplodeModifier_vgroup_set");
4618 RNA_def_property_ui_text(prop, "Vertex Group", "");
4619
4620 prop = RNA_def_property(srna, "protect", PROP_FLOAT, PROP_NONE);
4621 RNA_def_property_range(prop, 0, 1);
4622 RNA_def_property_ui_text(prop, "Protect", "Clean vertex group edges");
4623 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4624
4625 prop = RNA_def_property(srna, "use_edge_cut", PROP_BOOLEAN, PROP_NONE);
4627 RNA_def_property_ui_text(prop, "Cut Edges", "Cut face edges for nicer shrapnel");
4628 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4629
4630 prop = RNA_def_property(srna, "show_unborn", PROP_BOOLEAN, PROP_NONE);
4631 RNA_def_property_boolean_sdna(prop, nullptr, "flag", eExplodeFlag_Unborn);
4632 RNA_def_property_ui_text(prop, "Unborn", "Show mesh when particles are unborn");
4633 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4634
4635 prop = RNA_def_property(srna, "show_alive", PROP_BOOLEAN, PROP_NONE);
4636 RNA_def_property_boolean_sdna(prop, nullptr, "flag", eExplodeFlag_Alive);
4637 RNA_def_property_ui_text(prop, "Alive", "Show mesh when particles are alive");
4638 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4639
4640 prop = RNA_def_property(srna, "show_dead", PROP_BOOLEAN, PROP_NONE);
4641 RNA_def_property_boolean_sdna(prop, nullptr, "flag", eExplodeFlag_Dead);
4642 RNA_def_property_ui_text(prop, "Dead", "Show mesh when particles are dead");
4643 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4644
4645 prop = RNA_def_property(srna, "use_size", PROP_BOOLEAN, PROP_NONE);
4646 RNA_def_property_boolean_sdna(prop, nullptr, "flag", eExplodeFlag_PaSize);
4647 RNA_def_property_ui_text(prop, "Size", "Use particle size for the shrapnel");
4648 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4649
4650 prop = RNA_def_property(srna, "particle_uv", PROP_STRING, PROP_NONE);
4651 RNA_def_property_string_sdna(prop, nullptr, "uvname");
4653 RNA_def_property_ui_text(prop, "Particle UV", "UV map to change with particle age");
4654 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4655
4656 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
4658 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
4659 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4660
4662}
4663
4665{
4666 StructRNA *srna;
4667 PropertyRNA *prop;
4668
4669 srna = RNA_def_struct(brna, "ClothModifier", "Modifier");
4670 RNA_def_struct_ui_text(srna, "Cloth Modifier", "Cloth simulation modifier");
4671 RNA_def_struct_sdna(srna, "ClothModifierData");
4672 RNA_def_struct_ui_icon(srna, ICON_MOD_CLOTH);
4673
4675
4676 prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
4678 RNA_def_property_pointer_sdna(prop, nullptr, "sim_parms");
4679 RNA_def_property_ui_text(prop, "Cloth Settings", "");
4680
4681 prop = RNA_def_property(srna, "collision_settings", PROP_POINTER, PROP_NONE);
4683 RNA_def_property_pointer_sdna(prop, nullptr, "coll_parms");
4684 RNA_def_property_ui_text(prop, "Cloth Collision Settings", "");
4685
4686 prop = RNA_def_property(srna, "solver_result", PROP_POINTER, PROP_NONE);
4687 RNA_def_property_struct_type(prop, "ClothSolverResult");
4688 RNA_def_property_pointer_sdna(prop, nullptr, "solver_result");
4689 RNA_def_property_ui_text(prop, "Solver Result", "");
4690
4691 prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
4693 RNA_def_property_ui_text(prop, "Point Cache", "");
4694
4695 prop = RNA_def_property(srna, "hair_grid_min", PROP_FLOAT, PROP_NONE);
4696 RNA_def_property_float_sdna(prop, nullptr, "hair_grid_min");
4698 RNA_def_property_ui_text(prop, "Hair Grid Minimum", "");
4699
4700 prop = RNA_def_property(srna, "hair_grid_max", PROP_FLOAT, PROP_NONE);
4701 RNA_def_property_float_sdna(prop, nullptr, "hair_grid_max");
4703 RNA_def_property_ui_text(prop, "Hair Grid Maximum", "");
4704
4705 prop = RNA_def_property(srna, "hair_grid_resolution", PROP_INT, PROP_NONE);
4706 RNA_def_property_int_sdna(prop, nullptr, "hair_grid_res");
4708 RNA_def_property_ui_text(prop, "Hair Grid Resolution", "");
4709
4711}
4712
4714{
4715 StructRNA *srna;
4716 PropertyRNA *prop;
4717
4718 static const EnumPropertyItem prop_fluid_type_items[] = {
4719 {0, "NONE", 0, "None", ""},
4720 {MOD_FLUID_TYPE_DOMAIN, "DOMAIN", 0, "Domain", "Container of the fluid simulation"},
4721 {MOD_FLUID_TYPE_FLOW, "FLOW", 0, "Flow", "Add or remove fluid to a domain object"},
4723 "EFFECTOR",
4724 0,
4725 "Effector",
4726 "Deflect fluids and influence the fluid flow"},
4727 {0, nullptr, 0, nullptr, nullptr},
4728 };
4729
4730 srna = RNA_def_struct(brna, "FluidModifier", "Modifier");
4731 RNA_def_struct_ui_text(srna, "Fluid Modifier", "Fluid simulation modifier");
4732 RNA_def_struct_sdna(srna, "FluidModifierData");
4733 RNA_def_struct_ui_icon(srna, ICON_MOD_FLUIDSIM);
4734
4736
4737 prop = RNA_def_property(srna, "domain_settings", PROP_POINTER, PROP_NONE);
4738 RNA_def_property_pointer_sdna(prop, nullptr, "domain");
4739 RNA_def_property_ui_text(prop, "Domain Settings", "");
4740
4741 prop = RNA_def_property(srna, "flow_settings", PROP_POINTER, PROP_NONE);
4742 RNA_def_property_pointer_sdna(prop, nullptr, "flow");
4743 RNA_def_property_ui_text(prop, "Flow Settings", "");
4744
4745 prop = RNA_def_property(srna, "effector_settings", PROP_POINTER, PROP_NONE);
4746 RNA_def_property_pointer_sdna(prop, nullptr, "effector");
4747 RNA_def_property_ui_text(prop, "Effector Settings", "");
4748
4749 prop = RNA_def_property(srna, "fluid_type", PROP_ENUM, PROP_NONE);
4750 RNA_def_property_enum_sdna(prop, nullptr, "type");
4751 RNA_def_property_enum_items(prop, prop_fluid_type_items);
4752 RNA_def_property_ui_text(prop, "Type", "");
4754 RNA_def_property_update(prop, 0, "rna_fluid_set_type");
4755
4757}
4758
4760{
4761 StructRNA *srna;
4762 PropertyRNA *prop;
4763
4764 srna = RNA_def_struct(brna, "DynamicPaintModifier", "Modifier");
4765 RNA_def_struct_ui_text(srna, "Dynamic Paint Modifier", "Dynamic Paint modifier");
4766 RNA_def_struct_sdna(srna, "DynamicPaintModifierData");
4767 RNA_def_struct_ui_icon(srna, ICON_MOD_DYNAMICPAINT);
4768
4770
4771 prop = RNA_def_property(srna, "canvas_settings", PROP_POINTER, PROP_NONE);
4772 RNA_def_property_pointer_sdna(prop, nullptr, "canvas");
4773 RNA_def_property_ui_text(prop, "Canvas Settings", "");
4774
4775 prop = RNA_def_property(srna, "brush_settings", PROP_POINTER, PROP_NONE);
4776 RNA_def_property_pointer_sdna(prop, nullptr, "brush");
4777 RNA_def_property_ui_text(prop, "Brush Settings", "");
4778
4779 prop = RNA_def_property(srna, "ui_type", PROP_ENUM, PROP_NONE);
4781 RNA_def_property_enum_sdna(prop, nullptr, "type");
4784 RNA_def_property_ui_text(prop, "Type", "");
4785
4787}
4788
4790{
4791 StructRNA *srna;
4792 PropertyRNA *prop;
4793
4794 srna = RNA_def_struct(brna, "CollisionModifier", "Modifier");
4796 "Collision Modifier",
4797 "Collision modifier defining modifier stack position used for collision");
4798 RNA_def_struct_sdna(srna, "CollisionModifierData");
4799 RNA_def_struct_ui_icon(srna, ICON_MOD_PHYSICS);
4800
4802
4803 prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE);
4805 RNA_def_property_struct_type(prop, "CollisionSettings");
4807 prop, "rna_CollisionModifier_settings_get", nullptr, nullptr, nullptr);
4808 RNA_def_property_ui_text(prop, "Settings", "");
4809
4811}
4812
4814{
4815 StructRNA *srna;
4816 PropertyRNA *prop;
4817
4818 static const EnumPropertyItem prop_limit_method_items[] = {
4819 {0, "NONE", 0, "None", "Bevel the entire mesh by a constant amount"},
4821 "ANGLE",
4822 0,
4823 "Angle",
4824 "Only bevel edges with sharp enough angles between faces"},
4826 "WEIGHT",
4827 0,
4828 "Weight",
4829 "Use bevel weights to determine how much bevel is applied in edge mode"},
4831 "VGROUP",
4832 0,
4833 "Vertex Group",
4834 "Use vertex group weights to select whether vertex or edge is beveled"},
4835 {0, nullptr, 0, nullptr, nullptr},
4836 };
4837
4838 static const EnumPropertyItem prop_val_type_items[] = {
4839 {MOD_BEVEL_AMT_OFFSET, "OFFSET", 0, "Offset", "Amount is offset of new edges from original"},
4840 {MOD_BEVEL_AMT_WIDTH, "WIDTH", 0, "Width", "Amount is width of new face"},
4842 "DEPTH",
4843 0,
4844 "Depth",
4845 "Amount is perpendicular distance from original edge to bevel face"},
4847 "PERCENT",
4848 0,
4849 "Percent",
4850 "Amount is percent of adjacent edge length"},
4852 "ABSOLUTE",
4853 0,
4854 "Absolute",
4855 "Amount is absolute distance along adjacent edge"},
4856 {0, nullptr, 0, nullptr, nullptr},
4857 };
4858
4859 static const EnumPropertyItem prop_profile_type_items[] = {
4861 "SUPERELLIPSE",
4862 0,
4863 "Superellipse",
4864 "The profile can be a concave or convex curve"},
4866 "CUSTOM",
4867 0,
4868 "Custom",
4869 "The profile can be any arbitrary path between its endpoints"},
4870 {0, nullptr, 0, nullptr, nullptr},
4871 };
4872
4873 static EnumPropertyItem prop_harden_normals_items[] = {
4874 {MOD_BEVEL_FACE_STRENGTH_NONE, "FSTR_NONE", 0, "None", "Do not set face strength"},
4875 {MOD_BEVEL_FACE_STRENGTH_NEW, "FSTR_NEW", 0, "New", "Set face strength on new faces only"},
4877 "FSTR_AFFECTED",
4878 0,
4879 "Affected",
4880 "Set face strength on new and affected faces only"},
4881 {MOD_BEVEL_FACE_STRENGTH_ALL, "FSTR_ALL", 0, "All", "Set face strength on all faces"},
4882 {0, nullptr, 0, nullptr, nullptr},
4883 };
4884
4885 static const EnumPropertyItem prop_miter_outer_items[] = {
4886 {MOD_BEVEL_MITER_SHARP, "MITER_SHARP", 0, "Sharp", "Outside of miter is sharp"},
4887 {MOD_BEVEL_MITER_PATCH, "MITER_PATCH", 0, "Patch", "Outside of miter is squared-off patch"},
4888 {MOD_BEVEL_MITER_ARC, "MITER_ARC", 0, "Arc", "Outside of miter is arc"},
4889 {0, nullptr, 0, nullptr, nullptr},
4890 };
4891
4892 static const EnumPropertyItem prop_miter_inner_items[] = {
4893 {MOD_BEVEL_MITER_SHARP, "MITER_SHARP", 0, "Sharp", "Inside of miter is sharp"},
4894 {MOD_BEVEL_MITER_ARC, "MITER_ARC", 0, "Arc", "Inside of miter is arc"},
4895 {0, nullptr, 0, nullptr, nullptr},
4896 };
4897
4898 static EnumPropertyItem prop_vmesh_method_items[] = {
4899 {MOD_BEVEL_VMESH_ADJ, "ADJ", 0, "Grid Fill", "Default patterned fill"},
4901 "CUTOFF",
4902 0,
4903 "Cutoff",
4904 "A cut-off at the end of each profile before the intersection"},
4905 {0, nullptr, 0, nullptr, nullptr},
4906 };
4907
4908 static const EnumPropertyItem prop_affect_items[] = {
4909 {MOD_BEVEL_AFFECT_VERTICES, "VERTICES", 0, "Vertices", "Affect only vertices"},
4910 {MOD_BEVEL_AFFECT_EDGES, "EDGES", 0, "Edges", "Affect only edges"},
4911 {0, nullptr, 0, nullptr, nullptr},
4912 };
4913
4914 srna = RNA_def_struct(brna, "BevelModifier", "Modifier");
4916 srna, "Bevel Modifier", "Bevel modifier to make edges and vertices more rounded");
4917 RNA_def_struct_sdna(srna, "BevelModifierData");
4918 RNA_def_struct_ui_icon(srna, ICON_MOD_BEVEL);
4919
4921
4922 prop = RNA_def_property(srna, "width", PROP_FLOAT, PROP_DISTANCE);
4923 RNA_def_property_float_sdna(prop, nullptr, "value");
4925 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 0.1, 4);
4926 RNA_def_property_ui_text(prop, "Width", "Bevel amount");
4927 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4928
4929 prop = RNA_def_property(srna, "width_pct", PROP_FLOAT, PROP_PERCENTAGE);
4930 RNA_def_property_float_sdna(prop, nullptr, "value");
4932 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 5.0, 2);
4933 RNA_def_property_ui_text(prop, "Width Percent", "Bevel amount for percentage method");
4934 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4935
4936 prop = RNA_def_property(srna, "segments", PROP_INT, PROP_NONE);
4937 RNA_def_property_int_sdna(prop, nullptr, "res");
4938 RNA_def_property_range(prop, 1, 1000);
4939 RNA_def_property_ui_range(prop, 1, 100, 1, -1);
4940 RNA_def_property_ui_text(prop, "Segments", "Number of segments for round edges/verts");
4941 RNA_def_property_update(prop, 0, "rna_BevelModifier_update_segments");
4942
4943 prop = RNA_def_property(srna, "affect", PROP_ENUM, PROP_NONE); /* as an enum */
4944 RNA_def_property_enum_sdna(prop, nullptr, "affect_type");
4945 RNA_def_property_enum_items(prop, prop_affect_items);
4946 RNA_def_property_ui_text(prop, "Affect", "Affect edges or vertices");
4947 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4948
4949 prop = RNA_def_property(srna, "limit_method", PROP_ENUM, PROP_NONE);
4950 RNA_def_property_enum_sdna(prop, nullptr, "lim_flags");
4951 RNA_def_property_enum_items(prop, prop_limit_method_items);
4952 RNA_def_property_ui_text(prop, "Limit Method", "");
4953 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4954
4955 prop = RNA_def_property(srna, "edge_weight", PROP_STRING, PROP_NONE);
4956 RNA_def_property_string_sdna(prop, nullptr, "edge_weight_name");
4957 RNA_def_property_ui_text(prop, "Edge Weight", "Attribute name for edge weight");
4959 prop, "rna_BevelModifier_weight_attribute_visit_for_search", PROP_STRING_SEARCH_SUGGESTION);
4960 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4961
4962 prop = RNA_def_property(srna, "vertex_weight", PROP_STRING, PROP_NONE);
4963 RNA_def_property_string_sdna(prop, nullptr, "vertex_weight_name");
4964 RNA_def_property_ui_text(prop, "Vertex Weight", "Attribute name for vertex weight");
4966 prop, "rna_BevelModifier_weight_attribute_visit_for_search", PROP_STRING_SEARCH_SUGGESTION);
4967 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4968
4969 prop = RNA_def_property(srna, "angle_limit", PROP_FLOAT, PROP_ANGLE);
4970 RNA_def_property_float_sdna(prop, nullptr, "bevel_angle");
4971 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
4972 RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 4);
4973 RNA_def_property_ui_text(prop, "Angle", "Angle above which to bevel edges");
4974 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4975
4976 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
4977 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
4978 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
4979 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_BevelModifier_defgrp_name_set");
4980 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4981
4982 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
4984 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
4985 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4986
4987 prop = RNA_def_property(srna, "use_clamp_overlap", PROP_BOOLEAN, PROP_NONE);
4989 RNA_def_property_ui_text(prop, "Clamp Overlap", "Clamp the width to avoid overlap");
4990 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4991
4992 prop = RNA_def_property(srna, "offset_type", PROP_ENUM, PROP_NONE);
4993 RNA_def_property_enum_sdna(prop, nullptr, "val_flags");
4994 RNA_def_property_enum_items(prop, prop_val_type_items);
4995 RNA_def_property_ui_text(prop, "Width Type", "What distance Width measures");
4996 RNA_def_property_update(prop, 0, "rna_Modifier_update");
4997
4998 prop = RNA_def_property(srna, "profile_type", PROP_ENUM, PROP_NONE);
4999 RNA_def_property_enum_sdna(prop, nullptr, "profile_type");
5000 RNA_def_property_enum_items(prop, prop_profile_type_items);
5002 prop, "Profile Type", "The type of shape used to rebuild a beveled section");
5003 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5004
5005 prop = RNA_def_property(srna, "profile", PROP_FLOAT, PROP_FACTOR);
5006 RNA_def_property_range(prop, 0.0f, 1.0f);
5007 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.05, 2);
5008 RNA_def_property_ui_text(prop, "Profile", "The profile shape (0.5 = round)");
5009 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5010
5011 prop = RNA_def_property(srna, "material", PROP_INT, PROP_NONE);
5012 RNA_def_property_int_sdna(prop, nullptr, "mat");
5013 RNA_def_property_range(prop, -1, SHRT_MAX);
5015 prop, "Material Index", "Material index of generated faces, -1 for automatic");
5016 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5017
5018 prop = RNA_def_property(srna, "loop_slide", PROP_BOOLEAN, PROP_NONE);
5020 RNA_def_property_ui_text(prop, "Loop Slide", "Prefer sliding along edges to having even widths");
5021 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5022
5023 prop = RNA_def_property(srna, "mark_seam", PROP_BOOLEAN, PROP_NONE);
5024 RNA_def_property_boolean_sdna(prop, nullptr, "edge_flags", MOD_BEVEL_MARK_SEAM);
5025 RNA_def_property_ui_text(prop, "Mark Seams", "Mark Seams along beveled edges");
5026 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5027
5028 prop = RNA_def_property(srna, "mark_sharp", PROP_BOOLEAN, PROP_NONE);
5029 RNA_def_property_boolean_sdna(prop, nullptr, "edge_flags", MOD_BEVEL_MARK_SHARP);
5030 RNA_def_property_ui_text(prop, "Mark Sharp", "Mark beveled edges as sharp");
5031 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5032
5033 prop = RNA_def_property(srna, "harden_normals", PROP_BOOLEAN, PROP_NONE);
5035 RNA_def_property_ui_text(prop, "Harden Normals", "Match normals of new faces to adjacent faces");
5036 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5037
5038 prop = RNA_def_property(srna, "face_strength_mode", PROP_ENUM, PROP_NONE);
5039 RNA_def_property_enum_sdna(prop, nullptr, "face_str_mode");
5040 RNA_def_property_enum_items(prop, prop_harden_normals_items);
5042 prop, "Face Strength", "Whether to set face strength, and which faces to set it on");
5043 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5044
5045 prop = RNA_def_property(srna, "miter_outer", PROP_ENUM, PROP_NONE);
5046 RNA_def_property_enum_sdna(prop, nullptr, "miter_outer");
5047 RNA_def_property_enum_items(prop, prop_miter_outer_items);
5048 RNA_def_property_ui_text(prop, "Outer Miter", "Pattern to use for outside of miters");
5049 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5050
5051 prop = RNA_def_property(srna, "miter_inner", PROP_ENUM, PROP_NONE);
5052 RNA_def_property_enum_sdna(prop, nullptr, "miter_inner");
5053 RNA_def_property_enum_items(prop, prop_miter_inner_items);
5054 RNA_def_property_ui_text(prop, "Inner Miter", "Pattern to use for inside of miters");
5055 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5056
5057 prop = RNA_def_property(srna, "spread", PROP_FLOAT, PROP_DISTANCE);
5058 RNA_def_property_float_sdna(prop, nullptr, "spread");
5060 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 0.1, 4);
5061 RNA_def_property_ui_text(prop, "Spread", "Spread distance for inner miter arcs");
5062 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5063
5064 prop = RNA_def_property(srna, "custom_profile", PROP_POINTER, PROP_NONE);
5065 RNA_def_property_struct_type(prop, "CurveProfile");
5066 RNA_def_property_pointer_sdna(prop, nullptr, "custom_profile");
5067 RNA_def_property_ui_text(prop, "Custom Profile Path", "The path for the custom profile");
5068 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5069
5070 prop = RNA_def_property(srna, "vmesh_method", PROP_ENUM, PROP_NONE);
5071 RNA_def_property_enum_sdna(prop, nullptr, "vmesh_method");
5072 RNA_def_property_enum_items(prop, prop_vmesh_method_items);
5074 prop, "Vertex Mesh Method", "The method to use to create the mesh at intersections");
5075 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5076
5078}
5079
5081{
5082 StructRNA *srna;
5083 PropertyRNA *prop;
5084
5085 srna = RNA_def_struct(brna, "ShrinkwrapModifier", "Modifier");
5087 "Shrinkwrap Modifier",
5088 "Shrink wrapping modifier to shrink wrap and object to a target");
5089 RNA_def_struct_sdna(srna, "ShrinkwrapModifierData");
5090 RNA_def_struct_ui_icon(srna, ICON_MOD_SHRINKWRAP);
5091
5093
5094 prop = RNA_def_property(srna, "wrap_method", PROP_ENUM, PROP_NONE);
5095 RNA_def_property_enum_sdna(prop, nullptr, "shrinkType");
5097 RNA_def_property_ui_text(prop, "Wrap Method", "");
5098 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
5099
5100 prop = RNA_def_property(srna, "wrap_mode", PROP_ENUM, PROP_NONE);
5101 RNA_def_property_enum_sdna(prop, nullptr, "shrinkMode");
5104 prop, "Snap Mode", "Select how vertices are constrained to the target surface");
5105 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
5106
5107 prop = RNA_def_property(srna, "cull_face", PROP_ENUM, PROP_NONE);
5108 RNA_def_property_enum_sdna(prop, nullptr, "shrinkOpts");
5111 "rna_ShrinkwrapModifier_face_cull_get",
5112 "rna_ShrinkwrapModifier_face_cull_set",
5113 nullptr);
5115 prop,
5116 "Face Cull",
5117 "Stop vertices from projecting to a face on the target when facing towards/away");
5118 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5119
5120 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
5121 RNA_def_property_ui_text(prop, "Target", "Mesh target to shrink to");
5123 prop, nullptr, "rna_ShrinkwrapModifier_target_set", nullptr, "rna_Mesh_object_poll");
5125 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
5126
5127 prop = RNA_def_property(srna, "auxiliary_target", PROP_POINTER, PROP_NONE);
5128 RNA_def_property_pointer_sdna(prop, nullptr, "auxTarget");
5129 RNA_def_property_ui_text(prop, "Auxiliary Target", "Additional mesh target to shrink to");
5131 prop, nullptr, "rna_ShrinkwrapModifier_auxTarget_set", nullptr, "rna_Mesh_object_poll");
5133 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
5134
5135 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
5136 RNA_def_property_string_sdna(prop, nullptr, "vgroup_name");
5137 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
5138 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_ShrinkwrapModifier_vgroup_name_set");
5139 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5140
5141 prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_DISTANCE);
5142 RNA_def_property_float_sdna(prop, nullptr, "keepDist");
5144 RNA_def_property_ui_range(prop, -100, 100, 1, 2);
5145 RNA_def_property_ui_text(prop, "Offset", "Distance to keep from the target");
5146 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5147
5148 prop = RNA_def_property(srna, "project_limit", PROP_FLOAT, PROP_DISTANCE);
5149 RNA_def_property_float_sdna(prop, nullptr, "projLimit");
5150 RNA_def_property_range(prop, 0.0, FLT_MAX);
5151 RNA_def_property_ui_range(prop, 0, 100, 1, 2);
5153 prop, "Project Limit", "Limit the distance used for projection (zero disables)");
5154 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5155
5156 prop = RNA_def_property(srna, "use_project_x", PROP_BOOLEAN, PROP_NONE);
5158 RNA_def_property_ui_text(prop, "X", "");
5159 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5160
5161 prop = RNA_def_property(srna, "use_project_y", PROP_BOOLEAN, PROP_NONE);
5163 RNA_def_property_ui_text(prop, "Y", "");
5164 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5165
5166 prop = RNA_def_property(srna, "use_project_z", PROP_BOOLEAN, PROP_NONE);
5168 RNA_def_property_ui_text(prop, "Z", "");
5169 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5170
5171 prop = RNA_def_property(srna, "subsurf_levels", PROP_INT, PROP_NONE);
5172 RNA_def_property_int_sdna(prop, nullptr, "subsurfLevels");
5173 RNA_def_property_range(prop, 0, 6);
5174 RNA_def_property_ui_range(prop, 0, 6, 1, -1);
5176 prop,
5177 "Subdivision Levels",
5178 "Number of subdivisions that must be performed before extracting vertices' "
5179 "positions and normals");
5180 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5181
5182 prop = RNA_def_property(srna, "use_negative_direction", PROP_BOOLEAN, PROP_NONE);
5185 prop, "Negative", "Allow vertices to move in the negative direction of axis");
5186 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5187
5188 prop = RNA_def_property(srna, "use_positive_direction", PROP_BOOLEAN, PROP_NONE);
5191 prop, "Positive", "Allow vertices to move in the positive direction of axis");
5192 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5193
5194 prop = RNA_def_property(srna, "use_invert_cull", PROP_BOOLEAN, PROP_NONE);
5197 prop, "Invert Cull", "When projecting in the negative direction invert the face cull mode");
5198 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5199
5200 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
5201 RNA_def_property_boolean_sdna(prop, nullptr, "shrinkOpts", MOD_SHRINKWRAP_INVERT_VGROUP);
5202 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
5203 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5204
5206}
5207
5209{
5210 StructRNA *srna;
5211 PropertyRNA *prop;
5212
5213 static const EnumPropertyItem modifier_mask_mode_items[] = {
5214 {MOD_MASK_MODE_VGROUP, "VERTEX_GROUP", 0, "Vertex Group", ""},
5215 {MOD_MASK_MODE_ARM, "ARMATURE", 0, "Armature", ""},
5216 {0, nullptr, 0, nullptr, nullptr},
5217 };
5218
5219 srna = RNA_def_struct(brna, "MaskModifier", "Modifier");
5220 RNA_def_struct_ui_text(srna, "Mask Modifier", "Mask modifier to hide parts of the mesh");
5221 RNA_def_struct_sdna(srna, "MaskModifierData");
5222 RNA_def_struct_ui_icon(srna, ICON_MOD_MASK);
5223
5225
5226 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
5227 RNA_def_property_enum_items(prop, modifier_mask_mode_items);
5228 RNA_def_property_ui_text(prop, "Mode", "");
5229 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5230
5231 prop = RNA_def_property(srna, "armature", PROP_POINTER, PROP_NONE);
5232 RNA_def_property_pointer_sdna(prop, nullptr, "ob_arm");
5233 RNA_def_property_ui_text(prop, "Armature", "Armature to use as source of bones to mask");
5235 prop, nullptr, "rna_MaskModifier_ob_arm_set", nullptr, "rna_Armature_object_poll");
5237 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
5238
5239 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
5240 RNA_def_property_string_sdna(prop, nullptr, "vgroup");
5241 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
5242 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_MaskModifier_vgroup_set");
5243 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5244
5245 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
5246 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_MASK_INV);
5247 RNA_def_property_ui_text(prop, "Invert", "Use vertices that are not part of region defined");
5248 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5249
5250 prop = RNA_def_property(srna, "use_smooth", PROP_BOOLEAN, PROP_NONE);
5251 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_MASK_SMOOTH);
5253 prop, "Smooth", "Use vertex group weights to cut faces at the weight contour");
5254 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5255
5256 prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_FACTOR);
5257 RNA_def_property_float_sdna(prop, nullptr, "threshold");
5258 RNA_def_property_range(prop, 0.0, 1.0);
5259 RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
5260 RNA_def_property_ui_text(prop, "Threshold", "Weights over this threshold remain");
5261 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5262
5264}
5265
5267{
5268 StructRNA *srna;
5269 PropertyRNA *prop;
5270
5271 static const EnumPropertyItem simple_deform_mode_items[] = {
5273 "TWIST",
5274 0,
5275 "Twist",
5276 "Rotate around the Z axis of the modifier space"},
5278 "BEND",
5279 0,
5280 "Bend",
5281 "Bend the mesh over the Z axis of the modifier space"},
5283 "TAPER",
5284 0,
5285 "Taper",
5286 "Linearly scale along Z axis of the modifier space"},
5288 "STRETCH",
5289 0,
5290 "Stretch",
5291 "Stretch the object along the Z axis of the modifier space"},
5292 {0, nullptr, 0, nullptr, nullptr},
5293 };
5294
5295 srna = RNA_def_struct(brna, "SimpleDeformModifier", "Modifier");
5297 srna,
5298 "SimpleDeform Modifier",
5299 "Simple deformation modifier to apply effects such as twisting and bending");
5300 RNA_def_struct_sdna(srna, "SimpleDeformModifierData");
5301 RNA_def_struct_ui_icon(srna, ICON_MOD_SIMPLEDEFORM);
5302
5304
5305 prop = RNA_def_property(srna, "deform_method", PROP_ENUM, PROP_NONE);
5306 RNA_def_property_enum_sdna(prop, nullptr, "mode");
5307 RNA_def_property_enum_items(prop, simple_deform_mode_items);
5308 RNA_def_property_ui_text(prop, "Mode", "");
5310 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5311
5312 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
5313 RNA_def_property_string_sdna(prop, nullptr, "vgroup_name");
5314 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
5316 prop, nullptr, nullptr, "rna_SimpleDeformModifier_vgroup_name_set");
5317 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5318
5319 prop = RNA_def_property(srna, "deform_axis", PROP_ENUM, PROP_NONE);
5321 RNA_def_property_ui_text(prop, "Axis", "Deform around local axis");
5322 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5323
5324 prop = RNA_def_property(srna, "origin", PROP_POINTER, PROP_NONE);
5325 RNA_def_property_ui_text(prop, "Origin", "Offset the origin and orientation of the deformation");
5327 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
5328
5329 prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
5331 RNA_def_property_ui_range(prop, -10.0, 10.0, 1.0, 3);
5332 RNA_def_property_ui_text(prop, "Factor", "Amount to deform object");
5333 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5334
5335 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
5336 RNA_def_property_float_sdna(prop, nullptr, "factor");
5338 RNA_def_property_ui_range(prop, DEG2RAD(-360.0), DEG2RAD(360.0), 10.0, 3);
5339 RNA_def_property_ui_text(prop, "Angle", "Angle of deformation");
5340 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5341
5342 prop = RNA_def_property(srna, "limits", PROP_FLOAT, PROP_NONE);
5343 RNA_def_property_float_sdna(prop, nullptr, "limit");
5344 RNA_def_property_array(prop, 2);
5345 RNA_def_property_range(prop, 0, 1);
5346 RNA_def_property_ui_range(prop, 0, 1, 5, 2);
5347 RNA_def_property_ui_text(prop, "Limits", "Lower/Upper limits for deform");
5348 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5349
5350 prop = RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE);
5352 RNA_def_property_ui_text(prop, "X", "Do not allow deformation along the X axis");
5353 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5354
5355 prop = RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE);
5357 RNA_def_property_ui_text(prop, "Y", "Do not allow deformation along the Y axis");
5358 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5359
5360 prop = RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE);
5362 RNA_def_property_ui_text(prop, "Z", "Do not allow deformation along the Z axis");
5363 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5364
5365 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
5367 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
5368 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5369
5371}
5372
5374{
5375 StructRNA *srna;
5376
5377 srna = RNA_def_struct(brna, "SurfaceModifier", "Modifier");
5379 srna,
5380 "Surface Modifier",
5381 "Surface modifier defining modifier stack position used for surface fields");
5382 RNA_def_struct_sdna(srna, "SurfaceModifierData");
5383 RNA_def_struct_ui_icon(srna, ICON_MOD_PHYSICS);
5384}
5385
5387{
5388 static const EnumPropertyItem mode_items[] = {
5390 "EXTRUDE",
5391 0,
5392 "Simple",
5393 "Output a solidified version of a mesh by simple extrusion"},
5395 "NON_MANIFOLD",
5396 0,
5397 "Complex",
5398 "Output a manifold mesh even if the base mesh is non-manifold, "
5399 "where edges have 3 or more connecting faces. "
5400 "This method is slower."},
5401 {0, nullptr, 0, nullptr, nullptr},
5402 };
5403
5404 static const EnumPropertyItem nonmanifold_thickness_mode_items[] = {
5406 "FIXED",
5407 0,
5408 "Fixed",
5409 "Most basic thickness calculation"},
5411 "EVEN",
5412 0,
5413 "Even",
5414 "Even thickness calculation which takes the angle between faces into account"},
5416 "CONSTRAINTS",
5417 0,
5418 "Constraints",
5419 "Thickness calculation using constraints, most advanced"},
5420 {0, nullptr, 0, nullptr, nullptr},
5421 };
5422
5423 static const EnumPropertyItem nonmanifold_boundary_mode_items[] = {
5424 {MOD_SOLIDIFY_NONMANIFOLD_BOUNDARY_MODE_NONE, "NONE", 0, "None", "No shape correction"},
5426 "ROUND",
5427 0,
5428 "Round",
5429 "Round open perimeter shape"},
5431 "FLAT",
5432 0,
5433 "Flat",
5434 "Flat open perimeter shape"},
5435 {0, nullptr, 0, nullptr, nullptr},
5436 };
5437
5438 StructRNA *srna;
5439 PropertyRNA *prop;
5440
5441 srna = RNA_def_struct(brna, "SolidifyModifier", "Modifier");
5443 srna, "Solidify Modifier", "Create a solid skin, compensating for sharp angles");
5444 RNA_def_struct_sdna(srna, "SolidifyModifierData");
5445 RNA_def_struct_ui_icon(srna, ICON_MOD_SOLIDIFY);
5446
5448
5449 prop = RNA_def_property(srna, "solidify_mode", PROP_ENUM, PROP_NONE);
5450 RNA_def_property_enum_sdna(prop, nullptr, "mode");
5451 RNA_def_property_enum_items(prop, mode_items);
5452 RNA_def_property_ui_text(prop, "Mode", "Selects the used algorithm");
5453 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5454
5455 prop = RNA_def_property(srna, "thickness", PROP_FLOAT, PROP_DISTANCE);
5456 RNA_def_property_float_sdna(prop, nullptr, "offset");
5458 RNA_def_property_ui_range(prop, -10, 10, 0.1, 4);
5459 RNA_def_property_ui_text(prop, "Thickness", "Thickness of the shell");
5460 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5461
5462 prop = RNA_def_property(srna, "thickness_clamp", PROP_FLOAT, PROP_FACTOR);
5463 RNA_def_property_float_sdna(prop, nullptr, "offset_clamp");
5464 RNA_def_property_range(prop, 0, 100.0);
5465 RNA_def_property_ui_range(prop, 0, 2.0, 0.1, 4);
5466 RNA_def_property_ui_text(prop, "Clamp", "Offset clamp based on geometry scale");
5467 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5468
5469 prop = RNA_def_property(srna, "use_thickness_angle_clamp", PROP_BOOLEAN, PROP_NONE);
5471 RNA_def_property_ui_text(prop, "Angle Clamp", "Clamp thickness based on angles");
5472 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5473
5474 prop = RNA_def_property(srna, "thickness_vertex_group", PROP_FLOAT, PROP_FACTOR);
5475 RNA_def_property_float_sdna(prop, nullptr, "offset_fac_vg");
5476 RNA_def_property_range(prop, 0.0, 1.0);
5477 RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
5479 prop, "Vertex Group Factor", "Thickness factor to use for zero vertex group influence");
5480 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5481
5482 prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_FACTOR);
5483 RNA_def_property_float_sdna(prop, nullptr, "offset_fac");
5485 RNA_def_property_ui_range(prop, -1, 1, 0.1, 4);
5486 RNA_def_property_ui_text(prop, "Offset", "Offset the thickness from the center");
5487 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5488
5489 prop = RNA_def_property(srna, "edge_crease_inner", PROP_FLOAT, PROP_FACTOR);
5490 RNA_def_property_float_sdna(prop, nullptr, "crease_inner");
5491 RNA_def_property_range(prop, 0, 1);
5492 RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
5493 RNA_def_property_ui_text(prop, "Inner Crease", "Assign a crease to inner edges");
5494 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5495
5496 prop = RNA_def_property(srna, "edge_crease_outer", PROP_FLOAT, PROP_FACTOR);
5497 RNA_def_property_float_sdna(prop, nullptr, "crease_outer");
5498 RNA_def_property_range(prop, 0, 1);
5499 RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
5500 RNA_def_property_ui_text(prop, "Outer Crease", "Assign a crease to outer edges");
5501 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5502
5503 prop = RNA_def_property(srna, "edge_crease_rim", PROP_FLOAT, PROP_FACTOR);
5504 RNA_def_property_float_sdna(prop, nullptr, "crease_rim");
5505 RNA_def_property_range(prop, 0, 1);
5506 RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
5507 RNA_def_property_ui_text(prop, "Rim Crease", "Assign a crease to the edges making up the rim");
5508 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5509
5510 prop = RNA_def_property(srna, "material_offset", PROP_INT, PROP_NONE);
5511 RNA_def_property_int_sdna(prop, nullptr, "mat_ofs");
5512 RNA_def_property_range(prop, SHRT_MIN, SHRT_MAX);
5513 RNA_def_property_ui_text(prop, "Material Offset", "Offset material index of generated faces");
5514 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5515
5516 prop = RNA_def_property(srna, "material_offset_rim", PROP_INT, PROP_NONE);
5517 RNA_def_property_int_sdna(prop, nullptr, "mat_ofs_rim");
5518 RNA_def_property_range(prop, SHRT_MIN, SHRT_MAX);
5520 prop, "Rim Material Offset", "Offset material index of generated rim faces");
5521 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5522
5523 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
5524 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
5525 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
5526 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_SolidifyModifier_defgrp_name_set");
5527 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5528
5529 prop = RNA_def_property(srna, "shell_vertex_group", PROP_STRING, PROP_NONE);
5530 RNA_def_property_string_sdna(prop, nullptr, "shell_defgrp_name");
5532 "Shell Vertex Group",
5533 "Vertex group that the generated shell geometry will be weighted to");
5535 prop, nullptr, nullptr, "rna_SolidifyModifier_shell_defgrp_name_set");
5536 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5537
5538 prop = RNA_def_property(srna, "rim_vertex_group", PROP_STRING, PROP_NONE);
5539 RNA_def_property_string_sdna(prop, nullptr, "rim_defgrp_name");
5541 "Rim Vertex Group",
5542 "Vertex group that the generated rim geometry will be weighted to");
5544 prop, nullptr, nullptr, "rna_SolidifyModifier_rim_defgrp_name_set");
5545 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5546
5547 prop = RNA_def_property(srna, "use_rim", PROP_BOOLEAN, PROP_NONE);
5548 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_SOLIDIFY_RIM);
5550 "Fill Rim",
5551 "Create edge loops between the inner and outer surfaces on face edges "
5552 "(slow, disable when not needed)");
5553 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5554
5555 prop = RNA_def_property(srna, "use_even_offset", PROP_BOOLEAN, PROP_NONE);
5556 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_SOLIDIFY_EVEN);
5558 prop,
5559 "Even Thickness",
5560 "Maintain thickness by adjusting for sharp corners (slow, disable when not needed)");
5561 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5562
5563 prop = RNA_def_property(srna, "use_quality_normals", PROP_BOOLEAN, PROP_NONE);
5566 prop,
5567 "High Quality Normals",
5568 "Calculate normals which result in more even thickness (slow, disable when not needed)");
5569 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5570
5571 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
5573 RNA_def_property_ui_text(prop, "Vertex Group Invert", "Invert the vertex group influence");
5574 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5575
5576 prop = RNA_def_property(srna, "use_flat_faces", PROP_BOOLEAN, PROP_NONE);
5579 "Flat Faces",
5580 "Make faces use the minimal vertex weight assigned to their vertices "
5581 "(ensures new faces remain parallel to their original ones, slow, "
5582 "disable when not needed)");
5583 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5584
5585 prop = RNA_def_property(srna, "use_flip_normals", PROP_BOOLEAN, PROP_NONE);
5586 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_SOLIDIFY_FLIP);
5587 RNA_def_property_ui_text(prop, "Flip Normals", "Invert the face direction");
5588 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5589
5590 prop = RNA_def_property(srna, "use_rim_only", PROP_BOOLEAN, PROP_NONE);
5592 RNA_def_property_ui_text(prop, "Only Rim", "Only add the rim to the original data");
5593 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5594
5595 /* Settings for #MOD_SOLIDIFY_MODE_NONMANIFOLD */
5596 prop = RNA_def_property(srna, "nonmanifold_thickness_mode", PROP_ENUM, PROP_NONE);
5597 RNA_def_property_enum_sdna(prop, nullptr, "nonmanifold_offset_mode");
5598 RNA_def_property_enum_items(prop, nonmanifold_thickness_mode_items);
5599 RNA_def_property_ui_text(prop, "Thickness Mode", "Selects the used thickness algorithm");
5600 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5601
5602 prop = RNA_def_property(srna, "nonmanifold_boundary_mode", PROP_ENUM, PROP_NONE);
5603 RNA_def_property_enum_items(prop, nonmanifold_boundary_mode_items);
5604 RNA_def_property_ui_text(prop, "Boundary Shape", "Selects the boundary adjustment algorithm");
5606 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5607
5608 prop = RNA_def_property(srna, "nonmanifold_merge_threshold", PROP_FLOAT, PROP_DISTANCE);
5609 RNA_def_property_float_sdna(prop, nullptr, "merge_tolerance");
5610 RNA_def_property_range(prop, 0.0, 1.0);
5611 RNA_def_property_ui_range(prop, 0.0, 1.0, 0.01, 4);
5613 prop, "Merge Threshold", "Distance within which degenerated geometry is merged");
5614 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5615
5616 prop = RNA_def_property(srna, "bevel_convex", PROP_FLOAT, PROP_NONE);
5617 RNA_def_property_float_sdna(prop, nullptr, "bevel_convex");
5618 RNA_def_property_range(prop, -1.0, 1.0);
5619 RNA_def_property_ui_range(prop, -1.0, 1.0, 0.1, 3);
5620 RNA_def_property_ui_text(prop, "Bevel Convex", "Edge bevel weight to be added to outside edges");
5621 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5622
5624}
5625
5627{
5628 StructRNA *srna;
5629 PropertyRNA *prop;
5630
5631 srna = RNA_def_struct(brna, "ScrewModifier", "Modifier");
5632 RNA_def_struct_ui_text(srna, "Screw Modifier", "Revolve edges");
5633 RNA_def_struct_sdna(srna, "ScrewModifierData");
5634 RNA_def_struct_ui_icon(srna, ICON_MOD_SCREW);
5635
5637
5638 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
5639 RNA_def_property_pointer_sdna(prop, nullptr, "ob_axis");
5640 RNA_def_property_ui_text(prop, "Object", "Object to define the screw axis");
5642 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
5643
5644 prop = RNA_def_property(srna, "steps", PROP_INT, PROP_UNSIGNED);
5645 RNA_def_property_range(prop, 1, 10000);
5646 RNA_def_property_ui_range(prop, 1, 512, 1, -1);
5647 RNA_def_property_ui_text(prop, "Steps", "Number of steps in the revolution");
5648 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5649
5650 prop = RNA_def_property(srna, "render_steps", PROP_INT, PROP_UNSIGNED);
5651 RNA_def_property_range(prop, 1, 10000);
5652 RNA_def_property_ui_range(prop, 1, 512, 1, -1);
5653 RNA_def_property_ui_text(prop, "Render Steps", "Number of steps in the revolution");
5654 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5655
5656 prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_UNSIGNED);
5657 RNA_def_property_int_sdna(prop, nullptr, "iter");
5658 RNA_def_property_range(prop, 1, 10000);
5659 RNA_def_property_ui_range(prop, 1, 100, 1, -1);
5660 RNA_def_property_ui_text(prop, "Iterations", "Number of times to apply the screw operation");
5661 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5662
5663 prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
5665 RNA_def_property_ui_text(prop, "Axis", "Screw axis");
5666 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5667
5668 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
5669 RNA_def_property_ui_range(prop, -M_PI * 2, M_PI * 2, 10, -1);
5671 RNA_def_property_ui_text(prop, "Angle", "Angle of revolution");
5672 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5673
5674 prop = RNA_def_property(srna, "screw_offset", PROP_FLOAT, PROP_DISTANCE);
5675 RNA_def_property_float_sdna(prop, nullptr, "screw_ofs");
5676 RNA_def_property_ui_text(prop, "Screw", "Offset the revolution along its axis");
5677 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5678
5679 prop = RNA_def_property(srna, "merge_threshold", PROP_FLOAT, PROP_DISTANCE);
5680 RNA_def_property_float_sdna(prop, nullptr, "merge_dist");
5682 RNA_def_property_ui_range(prop, 0, 1, 1, 4);
5683 RNA_def_property_ui_text(prop, "Merge Distance", "Limit below which to merge vertices");
5684 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5685
5686 prop = RNA_def_property(srna, "use_normal_flip", PROP_BOOLEAN, PROP_NONE);
5688 RNA_def_property_ui_text(prop, "Flip", "Flip normals of lathed faces");
5689 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5690
5691 prop = RNA_def_property(srna, "use_normal_calculate", PROP_BOOLEAN, PROP_NONE);
5694 prop, "Calculate Order", "Calculate the order of edges (needed for meshes, but not curves)");
5695 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5696
5697 prop = RNA_def_property(srna, "use_object_screw_offset", PROP_BOOLEAN, PROP_NONE);
5700 prop, "Object Screw", "Use the distance between the objects to make a screw");
5701 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5702
5703 /* Vertex merging parameters */
5704 prop = RNA_def_property(srna, "use_merge_vertices", PROP_BOOLEAN, PROP_NONE);
5705 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_SCREW_MERGE);
5707 prop, "Merge Vertices", "Merge adjacent vertices (screw offset must be zero)");
5708 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5709
5710 prop = RNA_def_property(srna, "use_smooth_shade", PROP_BOOLEAN, PROP_NONE);
5713 prop, "Smooth Shading", "Output faces with smooth shading rather than flat shaded");
5714 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5715
5716 prop = RNA_def_property(srna, "use_stretch_u", PROP_BOOLEAN, PROP_NONE);
5719 prop, "Stretch U", "Stretch the U coordinates between 0 and 1 when UVs are present");
5720 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5721
5722 prop = RNA_def_property(srna, "use_stretch_v", PROP_BOOLEAN, PROP_NONE);
5725 prop, "Stretch V", "Stretch the V coordinates between 0 and 1 when UVs are present");
5726 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5727
5728# if 0
5729 prop = RNA_def_property(srna, "use_angle_object", PROP_BOOLEAN, PROP_NONE);
5730 RNA_def_property_boolean_sdna(prop, nullptr, "flag", MOD_SCREW_OBJECT_ANGLE);
5732 prop, "Object Angle", "Use the angle between the objects rather than the fixed angle");
5733 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5734# endif
5735
5737}
5738
5740{
5741 StructRNA *srna;
5742 PropertyRNA *prop;
5743
5744 srna = RNA_def_struct(brna, "UVWarpModifier", "Modifier");
5745 RNA_def_struct_ui_text(srna, "UVWarp Modifier", "Add target position to UV coordinates");
5746 RNA_def_struct_sdna(srna, "UVWarpModifierData");
5747 RNA_def_struct_ui_icon(srna, ICON_MOD_UVPROJECT);
5748
5750
5751 prop = RNA_def_property(srna, "axis_u", PROP_ENUM, PROP_NONE);
5752 RNA_def_property_enum_sdna(prop, nullptr, "axis_u");
5754 RNA_def_property_ui_text(prop, "U-Axis", "Pole axis for rotation");
5755 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5756
5757 prop = RNA_def_property(srna, "axis_v", PROP_ENUM, PROP_NONE);
5758 RNA_def_property_enum_sdna(prop, nullptr, "axis_v");
5760 RNA_def_property_ui_text(prop, "V-Axis", "Pole axis for rotation");
5761 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5762
5763 prop = RNA_def_property(srna, "center", PROP_FLOAT, PROP_NONE);
5764 RNA_def_property_float_sdna(prop, nullptr, "center");
5765 RNA_def_property_ui_text(prop, "UV Center", "Center point for rotate/scale");
5766 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5767
5768 prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
5769 RNA_def_property_float_sdna(prop, nullptr, "offset");
5770 RNA_def_property_ui_text(prop, "Offset", "2D Offset for the warp");
5771 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5772
5773 prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
5774 RNA_def_property_float_sdna(prop, nullptr, "scale");
5775 RNA_def_property_ui_text(prop, "Scale", "2D Scale for the warp");
5776 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5777
5778 prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ANGLE);
5779 RNA_def_property_float_sdna(prop, nullptr, "rotation");
5780 RNA_def_property_ui_text(prop, "Rotation", "2D Rotation for the warp");
5781 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5782
5783 prop = RNA_def_property(srna, "object_from", PROP_POINTER, PROP_NONE);
5784 RNA_def_property_pointer_sdna(prop, nullptr, "object_src");
5785 RNA_def_property_ui_text(prop, "Object From", "Object defining offset");
5787 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
5788
5789 prop = RNA_def_property(srna, "bone_from", PROP_STRING, PROP_NONE);
5790 RNA_def_property_string_sdna(prop, nullptr, "bone_src");
5791 RNA_def_property_ui_text(prop, "Bone From", "Bone defining offset");
5792 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
5793
5794 prop = RNA_def_property(srna, "object_to", PROP_POINTER, PROP_NONE);
5795 RNA_def_property_pointer_sdna(prop, nullptr, "object_dst");
5796 RNA_def_property_ui_text(prop, "Object To", "Object defining offset");
5798 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
5799
5800 prop = RNA_def_property(srna, "bone_to", PROP_STRING, PROP_NONE);
5801 RNA_def_property_string_sdna(prop, nullptr, "bone_dst");
5802 RNA_def_property_ui_text(prop, "Bone To", "Bone defining offset");
5803 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
5804
5805 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
5806 RNA_def_property_string_sdna(prop, nullptr, "vgroup_name");
5807 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
5808 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_UVWarpModifier_vgroup_name_set");
5809 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5810
5811 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
5813 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
5814 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5815
5816 prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
5817 RNA_def_property_string_sdna(prop, nullptr, "uvlayer_name");
5818 RNA_def_property_ui_text(prop, "UV Map", "UV map name");
5819 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_UVWarpModifier_uvlayer_name_set");
5820 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5821
5823}
5824
5826 StructRNA *srna,
5827 const char *mask_flags,
5828 const int invert_vgroup_mask_flag,
5829 const char *mask_vgroup_setter,
5830 const char *mask_uvlayer_setter)
5831{
5832 static const EnumPropertyItem weightvg_mask_tex_map_items[] = {
5833 {MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Local", "Use local generated coordinates"},
5834 {MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", "Use global coordinates"},
5836 "OBJECT",
5837 0,
5838 "Object",
5839 "Use local generated coordinates of another object"},
5840 {MOD_DISP_MAP_UV, "UV", 0, "UV", "Use coordinates from a UV layer"},
5841 {0, nullptr, 0, nullptr, nullptr},
5842 };
5843
5844 static const EnumPropertyItem weightvg_mask_tex_used_items[] = {
5845 {MOD_WVG_MASK_TEX_USE_INT, "INT", 0, "Intensity", ""},
5846 {MOD_WVG_MASK_TEX_USE_RED, "RED", 0, "Red", ""},
5847 {MOD_WVG_MASK_TEX_USE_GREEN, "GREEN", 0, "Green", ""},
5848 {MOD_WVG_MASK_TEX_USE_BLUE, "BLUE", 0, "Blue", ""},
5849 {MOD_WVG_MASK_TEX_USE_HUE, "HUE", 0, "Hue", ""},
5850 {MOD_WVG_MASK_TEX_USE_SAT, "SAT", 0, "Saturation", ""},
5851 {MOD_WVG_MASK_TEX_USE_VAL, "VAL", 0, "Value", ""},
5852 {MOD_WVG_MASK_TEX_USE_ALPHA, "ALPHA", 0, "Alpha", ""},
5853 {0, nullptr, 0, nullptr, nullptr},
5854 };
5855
5856 PropertyRNA *prop;
5857
5859
5860 prop = RNA_def_property(srna, "mask_constant", PROP_FLOAT, PROP_FACTOR);
5862 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, -1);
5864 prop, "Influence", "Global influence of current modifications on vgroup");
5865 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5866
5867 prop = RNA_def_property(srna, "mask_vertex_group", PROP_STRING, PROP_NONE);
5868 RNA_def_property_string_sdna(prop, nullptr, "mask_defgrp_name");
5869 RNA_def_property_ui_text(prop, "Mask Vertex Group", "Masking vertex group name");
5870 RNA_def_property_string_funcs(prop, nullptr, nullptr, mask_vgroup_setter);
5871 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5872
5873 prop = RNA_def_property(srna, "invert_mask_vertex_group", PROP_BOOLEAN, PROP_NONE);
5874 RNA_def_property_boolean_sdna(prop, nullptr, mask_flags, invert_vgroup_mask_flag);
5875 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group mask influence");
5876 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5877
5878 prop = RNA_def_property(srna, "mask_texture", PROP_POINTER, PROP_NONE);
5879 RNA_def_property_ui_text(prop, "Masking Tex", "Masking texture");
5881 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
5882
5883 prop = RNA_def_property(srna, "mask_tex_use_channel", PROP_ENUM, PROP_NONE);
5884 RNA_def_property_enum_items(prop, weightvg_mask_tex_used_items);
5885 RNA_def_property_ui_text(prop, "Use Channel", "Which texture channel to use for masking");
5886 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5887
5888 prop = RNA_def_property(srna, "mask_tex_mapping", PROP_ENUM, PROP_NONE);
5889 RNA_def_property_enum_items(prop, weightvg_mask_tex_map_items);
5891 "Texture Coordinates",
5892 "Which texture coordinates "
5893 "to use for mapping");
5894 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
5895
5896 prop = RNA_def_property(srna, "mask_tex_uv_layer", PROP_STRING, PROP_NONE);
5897 RNA_def_property_string_sdna(prop, nullptr, "mask_tex_uvlayer_name");
5898 RNA_def_property_ui_text(prop, "UV Map", "UV map name");
5899 RNA_def_property_string_funcs(prop, nullptr, nullptr, mask_uvlayer_setter);
5900 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5901
5902 prop = RNA_def_property(srna, "mask_tex_map_object", PROP_POINTER, PROP_NONE);
5903 RNA_def_property_pointer_sdna(prop, nullptr, "mask_tex_map_obj");
5905 "Texture Coordinate Object",
5906 "Which object to take texture "
5907 "coordinates from");
5909 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
5910
5911 prop = RNA_def_property(srna, "mask_tex_map_bone", PROP_STRING, PROP_NONE);
5912 RNA_def_property_string_sdna(prop, nullptr, "mask_tex_map_bone");
5914 prop, "Texture Coordinate Bone", "Which bone to take texture coordinates from");
5915 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
5916
5918}
5919
5921{
5922 static const EnumPropertyItem weightvg_edit_falloff_type_items[] = {
5923 {MOD_WVG_MAPPING_NONE, "LINEAR", ICON_LINCURVE, "Linear", "Null action"},
5924 {MOD_WVG_MAPPING_CURVE, "CURVE", ICON_RNDCURVE, "Custom Curve", ""},
5925 {MOD_WVG_MAPPING_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
5926 {MOD_WVG_MAPPING_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
5927 {MOD_WVG_MAPPING_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
5928 {MOD_WVG_MAPPING_SPHERE, "ICON_SPHERECURVE", ICON_SPHERECURVE, "Sphere", ""},
5929 {MOD_WVG_MAPPING_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""},
5931 "STEP",
5932 ICON_IPO_CONSTANT,
5933 "Median Step",
5934 "Map all values below 0.5 to 0.0, and all others to 1.0"},
5935 {0, nullptr, 0, nullptr, nullptr},
5936 };
5937
5938 StructRNA *srna;
5939 PropertyRNA *prop;
5940
5941 srna = RNA_def_struct(brna, "VertexWeightEditModifier", "Modifier");
5943 srna, "WeightVG Edit Modifier", "Edit the weights of vertices in a group");
5944 RNA_def_struct_sdna(srna, "WeightVGEditModifierData");
5945 RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT);
5946
5948
5949 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
5950 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
5951 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
5953 prop, nullptr, nullptr, "rna_WeightVGEditModifier_defgrp_name_set");
5954 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5955
5956 prop = RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
5957 RNA_def_property_enum_items(prop, weightvg_edit_falloff_type_items);
5958 RNA_def_property_ui_text(prop, "Falloff Type", "How weights are mapped to their new values");
5960 BLT_I18NCONTEXT_ID_CURVE_LEGACY); /* Abusing id_curve :/ */
5961 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5962
5963 prop = RNA_def_property(srna, "invert_falloff", PROP_BOOLEAN, PROP_NONE);
5964 RNA_def_property_boolean_sdna(prop, nullptr, "edit_flags", MOD_WVG_INVERT_FALLOFF);
5965 RNA_def_property_ui_text(prop, "Invert Falloff", "Invert the resulting falloff weight");
5966 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5967
5968 prop = RNA_def_property(srna, "normalize", PROP_BOOLEAN, PROP_NONE);
5971 prop,
5972 "Normalize Weights",
5973 "Normalize the resulting weights (otherwise they are only clamped within 0.0 to 1.0 range)");
5974 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5975
5976 prop = RNA_def_property(srna, "map_curve", PROP_POINTER, PROP_NONE);
5977 RNA_def_property_pointer_sdna(prop, nullptr, "cmap_curve");
5978 RNA_def_property_ui_text(prop, "Mapping Curve", "Custom mapping curve");
5979 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5980
5981 prop = RNA_def_property(srna, "use_add", PROP_BOOLEAN, PROP_NONE);
5982 RNA_def_property_boolean_sdna(prop, nullptr, "edit_flags", MOD_WVG_EDIT_ADD2VG);
5984 "Group Add",
5985 "Add vertices with weight over threshold "
5986 "to vgroup");
5987 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5988
5989 prop = RNA_def_property(srna, "use_remove", PROP_BOOLEAN, PROP_NONE);
5990 RNA_def_property_boolean_sdna(prop, nullptr, "edit_flags", MOD_WVG_EDIT_REMFVG);
5992 "Group Remove",
5993 "Remove vertices with weight below threshold "
5994 "from vgroup");
5995 RNA_def_property_update(prop, 0, "rna_Modifier_update");
5996
5997 prop = RNA_def_property(srna, "default_weight", PROP_FLOAT, PROP_FACTOR);
5998 RNA_def_property_range(prop, 0.0, 1.0f);
5999 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, -1);
6001 "Default Weight",
6002 "Default weight a vertex will have if "
6003 "it is not in the vgroup");
6004 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6005
6006 prop = RNA_def_property(srna, "add_threshold", PROP_FLOAT, PROP_NONE);
6007 RNA_def_property_float_sdna(prop, nullptr, "add_threshold");
6008 RNA_def_property_range(prop, -1000.0, 1000.0);
6009 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, -1);
6011 "Add Threshold",
6012 "Lower (inclusive) bound for a vertex's weight "
6013 "to be added to the vgroup");
6014 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6015
6016 prop = RNA_def_property(srna, "remove_threshold", PROP_FLOAT, PROP_NONE);
6017 RNA_def_property_float_sdna(prop, nullptr, "rem_threshold");
6018 RNA_def_property_range(prop, -1000.0, 1000.0);
6019 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, -1);
6021 "Remove Threshold",
6022 "Upper (inclusive) bound for a vertex's weight "
6023 "to be removed from the vgroup");
6024 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6025
6027
6028 /* Common masking properties. */
6030 srna,
6031 "edit_flags",
6033 "rna_WeightVGEditModifier_mask_defgrp_name_set",
6034 "rna_WeightVGEditModifier_mask_tex_uvlayer_name_set");
6035}
6036
6038{
6039 static const EnumPropertyItem weightvg_mix_modes_items[] = {
6040 {MOD_WVG_MIX_SET, "SET", 0, "Replace", "Replace VGroup A's weights by VGroup B's ones"},
6041 {MOD_WVG_MIX_ADD, "ADD", 0, "Add", "Add VGroup B's weights to VGroup A's ones"},
6042 {MOD_WVG_MIX_SUB, "SUB", 0, "Subtract", "Subtract VGroup B's weights from VGroup A's ones"},
6043 {MOD_WVG_MIX_MUL, "MUL", 0, "Multiply", "Multiply VGroup A's weights by VGroup B's ones"},
6044 {MOD_WVG_MIX_DIV, "DIV", 0, "Divide", "Divide VGroup A's weights by VGroup B's ones"},
6046 "DIF",
6047 0,
6048 "Difference",
6049 "Difference between VGroup A's and VGroup B's weights"},
6050 {MOD_WVG_MIX_AVG, "AVG", 0, "Average", "Average value of VGroup A's and VGroup B's weights"},
6051 {MOD_WVG_MIX_MIN, "MIN", 0, "Minimum", "Minimum of VGroup A's and VGroup B's weights"},
6052 {MOD_WVG_MIX_MAX, "MAX", 0, "Maximum", "Maximum of VGroup A's and VGroup B's weights"},
6053 {0, nullptr, 0, nullptr, nullptr},
6054 };
6055
6056 static const EnumPropertyItem weightvg_mix_set_items[] = {
6057 {MOD_WVG_SET_ALL, "ALL", 0, "All", "Affect all vertices (might add some to VGroup A)"},
6058 {MOD_WVG_SET_A, "A", 0, "VGroup A", "Affect vertices in VGroup A"},
6060 "B",
6061 0,
6062 "VGroup B",
6063 "Affect vertices in VGroup B (might add some to VGroup A)"},
6065 "OR",
6066 0,
6067 "VGroup A or B",
6068 "Affect vertices in at least one of both VGroups (might add some to VGroup A)"},
6069 {MOD_WVG_SET_AND, "AND", 0, "VGroup A and B", "Affect vertices in both groups"},
6070 {0, nullptr, 0, nullptr, nullptr},
6071 };
6072
6073 StructRNA *srna;
6074 PropertyRNA *prop;
6075
6076 srna = RNA_def_struct(brna, "VertexWeightMixModifier", "Modifier");
6077 RNA_def_struct_ui_text(srna, "WeightVG Mix Modifier", "Mix the weights of two vertex groups");
6078 RNA_def_struct_sdna(srna, "WeightVGMixModifierData");
6079 RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT);
6080
6082
6083 prop = RNA_def_property(srna, "vertex_group_a", PROP_STRING, PROP_NONE);
6084 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name_a");
6085 RNA_def_property_ui_text(prop, "Vertex Group A", "First vertex group name");
6087 prop, nullptr, nullptr, "rna_WeightVGMixModifier_defgrp_name_a_set");
6088 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6089
6090 prop = RNA_def_property(srna, "vertex_group_b", PROP_STRING, PROP_NONE);
6091 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name_b");
6092 RNA_def_property_ui_text(prop, "Vertex Group B", "Second vertex group name");
6094 prop, nullptr, nullptr, "rna_WeightVGMixModifier_defgrp_name_b_set");
6095 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6096
6097 prop = RNA_def_property(srna, "invert_vertex_group_a", PROP_BOOLEAN, PROP_NONE);
6099 RNA_def_property_ui_text(prop, "Invert Weights A", "Invert the influence of vertex group A");
6100 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6101
6102 prop = RNA_def_property(srna, "invert_vertex_group_b", PROP_BOOLEAN, PROP_NONE);
6104 RNA_def_property_ui_text(prop, "Invert Weights B", "Invert the influence of vertex group B");
6105 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6106
6107 prop = RNA_def_property(srna, "default_weight_a", PROP_FLOAT, PROP_FACTOR);
6108 RNA_def_property_range(prop, 0.0, 1.0f);
6109 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, -1);
6111 "Default Weight A",
6112 "Default weight a vertex will have if "
6113 "it is not in the first A vgroup");
6114 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6115
6116 prop = RNA_def_property(srna, "default_weight_b", PROP_FLOAT, PROP_FACTOR);
6117 RNA_def_property_range(prop, 0.0, 1.0f);
6118 RNA_def_property_ui_range(prop, 0.0, 1.0, 1, -1);
6120 "Default Weight B",
6121 "Default weight a vertex will have if "
6122 "it is not in the second B vgroup");
6123 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6124
6125 prop = RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
6126 RNA_def_property_enum_items(prop, weightvg_mix_modes_items);
6128 "Mix Mode",
6129 "How weights from vgroup B affect weights "
6130 "of vgroup A");
6131 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6132
6133 prop = RNA_def_property(srna, "mix_set", PROP_ENUM, PROP_NONE);
6134 RNA_def_property_enum_items(prop, weightvg_mix_set_items);
6135 RNA_def_property_ui_text(prop, "Vertex Set", "Which vertices should be affected");
6136 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6137
6138 prop = RNA_def_property(srna, "normalize", PROP_BOOLEAN, PROP_NONE);
6141 prop,
6142 "Normalize Weights",
6143 "Normalize the resulting weights (otherwise they are only clamped within 0.0 to 1.0 range)");
6144 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6145
6147
6148 /* Common masking properties. */
6150 srna,
6151 "flag",
6153 "rna_WeightVGMixModifier_mask_defgrp_name_set",
6154 "rna_WeightVGMixModifier_mask_tex_uvlayer_name_set");
6155}
6156
6158{
6159 static const EnumPropertyItem weightvg_proximity_modes_items[] = {
6161 "OBJECT",
6162 0,
6163 "Object",
6164 "Use distance between affected and target objects"},
6166 "GEOMETRY",
6167 0,
6168 "Geometry",
6169 "Use distance between affected object's vertices and target "
6170 "object, or target object's geometry"},
6171 {0, nullptr, 0, nullptr, nullptr},
6172 };
6173
6174 static const EnumPropertyItem proximity_geometry_items[] = {
6175 {MOD_WVG_PROXIMITY_GEOM_VERTS, "VERTEX", 0, "Vertex", "Compute distance to nearest vertex"},
6176 {MOD_WVG_PROXIMITY_GEOM_EDGES, "EDGE", 0, "Edge", "Compute distance to nearest edge"},
6177 {MOD_WVG_PROXIMITY_GEOM_FACES, "FACE", 0, "Face", "Compute distance to nearest face"},
6178 {0, nullptr, 0, nullptr, nullptr},
6179 };
6180
6181 static const EnumPropertyItem weightvg_proximity_falloff_type_items[] = {
6182 {MOD_WVG_MAPPING_NONE, "LINEAR", ICON_LINCURVE, "Linear", "Null action"},
6183 {MOD_WVG_MAPPING_CURVE, "CURVE", ICON_RNDCURVE, "Custom Curve", ""},
6184 {MOD_WVG_MAPPING_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
6185 {MOD_WVG_MAPPING_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
6186 {MOD_WVG_MAPPING_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
6187 {MOD_WVG_MAPPING_SPHERE, "ICON_SPHERECURVE", ICON_SPHERECURVE, "Sphere", ""},
6188 {MOD_WVG_MAPPING_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""},
6190 "STEP",
6191 ICON_IPO_CONSTANT,
6192 "Median Step",
6193 "Map all values below 0.5 to 0.0, and all others to 1.0"},
6194 {0, nullptr, 0, nullptr, nullptr},
6195 };
6196
6197 StructRNA *srna;
6198 PropertyRNA *prop;
6199
6200 srna = RNA_def_struct(brna, "VertexWeightProximityModifier", "Modifier");
6202 "WeightVG Proximity Modifier",
6203 "Set the weights of vertices in a group from a target object's "
6204 "distance");
6205 RNA_def_struct_sdna(srna, "WeightVGProximityModifierData");
6206 RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT);
6207
6209
6210 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
6211 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
6212 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
6214 prop, nullptr, nullptr, "rna_WeightVGProximityModifier_defgrp_name_set");
6215 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6216
6217 prop = RNA_def_property(srna, "proximity_mode", PROP_ENUM, PROP_NONE);
6218 RNA_def_property_enum_items(prop, weightvg_proximity_modes_items);
6220 RNA_def_property_ui_text(prop, "Proximity Mode", "Which distances to target object to use");
6221 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6222
6223 prop = RNA_def_property(srna, "proximity_geometry", PROP_ENUM, PROP_NONE);
6224 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "proximity_flags");
6226 RNA_def_property_enum_items(prop, proximity_geometry_items);
6229 "Proximity Geometry",
6230 "Use the shortest computed distance to target object's geometry "
6231 "as weight");
6232 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6233
6234 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
6235 RNA_def_property_pointer_sdna(prop, nullptr, "proximity_ob_target");
6236 RNA_def_property_ui_text(prop, "Target Object", "Object to calculate vertices distances from");
6238 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
6239
6240 prop = RNA_def_property(srna, "min_dist", PROP_FLOAT, PROP_DISTANCE);
6241 RNA_def_property_range(prop, 0.0, FLT_MAX);
6242 RNA_def_property_ui_range(prop, 0.0, 1000.0, 10, -1);
6243 RNA_def_property_ui_text(prop, "Lowest", "Distance mapping to weight 0.0");
6244 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6245
6246 prop = RNA_def_property(srna, "max_dist", PROP_FLOAT, PROP_DISTANCE);
6247 RNA_def_property_range(prop, 0.0, FLT_MAX);
6248 RNA_def_property_ui_range(prop, 0.0, 1000.0, 10, -1);
6249 RNA_def_property_ui_text(prop, "Highest", "Distance mapping to weight 1.0");
6250 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6251
6252 prop = RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
6253 RNA_def_property_enum_items(prop, weightvg_proximity_falloff_type_items);
6254 RNA_def_property_ui_text(prop, "Falloff Type", "How weights are mapped to their new values");
6256 BLT_I18NCONTEXT_ID_CURVE_LEGACY); /* Abusing id_curve :/ */
6257 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6258
6259 prop = RNA_def_property(srna, "invert_falloff", PROP_BOOLEAN, PROP_NONE);
6261 prop, nullptr, "proximity_flags", MOD_WVG_PROXIMITY_INVERT_FALLOFF);
6262 RNA_def_property_ui_text(prop, "Invert Falloff", "Invert the resulting falloff weight");
6263 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6264
6265 prop = RNA_def_property(srna, "normalize", PROP_BOOLEAN, PROP_NONE);
6267 prop, nullptr, "proximity_flags", MOD_WVG_PROXIMITY_WEIGHTS_NORMALIZE);
6269 prop,
6270 "Normalize Weights",
6271 "Normalize the resulting weights (otherwise they are only clamped within 0.0 to 1.0 range)");
6272 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6273
6274 prop = RNA_def_property(srna, "map_curve", PROP_POINTER, PROP_NONE);
6275 RNA_def_property_pointer_sdna(prop, nullptr, "cmap_curve");
6276 RNA_def_property_ui_text(prop, "Mapping Curve", "Custom mapping curve");
6277 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6278
6280
6281 /* Common masking properties. */
6283 srna,
6284 "proximity_flags",
6286 "rna_WeightVGProximityModifier_mask_defgrp_name_set",
6287 "rna_WeightVGProximityModifier_mask_tex_uvlayer_name_set");
6288}
6289
6291{
6292 static const EnumPropertyItem mode_items[] = {
6293 {MOD_REMESH_CENTROID, "BLOCKS", 0, "Blocks", "Output a blocky surface with no smoothing"},
6295 "SMOOTH",
6296 0,
6297 "Smooth",
6298 "Output a smooth surface with no sharp-features detection"},
6300 "SHARP",
6301 0,
6302 "Sharp",
6303 "Output a surface that reproduces sharp edges and corners from the input mesh"},
6305 "VOXEL",
6306 0,
6307 "Voxel",
6308 "Output a mesh corresponding to the volume of the original mesh"},
6309 {0, nullptr, 0, nullptr, nullptr},
6310 };
6311
6312 StructRNA *srna;
6313 PropertyRNA *prop;
6314
6315 srna = RNA_def_struct(brna, "RemeshModifier", "Modifier");
6317 srna,
6318 "Remesh Modifier",
6319 "Generate a new surface with regular topology that follows the shape of the input mesh");
6320 RNA_def_struct_sdna(srna, "RemeshModifierData");
6321 RNA_def_struct_ui_icon(srna, ICON_MOD_REMESH);
6322
6324
6325 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
6326 RNA_def_property_enum_items(prop, mode_items);
6327 RNA_def_property_ui_text(prop, "Mode", "");
6329 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6330
6331 prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
6332 RNA_def_property_ui_range(prop, 0, 0.99, 0.01, 3);
6333 RNA_def_property_range(prop, 0, 0.99);
6335 prop, "Scale", "The ratio of the largest dimension of the model over the size of the grid");
6336 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6337
6338 prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
6339 RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
6340 RNA_def_property_range(prop, 0, 1);
6342 prop,
6343 "Threshold",
6344 "If removing disconnected pieces, minimum size of components to preserve as a ratio "
6345 "of the number of polygons in the largest component");
6346 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6347
6348 prop = RNA_def_property(srna, "octree_depth", PROP_INT, PROP_NONE);
6349 RNA_def_property_int_sdna(prop, nullptr, "depth");
6350 RNA_def_property_range(prop, 1, 24);
6351 RNA_def_property_ui_range(prop, 1, 12, 1, 3);
6353 prop, "Octree Depth", "Resolution of the octree; higher values give finer details");
6354 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6355
6356 prop = RNA_def_property(srna, "sharpness", PROP_FLOAT, PROP_NONE);
6357 RNA_def_property_float_sdna(prop, nullptr, "hermite_num");
6358 RNA_def_property_ui_range(prop, 0, 2, 0.1, 3);
6360 prop,
6361 "Sharpness",
6362 "Tolerance for outliers; lower values filter noise while higher values will reproduce "
6363 "edges closer to the input");
6364 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6365
6366 /* NOTE: allow zero (which skips computation), to avoid zero clamping
6367 * to a small value which is likely to run out of memory, see: #130526. */
6368 prop = RNA_def_property(srna, "voxel_size", PROP_FLOAT, PROP_DISTANCE);
6369 RNA_def_property_float_sdna(prop, nullptr, "voxel_size");
6370 RNA_def_property_range(prop, 0.0f, FLT_MAX);
6371 RNA_def_property_ui_range(prop, 0.0001, 2, 0.1, 3);
6374 "Voxel Size",
6375 "Size of the voxel in object space used for volume evaluation. Lower "
6376 "values preserve finer details.");
6377 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6378
6379 prop = RNA_def_property(srna, "adaptivity", PROP_FLOAT, PROP_DISTANCE);
6380 RNA_def_property_float_sdna(prop, nullptr, "adaptivity");
6381 RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
6383 prop,
6384 "Adaptivity",
6385 "Reduces the final face count by simplifying geometry where detail is not needed, "
6386 "generating triangles. A value greater than 0 disables Fix Poles.");
6387 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6388
6389 prop = RNA_def_property(srna, "use_remove_disconnected", PROP_BOOLEAN, PROP_NONE);
6391 RNA_def_property_ui_text(prop, "Remove Disconnected", "");
6392 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6393
6394 prop = RNA_def_property(srna, "use_smooth_shade", PROP_BOOLEAN, PROP_NONE);
6397 prop, "Smooth Shading", "Output faces with smooth shading rather than flat shaded");
6398 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6399
6401}
6402
6404{
6405 StructRNA *srna;
6406 PropertyRNA *prop;
6407
6408 static const EnumPropertyItem geometry_items[] = {
6410 "GENERATE",
6411 0,
6412 "Generate",
6413 "Generate ocean surface geometry at the specified resolution"},
6415 "DISPLACE",
6416 0,
6417 "Displace",
6418 "Displace existing geometry according to simulation"},
6419# if 0
6421 "SIM_ONLY",
6422 0,
6423 "Sim Only",
6424 "Leaves geometry unchanged, but still runs simulation (to be used from texture)"},
6425# endif
6426 {0, nullptr, 0, nullptr, nullptr},
6427 };
6428
6429 static const EnumPropertyItem spectrum_items[] = {
6431 "PHILLIPS",
6432 0,
6433 "Turbulent Ocean",
6434 "Use for turbulent seas with foam"},
6436 "PIERSON_MOSKOWITZ",
6437 0,
6438 "Established Ocean",
6439 "Use for a large area, established ocean (Pierson-Moskowitz method)"},
6441 "JONSWAP",
6442 0,
6443 "Established Ocean (Sharp Peaks)",
6444 "Use for established oceans ('JONSWAP', Pierson-Moskowitz method) with peak sharpening"},
6446 "TEXEL_MARSEN_ARSLOE",
6447 0,
6448 "Shallow Water",
6449 "Use for shallow water ('JONSWAP', 'TMA' - Texel-Marsen-Arsloe method)"},
6450 {0, nullptr, 0, nullptr, nullptr},
6451 };
6452
6453 srna = RNA_def_struct(brna, "OceanModifier", "Modifier");
6454 RNA_def_struct_ui_text(srna, "Ocean Modifier", "Simulate an ocean surface");
6455 RNA_def_struct_sdna(srna, "OceanModifierData");
6456 RNA_def_struct_ui_icon(srna, ICON_MOD_OCEAN);
6457
6459
6460 prop = RNA_def_property(srna, "geometry_mode", PROP_ENUM, PROP_NONE);
6461 RNA_def_property_enum_sdna(prop, nullptr, "geometry_mode");
6462 RNA_def_property_enum_items(prop, geometry_items);
6463 RNA_def_property_ui_text(prop, "Geometry", "Method of modifying geometry");
6464 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6465
6466 prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_UNSIGNED);
6467 RNA_def_property_float_sdna(prop, nullptr, "size");
6469 prop, "Size", "Surface scale factor (does not affect the height of the waves)");
6471 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6472
6473 prop = RNA_def_property(srna, "repeat_x", PROP_INT, PROP_UNSIGNED);
6474 RNA_def_property_int_sdna(prop, nullptr, "repeat_x");
6476 RNA_def_property_range(prop, 1, 1024);
6477 RNA_def_property_ui_range(prop, 1, 100, 1, -1);
6478 RNA_def_property_ui_text(prop, "Repeat X", "Repetitions of the generated surface in X");
6479 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6480
6481 prop = RNA_def_property(srna, "repeat_y", PROP_INT, PROP_UNSIGNED);
6482 RNA_def_property_int_sdna(prop, nullptr, "repeat_y");
6484 RNA_def_property_range(prop, 1, 1024);
6485 RNA_def_property_ui_range(prop, 1, 100, 1, -1);
6486 RNA_def_property_ui_text(prop, "Repeat Y", "Repetitions of the generated surface in Y");
6487 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6488
6489 prop = RNA_def_property(srna, "use_normals", PROP_BOOLEAN, PROP_NONE);
6493 prop,
6494 "Generate Normals",
6495 "Output normals for bump mapping - disabling can speed up performance if it's not needed");
6496 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6497
6498 prop = RNA_def_property(srna, "use_foam", PROP_BOOLEAN, PROP_NONE);
6501 RNA_def_property_ui_text(prop, "Generate Foam", "Generate foam mask as a vertex color channel");
6502 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6503
6504 prop = RNA_def_property(srna, "use_spray", PROP_BOOLEAN, PROP_NONE);
6508 prop, "Generate Spray Map", "Generate map of spray direction as a vertex color channel");
6509 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6510
6511 prop = RNA_def_property(srna, "invert_spray", PROP_BOOLEAN, PROP_NONE);
6514 RNA_def_property_ui_text(prop, "Invert Spray", "Invert the spray direction map");
6515 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6516
6517 prop = RNA_def_property(srna, "spray_layer_name", PROP_STRING, PROP_NONE);
6518 RNA_def_property_string_sdna(prop, nullptr, "spraylayername");
6521 prop, "Spray Map", "Name of the vertex color layer used for the spray direction map");
6522 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6523
6524 prop = RNA_def_property(srna, "resolution", PROP_INT, PROP_UNSIGNED);
6525 RNA_def_property_int_sdna(prop, nullptr, "resolution");
6527 RNA_def_property_range(prop, 1, 1024);
6528 RNA_def_property_ui_range(prop, 1, 32, 1, -1);
6530 prop, "Render Resolution", "Resolution of the generated surface for rendering and baking");
6531 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6532
6533 prop = RNA_def_property(srna, "viewport_resolution", PROP_INT, PROP_UNSIGNED);
6534 RNA_def_property_int_sdna(prop, nullptr, "viewport_resolution");
6536 RNA_def_property_range(prop, 1, 1024);
6537 RNA_def_property_ui_range(prop, 1, 32, 1, -1);
6539 prop, "Viewport Resolution", "Viewport resolution of the generated surface");
6540 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6541
6542 prop = RNA_def_property(srna, "spatial_size", PROP_INT, PROP_NONE);
6543 RNA_def_property_int_sdna(prop, nullptr, "spatial_size");
6544 RNA_def_property_ui_range(prop, 1, 512, 2, -1);
6547 prop,
6548 "Spatial Size",
6549 "Size of the simulation domain (in meters), and of the generated geometry (in BU)");
6550 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6551
6552 prop = RNA_def_property(srna, "wind_velocity", PROP_FLOAT, PROP_VELOCITY);
6553 RNA_def_property_float_sdna(prop, nullptr, "wind_velocity");
6555 RNA_def_property_ui_text(prop, "Wind Velocity", "Wind speed");
6556 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6557
6558 prop = RNA_def_property(srna, "damping", PROP_FLOAT, PROP_FACTOR);
6559 RNA_def_property_float_sdna(prop, nullptr, "damp");
6562 prop, "Damping", "Damp reflected waves going in opposite direction to the wind");
6563 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6564
6565 prop = RNA_def_property(srna, "wave_scale_min", PROP_FLOAT, PROP_DISTANCE);
6566 RNA_def_property_float_sdna(prop, nullptr, "smallest_wave");
6568 RNA_def_property_range(prop, 0.0, FLT_MAX);
6569 RNA_def_property_ui_text(prop, "Smallest Wave", "Shortest allowed wavelength");
6570 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6571
6572 prop = RNA_def_property(srna, "wave_alignment", PROP_FLOAT, PROP_UNSIGNED);
6573 RNA_def_property_float_sdna(prop, nullptr, "wave_alignment");
6575 RNA_def_property_range(prop, 0.0, 1.0);
6576 RNA_def_property_ui_text(prop, "Wave Alignment", "How much the waves are aligned to each other");
6577 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6578
6579 prop = RNA_def_property(srna, "wave_direction", PROP_FLOAT, PROP_ANGLE);
6580 RNA_def_property_float_sdna(prop, nullptr, "wave_direction");
6583 prop, "Wave Direction", "Main direction of the waves when they are (partially) aligned");
6584 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6585
6586 prop = RNA_def_property(srna, "wave_scale", PROP_FLOAT, PROP_UNSIGNED);
6587 RNA_def_property_float_sdna(prop, nullptr, "wave_scale");
6588 RNA_def_property_ui_text(prop, "Wave Scale", "Scale of the displacement effect");
6589 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6590
6591 prop = RNA_def_property(srna, "depth", PROP_FLOAT, PROP_DISTANCE);
6592 RNA_def_property_float_sdna(prop, nullptr, "depth");
6594 RNA_def_property_ui_text(prop, "Depth", "Depth of the solid ground below the water surface");
6595 RNA_def_property_ui_range(prop, 0, 250, 1, -1);
6596 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6597
6598 prop = RNA_def_property(srna, "foam_coverage", PROP_FLOAT, PROP_NONE);
6599 RNA_def_property_float_sdna(prop, nullptr, "foam_coverage");
6600 RNA_def_property_ui_text(prop, "Foam Coverage", "Amount of generated foam");
6601 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6602
6603 prop = RNA_def_property(srna, "bake_foam_fade", PROP_FLOAT, PROP_UNSIGNED);
6604 RNA_def_property_float_sdna(prop, nullptr, "foam_fade");
6607 prop, "Foam Fade", "How much foam accumulates over time (baked ocean only)");
6608 RNA_def_property_ui_range(prop, 0.0, 10.0, 1, -1);
6609 RNA_def_property_update(prop, 0, nullptr);
6610
6611 prop = RNA_def_property(srna, "foam_layer_name", PROP_STRING, PROP_NONE);
6612 RNA_def_property_string_sdna(prop, nullptr, "foamlayername");
6614 prop, "Foam Layer Name", "Name of the vertex color layer used for foam");
6615 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6616
6617 prop = RNA_def_property(srna, "choppiness", PROP_FLOAT, PROP_UNSIGNED);
6618 RNA_def_property_float_sdna(prop, nullptr, "chop_amount");
6620 prop,
6621 "Choppiness",
6622 "Choppiness of the wave's crest (adds some horizontal component to the displacement)");
6623 RNA_def_property_ui_range(prop, 0.0, 4.0, 3, -1);
6624 RNA_def_property_float_funcs(prop, nullptr, "rna_OceanModifier_ocean_chop_set", nullptr);
6625 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6626
6627 prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
6628 RNA_def_property_float_sdna(prop, nullptr, "time");
6629 RNA_def_property_ui_text(prop, "Time", "Current time of the simulation");
6631 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6632
6633 prop = RNA_def_property(srna, "spectrum", PROP_ENUM, PROP_NONE);
6634 RNA_def_property_enum_sdna(prop, nullptr, "spectrum");
6636 RNA_def_property_enum_items(prop, spectrum_items);
6637 RNA_def_property_ui_text(prop, "Spectrum", "Spectrum to use");
6638 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6639
6640 prop = RNA_def_property(srna, "fetch_jonswap", PROP_FLOAT, PROP_UNSIGNED);
6641 RNA_def_property_float_sdna(prop, nullptr, "fetch_jonswap");
6643 RNA_def_property_range(prop, 0.0, FLT_MAX);
6645 prop,
6646 "Fetch",
6647 "This is the distance from a lee shore, "
6648 "called the fetch, or the distance over which the wind blows with constant velocity. "
6649 "Used by 'JONSWAP' and 'TMA' models.");
6650 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6651
6652 prop = RNA_def_property(srna, "sharpen_peak_jonswap", PROP_FLOAT, PROP_UNSIGNED);
6653 RNA_def_property_float_sdna(prop, nullptr, "sharpen_peak_jonswap");
6655 RNA_def_property_range(prop, 0.0, 1.0);
6656 RNA_def_property_ui_text(prop, "Sharpen Peak", "Peak sharpening for 'JONSWAP' and 'TMA' models");
6657 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6658
6659 prop = RNA_def_property(srna, "random_seed", PROP_INT, PROP_UNSIGNED);
6660 RNA_def_property_int_sdna(prop, nullptr, "seed");
6662 RNA_def_property_ui_text(prop, "Random Seed", "Seed of the random generator");
6663 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6664
6665 prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
6666 RNA_def_property_int_sdna(prop, nullptr, "bakestart");
6668 RNA_def_property_ui_text(prop, "Bake Start", "Start frame of the ocean baking");
6669 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6670
6671 prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
6672 RNA_def_property_int_sdna(prop, nullptr, "bakeend");
6674 RNA_def_property_ui_text(prop, "Bake End", "End frame of the ocean baking");
6675 RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update");
6676
6677 prop = RNA_def_property(srna, "is_cached", PROP_BOOLEAN, PROP_NONE);
6678 RNA_def_property_boolean_sdna(prop, nullptr, "cached", 1);
6681 prop, "Ocean is Cached", "Whether the ocean is using cached data or simulating");
6682
6683 /* TODO: rename to `dirpath`. */
6684 prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_DIRPATH);
6685 RNA_def_property_string_sdna(prop, nullptr, "cachepath");
6687 RNA_def_property_ui_text(prop, "Cache Path", "Path to a folder to store external baked images");
6688 // RNA_def_property_update(prop, 0, "rna_Modifier_update");
6689 /* XXX how to update? */
6690
6692}
6693
6695{
6696 StructRNA *srna;
6697 PropertyRNA *prop;
6698
6699 srna = RNA_def_struct(brna, "SkinModifier", "Modifier");
6700 RNA_def_struct_ui_text(srna, "Skin Modifier", "Generate Skin");
6701 RNA_def_struct_sdna(srna, "SkinModifierData");
6702 RNA_def_struct_ui_icon(srna, ICON_MOD_SKIN);
6703
6705
6706 prop = RNA_def_property(srna, "branch_smoothing", PROP_FLOAT, PROP_FACTOR);
6707 RNA_def_property_ui_text(prop, "Branch Smoothing", "Smooth complex geometry around branches");
6708 RNA_def_property_ui_range(prop, 0, 1, 1, -1);
6709 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6710
6711 prop = RNA_def_property(srna, "use_smooth_shade", PROP_BOOLEAN, PROP_NONE);
6714 prop, "Smooth Shading", "Output faces with smooth shading rather than flat shaded");
6715 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6716
6717 prop = RNA_def_property(srna, "use_x_symmetry", PROP_BOOLEAN, PROP_NONE);
6718 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_axes", MOD_SKIN_SYMM_X);
6719 RNA_def_property_ui_text(prop, "X", "Avoid making unsymmetrical quads across the X axis");
6720 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6721
6722 prop = RNA_def_property(srna, "use_y_symmetry", PROP_BOOLEAN, PROP_NONE);
6723 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_axes", MOD_SKIN_SYMM_Y);
6724 RNA_def_property_ui_text(prop, "Y", "Avoid making unsymmetrical quads across the Y axis");
6725 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6726
6727 prop = RNA_def_property(srna, "use_z_symmetry", PROP_BOOLEAN, PROP_NONE);
6728 RNA_def_property_boolean_sdna(prop, nullptr, "symmetry_axes", MOD_SKIN_SYMM_Z);
6729 RNA_def_property_ui_text(prop, "Z", "Avoid making unsymmetrical quads across the Z axis");
6730 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6731
6733}
6734
6736{
6737 StructRNA *srna;
6738 PropertyRNA *prop;
6739
6740 srna = RNA_def_struct(brna, "TriangulateModifier", "Modifier");
6741 RNA_def_struct_ui_text(srna, "Triangulate Modifier", "Triangulate Mesh");
6742 RNA_def_struct_sdna(srna, "TriangulateModifierData");
6743 RNA_def_struct_ui_icon(srna, ICON_MOD_TRIANGULATE);
6744
6746
6747 prop = RNA_def_property(srna, "quad_method", PROP_ENUM, PROP_NONE);
6748 RNA_def_property_enum_sdna(prop, nullptr, "quad_method");
6750 RNA_def_property_ui_text(prop, "Quad Method", "Method for splitting the quads into triangles");
6751 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6752
6753 prop = RNA_def_property(srna, "ngon_method", PROP_ENUM, PROP_NONE);
6754 RNA_def_property_enum_sdna(prop, nullptr, "ngon_method");
6756 RNA_def_property_ui_text(prop, "N-gon Method", "Method for splitting the n-gons into triangles");
6757 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6758
6759 prop = RNA_def_property(srna, "min_vertices", PROP_INT, PROP_UNSIGNED);
6760 RNA_def_property_int_sdna(prop, nullptr, "min_vertices");
6761 RNA_def_property_range(prop, 4, INT_MAX);
6763 prop,
6764 "Minimum Vertices",
6765 "Triangulate only polygons with vertex count greater than or equal to this number");
6766 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6767
6768 prop = RNA_def_property(srna, "keep_custom_normals", PROP_BOOLEAN, PROP_NONE);
6771 prop,
6772 "Keep Normals",
6773 "Try to preserve custom normals.\n"
6774 "Warning: Depending on chosen triangulation method, "
6775 "shading may not be fully preserved, \"Fixed\" method usually gives the best result here");
6776 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6777
6779}
6780
6782{
6783 static const EnumPropertyItem prop_format_type_items[] = {
6784 {MOD_MESHCACHE_TYPE_MDD, "MDD", 0, "MDD", ""},
6785 {MOD_MESHCACHE_TYPE_PC2, "PC2", 0, "PC2", ""},
6786 {0, nullptr, 0, nullptr, nullptr},
6787 };
6788
6789 static const EnumPropertyItem prop_deform_mode_items[] = {
6791 "OVERWRITE",
6792 0,
6793 "Overwrite",
6794 "Replace vertex coordinates with cached values"},
6796 "INTEGRATE",
6797 0,
6798 "Integrate",
6799 "Integrate deformation from this modifier's input with the mesh-cache coordinates "
6800 "(useful for shape keys)"},
6801 {0, nullptr, 0, nullptr, nullptr},
6802 };
6803
6804 static const EnumPropertyItem prop_interpolation_type_items[] = {
6805 {MOD_MESHCACHE_INTERP_NONE, "NONE", 0, "None", ""},
6806 {MOD_MESHCACHE_INTERP_LINEAR, "LINEAR", 0, "Linear", ""},
6807 /* for cardinal we'd need to read 4x cache's */
6808 // {MOD_MESHCACHE_INTERP_CARDINAL, "CARDINAL", 0, "Cardinal", ""},
6809 {0, nullptr, 0, nullptr, nullptr},
6810 };
6811
6812 static const EnumPropertyItem prop_time_type_items[] = {
6813 /* use 'eval_frame' */
6815 "FRAME",
6816 0,
6817 "Frame",
6818 "Control playback using a frame-number "
6819 "(ignoring time FPS and start frame from the file)"},
6820 /* use 'eval_time' */
6821 {MOD_MESHCACHE_TIME_SECONDS, "TIME", 0, "Time", "Control playback using time in seconds"},
6822 /* use 'eval_factor' */
6824 "FACTOR",
6825 0,
6826 "Factor",
6827 "Control playback using a value between 0 and 1"},
6828 {0, nullptr, 0, nullptr, nullptr},
6829 };
6830
6831 static const EnumPropertyItem prop_time_play_items[] = {
6832 {MOD_MESHCACHE_PLAY_CFEA, "SCENE", 0, "Scene", "Use the time from the scene"},
6833 {MOD_MESHCACHE_PLAY_EVAL, "CUSTOM", 0, "Custom", "Use the modifier's own time evaluation"},
6834 {0, nullptr, 0, nullptr, nullptr},
6835 };
6836
6837 StructRNA *srna;
6838 PropertyRNA *prop;
6839
6840 srna = RNA_def_struct(brna, "MeshCacheModifier", "Modifier");
6841 RNA_def_struct_ui_text(srna, "Cache Modifier", "Cache Mesh");
6842 RNA_def_struct_sdna(srna, "MeshCacheModifierData");
6843 RNA_def_struct_ui_icon(srna, ICON_MOD_MESHDEFORM); /* XXX, needs own icon */
6844
6846
6847 prop = RNA_def_property(srna, "cache_format", PROP_ENUM, PROP_NONE);
6848 RNA_def_property_enum_sdna(prop, nullptr, "type");
6849 RNA_def_property_enum_items(prop, prop_format_type_items);
6850 RNA_def_property_ui_text(prop, "Format", "");
6851 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6852
6853 prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
6854 RNA_def_property_enum_sdna(prop, nullptr, "interp");
6855 RNA_def_property_enum_items(prop, prop_interpolation_type_items);
6856 RNA_def_property_ui_text(prop, "Interpolation", "");
6857 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6858
6859 prop = RNA_def_property(srna, "time_mode", PROP_ENUM, PROP_NONE);
6860 RNA_def_property_enum_sdna(prop, nullptr, "time_mode");
6861 RNA_def_property_enum_items(prop, prop_time_type_items);
6862 RNA_def_property_ui_text(prop, "Time Mode", "Method to control playback time");
6863 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6864
6865 prop = RNA_def_property(srna, "play_mode", PROP_ENUM, PROP_NONE);
6866 RNA_def_property_enum_sdna(prop, nullptr, "play_mode");
6867 RNA_def_property_enum_items(prop, prop_time_play_items);
6868 RNA_def_property_ui_text(prop, "Play Mode", "");
6869 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6870
6871 prop = RNA_def_property(srna, "deform_mode", PROP_ENUM, PROP_NONE);
6872 RNA_def_property_enum_sdna(prop, nullptr, "deform_mode");
6873 RNA_def_property_enum_items(prop, prop_deform_mode_items);
6874 RNA_def_property_ui_text(prop, "Deform Mode", "");
6875 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6876
6877 prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
6878 RNA_def_property_ui_text(prop, "File Path", "Path to external displacements file");
6880 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6881
6882 prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
6883 RNA_def_property_float_sdna(prop, nullptr, "factor");
6884 RNA_def_property_range(prop, 0.0f, 1.0f);
6885 RNA_def_property_ui_text(prop, "Influence", "Influence of the deformation");
6886 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6887
6888 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
6889 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
6891 prop,
6892 "Vertex Group",
6893 "Name of the Vertex Group which determines the influence of the modifier per point");
6894 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_MeshCacheModifier_defgrp_name_set");
6895 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6896
6897 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
6899 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
6900 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6901
6902 /* -------------------------------------------------------------------- */
6903 /* Axis Conversion */
6904 prop = RNA_def_property(srna, "forward_axis", PROP_ENUM, PROP_NONE);
6905 RNA_def_property_enum_sdna(prop, nullptr, "forward_axis");
6907 RNA_def_property_ui_text(prop, "Forward", "");
6908 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6909
6910 prop = RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
6911 RNA_def_property_enum_sdna(prop, nullptr, "up_axis");
6913 RNA_def_property_ui_text(prop, "Up", "");
6914 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6915
6916 prop = RNA_def_property(srna, "flip_axis", PROP_BOOLEAN, PROP_NONE);
6918 prop, nullptr, "flip_axis", MOD_MESHCACHE_FLIP_AXIS_X, 3);
6919 RNA_def_property_ui_text(prop, "Flip Axis", "");
6920 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6921
6922 /* -------------------------------------------------------------------- */
6923 /* For Scene time */
6924 prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME);
6925 RNA_def_property_float_sdna(prop, nullptr, "frame_start");
6927 RNA_def_property_ui_text(prop, "Frame Start", "Add this to the start frame");
6928 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6929
6930 prop = RNA_def_property(srna, "frame_scale", PROP_FLOAT, PROP_NONE);
6931 RNA_def_property_float_sdna(prop, nullptr, "frame_scale");
6932 RNA_def_property_range(prop, 0.0f, 100.0f);
6933 RNA_def_property_ui_text(prop, "Frame Scale", "Evaluation time in seconds");
6934 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6935
6936 /* -------------------------------------------------------------------- */
6937 /* eval values depend on 'time_mode' */
6938 prop = RNA_def_property(srna, "eval_frame", PROP_FLOAT, PROP_NONE);
6939 RNA_def_property_float_sdna(prop, nullptr, "eval_frame");
6941 RNA_def_property_ui_text(prop, "Evaluation Frame", "The frame to evaluate (starting at 0)");
6942 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6943
6944 prop = RNA_def_property(srna, "eval_time", PROP_FLOAT, PROP_NONE);
6945 RNA_def_property_float_sdna(prop, nullptr, "eval_time");
6946 RNA_def_property_range(prop, 0.0f, FLT_MAX);
6947 RNA_def_property_ui_text(prop, "Evaluation Time", "Evaluation time in seconds");
6948 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6949
6950 prop = RNA_def_property(srna, "eval_factor", PROP_FLOAT, PROP_FACTOR);
6951 RNA_def_property_float_sdna(prop, nullptr, "eval_factor");
6952 RNA_def_property_range(prop, 0.0f, 1.0f);
6953 RNA_def_property_ui_text(prop, "Evaluation Factor", "Evaluation time in seconds");
6954 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6955
6957}
6958
6960{
6961 StructRNA *srna;
6962 PropertyRNA *prop;
6963
6964 srna = RNA_def_struct(brna, "MeshSequenceCacheModifier", "Modifier");
6965 RNA_def_struct_ui_text(srna, "Cache Modifier", "Cache Mesh");
6966 RNA_def_struct_sdna(srna, "MeshSeqCacheModifierData");
6967 RNA_def_struct_ui_icon(srna, ICON_MOD_MESHDEFORM); /* XXX, needs own icon */
6968
6970
6971 prop = RNA_def_property(srna, "cache_file", PROP_POINTER, PROP_NONE);
6972 RNA_def_property_pointer_sdna(prop, nullptr, "cache_file");
6973 RNA_def_property_struct_type(prop, "CacheFile");
6974 RNA_def_property_ui_text(prop, "Cache File", "");
6976 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
6977
6978 prop = RNA_def_property(srna, "object_path", PROP_STRING, PROP_NONE);
6980 prop,
6981 "Object Path",
6982 "Path to the object in the Alembic archive used to lookup geometric data");
6983 RNA_def_property_update(prop, 0, "rna_Modifier_update");
6984
6985 static const EnumPropertyItem read_flag_items[] = {
6986 {MOD_MESHSEQ_READ_VERT, "VERT", 0, "Vertex", ""},
6987 {MOD_MESHSEQ_READ_POLY, "POLY", 0, "Faces", ""},
6988 {MOD_MESHSEQ_READ_UV, "UV", 0, "UV", ""},
6989 {MOD_MESHSEQ_READ_COLOR, "COLOR", 0, "Color", ""},
6990 {MOD_MESHSEQ_READ_ATTRIBUTES, "ATTRIBUTES", 0, "Attributes", ""},
6991 {0, nullptr, 0, nullptr, nullptr},
6992 };
6993
6994 prop = RNA_def_property(srna, "read_data", PROP_ENUM, PROP_NONE);
6996 RNA_def_property_enum_sdna(prop, nullptr, "read_flag");
6997 RNA_def_property_enum_items(prop, read_flag_items);
6998 RNA_def_property_ui_text(prop, "Read Data", "Data to read from the cache");
6999 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7000
7001 prop = RNA_def_property(srna, "use_vertex_interpolation", PROP_BOOLEAN, PROP_NONE);
7004 prop, "Vertex Interpolation", "Allow interpolation of vertex positions");
7005 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7006
7007 prop = RNA_def_property(srna, "velocity_scale", PROP_FLOAT, PROP_NONE);
7008 RNA_def_property_float_sdna(prop, nullptr, "velocity_scale");
7009 RNA_def_property_range(prop, 0.0f, FLT_MAX);
7011 prop,
7012 "Velocity Scale",
7013 "Multiplier used to control the magnitude of the velocity vectors for time effects");
7014 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7015
7017}
7018
7020{
7021 StructRNA *srna;
7022 PropertyRNA *prop;
7023
7024 srna = RNA_def_struct(brna, "LaplacianDeformModifier", "Modifier");
7025 RNA_def_struct_ui_text(srna, "Laplacian Deform Modifier", "Mesh deform modifier");
7026 RNA_def_struct_sdna(srna, "LaplacianDeformModifierData");
7027 RNA_def_struct_ui_icon(srna, ICON_MOD_MESHDEFORM);
7028
7030
7031 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
7032 RNA_def_property_string_sdna(prop, nullptr, "anchor_grp_name");
7034 prop, "Anchor Weights", "Name of Vertex Group which determines Anchors");
7036 prop, nullptr, nullptr, "rna_LaplacianDeformModifier_anchor_grp_name_set");
7037
7038 prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_UNSIGNED);
7039 RNA_def_property_int_sdna(prop, nullptr, "repeat");
7040 RNA_def_property_ui_range(prop, 1, 50, 1, -1);
7041 RNA_def_property_ui_text(prop, "Repeat", "");
7042 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7043
7044 prop = RNA_def_property(srna, "is_bind", PROP_BOOLEAN, PROP_NONE);
7045 RNA_def_property_boolean_funcs(prop, "rna_LaplacianDeformModifier_is_bind_get", nullptr);
7046 RNA_def_property_ui_text(prop, "Bound", "Whether geometry has been bound to anchors");
7048
7049 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
7051 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
7052 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7053
7055
7056 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7057}
7058
7060{
7061 StructRNA *srna;
7062 PropertyRNA *prop;
7063
7064 static const EnumPropertyItem mode_items[] = {
7065 {MOD_WELD_MODE_ALL, "ALL", 0, "All", "Full merge by distance"},
7066 {MOD_WELD_MODE_CONNECTED, "CONNECTED", 0, "Connected", "Only merge along the edges"},
7067 {0, nullptr, 0, nullptr, nullptr},
7068 };
7069
7070 srna = RNA_def_struct(brna, "WeldModifier", "Modifier");
7071 RNA_def_struct_ui_text(srna, "Weld Modifier", "Weld modifier");
7072 RNA_def_struct_sdna(srna, "WeldModifierData");
7073 RNA_def_struct_ui_icon(srna, ICON_AUTOMERGE_OFF);
7074
7076
7077 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
7078 RNA_def_property_enum_items(prop, mode_items);
7079 RNA_def_property_ui_text(prop, "Mode", "Mode defines the merge rule");
7080 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7081
7082 prop = RNA_def_property(srna, "merge_threshold", PROP_FLOAT, PROP_DISTANCE);
7083 RNA_def_property_float_sdna(prop, nullptr, "merge_dist");
7085 RNA_def_property_ui_range(prop, 0, 1, 0.001, 6);
7086 RNA_def_property_ui_text(prop, "Merge Distance", "Limit below which to merge vertices");
7087 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7088
7089 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
7090 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
7092 prop, "Vertex Group", "Vertex group name for selecting the affected areas");
7093 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_WeldModifier_defgrp_name_set");
7094 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7095
7096 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
7098 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
7099 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7100
7101 prop = RNA_def_property(srna, "loose_edges", PROP_BOOLEAN, PROP_NONE);
7104 prop, "Only Loose Edges", "Collapse edges without faces, cloth sewing edges");
7105 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7106
7108}
7109
7111{
7112 StructRNA *srna;
7113 PropertyRNA *prop;
7114
7115 srna = RNA_def_struct(brna, "WireframeModifier", "Modifier");
7116 RNA_def_struct_ui_text(srna, "Wireframe Modifier", "Wireframe effect modifier");
7117 RNA_def_struct_sdna(srna, "WireframeModifierData");
7118 RNA_def_struct_ui_icon(srna, ICON_MOD_WIREFRAME);
7119
7121
7122 prop = RNA_def_property(srna, "thickness", PROP_FLOAT, PROP_DISTANCE);
7123 RNA_def_property_float_sdna(prop, nullptr, "offset");
7125 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 4);
7126 RNA_def_property_ui_text(prop, "Thickness", "Thickness factor");
7127 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7128
7129 prop = RNA_def_property(srna, "thickness_vertex_group", PROP_FLOAT, PROP_FACTOR);
7130 RNA_def_property_float_sdna(prop, nullptr, "offset_fac_vg");
7131 RNA_def_property_range(prop, 0.0, 1.0);
7132 RNA_def_property_ui_range(prop, 0, 1, 0.1, 3);
7134 prop, "Vertex Group Factor", "Thickness factor to use for zero vertex group influence");
7135 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7136
7137 prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_FACTOR);
7138 RNA_def_property_float_sdna(prop, nullptr, "offset_fac");
7140 RNA_def_property_ui_range(prop, -1, 1, 0.1, 4);
7141 RNA_def_property_ui_text(prop, "Offset", "Offset the thickness from the center");
7142 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7143
7144 prop = RNA_def_property(srna, "use_replace", PROP_BOOLEAN, PROP_NONE);
7146 RNA_def_property_ui_text(prop, "Replace", "Remove original geometry");
7147 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7148
7149 prop = RNA_def_property(srna, "use_boundary", PROP_BOOLEAN, PROP_NONE);
7151 RNA_def_property_ui_text(prop, "Boundary", "Support face boundaries");
7152 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7153
7154 prop = RNA_def_property(srna, "use_even_offset", PROP_BOOLEAN, PROP_NONE);
7156 RNA_def_property_ui_text(prop, "Offset Even", "Scale the offset to give more even thickness");
7157 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7158
7159 prop = RNA_def_property(srna, "use_relative_offset", PROP_BOOLEAN, PROP_NONE);
7161 RNA_def_property_ui_text(prop, "Offset Relative", "Scale the offset by surrounding geometry");
7162 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7163
7164 prop = RNA_def_property(srna, "use_crease", PROP_BOOLEAN, PROP_NONE);
7167 prop, "Offset Relative", "Crease hub edges for improved subdivision surface");
7168 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7169
7170 prop = RNA_def_property(srna, "crease_weight", PROP_FLOAT, PROP_NONE);
7171 RNA_def_property_float_sdna(prop, nullptr, "crease_weight");
7173 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 1);
7174 RNA_def_property_ui_text(prop, "Weight", "Crease weight (if active)");
7175 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7176
7177 prop = RNA_def_property(srna, "material_offset", PROP_INT, PROP_NONE);
7178 RNA_def_property_int_sdna(prop, nullptr, "mat_ofs");
7179 RNA_def_property_range(prop, SHRT_MIN, SHRT_MAX);
7180 RNA_def_property_ui_text(prop, "Material Offset", "Offset material index of generated faces");
7181 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7182
7183 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
7184 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
7186 prop, "Vertex Group", "Vertex group name for selecting the affected areas");
7187 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_WireframeModifier_defgrp_name_set");
7188 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7189
7190 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
7192 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
7193 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7194
7196}
7197
7199{
7200 StructRNA *srna;
7201 PropertyRNA *prop;
7202
7203 static const EnumPropertyItem DT_layer_vert_items[] = {
7205 "VGROUP_WEIGHTS",
7206 0,
7207 "Vertex Groups",
7208 "Transfer active or all vertex groups"},
7209 {DT_TYPE_BWEIGHT_VERT, "BEVEL_WEIGHT_VERT", 0, "Bevel Weight", "Transfer bevel weights"},
7211 "COLOR_VERTEX",
7212 0,
7213 "Colors",
7214 "Transfer color attributes"},
7215 {0, nullptr, 0, nullptr, nullptr},
7216 };
7217
7218 static const EnumPropertyItem DT_layer_edge_items[] = {
7219 {DT_TYPE_SHARP_EDGE, "SHARP_EDGE", 0, "Sharp", "Transfer sharp mark"},
7220 {DT_TYPE_SEAM, "SEAM", 0, "UV Seam", "Transfer UV seam mark"},
7221 {DT_TYPE_CREASE, "CREASE", 0, "Crease", "Transfer subdivision crease values"},
7222 {DT_TYPE_BWEIGHT_EDGE, "BEVEL_WEIGHT_EDGE", 0, "Bevel Weight", "Transfer bevel weights"},
7223 {DT_TYPE_FREESTYLE_EDGE, "FREESTYLE_EDGE", 0, "Freestyle", "Transfer Freestyle edge mark"},
7224 {0, nullptr, 0, nullptr, nullptr},
7225 };
7226
7227 static const EnumPropertyItem DT_layer_loop_items[] = {
7228 {DT_TYPE_LNOR, "CUSTOM_NORMAL", 0, "Custom Normals", "Transfer custom normals"},
7230 "COLOR_CORNER",
7231 0,
7232 "Colors",
7233 "Transfer color attributes"},
7234 {DT_TYPE_UV, "UV", 0, "UVs", "Transfer UV layers"},
7235 {0, nullptr, 0, nullptr, nullptr},
7236 };
7237
7238 static const EnumPropertyItem DT_layer_poly_items[] = {
7239 {DT_TYPE_SHARP_FACE, "SMOOTH", 0, "Smooth", "Transfer flat/smooth mark"},
7241 "FREESTYLE_FACE",
7242 0,
7243 "Freestyle Mark",
7244 "Transfer Freestyle face mark"},
7245 {0, nullptr, 0, nullptr, nullptr},
7246 };
7247
7248 srna = RNA_def_struct(brna, "DataTransferModifier", "Modifier");
7250 srna, "Data Transfer Modifier", "Modifier transferring some data from a source mesh");
7251 RNA_def_struct_sdna(srna, "DataTransferModifierData");
7252 RNA_def_struct_ui_icon(srna, ICON_MOD_DATA_TRANSFER);
7253
7255
7256 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
7257 RNA_def_property_pointer_sdna(prop, nullptr, "ob_source");
7258 RNA_def_property_ui_text(prop, "Source Object", "Object to transfer data from");
7261 prop, nullptr, "rna_DataTransferModifier_ob_source_set", nullptr, "rna_Mesh_object_poll");
7262 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
7263
7264 prop = RNA_def_boolean(srna,
7265 "use_object_transform",
7266 true,
7267 "Object Transform",
7268 "Evaluate source and destination meshes in global space");
7270 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7271
7272 /* Generic, UI-only data types toggles. */
7273 prop = RNA_def_boolean(
7274 srna, "use_vert_data", false, "Vertex Data", "Enable vertex data transfer");
7276 RNA_def_property_update(prop, 0, "rna_DataTransferModifier_use_data_update");
7277
7278 prop = RNA_def_boolean(srna, "use_edge_data", false, "Edge Data", "Enable edge data transfer");
7280 RNA_def_property_update(prop, 0, "rna_DataTransferModifier_use_data_update");
7281
7282 prop = RNA_def_boolean(
7283 srna, "use_loop_data", false, "Face Corner Data", "Enable face corner data transfer");
7285 RNA_def_property_update(prop, 0, "rna_DataTransferModifier_use_data_update");
7286
7287 prop = RNA_def_boolean(srna, "use_poly_data", false, "Face Data", "Enable face data transfer");
7289 RNA_def_property_update(prop, 0, "rna_DataTransferModifier_use_data_update");
7290
7291 /* Actual data types selection. */
7292 prop = RNA_def_enum_flag(srna,
7293 "data_types_verts",
7294 DT_layer_vert_items,
7295 0,
7296 "Vertex Data Types",
7297 "Which vertex data layers to transfer");
7298 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "data_types");
7299 RNA_def_property_update(prop, 0, "rna_DataTransferModifier_data_types_update");
7300
7301 prop = RNA_def_enum_flag(srna,
7302 "data_types_edges",
7303 DT_layer_edge_items,
7304 0,
7305 "Edge Data Types",
7306 "Which edge data layers to transfer");
7307 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "data_types");
7308 RNA_def_property_update(prop, 0, "rna_DataTransferModifier_data_types_update");
7309
7310 prop = RNA_def_enum_flag(srna,
7311 "data_types_loops",
7312 DT_layer_loop_items,
7313 0,
7314 "Face Corner Data Types",
7315 "Which face corner data layers to transfer");
7316 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "data_types");
7317 RNA_def_property_update(prop, 0, "rna_DataTransferModifier_data_types_update");
7318
7319 prop = RNA_def_enum_flag(srna,
7320 "data_types_polys",
7321 DT_layer_poly_items,
7322 0,
7323 "Poly Data Types",
7324 "Which face data layers to transfer");
7325 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "data_types");
7326 RNA_def_property_update(prop, 0, "rna_DataTransferModifier_data_types_update");
7327
7328 /* Mapping methods. */
7329 prop = RNA_def_enum(srna,
7330 "vert_mapping",
7333 "Vertex Mapping",
7334 "Method used to map source vertices to destination ones");
7335 RNA_def_property_enum_sdna(prop, nullptr, "vmap_mode");
7336 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7337
7338 prop = RNA_def_enum(srna,
7339 "edge_mapping",
7342 "Edge Mapping",
7343 "Method used to map source edges to destination ones");
7344 RNA_def_property_enum_sdna(prop, nullptr, "emap_mode");
7345 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7346
7347 prop = RNA_def_enum(srna,
7348 "loop_mapping",
7351 "Face Corner Mapping",
7352 "Method used to map source faces' corners to destination ones");
7353 RNA_def_property_enum_sdna(prop, nullptr, "lmap_mode");
7354 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7355
7356 prop = RNA_def_enum(srna,
7357 "poly_mapping",
7360 "Face Mapping",
7361 "Method used to map source faces to destination ones");
7362 RNA_def_property_enum_sdna(prop, nullptr, "pmap_mode");
7363 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7364
7365 /* Mapping options and filtering. */
7366 prop = RNA_def_boolean(
7367 srna,
7368 "use_max_distance",
7369 false,
7370 "Only Neighbor Geometry",
7371 "Source elements must be closer than given distance from destination one");
7373 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7374
7375 prop = RNA_def_float(
7376 srna,
7377 "max_distance",
7378 1.0f,
7379 0.0f,
7380 FLT_MAX,
7381 "Max Distance",
7382 "Maximum allowed distance between source and destination element, for non-topology mappings",
7383 0.0f,
7384 100.0f);
7385 RNA_def_property_float_sdna(prop, nullptr, "map_max_distance");
7387 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7388
7389 prop = RNA_def_float(
7390 srna,
7391 "ray_radius",
7392 0.0f,
7393 0.0f,
7394 FLT_MAX,
7395 "Ray Radius",
7396 "'Width' of rays (especially useful when raycasting against vertices or edges)",
7397 0.0f,
7398 10.0f);
7399 RNA_def_property_float_sdna(prop, nullptr, "map_ray_radius");
7401 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7402
7403 prop = RNA_def_float(
7404 srna,
7405 "islands_precision",
7406 0.0f,
7407 0.0f,
7408 1.0f,
7409 "Islands Precision",
7410 "Factor controlling precision of islands handling "
7411 "(typically, 0.1 should be enough, higher values can make things really slow)",
7412 0.0f,
7413 1.0f);
7415 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7416
7417 /* How to handle multi-layers types of data. */
7418 prop = RNA_def_enum(srna,
7419 "layers_vgroup_select_src",
7422 "Source Layers Selection",
7423 "Which layers to transfer, in case of multi-layers types");
7424 RNA_def_property_enum_sdna(prop, nullptr, "layers_select_src[DT_MULTILAYER_INDEX_MDEFORMVERT]");
7426 prop, nullptr, nullptr, "rna_DataTransferModifier_layers_select_src_itemf");
7427 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7428
7429 prop = RNA_def_enum(srna,
7430 "layers_vcol_vert_select_src",
7433 "Source Layers Selection",
7434 "Which layers to transfer, in case of multi-layers types");
7435 RNA_def_property_enum_sdna(prop, nullptr, "layers_select_src[DT_MULTILAYER_INDEX_VCOL_VERT]");
7437 prop, nullptr, nullptr, "rna_DataTransferModifier_layers_select_src_itemf");
7438 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7439
7440 prop = RNA_def_enum(srna,
7441 "layers_vcol_loop_select_src",
7444 "Source Layers Selection",
7445 "Which layers to transfer, in case of multi-layers types");
7446 RNA_def_property_enum_sdna(prop, nullptr, "layers_select_src[DT_MULTILAYER_INDEX_VCOL_LOOP]");
7448 prop, nullptr, nullptr, "rna_DataTransferModifier_layers_select_src_itemf");
7449 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7450
7451 prop = RNA_def_enum(srna,
7452 "layers_uv_select_src",
7455 "Source Layers Selection",
7456 "Which layers to transfer, in case of multi-layers types");
7457 RNA_def_property_enum_sdna(prop, nullptr, "layers_select_src[DT_MULTILAYER_INDEX_UV]");
7459 prop, nullptr, nullptr, "rna_DataTransferModifier_layers_select_src_itemf");
7460 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7461
7462 prop = RNA_def_enum(srna,
7463 "layers_vgroup_select_dst",
7466 "Destination Layers Matching",
7467 "How to match source and destination layers");
7468 RNA_def_property_enum_sdna(prop, nullptr, "layers_select_dst[DT_MULTILAYER_INDEX_MDEFORMVERT]");
7470 prop, nullptr, nullptr, "rna_DataTransferModifier_layers_select_dst_itemf");
7471 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7472
7473 prop = RNA_def_enum(srna,
7474 "layers_vcol_vert_select_dst",
7477 "Destination Layers Matching",
7478 "How to match source and destination layers");
7479 RNA_def_property_enum_sdna(prop, nullptr, "layers_select_dst[DT_MULTILAYER_INDEX_VCOL_VERT]");
7481 prop, nullptr, nullptr, "rna_DataTransferModifier_layers_select_dst_itemf");
7482 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7483
7484 prop = RNA_def_enum(srna,
7485 "layers_vcol_loop_select_dst",
7488 "Destination Layers Matching",
7489 "How to match source and destination layers");
7490 RNA_def_property_enum_sdna(prop, nullptr, "layers_select_dst[DT_MULTILAYER_INDEX_VCOL_LOOP]");
7492 prop, nullptr, nullptr, "rna_DataTransferModifier_layers_select_dst_itemf");
7493 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7494
7495 prop = RNA_def_enum(srna,
7496 "layers_uv_select_dst",
7499 "Destination Layers Matching",
7500 "How to match source and destination layers");
7501 RNA_def_property_enum_sdna(prop, nullptr, "layers_select_dst[DT_MULTILAYER_INDEX_UV]");
7503 prop, nullptr, nullptr, "rna_DataTransferModifier_layers_select_dst_itemf");
7504 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7505
7506 /* Mix stuff */
7507 prop = RNA_def_enum(srna,
7508 "mix_mode",
7511 "Mix Mode",
7512 "How to affect destination elements with source values");
7513 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_DataTransferModifier_mix_mode_itemf");
7514 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7515
7516 prop = RNA_def_float_factor(
7517 srna,
7518 "mix_factor",
7519 0.0f,
7520 0.0f,
7521 1.0f,
7522 "Mix Factor",
7523 "Factor to use when applying data to destination (exact behavior depends on mix mode, "
7524 "multiplied with weights from vertex group when defined)",
7525 0.0f,
7526 1.0f);
7527 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7528
7529 prop = RNA_def_string(srna,
7530 "vertex_group",
7531 nullptr,
7533 "Vertex Group",
7534 "Vertex group name for selecting the affected areas");
7535 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
7537 prop, nullptr, nullptr, "rna_DataTransferModifier_defgrp_name_set");
7538 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7539
7540 prop = RNA_def_boolean(
7541 srna, "invert_vertex_group", false, "Invert", "Invert vertex group influence");
7543 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7544
7546}
7547
7549{
7550 StructRNA *srna;
7551 PropertyRNA *prop;
7552
7553 static const EnumPropertyItem prop_mode_items[] = {
7555 "RADIAL",
7556 0,
7557 "Radial",
7558 "From an ellipsoid (shape defined by the boundbox's dimensions, target is optional)"},
7560 "DIRECTIONAL",
7561 0,
7562 "Directional",
7563 "Normals 'track' (point to) the target object"},
7564 {0, nullptr, 0, nullptr, nullptr},
7565 };
7566
7567 static const EnumPropertyItem prop_mix_mode_items[] = {
7568 {MOD_NORMALEDIT_MIX_COPY, "COPY", 0, "Copy", "Copy new normals (overwrite existing)"},
7569 {MOD_NORMALEDIT_MIX_ADD, "ADD", 0, "Add", "Copy sum of new and old normals"},
7570 {MOD_NORMALEDIT_MIX_SUB, "SUB", 0, "Subtract", "Copy new normals minus old normals"},
7572 "MUL",
7573 0,
7574 "Multiply",
7575 "Copy product of old and new normals (not cross product)"},
7576 {0, nullptr, 0, nullptr, nullptr},
7577 };
7578
7579 srna = RNA_def_struct(brna, "NormalEditModifier", "Modifier");
7581 srna, "Normal Edit Modifier", "Modifier affecting/generating custom normals");
7582 RNA_def_struct_sdna(srna, "NormalEditModifierData");
7583 RNA_def_struct_ui_icon(srna, ICON_MOD_NORMALEDIT);
7584
7586
7587 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
7588 RNA_def_property_enum_items(prop, prop_mode_items);
7589 RNA_def_property_ui_text(prop, "Mode", "How to affect (generate) normals");
7590 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7591
7592 prop = RNA_def_float_array(srna,
7593 "offset",
7594 3,
7595 nullptr,
7596 -FLT_MAX,
7597 FLT_MAX,
7598 "Offset",
7599 "Offset from object's center",
7600 -100.0f,
7601 100.0f);
7603 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7604
7605 prop = RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
7606 RNA_def_property_enum_items(prop, prop_mix_mode_items);
7607 RNA_def_property_ui_text(prop, "Mix Mode", "How to mix generated normals with existing ones");
7608 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7609
7610 prop = RNA_def_property(srna, "mix_factor", PROP_FLOAT, PROP_FACTOR);
7611 RNA_def_property_range(prop, 0.0, 1.0);
7613 prop, "Mix Factor", "How much of generated normals to mix with existing ones");
7614 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7615
7616 prop = RNA_def_property(srna, "mix_limit", PROP_FLOAT, PROP_ANGLE);
7617 RNA_def_property_range(prop, 0.0, DEG2RADF(180.0f));
7618 RNA_def_property_ui_text(prop, "Max Angle", "Maximum angle between old and new normals");
7619 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7620
7621 prop = RNA_def_property(srna, "no_polynors_fix", PROP_BOOLEAN, PROP_NONE);
7625 "Lock Polygon Normals",
7626 "Do not flip polygons when their normals are not consistent "
7627 "with their newly computed custom vertex normals");
7628 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7629
7630 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
7631 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
7633 prop, "Vertex Group", "Vertex group name for selecting/weighting the affected areas");
7634 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_NormalEditModifier_defgrp_name_set");
7635 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7636
7637 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
7639 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
7640 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7641
7642 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
7643 RNA_def_property_ui_text(prop, "Target", "Target object used to affect normals");
7645 prop, nullptr, "rna_NormalEditModifier_target_set", nullptr, nullptr);
7647 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
7648
7649 prop = RNA_def_property(srna, "use_direction_parallel", PROP_BOOLEAN, PROP_NONE);
7653 "Parallel Normals",
7654 "Use same direction for all normals, from origin to target's center "
7655 "(Directional mode only)");
7656 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7657
7659}
7660
7662{
7663 StructRNA *srna;
7664 PropertyRNA *prop;
7665
7666 srna = RNA_def_struct(brna, "SurfaceDeformModifier", "Modifier");
7667 RNA_def_struct_ui_text(srna, "SurfaceDeform Modifier", "");
7668 RNA_def_struct_sdna(srna, "SurfaceDeformModifierData");
7669 RNA_def_struct_ui_icon(srna, ICON_MOD_MESHDEFORM);
7670
7672
7673 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
7674 RNA_def_property_ui_text(prop, "Target", "Mesh object to deform with");
7676 prop, nullptr, "rna_SurfaceDeformModifier_target_set", nullptr, "rna_Mesh_object_poll");
7678 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
7679
7680 prop = RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
7681 RNA_def_property_range(prop, 2.0f, 16.0f);
7683 prop, "Interpolation Falloff", "Controls how much nearby polygons influence deformation");
7684 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7685
7686 prop = RNA_def_property(srna, "is_bound", PROP_BOOLEAN, PROP_NONE);
7687 RNA_def_property_boolean_funcs(prop, "rna_SurfaceDeformModifier_is_bound_get", nullptr);
7688 RNA_def_property_ui_text(prop, "Bound", "Whether geometry has been bound to target mesh");
7690
7691 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
7692 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
7694 prop, "Vertex Group", "Vertex group name for selecting/weighting the affected areas");
7696 prop, nullptr, nullptr, "rna_SurfaceDeformModifier_defgrp_name_set");
7697 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7698
7699 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
7701 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
7702 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7703
7704 prop = RNA_def_property(srna, "use_sparse_bind", PROP_BOOLEAN, PROP_NONE);
7705 RNA_def_property_boolean_sdna(prop, nullptr, "flags", MOD_SDEF_SPARSE_BIND);
7708 prop,
7709 "Sparse Bind",
7710 "Only record binding data for vertices matching the vertex group at the time of bind");
7711 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7712
7713 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
7714 RNA_def_property_range(prop, -100, 100);
7715 RNA_def_property_ui_range(prop, -100, 100, 10, 2);
7716 RNA_def_property_ui_text(prop, "Strength", "Strength of modifier deformations");
7717 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7718
7720}
7721
7723{
7724 StructRNA *srna;
7725 PropertyRNA *prop;
7726
7727 static EnumPropertyItem prop_weighting_mode_items[] = {
7729 "FACE_AREA",
7730 0,
7731 "Face Area",
7732 "Generate face area weighted normals"},
7734 "CORNER_ANGLE",
7735 0,
7736 "Corner Angle",
7737 "Generate corner angle weighted normals"},
7739 "FACE_AREA_WITH_ANGLE",
7740 0,
7741 "Face Area & Angle",
7742 "Generated normals weighted by both face area and angle"},
7743 {0, nullptr, 0, nullptr, nullptr},
7744 };
7745
7746 srna = RNA_def_struct(brna, "WeightedNormalModifier", "Modifier");
7747 RNA_def_struct_ui_text(srna, "WeightedNormal Modifier", "");
7748 RNA_def_struct_sdna(srna, "WeightedNormalModifierData");
7749 RNA_def_struct_ui_icon(srna, ICON_MOD_NORMALEDIT);
7750
7752
7753 prop = RNA_def_property(srna, "weight", PROP_INT, PROP_NONE);
7754 RNA_def_property_range(prop, 1, 100);
7755 RNA_def_property_ui_range(prop, 1, 100, 1, -1);
7757 "Weight",
7758 "Corrective factor applied to faces' weights, 50 is neutral, "
7759 "lower values increase weight of weak faces, "
7760 "higher values increase weight of strong faces");
7761 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7762
7763 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
7764 RNA_def_property_enum_items(prop, prop_weighting_mode_items);
7765 RNA_def_property_ui_text(prop, "Weighting Mode", "Weighted vertex normal mode to use");
7766 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7767
7768 prop = RNA_def_property(srna, "thresh", PROP_FLOAT, PROP_NONE);
7769 RNA_def_property_range(prop, 0, 10);
7770 RNA_def_property_ui_range(prop, 0, 10, 1, 2);
7772 prop, "Threshold", "Threshold value for different weights to be considered equal");
7773 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7774
7775 prop = RNA_def_property(srna, "keep_sharp", PROP_BOOLEAN, PROP_NONE);
7778 "Keep Sharp",
7779 "Keep sharp edges as computed for default custom normals, "
7780 "instead of setting a single weighted normal for each vertex");
7781 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7782
7783 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
7784 RNA_def_property_string_sdna(prop, nullptr, "defgrp_name");
7786 prop, "Vertex Group", "Vertex group name for modifying the selected areas");
7788 prop, nullptr, nullptr, "rna_WeightedNormalModifier_defgrp_name_set");
7789 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7790
7791 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
7793 RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence");
7794 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7795
7796 prop = RNA_def_property(srna, "use_face_influence", PROP_BOOLEAN, PROP_NONE);
7798 RNA_def_property_ui_text(prop, "Face Influence", "Use influence of face for weighting");
7799 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7800
7802}
7803
7805{
7806 StructRNA *srna;
7807 PropertyRNA *prop;
7808
7809 srna = RNA_def_struct(brna, "NodesModifierDataBlock", nullptr);
7810 RNA_def_struct_sdna(srna, "NodesModifierDataBlock");
7811
7813
7814 prop = RNA_def_property(srna, "id_name", PROP_STRING, PROP_NONE);
7817 prop, "Data-Block Name", "Name that is mapped to the referenced data-block");
7818 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7819
7820 prop = RNA_def_property(srna, "lib_name", PROP_STRING, PROP_NONE);
7823 "Library Name",
7824 "Used when the data block is not local to the current .blend file but "
7825 "is linked from some library");
7826 RNA_def_property_update(prop, 0, "rna_Modifier_update");
7827
7828 prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
7829 RNA_def_property_struct_type(prop, "ID");
7832 prop, nullptr, nullptr, "rna_NodesModifierBake_data_block_typef", nullptr);
7833 RNA_def_property_ui_text(prop, "Data-Block", "");
7834 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
7835
7836 prop = RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE);
7840
7842}
7843
7845{
7846 StructRNA *srna;
7847 PropertyRNA *prop;
7848
7849 srna = RNA_def_struct(brna, "NodesModifierBakeDataBlocks", nullptr);
7850 RNA_def_struct_sdna(srna, "NodesModifierBake");
7852 srna, "Data-Blocks", "Collection of data-blocks that can be referenced by baked data");
7853
7854 prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
7855 RNA_def_property_int_sdna(prop, nullptr, "active_data_block");
7856}
7857
7860 "INHERIT",
7861 0,
7862 "Inherit from Modifier",
7863 "Use setting from the modifier"},
7865 "PACKED",
7866 0,
7867 "Packed",
7868 "Pack the baked data into the .blend file"},
7870 "DISK",
7871 0,
7872 "Disk",
7873 "Store the baked data in a directory on disk"},
7874 {0, nullptr, 0, nullptr, nullptr},
7875};
7876
7879 "PACKED",
7880 0,
7881 "Packed",
7882 "Pack the baked data into the .blend file"},
7884 "DISK",
7885 0,
7886 "Disk",
7887 "Store the baked data in a directory on disk"},
7888 {0, nullptr, 0, nullptr, nullptr},
7889};
7890
7892{
7894
7895 static EnumPropertyItem bake_mode_items[] = {
7896 {NODES_MODIFIER_BAKE_MODE_ANIMATION, "ANIMATION", 0, "Animation", "Bake a frame range"},
7897 {NODES_MODIFIER_BAKE_MODE_STILL, "STILL", 0, "Still", "Bake a single frame"},
7898 {0, nullptr, 0, nullptr, nullptr},
7899 };
7900
7901 StructRNA *srna;
7902 PropertyRNA *prop;
7903
7905
7906 srna = RNA_def_struct(brna, "NodesModifierBake", nullptr);
7907 RNA_def_struct_ui_text(srna, "Nodes Modifier Bake", "");
7908
7909 prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
7911 RNA_def_property_ui_text(prop, "Directory", "Location on disk where the bake data is stored");
7912 RNA_def_property_update(prop, 0, "rna_NodesModifier_bake_update");
7913
7914 prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
7915 RNA_def_property_ui_text(prop, "Start Frame", "Frame where the baking starts");
7916 RNA_def_property_update(prop, 0, "rna_NodesModifier_bake_update");
7917
7918 prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
7919 RNA_def_property_ui_text(prop, "End Frame", "Frame where the baking ends");
7920 RNA_def_property_update(prop, 0, "rna_NodesModifier_bake_update");
7921
7922 prop = RNA_def_property(srna, "use_custom_simulation_frame_range", PROP_BOOLEAN, PROP_NONE);
7926 prop, "Custom Simulation Frame Range", "Override the simulation frame range from the scene");
7927 RNA_def_property_update(prop, 0, "rna_NodesModifier_bake_update");
7928
7929 prop = RNA_def_property(srna, "use_custom_path", PROP_BOOLEAN, PROP_NONE);
7932 prop, "Custom Path", "Specify a path where the baked data should be stored manually");
7933 RNA_def_property_update(prop, 0, "rna_NodesModifier_bake_update");
7934
7935 prop = RNA_def_property(srna, "bake_target", PROP_ENUM, PROP_NONE);
7937 RNA_def_property_ui_text(prop, "Bake Target", "Where to store the baked data");
7939 RNA_def_property_update(prop, 0, "rna_NodesModifier_bake_update");
7940
7941 prop = RNA_def_property(srna, "bake_mode", PROP_ENUM, PROP_NONE);
7942 RNA_def_property_enum_items(prop, bake_mode_items);
7943 RNA_def_property_ui_text(prop, "Bake Mode", "");
7944 RNA_def_property_update(prop, 0, "rna_NodesModifier_bake_update");
7945
7946 prop = RNA_def_property(srna, "bake_id", PROP_INT, PROP_NONE);
7948 "Bake ID",
7949 "Identifier for this bake which remains unchanged even when the bake "
7950 "node is renamed, grouped or ungrouped");
7951 RNA_def_property_int_sdna(prop, nullptr, "id");
7953
7954 prop = RNA_def_property(srna, "node", PROP_POINTER, PROP_NONE);
7955 RNA_def_property_struct_type(prop, "Node");
7957 "Node",
7958 "Bake node or simulation output node that corresponds to this bake. "
7959 "This node may be deeply nested in the modifier node group. It can be "
7960 "none in some cases like missing linked data blocks.");
7962 prop, "rna_NodesModifierBake_node_get", nullptr, nullptr, nullptr);
7963
7964 prop = RNA_def_property(srna, "data_blocks", PROP_COLLECTION, PROP_NONE);
7965 RNA_def_property_struct_type(prop, "NodesModifierDataBlock");
7966 RNA_def_property_collection_sdna(prop, nullptr, "data_blocks", "data_blocks_num");
7967 RNA_def_property_srna(prop, "NodesModifierBakeDataBlocks");
7969
7971}
7972
7974{
7975 StructRNA *srna;
7976
7977 srna = RNA_def_struct(brna, "NodesModifierBakes", nullptr);
7978 RNA_def_struct_sdna(srna, "NodesModifierData");
7979 RNA_def_struct_ui_text(srna, "Bakes", "Bake data for every bake node");
7980}
7981
7983{
7984 StructRNA *srna;
7985 PropertyRNA *prop;
7986
7987 srna = RNA_def_struct(brna, "NodesModifierPanel", nullptr);
7988 RNA_def_struct_ui_text(srna, "Nodes Modifier Panel", "");
7989
7990 prop = RNA_def_property(srna, "is_open", PROP_BOOLEAN, PROP_NONE);
7992 RNA_def_property_ui_text(prop, "Is Open", "Whether the panel is expanded or closed");
7995}
7996
7998{
7999 StructRNA *srna;
8000
8001 srna = RNA_def_struct(brna, "NodesModifierPanels", nullptr);
8002 RNA_def_struct_sdna(srna, "NodesModifierData");
8003 RNA_def_struct_ui_text(srna, "Panels", "State of all panels defined by the node group");
8004}
8005
8007{
8008 StructRNA *srna;
8009 PropertyRNA *prop;
8010
8011 srna = RNA_def_struct(brna, "NodesModifierWarning", nullptr);
8013 "Nodes Modifier Warning",
8014 "Warning created during evaluation of a geometry nodes modifier");
8015
8016 prop = RNA_def_property(srna, "message", PROP_STRING, PROP_NONE);
8017 RNA_def_property_ui_text(prop, "Message", nullptr);
8020 "rna_NodesModifierWarning_message_get",
8021 "rna_NodesModifierWarning_message_length",
8022 nullptr);
8023
8024 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
8025 RNA_def_property_ui_text(prop, "Type", nullptr);
8028 RNA_def_property_enum_funcs(prop, "rna_NodesModifierWarning_type_get", nullptr, nullptr);
8029}
8030
8032{
8033 StructRNA *srna;
8034 PropertyRNA *prop;
8035
8037
8040
8043
8045
8046 srna = RNA_def_struct(brna, "NodesModifier", "Modifier");
8047 RNA_def_struct_ui_text(srna, "Nodes Modifier", "");
8048 RNA_def_struct_sdna(srna, "NodesModifierData");
8049 /* NOTE: `RNA_def_struct_idprops_func` should be removed once #132129 is implemented.
8050 * Similar to the issue with Operator (for node tools), see #rna_def_operator. */
8051 RNA_def_struct_idprops_func(srna, "rna_NodesModifier_properties");
8052 RNA_def_struct_system_idprops_func(srna, "rna_NodesModifier_properties");
8053 RNA_def_struct_ui_icon(srna, ICON_GEOMETRY_NODES);
8054
8056
8057 prop = RNA_def_property(srna, "node_group", PROP_POINTER, PROP_NONE);
8058 RNA_def_property_ui_text(prop, "Node Group", "Node group that controls what this modifier does");
8060 prop, nullptr, nullptr, nullptr, "rna_NodesModifier_node_group_poll");
8062 RNA_def_property_update(prop, 0, "rna_NodesModifier_node_group_update");
8063
8064 prop = RNA_def_property(srna, "bake_directory", PROP_STRING, PROP_DIRPATH);
8067 prop, "Simulation Bake Directory", "Location on disk where the bake data is stored");
8068 RNA_def_property_update(prop, 0, "rna_NodesModifier_bake_update");
8069
8070 prop = RNA_def_property(srna, "bake_target", PROP_ENUM, PROP_NONE);
8072 RNA_def_property_ui_text(prop, "Bake Target", "Where to store the baked data");
8074 RNA_def_property_update(prop, 0, "rna_NodesModifier_bake_update");
8075
8076 prop = RNA_def_property(srna, "bakes", PROP_COLLECTION, PROP_NONE);
8077 RNA_def_property_struct_type(prop, "NodesModifierBake");
8078 RNA_def_property_collection_sdna(prop, nullptr, "bakes", "bakes_num");
8079 RNA_def_property_srna(prop, "NodesModifierBakes");
8080
8081 prop = RNA_def_property(srna, "panels", PROP_COLLECTION, PROP_NONE);
8082 RNA_def_property_struct_type(prop, "NodesModifierPanel");
8083 RNA_def_property_collection_sdna(prop, nullptr, "panels", "panels_num");
8084 RNA_def_property_srna(prop, "NodesModifierPanels");
8085
8086 prop = RNA_def_property(srna, "show_group_selector", PROP_BOOLEAN, PROP_NONE);
8088 prop, nullptr, "flag", NODES_MODIFIER_HIDE_DATABLOCK_SELECTOR);
8089 RNA_def_property_ui_text(prop, "Show Node Group", "");
8092
8093 prop = RNA_def_property(srna, "show_manage_panel", PROP_BOOLEAN, PROP_NONE);
8095 RNA_def_property_ui_text(prop, "Show Manage Panel", "");
8098
8099 prop = RNA_def_property(srna, "node_warnings", PROP_COLLECTION, PROP_NONE);
8101 "rna_NodesModifier_node_warnings_iterator_begin",
8102 "rna_NodesModifier_node_warnings_iterator_next",
8103 nullptr,
8104 "rna_NodesModifier_node_warnings_iterator_get",
8105 "rna_NodesModifier_node_warnings_length",
8106 nullptr,
8107 nullptr,
8108 nullptr);
8109 RNA_def_property_struct_type(prop, "NodesModifierWarning");
8112
8114 srna, "open_output_attributes_panel", NODES_MODIFIER_PANEL_OUTPUT_ATTRIBUTES);
8118 srna, "open_named_attributes_panel", NODES_MODIFIER_PANEL_NAMED_ATTRIBUTES);
8120 srna, "open_bake_data_blocks_panel", NODES_MODIFIER_PANEL_BAKE_DATA_BLOCKS);
8122
8124}
8125
8127{
8128 StructRNA *srna;
8129 PropertyRNA *prop;
8130
8131 static EnumPropertyItem resolution_mode_items[] = {
8133 "VOXEL_AMOUNT",
8134 0,
8135 "Voxel Amount",
8136 "Desired number of voxels along one axis"},
8138 "VOXEL_SIZE",
8139 0,
8140 "Voxel Size",
8141 "Desired voxel side length"},
8142 {0, nullptr, 0, nullptr, nullptr},
8143 };
8144
8145 srna = RNA_def_struct(brna, "MeshToVolumeModifier", "Modifier");
8146 RNA_def_struct_ui_text(srna, "Mesh to Volume Modifier", "");
8147 RNA_def_struct_sdna(srna, "MeshToVolumeModifierData");
8148 RNA_def_struct_ui_icon(srna, ICON_VOLUME_DATA); /* TODO: Use correct icon. */
8149
8151
8152 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
8153 RNA_def_property_ui_text(prop, "Object", "Object");
8155 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
8156
8157 prop = RNA_def_property(srna, "resolution_mode", PROP_ENUM, PROP_NONE);
8158 RNA_def_property_enum_items(prop, resolution_mode_items);
8160 prop, "Resolution Mode", "Mode for how the desired voxel size is specified");
8161 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8162
8163 /* NOTE: allow zero (which skips computation), to avoid zero clamping
8164 * to a small value which is likely to run out of memory, see: #130526. */
8165 prop = RNA_def_property(srna, "voxel_size", PROP_FLOAT, PROP_NONE);
8167 prop, "Voxel Size", "Smaller values result in a higher resolution output");
8168 RNA_def_property_range(prop, 0.0, FLT_MAX);
8169 RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 0.01, 4);
8170 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8171
8172 prop = RNA_def_property(srna, "voxel_amount", PROP_INT, PROP_NONE);
8173 RNA_def_property_ui_text(prop, "Voxel Amount", "Approximate number of voxels along one axis");
8174 RNA_def_property_range(prop, 0, INT_MAX);
8175 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8176
8177 prop = RNA_def_property(srna, "interior_band_width", PROP_FLOAT, PROP_NONE);
8179 prop, "Interior Band Width", "Width of the gradient inside of the mesh");
8180 RNA_def_property_range(prop, 0.0, FLT_MAX);
8181 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8182
8183 prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_NONE);
8184 RNA_def_property_ui_text(prop, "Density", "Density of the new volume");
8185 RNA_def_property_range(prop, 0.0, FLT_MAX);
8186 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8187
8189}
8190
8192{
8193 static const EnumPropertyItem prop_texture_map_mode_items[] = {
8195 "LOCAL",
8196 0,
8197 "Local",
8198 "Use the local coordinate system for the texture coordinates"},
8200 "GLOBAL",
8201 0,
8202 "Global",
8203 "Use the global coordinate system for the texture coordinates"},
8205 "OBJECT",
8206 0,
8207 "Object",
8208 "Use the linked object's local coordinate system for the texture coordinates"},
8209 {0, nullptr, 0, nullptr, nullptr},
8210 };
8211
8212 StructRNA *srna;
8213 PropertyRNA *prop;
8214
8215 srna = RNA_def_struct(brna, "VolumeDisplaceModifier", "Modifier");
8216 RNA_def_struct_ui_text(srna, "Volume Displace Modifier", "");
8217 RNA_def_struct_sdna(srna, "VolumeDisplaceModifierData");
8218 RNA_def_struct_ui_icon(srna, ICON_VOLUME_DATA); /* TODO: Use correct icon. */
8219
8221
8222 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
8223 RNA_def_property_ui_text(prop, "Strength", "Strength of the displacement");
8224 RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 0.1, 4);
8225 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8226
8227 prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
8228 RNA_def_property_ui_text(prop, "Texture", "");
8230 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
8231
8232 prop = RNA_def_property(srna, "texture_map_mode", PROP_ENUM, PROP_NONE);
8233 RNA_def_property_enum_items(prop, prop_texture_map_mode_items);
8234 RNA_def_property_ui_text(prop, "Texture Mapping Mode", "");
8235 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
8236
8237 prop = RNA_def_property(srna, "texture_map_object", PROP_POINTER, PROP_NONE);
8238 RNA_def_property_ui_text(prop, "Object", "Object to use for texture mapping");
8240 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
8241
8242 prop = RNA_def_property(srna, "texture_mid_level", PROP_FLOAT, PROP_XYZ);
8244 prop, "Texture Mid Level", "Subtracted from the texture color to get a displacement vector");
8246 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 5);
8247 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8248
8249 prop = RNA_def_property(srna, "texture_sample_radius", PROP_FLOAT, PROP_FACTOR);
8251 prop,
8252 "Texture Sample Radius",
8253 "Smaller values result in better performance but might cut off the volume");
8254 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8255 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 5);
8256 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8257
8259}
8260
8262{
8263 StructRNA *srna;
8264 PropertyRNA *prop;
8265
8266 static EnumPropertyItem resolution_mode_items[] = {
8268 "GRID",
8269 0,
8270 "Grid",
8271 "Use resolution of the volume grid"},
8273 "VOXEL_AMOUNT",
8274 0,
8275 "Voxel Amount",
8276 "Desired number of voxels along one axis"},
8278 "VOXEL_SIZE",
8279 0,
8280 "Voxel Size",
8281 "Desired voxel side length"},
8282 {0, nullptr, 0, nullptr, nullptr},
8283 };
8284
8285 srna = RNA_def_struct(brna, "VolumeToMeshModifier", "Modifier");
8286 RNA_def_struct_ui_text(srna, "Volume to Mesh Modifier", "");
8287 RNA_def_struct_sdna(srna, "VolumeToMeshModifierData");
8288 RNA_def_struct_ui_icon(srna, ICON_VOLUME_DATA); /* TODO: Use correct icon. */
8289
8291
8292 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
8293 RNA_def_property_ui_text(prop, "Object", "Object");
8295 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
8296
8297 prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
8299 prop, "Threshold", "Voxels with a larger value are inside the generated mesh");
8300 RNA_def_property_range(prop, 0.0f, FLT_MAX);
8301 RNA_def_property_ui_range(prop, 0.001f, 1.0f, 0.1f, 5);
8302 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8303
8304 prop = RNA_def_property(srna, "adaptivity", PROP_FLOAT, PROP_NONE);
8306 prop,
8307 "Adaptivity",
8308 "Reduces the final face count by simplifying geometry where detail is not needed");
8309 RNA_def_property_range(prop, 0.0f, 1.0f);
8310 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8311
8312 prop = RNA_def_property(srna, "use_smooth_shade", PROP_BOOLEAN, PROP_NONE);
8315 prop, "Smooth Shading", "Output faces with smooth shading rather than flat shaded");
8316 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8317
8318 prop = RNA_def_property(srna, "grid_name", PROP_STRING, PROP_NONE);
8320 prop, "Grid Name", "Grid in the volume object that is converted to a mesh");
8321 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8322
8323 prop = RNA_def_property(srna, "resolution_mode", PROP_ENUM, PROP_NONE);
8324 RNA_def_property_enum_items(prop, resolution_mode_items);
8326 prop, "Resolution Mode", "Mode for how the desired voxel size is specified");
8327 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8328
8329 /* NOTE: allow zero (which skips computation), to avoid zero clamping
8330 * to a small value which is likely to run out of memory, see: #130526. */
8331 prop = RNA_def_property(srna, "voxel_size", PROP_FLOAT, PROP_NONE);
8333 prop, "Voxel Size", "Smaller values result in a higher resolution output");
8334 RNA_def_property_range(prop, 0.0, FLT_MAX);
8335 RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 0.01, 4);
8336 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8337
8338 prop = RNA_def_property(srna, "voxel_amount", PROP_INT, PROP_NONE);
8339 RNA_def_property_ui_text(prop, "Voxel Amount", "Approximate number of voxels along one axis");
8340 RNA_def_property_range(prop, 0, INT_MAX);
8341 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8342
8344}
8345
8347{
8348 PropertyRNA *prop;
8349
8350 prop = RNA_def_property(srna, "tree_node_filter", PROP_STRING, PROP_NONE);
8351 RNA_def_property_string_sdna(prop, nullptr, "influence.layer_name");
8352 RNA_def_property_ui_text(prop, "Layer", "Layer name");
8353 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8354
8355 prop = RNA_def_property(srna, "use_layer_pass_filter", PROP_BOOLEAN, PROP_NONE);
8357 prop, nullptr, "influence.flag", GREASE_PENCIL_INFLUENCE_USE_LAYER_PASS_FILTER);
8358 RNA_def_property_ui_text(prop, "Use Layer Pass", "Use layer pass filter");
8359 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8360
8361 prop = RNA_def_property(srna, "layer_pass_filter", PROP_INT, PROP_NONE);
8362 RNA_def_property_int_sdna(prop, nullptr, "influence.layer_pass");
8363 RNA_def_property_range(prop, 0, 100);
8364 RNA_def_property_ui_text(prop, "Layer Pass", "Layer pass filter");
8365 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8366
8367 prop = RNA_def_property(srna, "invert_layer_filter", PROP_BOOLEAN, PROP_NONE);
8369 prop, nullptr, "influence.flag", GREASE_PENCIL_INFLUENCE_INVERT_LAYER_FILTER);
8370 RNA_def_property_ui_text(prop, "Invert Layer", "Invert layer filter");
8371 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8372
8373 prop = RNA_def_property(srna, "invert_layer_pass_filter", PROP_BOOLEAN, PROP_NONE);
8375 prop, nullptr, "influence.flag", GREASE_PENCIL_INFLUENCE_INVERT_LAYER_PASS_FILTER);
8376 RNA_def_property_ui_text(prop, "Invert Layer Pass", "Invert layer pass filter");
8377 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8378
8379 prop = RNA_def_property(srna, "use_layer_group_filter", PROP_BOOLEAN, PROP_NONE);
8381 prop, nullptr, "influence.flag", GREASE_PENCIL_INFLUENCE_USE_LAYER_GROUP_FILTER);
8382 RNA_def_property_ui_text(prop, "Layer Group", "Filter by layer group name");
8383 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8384}
8385
8387 const char *material_set_fn)
8388{
8389 PropertyRNA *prop;
8390
8391 prop = RNA_def_property(srna, "material_filter", PROP_POINTER, PROP_NONE);
8392 RNA_def_property_pointer_sdna(prop, nullptr, "influence.material");
8395 prop, nullptr, material_set_fn, nullptr, "rna_GreasePencilModifier_material_poll");
8396 RNA_def_property_ui_text(prop, "Material", "Material used for filtering");
8397 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8398
8399 prop = RNA_def_property(srna, "use_material_pass_filter", PROP_BOOLEAN, PROP_NONE);
8401 prop, nullptr, "influence.flag", GREASE_PENCIL_INFLUENCE_USE_MATERIAL_PASS_FILTER);
8402 RNA_def_property_ui_text(prop, "Use Material Pass", "Use material pass filter");
8403 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8404
8405 prop = RNA_def_property(srna, "material_pass_filter", PROP_INT, PROP_NONE);
8406 RNA_def_property_int_sdna(prop, nullptr, "influence.material_pass");
8407 RNA_def_property_range(prop, 0, 100);
8408 RNA_def_property_ui_text(prop, "Material Pass", "Material pass");
8409 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8410
8411 prop = RNA_def_property(srna, "invert_material_filter", PROP_BOOLEAN, PROP_NONE);
8413 prop, nullptr, "influence.flag", GREASE_PENCIL_INFLUENCE_INVERT_MATERIAL_FILTER);
8414 RNA_def_property_ui_text(prop, "Invert Material", "Invert material filter");
8415 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8416
8417 prop = RNA_def_property(srna, "invert_material_pass_filter", PROP_BOOLEAN, PROP_NONE);
8419 prop, nullptr, "influence.flag", GREASE_PENCIL_INFLUENCE_INVERT_MATERIAL_PASS_FILTER);
8420 RNA_def_property_ui_text(prop, "Invert Material Pass", "Invert material pass filter");
8421 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8422}
8423
8425 const char *vertex_group_name_set_fn)
8426{
8427 PropertyRNA *prop;
8428
8429 prop = RNA_def_property(srna, "vertex_group_name", PROP_STRING, PROP_NONE);
8430 RNA_def_property_string_sdna(prop, nullptr, "influence.vertex_group_name");
8431 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the deform");
8432 RNA_def_property_string_funcs(prop, nullptr, nullptr, vertex_group_name_set_fn);
8433 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8434
8435 prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
8437 prop, nullptr, "influence.flag", GREASE_PENCIL_INFLUENCE_INVERT_VERTEX_GROUP);
8438 RNA_def_property_ui_text(prop, "Invert Vertex Group", "Invert vertex group weights");
8439 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8440}
8441
8443{
8444 PropertyRNA *prop;
8445
8446 prop = RNA_def_property(srna, "use_custom_curve", PROP_BOOLEAN, PROP_NONE);
8448 prop, nullptr, "influence.flag", GREASE_PENCIL_INFLUENCE_USE_CUSTOM_CURVE);
8450 prop, "Use Custom Curve", "Use a custom curve to define a factor along the strokes");
8451 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8452
8453 prop = RNA_def_property(srna, "custom_curve", PROP_POINTER, PROP_NONE);
8454 RNA_def_property_pointer_sdna(prop, nullptr, "influence.custom_curve");
8455 RNA_def_property_ui_text(prop, "Curve", "Custom curve to apply effect");
8456 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8457}
8458
8460{
8461 StructRNA *srna;
8462 PropertyRNA *prop;
8463 static const EnumPropertyItem color_mode_items[] = {
8464 {MOD_GREASE_PENCIL_COLOR_BOTH, "BOTH", 0, "Stroke & Fill", "Modify fill and stroke colors"},
8465 {MOD_GREASE_PENCIL_COLOR_STROKE, "STROKE", 0, "Stroke", "Modify stroke color only"},
8466 {MOD_GREASE_PENCIL_COLOR_FILL, "FILL", 0, "Fill", "Modify fill color only"},
8467 {MOD_GREASE_PENCIL_COLOR_HARDNESS, "HARDNESS", 0, "Hardness", "Modify stroke hardness"},
8468 {0, nullptr, 0, nullptr, nullptr},
8469 };
8470
8471 srna = RNA_def_struct(brna, "GreasePencilOpacityModifier", "Modifier");
8472 RNA_def_struct_ui_text(srna, "Grease Pencil Opacity Modifier", "");
8473 RNA_def_struct_sdna(srna, "GreasePencilOpacityModifierData");
8474 RNA_def_struct_ui_icon(srna, ICON_MOD_OPACITY);
8475
8478 srna, "rna_GreasePencilOpacityModifier_material_filter_set");
8480 srna, "rna_GreasePencilOpacityModifier_vertex_group_name_set");
8482
8483 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
8484
8486
8487 prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
8488 RNA_def_property_enum_items(prop, color_mode_items);
8489 RNA_def_property_ui_text(prop, "Mode", "Attributes to modify");
8490 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8491
8492 prop = RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_NONE);
8493 RNA_def_property_float_sdna(prop, nullptr, "color_factor");
8494 RNA_def_property_ui_range(prop, 0, 2.0, 0.1, 2);
8496 nullptr,
8497 "rna_GreasePencilOpacityModifier_opacity_factor_max_set",
8498 "rna_GreasePencilOpacityModifier_opacity_factor_range");
8499 RNA_def_property_ui_text(prop, "Opacity Factor", "Factor of opacity");
8500 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8501
8502 prop = RNA_def_property(srna, "hardness_factor", PROP_FLOAT, PROP_NONE);
8503 RNA_def_property_float_sdna(prop, nullptr, "hardness_factor");
8504 RNA_def_property_range(prop, 0.0, FLT_MAX);
8505 RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 0.1, 2);
8506 RNA_def_property_ui_text(prop, "Hardness Factor", "Factor of stroke hardness");
8507 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8508
8509 prop = RNA_def_property(srna, "use_weight_as_factor", PROP_BOOLEAN, PROP_NONE);
8511 prop, nullptr, "flag", MOD_GREASE_PENCIL_OPACITY_USE_WEIGHT_AS_FACTOR);
8513 prop, "Use Weight as Factor", "Use vertex group weight as factor instead of influence");
8514 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8515
8516 prop = RNA_def_property(srna, "use_uniform_opacity", PROP_BOOLEAN, PROP_NONE);
8518 prop, nullptr, "flag", MOD_GREASE_PENCIL_OPACITY_USE_UNIFORM_OPACITY);
8520 prop, "Uniform Opacity", "Replace the stroke opacity instead of modulating each point");
8521
8522 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8523
8525}
8526
8528{
8529 StructRNA *srna;
8530 PropertyRNA *prop;
8531
8532 static const EnumPropertyItem subdivision_type_items[] = {
8533 {MOD_GREASE_PENCIL_SUBDIV_CATMULL, "CATMULL_CLARK", 0, "Catmull-Clark", ""},
8534 {MOD_GREASE_PENCIL_SUBDIV_SIMPLE, "SIMPLE", 0, "Simple", ""},
8535 {0, nullptr, 0, nullptr, nullptr},
8536 };
8537
8538 srna = RNA_def_struct(brna, "GreasePencilSubdivModifier", "Modifier");
8539 RNA_def_struct_ui_text(srna, "Subdivision Modifier", "Subdivide Stroke modifier");
8540 RNA_def_struct_sdna(srna, "GreasePencilSubdivModifierData");
8541 RNA_def_struct_ui_icon(srna, ICON_MOD_SUBSURF);
8542
8545 srna, "rna_GreasePencilSubdivModifier_material_filter_set");
8546
8547 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
8548
8550
8551 prop = RNA_def_property(srna, "level", PROP_INT, PROP_NONE);
8552 RNA_def_property_int_sdna(prop, nullptr, "level");
8553 RNA_def_property_range(prop, 0, 16);
8554 RNA_def_property_ui_range(prop, 0, 6, 1, 0);
8555 RNA_def_property_ui_text(prop, "Level", "Level of subdivision");
8556 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8557
8558 prop = RNA_def_property(srna, "subdivision_type", PROP_ENUM, PROP_NONE);
8559 RNA_def_property_enum_sdna(prop, nullptr, "type");
8560 RNA_def_property_enum_items(prop, subdivision_type_items);
8561 RNA_def_property_ui_text(prop, "Subdivision Type", "Select type of subdivision algorithm");
8562 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8563
8564 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8565
8567}
8568
8570{
8571 StructRNA *srna;
8572 PropertyRNA *prop;
8573
8574 static const EnumPropertyItem color_mode_items[] = {
8575 {MOD_GREASE_PENCIL_COLOR_BOTH, "BOTH", 0, "Stroke & Fill", "Modify fill and stroke colors"},
8576 {MOD_GREASE_PENCIL_COLOR_STROKE, "STROKE", 0, "Stroke", "Modify stroke color only"},
8577 {MOD_GREASE_PENCIL_COLOR_FILL, "FILL", 0, "Fill", "Modify fill color only"},
8578 {0, nullptr, 0, nullptr, nullptr},
8579 };
8580
8581 srna = RNA_def_struct(brna, "GreasePencilColorModifier", "Modifier");
8582 RNA_def_struct_ui_text(srna, "Grease Pencil Color Modifier", "");
8583 RNA_def_struct_sdna(srna, "GreasePencilColorModifierData");
8584 RNA_def_struct_ui_icon(srna, ICON_MOD_HUE_SATURATION);
8585
8588 srna, "rna_GreasePencilColorModifier_material_filter_set");
8590
8591 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
8592
8594
8595 prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
8596 RNA_def_property_enum_items(prop, color_mode_items);
8597 RNA_def_property_ui_text(prop, "Mode", "Attributes to modify");
8598 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8599
8600 prop = RNA_def_property(srna, "hue", PROP_FLOAT, PROP_NONE);
8601 RNA_def_property_range(prop, 0.0, 1.0);
8602 RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 3);
8603 RNA_def_property_float_sdna(prop, nullptr, "hsv[0]");
8604 RNA_def_property_ui_text(prop, "Hue", "Color hue offset");
8605 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8606
8607 prop = RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
8608 RNA_def_property_range(prop, 0.0, FLT_MAX);
8609 RNA_def_property_ui_range(prop, 0.0, 2.0, 0.1, 3);
8610 RNA_def_property_float_sdna(prop, nullptr, "hsv[1]");
8611 RNA_def_property_ui_text(prop, "Saturation", "Color saturation factor");
8612 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8613
8614 prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
8615 RNA_def_property_range(prop, 0.0, FLT_MAX);
8616 RNA_def_property_ui_range(prop, 0.0, 2.0, 0.1, 3);
8617 RNA_def_property_float_sdna(prop, nullptr, "hsv[2]");
8618 RNA_def_property_ui_text(prop, "Value", "Color value factor");
8619 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8620
8622}
8623
8625{
8626 StructRNA *srna;
8627 PropertyRNA *prop;
8628
8629 static const EnumPropertyItem color_mode_items[] = {
8630 {MOD_GREASE_PENCIL_COLOR_BOTH, "BOTH", 0, "Stroke & Fill", "Modify fill and stroke colors"},
8631 {MOD_GREASE_PENCIL_COLOR_STROKE, "STROKE", 0, "Stroke", "Modify stroke color only"},
8632 {MOD_GREASE_PENCIL_COLOR_FILL, "FILL", 0, "Fill", "Modify fill color only"},
8633 {0, nullptr, 0, nullptr, nullptr},
8634 };
8635
8636 static const EnumPropertyItem tint_mode_items[] = {
8637 {MOD_GREASE_PENCIL_TINT_UNIFORM, "UNIFORM", 0, "Uniform", ""},
8638 {MOD_GREASE_PENCIL_TINT_GRADIENT, "GRADIENT", 0, "Gradient", ""},
8639 {0, nullptr, 0, nullptr, nullptr},
8640 };
8641
8642 srna = RNA_def_struct(brna, "GreasePencilTintModifier", "Modifier");
8643 RNA_def_struct_ui_text(srna, "Grease Pencil Tint Modifier", "");
8644 RNA_def_struct_sdna(srna, "GreasePencilTintModifierData");
8645 RNA_def_struct_ui_icon(srna, ICON_MOD_TINT);
8646
8649 srna, "rna_GreasePencilTintModifier_material_filter_set");
8651 srna, "rna_GreasePencilTintModifier_vertex_group_name_set");
8653
8654 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
8655
8657
8658 prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
8659 RNA_def_property_enum_items(prop, color_mode_items);
8660 RNA_def_property_ui_text(prop, "Mode", "Attributes to modify");
8661 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8662
8663 prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
8664 RNA_def_property_range(prop, 0, 2.0);
8665 RNA_def_property_ui_range(prop, 0, 2.0, 0.1, 2);
8666 RNA_def_property_ui_text(prop, "Factor", "Factor for tinting");
8667 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8668
8669 /* Type of Tint. */
8670 prop = RNA_def_property(srna, "tint_mode", PROP_ENUM, PROP_NONE);
8671 RNA_def_property_enum_items(prop, tint_mode_items);
8672 RNA_def_property_ui_text(prop, "Tint Mode", "");
8673 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8674
8675 /* Simple Color. */
8676 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
8677 RNA_def_property_range(prop, 0.0, 1.0);
8678 RNA_def_property_array(prop, 3);
8679 RNA_def_property_ui_text(prop, "Color", "Color used for tinting");
8680 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8681
8682 /* Color band. */
8683 prop = RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NONE);
8684 RNA_def_property_struct_type(prop, "ColorRamp");
8685 RNA_def_property_ui_text(prop, "Color Ramp", "Gradient tinting colors");
8686 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8687
8688 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
8689 RNA_def_property_ui_text(prop, "Object", "Object used for the gradient direction");
8692 prop, nullptr, "rna_GreasePencilTintModifier_object_set", nullptr, nullptr);
8693 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
8694
8695 prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_DISTANCE);
8696 RNA_def_property_range(prop, 1e-6f, FLT_MAX);
8697 RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 1, 3);
8698 RNA_def_property_ui_text(prop, "Radius", "Influence distance from the object");
8699 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8700
8702
8703 prop = RNA_def_property(srna, "use_weight_as_factor", PROP_BOOLEAN, PROP_NONE);
8705 prop, nullptr, "flag", MOD_GREASE_PENCIL_TINT_USE_WEIGHT_AS_FACTOR);
8707 prop, "Use Weight as Factor", "Use vertex group weight as factor instead of influence");
8708 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8709}
8710
8712{
8713 StructRNA *srna;
8714 PropertyRNA *prop;
8715
8716 static const EnumPropertyItem modifier_lineart_source_type[] = {
8717 {LINEART_SOURCE_COLLECTION, "COLLECTION", 0, "Collection", ""},
8718 {LINEART_SOURCE_OBJECT, "OBJECT", 0, "Object", ""},
8719 {LINEART_SOURCE_SCENE, "SCENE", 0, "Scene", ""},
8720 {0, nullptr, 0, nullptr, nullptr},
8721 };
8722
8723 static const EnumPropertyItem modifier_lineart_shadow_region_filtering[] = {
8725 "NONE",
8726 0,
8727 "None",
8728 "Not filtering any lines based on illumination region"},
8730 "ILLUMINATED",
8731 0,
8732 "Illuminated",
8733 "Only selecting lines from illuminated regions"},
8735 "SHADED",
8736 0,
8737 "Shaded",
8738 "Only selecting lines from shaded regions"},
8740 "ILLUMINATED_ENCLOSED",
8741 0,
8742 "Illuminated (Enclosed Shapes)",
8743 "Selecting lines from lit regions, and make the combination of contour, light contour and "
8744 "shadow lines into enclosed shapes"},
8745 {0, nullptr, 0, nullptr, nullptr},
8746 };
8747
8748 static const EnumPropertyItem modifier_lineart_silhouette_filtering[] = {
8749 {LINEART_SILHOUETTE_FILTER_NONE, "NONE", 0, "Contour", ""},
8750 {LINEART_SILHOUETTE_FILTER_GROUP, "GROUP", 0, "Silhouette", ""},
8751 {LINEART_SILHOUETTE_FILTER_INDIVIDUAL, "INDIVIDUAL", 0, "Individual Silhouette", ""},
8752 {0, nullptr, 0, nullptr, nullptr},
8753 };
8754
8755 srna = RNA_def_struct(brna, "GreasePencilLineartModifier", "Modifier");
8757 srna, "Line Art Modifier", "Generate Line Art strokes from selected source");
8758 RNA_def_struct_sdna(srna, "GreasePencilLineartModifierData");
8759 RNA_def_struct_ui_icon(srna, ICON_MOD_LINEART);
8760
8762
8763 prop = RNA_def_property(srna, "use_custom_camera", PROP_BOOLEAN, PROP_NONE);
8764 RNA_def_property_boolean_sdna(prop, nullptr, "calculation_flags", MOD_LINEART_USE_CUSTOM_CAMERA);
8766 prop, "Use Custom Camera", "Use custom camera instead of the active camera");
8767 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
8768
8769 prop = RNA_def_property(srna, "use_fuzzy_intersections", PROP_BOOLEAN, PROP_NONE);
8771 prop, nullptr, "calculation_flags", MOD_LINEART_INTERSECTION_AS_CONTOUR);
8773 "Intersection With Contour",
8774 "Treat intersection and contour lines as if they were the same type so "
8775 "they can be chained together");
8776 RNA_def_property_update(prop, NC_SCENE, "rna_Modifier_update");
8777
8778 prop = RNA_def_property(srna, "use_fuzzy_all", PROP_BOOLEAN, PROP_NONE);
8780 prop, nullptr, "calculation_flags", MOD_LINEART_EVERYTHING_AS_CONTOUR);
8782 prop, "All Lines", "Treat all lines as the same line type so they can be chained together");
8783 RNA_def_property_update(prop, NC_SCENE, "rna_Modifier_update");
8784
8785 prop = RNA_def_property(srna, "use_object_instances", PROP_BOOLEAN, PROP_NONE);
8787 prop, nullptr, "calculation_flags", MOD_LINEART_ALLOW_DUPLI_OBJECTS);
8789 "Instanced Objects",
8790 "Allow particle objects and face/vertex instances to show in Line Art");
8791 RNA_def_property_update(prop, NC_SCENE, "rna_Modifier_update");
8792
8793 prop = RNA_def_property(srna, "use_edge_overlap", PROP_BOOLEAN, PROP_NONE);
8795 prop, nullptr, "calculation_flags", MOD_LINEART_ALLOW_OVERLAPPING_EDGES);
8797 prop,
8798 "Handle Overlapping Edges",
8799 "Allow edges in the same location (i.e. from edge split) to show properly. May run slower.");
8800 RNA_def_property_update(prop, NC_SCENE, "rna_Modifier_update");
8801
8802 prop = RNA_def_property(srna, "use_clip_plane_boundaries", PROP_BOOLEAN, PROP_NONE);
8804 prop, nullptr, "calculation_flags", MOD_LINEART_ALLOW_CLIPPING_BOUNDARIES);
8806 "Clipping Boundaries",
8807 "Allow lines generated by the near/far clipping plane to be shown");
8808 RNA_def_property_update(prop, NC_SCENE, "rna_Modifier_update");
8809
8810 prop = RNA_def_property(srna, "crease_threshold", PROP_FLOAT, PROP_ANGLE);
8811 RNA_def_property_range(prop, 0, DEG2RAD(180.0f));
8812 RNA_def_property_ui_range(prop, 0.0f, DEG2RAD(180.0f), 0.01f, 1);
8814 "Crease Threshold",
8815 "Angles smaller than this will be treated as creases. Crease angle "
8816 "priority: object Line Art crease override > mesh auto smooth angle > "
8817 "Line Art default crease.");
8818 RNA_def_property_update(prop, NC_SCENE, "rna_Modifier_update");
8819
8820 prop = RNA_def_property(srna, "split_angle", PROP_FLOAT, PROP_ANGLE);
8821 RNA_def_property_float_sdna(prop, nullptr, "angle_splitting_threshold");
8823 prop, "Angle Splitting", "Angle in screen space below which a stroke is split in two");
8824 /* Don't allow value very close to PI, or we get a lot of small segments. */
8825 RNA_def_property_ui_range(prop, 0.0f, DEG2RAD(179.5f), 0.01f, 1);
8826 RNA_def_property_range(prop, 0.0f, DEG2RAD(180.0f));
8827 RNA_def_property_update(prop, NC_SCENE, "rna_Modifier_update");
8828
8829 prop = RNA_def_property(srna, "smooth_tolerance", PROP_FLOAT, PROP_NONE);
8830 RNA_def_property_float_sdna(prop, nullptr, "chain_smooth_tolerance");
8832 prop, "Smooth Tolerance", "Strength of smoothing applied on jagged chains");
8833 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.05f, 4);
8834 RNA_def_property_range(prop, 0.0f, 30.0f);
8835 RNA_def_property_update(prop, NC_SCENE, "rna_Modifier_update");
8836
8837 prop = RNA_def_property(srna, "use_loose_as_contour", PROP_BOOLEAN, PROP_NONE);
8838 RNA_def_property_boolean_sdna(prop, nullptr, "calculation_flags", MOD_LINEART_LOOSE_AS_CONTOUR);
8839 RNA_def_property_ui_text(prop, "Loose As Contour", "Loose edges will have contour type");
8840 RNA_def_property_update(prop, NC_SCENE, "rna_Modifier_update");
8841
8842 prop = RNA_def_property(srna, "invert_source_vertex_group", PROP_BOOLEAN, PROP_NONE);
8844 prop, nullptr, "calculation_flags", MOD_LINEART_INVERT_SOURCE_VGROUP);
8845 RNA_def_property_ui_text(prop, "Invert Vertex Group", "Invert source vertex group values");
8846 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8847
8848 prop = RNA_def_property(srna, "use_output_vertex_group_match_by_name", PROP_BOOLEAN, PROP_NONE);
8850 prop, nullptr, "calculation_flags", MOD_LINEART_MATCH_OUTPUT_VGROUP);
8851 RNA_def_property_ui_text(prop, "Match Output", "Match output vertex group based on name");
8852 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8853
8854 prop = RNA_def_property(srna, "use_face_mark", PROP_BOOLEAN, PROP_NONE);
8855 RNA_def_property_boolean_sdna(prop, nullptr, "calculation_flags", MOD_LINEART_FILTER_FACE_MARK);
8857 prop, "Filter Face Marks", "Filter feature lines using Freestyle face marks");
8858 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8859
8860 prop = RNA_def_property(srna, "use_face_mark_invert", PROP_BOOLEAN, PROP_NONE);
8862 prop, nullptr, "calculation_flags", MOD_LINEART_FILTER_FACE_MARK_INVERT);
8863 RNA_def_property_ui_text(prop, "Invert", "Invert face mark filtering");
8864 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8865
8866 prop = RNA_def_property(srna, "use_face_mark_boundaries", PROP_BOOLEAN, PROP_NONE);
8868 prop, nullptr, "calculation_flags", MOD_LINEART_FILTER_FACE_MARK_BOUNDARIES);
8870 prop, "Boundaries", "Filter feature lines based on face mark boundaries");
8871 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8872
8873 prop = RNA_def_property(srna, "use_face_mark_keep_contour", PROP_BOOLEAN, PROP_NONE);
8875 prop, nullptr, "calculation_flags", MOD_LINEART_FILTER_FACE_MARK_KEEP_CONTOUR);
8876 RNA_def_property_ui_text(prop, "Keep Contour", "Preserve contour lines while filtering");
8877 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8878
8879 prop = RNA_def_property(srna, "chaining_image_threshold", PROP_FLOAT, PROP_DISTANCE);
8881 prop,
8882 "Image Threshold",
8883 "Segments with an image distance smaller than this will be chained together");
8884 RNA_def_property_ui_range(prop, 0.0f, 0.3f, 0.001f, 4);
8885 RNA_def_property_range(prop, 0.0f, 0.3f);
8886 RNA_def_property_update(prop, NC_SCENE, "rna_Modifier_update");
8887
8888 prop = RNA_def_property(srna, "use_loose_edge_chain", PROP_BOOLEAN, PROP_NONE);
8889 RNA_def_property_boolean_sdna(prop, nullptr, "calculation_flags", MOD_LINEART_CHAIN_LOOSE_EDGES);
8890 RNA_def_property_ui_text(prop, "Chain Loose Edges", "Allow loose edges to be chained together");
8891 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8892
8893 prop = RNA_def_property(srna, "use_geometry_space_chain", PROP_BOOLEAN, PROP_NONE);
8895 prop, nullptr, "calculation_flags", MOD_LINEART_CHAIN_GEOMETRY_SPACE);
8897 prop, "Use Geometry Space", "Use geometry distance for chaining instead of image space");
8898 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8899
8900 prop = RNA_def_property(srna, "use_detail_preserve", PROP_BOOLEAN, PROP_NONE);
8902 prop, nullptr, "calculation_flags", MOD_LINEART_CHAIN_PRESERVE_DETAILS);
8904 prop, "Preserve Details", "Keep the zig-zag \"noise\" in initial chaining");
8905 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8906
8907 prop = RNA_def_property(srna, "use_overlap_edge_type_support", PROP_BOOLEAN, PROP_NONE);
8909 prop, nullptr, "calculation_flags", MOD_LINEART_ALLOW_OVERLAP_EDGE_TYPES);
8911 "Overlapping Edge Types",
8912 "Allow an edge to have multiple overlapping types. This will create a "
8913 "separate stroke for each overlapping type.");
8914 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8915
8916 prop = RNA_def_property(srna, "stroke_depth_offset", PROP_FLOAT, PROP_DISTANCE);
8918 "Stroke Depth Offset",
8919 "Move strokes slightly towards the camera to avoid clipping while "
8920 "preserve depth for the viewport");
8921 RNA_def_property_ui_range(prop, 0.0, 0.5, 0.001, 4);
8922 RNA_def_property_range(prop, -0.1, FLT_MAX);
8923 RNA_def_property_update(prop, NC_SCENE, "rna_Modifier_update");
8924
8925 prop = RNA_def_property(srna, "use_offset_towards_custom_camera", PROP_BOOLEAN, PROP_NONE);
8927 prop, nullptr, "flags", LINEART_GPENCIL_OFFSET_TOWARDS_CUSTOM_CAMERA);
8929 "Offset Towards Custom Camera",
8930 "Offset strokes towards selected camera instead of the active camera");
8931 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8932
8933 prop = RNA_def_property(srna, "source_camera", PROP_POINTER, PROP_NONE);
8935 RNA_def_property_struct_type(prop, "Object");
8938 prop, "Camera Object", "Use specified camera object for generating Line Art strokes");
8939 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
8940
8941 prop = RNA_def_property(srna, "light_contour_object", PROP_POINTER, PROP_NONE);
8943 RNA_def_property_struct_type(prop, "Object");
8946 prop, "Light Object", "Use this light object to generate light contour");
8947 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
8948
8949 prop = RNA_def_property(srna, "source_type", PROP_ENUM, PROP_NONE);
8950 RNA_def_property_enum_items(prop, modifier_lineart_source_type);
8951 RNA_def_property_ui_text(prop, "Source Type", "Line Art stroke source type");
8952 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
8953
8954 prop = RNA_def_property(srna, "source_object", PROP_POINTER, PROP_NONE);
8956 RNA_def_property_struct_type(prop, "Object");
8957 RNA_def_property_ui_text(prop, "Object", "Generate strokes from this object");
8958 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
8959
8960 prop = RNA_def_property(srna, "source_collection", PROP_POINTER, PROP_NONE);
8962 RNA_def_property_struct_type(prop, "Collection");
8964 prop, "Collection", "Generate strokes from the objects in this collection");
8965 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
8966
8967 /* types */
8968 prop = RNA_def_property(srna, "use_contour", PROP_BOOLEAN, PROP_NONE);
8970 RNA_def_property_ui_text(prop, "Use Contour", "Generate strokes from contours lines");
8971 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8972
8973 prop = RNA_def_property(srna, "use_loose", PROP_BOOLEAN, PROP_NONE);
8974 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", MOD_LINEART_EDGE_FLAG_LOOSE);
8975 RNA_def_property_ui_text(prop, "Use Loose", "Generate strokes from loose edges");
8976 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8977
8978 prop = RNA_def_property(srna, "use_crease", PROP_BOOLEAN, PROP_NONE);
8979 RNA_def_property_boolean_sdna(prop, nullptr, "edge_types", MOD_LINEART_EDGE_FLAG_CREASE);
8980 RNA_def_property_ui_text(prop, "Use Crease", "Generate strokes from creased edges");
8981 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8982
8983 prop = RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE);
8986 prop, "Use Material", "Generate strokes from borders between materials");
8987 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8988
8989 prop = RNA_def_property(srna, "use_edge_mark", PROP_BOOLEAN, PROP_NONE);
8991 RNA_def_property_ui_text(prop, "Use Edge Mark", "Generate strokes from Freestyle marked edges");
8992 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8993
8994 prop = RNA_def_property(srna, "use_intersection", PROP_BOOLEAN, PROP_NONE);
8996 RNA_def_property_ui_text(prop, "Use Intersection", "Generate strokes from intersections");
8997 RNA_def_property_update(prop, 0, "rna_Modifier_update");
8998
8999 prop = RNA_def_property(srna, "use_light_contour", PROP_BOOLEAN, PROP_NONE);
9002 "Use Light Contour",
9003 "Generate light/shadow separation lines from a reference light object");
9004 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9005
9006 prop = RNA_def_property(srna, "use_shadow", PROP_BOOLEAN, PROP_NONE);
9008 prop, nullptr, "edge_types", MOD_LINEART_EDGE_FLAG_PROJECTED_SHADOW);
9010 prop, "Use Shadow", "Project contour lines using a light source object");
9011 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9012
9013 prop = RNA_def_property(srna, "shadow_region_filtering", PROP_ENUM, PROP_NONE);
9014 RNA_def_property_enum_sdna(prop, nullptr, "shadow_selection");
9015 RNA_def_property_enum_items(prop, modifier_lineart_shadow_region_filtering);
9017 "Shadow Region Filtering",
9018 "Select feature lines that comes from lit or shaded regions. Will not "
9019 "affect cast shadow and light contour since they are at the border.");
9021 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
9022
9023 prop = RNA_def_property(srna, "silhouette_filtering", PROP_ENUM, PROP_NONE);
9024 RNA_def_property_enum_sdna(prop, nullptr, "silhouette_selection");
9025 RNA_def_property_enum_items(prop, modifier_lineart_silhouette_filtering);
9026 RNA_def_property_ui_text(prop, "Silhouette Filtering", "Select contour or silhouette");
9027 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
9028
9029 prop = RNA_def_property(srna, "use_multiple_levels", PROP_BOOLEAN, PROP_NONE);
9030 RNA_def_property_boolean_sdna(prop, nullptr, "use_multiple_levels", 0);
9032 prop, "Use Occlusion Range", "Generate strokes from a range of occlusion levels");
9033 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9034
9035 prop = RNA_def_property(srna, "level_start", PROP_INT, PROP_NONE);
9037 prop, "Level Start", "Minimum number of occlusions for the generated strokes");
9038 RNA_def_property_range(prop, 0, 128);
9039 RNA_def_property_int_funcs(prop, nullptr, "rna_Lineart_start_level_set", nullptr);
9040 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9041
9042 prop = RNA_def_property(srna, "level_end", PROP_INT, PROP_NONE);
9044 prop, "Level End", "Maximum number of occlusions for the generated strokes");
9045 RNA_def_property_range(prop, 0, 128);
9046 RNA_def_property_int_funcs(prop, nullptr, "rna_Lineart_end_level_set", nullptr);
9047 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9048
9049 prop = RNA_def_property(srna, "target_layer", PROP_STRING, PROP_NONE);
9051 prop, "Layer", "Grease Pencil layer to which assign the generated strokes");
9052 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9053
9054 prop = RNA_def_property(srna, "target_material", PROP_POINTER, PROP_NONE);
9056 RNA_def_property_struct_type(prop, "Material");
9058 nullptr,
9059 "rna_GreasePencilLineartModifier_material_set",
9060 nullptr,
9061 "rna_GreasePencilModifier_material_poll");
9063 prop, "Material", "Grease Pencil material assigned to the generated strokes");
9064 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9065
9066 prop = RNA_def_property(srna, "source_vertex_group", PROP_STRING, PROP_NONE);
9068 prop,
9069 "Source Vertex Group",
9070 "Match the beginning of vertex group names from mesh objects, match all when left empty");
9071 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9072
9073 prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
9074 RNA_def_property_string_sdna(prop, nullptr, "vgname");
9076 prop, nullptr, nullptr, "rna_GreasePencilLineartModifier_vgname_set");
9077 RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for selected strokes");
9078 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9079
9080 prop = RNA_def_property(srna, "is_baked", PROP_BOOLEAN, PROP_NONE);
9082 RNA_def_property_ui_text(prop, "Is Baked", "This modifier has baked data");
9083 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9084
9085 prop = RNA_def_property(srna, "use_cache", PROP_BOOLEAN, PROP_NONE);
9088 "Use Cache",
9089 "Use cached scene data from the first Line Art modifier in the stack. "
9090 "Certain settings will be unavailable.");
9091 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9092
9093 prop = RNA_def_property(srna, "overscan", PROP_FLOAT, PROP_NONE);
9095 prop,
9096 "Overscan",
9097 "A margin to prevent strokes from ending abruptly at the edge of the image");
9098 RNA_def_property_ui_range(prop, 0.0f, 0.5f, 0.01f, 3);
9099 RNA_def_property_range(prop, 0.0f, 0.5f);
9100 RNA_def_property_update(prop, NC_SCENE, "rna_Modifier_update");
9101
9102 prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_FACTOR);
9103 RNA_def_property_ui_text(prop, "Radius", "The radius for the generated strokes");
9104 RNA_def_property_ui_range(prop, 0.0f, 0.25f, 0.01f, 2);
9105 RNA_def_property_range(prop, 0.0f, 1.0f);
9106 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9107
9108 prop = RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_FACTOR);
9109 RNA_def_property_ui_text(prop, "Opacity", "The strength value for the generate strokes");
9110 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01f, 2);
9111 RNA_def_property_range(prop, 0.0f, 1.0f);
9112 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9113
9114 prop = RNA_def_property(srna, "use_material_mask", PROP_BOOLEAN, PROP_NONE);
9116 prop, nullptr, "mask_switches", LINEART_GPENCIL_MATERIAL_MASK_ENABLE);
9118 prop, "Use Material Mask", "Use material masks to filter out occluded strokes");
9119 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9120
9121 prop = RNA_def_property(srna, "use_material_mask_match", PROP_BOOLEAN, PROP_NONE);
9123 prop, nullptr, "mask_switches", LINEART_GPENCIL_MATERIAL_MASK_MATCH);
9125 prop, "Match Masks", "Require matching all material masks instead of just one");
9126 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9127
9128 prop = RNA_def_property(srna, "use_material_mask_bits", PROP_BOOLEAN, PROP_NONE);
9129 RNA_def_property_boolean_bitset_array_sdna(prop, nullptr, "material_mask_bits", 1 << 0, 8);
9130 RNA_def_property_ui_text(prop, "Masks", "Mask bits to match from Material Line Art settings");
9131 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9132
9133 prop = RNA_def_property(srna, "use_intersection_match", PROP_BOOLEAN, PROP_NONE);
9135 prop, nullptr, "mask_switches", LINEART_GPENCIL_INTERSECTION_MATCH);
9137 prop, "Match Intersection", "Require matching all intersection masks instead of just one");
9138 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9139
9140 prop = RNA_def_property(srna, "use_intersection_mask", PROP_BOOLEAN, PROP_NONE);
9141 RNA_def_property_boolean_bitset_array_sdna(prop, nullptr, "intersection_mask", 1 << 0, 8);
9142 RNA_def_property_ui_text(prop, "Masks", "Mask bits to match from Collection Line Art settings");
9143 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9144
9145 prop = RNA_def_property(srna, "use_crease_on_smooth", PROP_BOOLEAN, PROP_NONE);
9147 prop, nullptr, "calculation_flags", MOD_LINEART_USE_CREASE_ON_SMOOTH_SURFACES);
9149 prop, "Crease On Smooth Surfaces", "Allow crease edges to show inside smooth surfaces");
9150 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9151
9152 prop = RNA_def_property(srna, "use_crease_on_sharp", PROP_BOOLEAN, PROP_NONE);
9154 prop, nullptr, "calculation_flags", MOD_LINEART_USE_CREASE_ON_SHARP_EDGES);
9155 RNA_def_property_ui_text(prop, "Crease On Sharp Edges", "Allow crease to show on sharp edges");
9156 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9157
9158 prop = RNA_def_property(srna, "use_image_boundary_trimming", PROP_BOOLEAN, PROP_NONE);
9160 prop, nullptr, "calculation_flags", MOD_LINEART_USE_IMAGE_BOUNDARY_TRIMMING);
9162 prop,
9163 "Image Boundary Trimming",
9164 "Trim all edges right at the boundary of image (including overscan region)");
9165
9166 prop = RNA_def_property(srna, "use_back_face_culling", PROP_BOOLEAN, PROP_NONE);
9168 prop, nullptr, "calculation_flags", MOD_LINEART_USE_BACK_FACE_CULLING);
9170 prop,
9171 "Back Face Culling",
9172 "Remove all back faces to speed up calculation, this will create edges in "
9173 "different occlusion levels than when disabled");
9174 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9175
9176 prop = RNA_def_property(srna, "shadow_camera_near", PROP_FLOAT, PROP_NONE);
9177 RNA_def_property_ui_text(prop, "Shadow Camera Near", "Near clipping distance of shadow camera");
9178 RNA_def_property_ui_range(prop, 0.0f, 500.0f, 0.1f, 2);
9179 RNA_def_property_range(prop, 0.0f, 10000.0f);
9180 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9181
9182 prop = RNA_def_property(srna, "shadow_camera_far", PROP_FLOAT, PROP_NONE);
9183 RNA_def_property_ui_text(prop, "Shadow Camera Far", "Far clipping distance of shadow camera");
9184 RNA_def_property_ui_range(prop, 0.0f, 500.0f, 0.1f, 2);
9185 RNA_def_property_range(prop, 0.0f, 10000.0f);
9186 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9187
9188 prop = RNA_def_property(srna, "shadow_camera_size", PROP_FLOAT, PROP_NONE);
9190 prop,
9191 "Shadow Camera Size",
9192 "Represents the \"Orthographic Scale\" of an orthographic camera. "
9193 "If the camera is positioned at the light's location with this scale, it will "
9194 "represent the coverage of the shadow \"camera\".");
9195 RNA_def_property_ui_range(prop, 0.0f, 500.0f, 0.1f, 2);
9196 RNA_def_property_range(prop, 0.0f, 10000.0f);
9197
9198 prop = RNA_def_property(srna, "use_invert_collection", PROP_BOOLEAN, PROP_NONE);
9201 "Invert Collection Filtering",
9202 "Select everything except lines from specified collection");
9203 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9204
9205 prop = RNA_def_property(srna, "use_invert_silhouette", PROP_BOOLEAN, PROP_NONE);
9207 RNA_def_property_ui_text(prop, "Invert Silhouette Filtering", "Select anti-silhouette lines");
9208 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9209
9211}
9212
9214{
9215 StructRNA *srna;
9216 PropertyRNA *prop;
9217
9218 srna = RNA_def_struct(brna, "GreasePencilSmoothModifier", "Modifier");
9219 RNA_def_struct_ui_text(srna, "Smooth Modifier", "Smooth effect modifier");
9220 RNA_def_struct_sdna(srna, "GreasePencilSmoothModifierData");
9221 RNA_def_struct_ui_icon(srna, ICON_MOD_SMOOTH);
9222
9225 srna, "rna_GreasePencilSmoothModifier_material_filter_set");
9227 srna, "rna_GreasePencilSmoothModifier_vertex_group_name_set");
9229
9230 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
9231
9233
9234 prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_FACTOR);
9235 RNA_def_property_float_sdna(prop, nullptr, "factor");
9236 RNA_def_property_range(prop, 0, 1);
9237 RNA_def_property_ui_text(prop, "Factor", "Amount of smooth to apply");
9238 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9239
9240 prop = RNA_def_property(srna, "use_edit_position", PROP_BOOLEAN, PROP_NONE);
9243 prop, "Affect Position", "The modifier affects the position of the point");
9244 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9245
9246 prop = RNA_def_property(srna, "use_edit_strength", PROP_BOOLEAN, PROP_NONE);
9249 prop, "Affect Strength", "The modifier affects the color strength of the point");
9250 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9251
9252 prop = RNA_def_property(srna, "use_edit_thickness", PROP_BOOLEAN, PROP_NONE);
9255 prop, "Affect Thickness", "The modifier affects the thickness of the point");
9256 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9257
9258 prop = RNA_def_property(srna, "use_edit_uv", PROP_BOOLEAN, PROP_NONE);
9261 prop, "Affect UV", "The modifier affects the UV rotation factor of the point");
9262 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9263
9264 prop = RNA_def_property(srna, "step", PROP_INT, PROP_NONE);
9265 RNA_def_property_int_sdna(prop, nullptr, "step");
9266 RNA_def_property_range(prop, 1, 1000);
9268 prop, "Steps", "Number of times to apply smooth (high numbers can reduce fps)");
9269 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9270
9271 prop = RNA_def_property(srna, "use_keep_shape", PROP_BOOLEAN, PROP_NONE);
9273 RNA_def_property_ui_text(prop, "Keep Shape", "Smooth the details, but keep the overall shape");
9274 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9275
9276 prop = RNA_def_property(srna, "use_smooth_ends", PROP_BOOLEAN, PROP_NONE);
9278 RNA_def_property_ui_text(prop, "Smooth Ends", "Smooth ends of strokes");
9279 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9280
9282}
9283
9285{
9286 StructRNA *srna;
9287 PropertyRNA *prop;
9288
9290 static EnumPropertyItem offset_mode_items[] = {
9291 {MOD_GREASE_PENCIL_OFFSET_RANDOM, "RANDOM", 0, "Random", "Randomize stroke offset"},
9292 {MOD_GREASE_PENCIL_OFFSET_LAYER, "LAYER", 0, "Layer", "Offset layers by the same factor"},
9294 "STROKE",
9295 0,
9296 "Stroke",
9297 "Offset strokes by the same factor based on stroke draw order"},
9299 "MATERIAL",
9300 0,
9301 "Material",
9302 "Offset materials by the same factor"},
9303 {0, nullptr, 0, nullptr, nullptr},
9304 };
9305
9306 srna = RNA_def_struct(brna, "GreasePencilOffsetModifier", "Modifier");
9307 RNA_def_struct_ui_text(srna, "Grease Pencil Offset Modifier", "");
9308 RNA_def_struct_sdna(srna, "GreasePencilOffsetModifierData");
9309 RNA_def_struct_ui_icon(srna, ICON_MOD_OFFSET);
9310
9313 srna, "rna_GreasePencilOffsetModifier_material_filter_set");
9315 srna, "rna_GreasePencilOffsetModifier_vertex_group_name_set");
9316
9317 rna_def_modifier_panel_open_prop(srna, "open_general_panel", 0);
9318 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 1);
9319
9320 prop = RNA_def_property(srna, "offset_mode", PROP_ENUM, PROP_NONE);
9321 RNA_def_property_enum_items(prop, offset_mode_items);
9322 RNA_def_property_ui_text(prop, "Mode", "");
9323 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9324
9326
9327 prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
9328 RNA_def_property_float_sdna(prop, nullptr, "loc");
9329 RNA_def_property_ui_text(prop, "Location", "Values for change location");
9331 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9332
9333 prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
9334 RNA_def_property_float_sdna(prop, nullptr, "rot");
9335 RNA_def_property_ui_text(prop, "Rotation", "Values for changes in rotation");
9337 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9338
9339 prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
9340 RNA_def_property_float_sdna(prop, nullptr, "scale");
9341 RNA_def_property_ui_text(prop, "Scale", "Values for changes in scale");
9343 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9344
9345 prop = RNA_def_property(srna, "stroke_location", PROP_FLOAT, PROP_XYZ);
9346 RNA_def_property_float_sdna(prop, nullptr, "stroke_loc");
9347 RNA_def_property_ui_text(prop, "Random Offset", "Value for changes in location");
9349 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9350
9351 prop = RNA_def_property(srna, "stroke_rotation", PROP_FLOAT, PROP_EULER);
9352 RNA_def_property_float_sdna(prop, nullptr, "stroke_rot");
9353 RNA_def_property_ui_text(prop, "Random Rotation", "Value for changes in rotation");
9355 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9356
9357 prop = RNA_def_property(srna, "stroke_scale", PROP_FLOAT, PROP_XYZ);
9358 RNA_def_property_float_sdna(prop, nullptr, "stroke_scale");
9359 RNA_def_property_ui_text(prop, "Scale", "Value for changes in scale");
9361 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9362
9363 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
9364 RNA_def_property_ui_text(prop, "Seed", "Random seed");
9365 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9366
9367 prop = RNA_def_property(srna, "stroke_step", PROP_INT, PROP_UNSIGNED);
9368 RNA_def_property_ui_text(prop, "Step", "Number of elements that will be grouped");
9369 RNA_def_property_range(prop, 1, 500);
9370 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9371
9372 prop = RNA_def_property(srna, "stroke_start_offset", PROP_INT, PROP_UNSIGNED);
9373 RNA_def_property_ui_text(prop, "Start Offset", "Offset starting point");
9374 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9375
9376 prop = RNA_def_property(srna, "use_uniform_random_scale", PROP_BOOLEAN, PROP_NONE);
9378 prop, nullptr, "flag", MOD_GREASE_PENCIL_OFFSET_UNIFORM_RANDOM_SCALE);
9380 prop, "Uniform Scale", "Use the same random seed for each scale axis for a uniform scale");
9381 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9382
9384}
9385
9387{
9388 StructRNA *srna;
9389 PropertyRNA *prop;
9390
9391 static const EnumPropertyItem modifier_noise_random_mode_items[] = {
9392 {GP_NOISE_RANDOM_STEP, "STEP", 0, "Steps", "Randomize every number of frames"},
9393 {GP_NOISE_RANDOM_KEYFRAME, "KEYFRAME", 0, "Keyframes", "Randomize on keyframes only"},
9394 {0, nullptr, 0, nullptr, nullptr},
9395 };
9396
9397 srna = RNA_def_struct(brna, "GreasePencilNoiseModifier", "Modifier");
9398 RNA_def_struct_ui_text(srna, "Grease Pencil Noise Modifier", "Noise effect modifier");
9399 RNA_def_struct_sdna(srna, "GreasePencilNoiseModifierData");
9400 RNA_def_struct_ui_icon(srna, ICON_MOD_NOISE);
9401
9404 srna, "rna_GreasePencilNoiseModifier_material_filter_set");
9406 srna, "rna_GreasePencilNoiseModifier_vertex_group_name_set");
9408
9409 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
9410 rna_def_modifier_panel_open_prop(srna, "open_random_panel", 1);
9411
9413
9414 prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_FACTOR);
9415 RNA_def_property_float_sdna(prop, nullptr, "factor");
9416 RNA_def_property_range(prop, 0.0, FLT_MAX);
9417 RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 2);
9418 RNA_def_property_ui_text(prop, "Position Factor", "Amount of noise to apply");
9419 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9420
9421 prop = RNA_def_property(srna, "factor_strength", PROP_FLOAT, PROP_FACTOR);
9422 RNA_def_property_float_sdna(prop, nullptr, "factor_strength");
9423 RNA_def_property_range(prop, 0.0, FLT_MAX);
9424 RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 2);
9425 RNA_def_property_ui_text(prop, "Strength Factor", "Amount of noise to apply to opacity");
9426 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9427
9428 prop = RNA_def_property(srna, "factor_thickness", PROP_FLOAT, PROP_FACTOR);
9429 RNA_def_property_float_sdna(prop, nullptr, "factor_thickness");
9430 RNA_def_property_range(prop, 0.0, FLT_MAX);
9431 RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 2);
9432 RNA_def_property_ui_text(prop, "Thickness Factor", "Amount of noise to apply to thickness");
9433 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9434
9435 prop = RNA_def_property(srna, "factor_uvs", PROP_FLOAT, PROP_FACTOR);
9436 RNA_def_property_float_sdna(prop, nullptr, "factor_uvs");
9437 RNA_def_property_range(prop, 0.0, FLT_MAX);
9438 RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 2);
9439 RNA_def_property_ui_text(prop, "UV Factor", "Amount of noise to apply to UV rotation");
9440 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9441
9442 prop = RNA_def_property(srna, "use_random", PROP_BOOLEAN, PROP_NONE);
9443 RNA_def_property_boolean_sdna(prop, nullptr, "flag", GP_NOISE_USE_RANDOM);
9444 RNA_def_property_ui_text(prop, "Random", "Use random values over time");
9445 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9446
9447 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
9448 RNA_def_property_ui_text(prop, "Noise Seed", "Random seed");
9449 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9450
9451 prop = RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_FACTOR);
9452 RNA_def_property_float_sdna(prop, nullptr, "noise_scale");
9453 RNA_def_property_range(prop, 0.0, 1.0);
9454 RNA_def_property_ui_text(prop, "Noise Scale", "Scale the noise frequency");
9455 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9456
9457 prop = RNA_def_property(srna, "noise_offset", PROP_FLOAT, PROP_FACTOR);
9458 RNA_def_property_float_sdna(prop, nullptr, "noise_offset");
9459 RNA_def_property_range(prop, 0.0, FLT_MAX);
9460 RNA_def_property_ui_range(prop, 0.0, 100.0, 0.1, 3);
9461 RNA_def_property_ui_text(prop, "Noise Offset", "Offset the noise along the strokes");
9462 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9463
9464 prop = RNA_def_property(srna, "step", PROP_INT, PROP_NONE);
9465 RNA_def_property_int_sdna(prop, nullptr, "step");
9466 RNA_def_property_range(prop, 1, 100);
9467 RNA_def_property_ui_text(prop, "Step", "Number of frames between randomization steps");
9468 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9469
9470 prop = RNA_def_property(srna, "random_mode", PROP_ENUM, PROP_NONE);
9471 RNA_def_property_enum_sdna(prop, nullptr, "noise_mode");
9472 RNA_def_property_enum_items(prop, modifier_noise_random_mode_items);
9474 RNA_def_property_ui_text(prop, "Mode", "Where to perform randomization");
9475
9477}
9478
9480{
9481 StructRNA *srna;
9482 PropertyRNA *prop;
9483 static const EnumPropertyItem gpencil_length_mode_items[] = {
9484 {GP_LENGTH_RELATIVE, "RELATIVE", 0, "Relative", "Length in ratio to the stroke's length"},
9485 {GP_LENGTH_ABSOLUTE, "ABSOLUTE", 0, "Absolute", "Length in geometry space"},
9486 {0, nullptr, 0, nullptr, nullptr},
9487 };
9488
9489 srna = RNA_def_struct(brna, "GreasePencilLengthModifier", "Modifier");
9490 RNA_def_struct_ui_text(srna, "Length Modifier", "Stretch or shrink strokes");
9491 RNA_def_struct_sdna(srna, "GreasePencilLengthModifierData");
9492 RNA_def_struct_ui_icon(srna, ICON_MOD_LENGTH);
9493
9496 srna, "rna_GreasePencilLengthModifier_material_filter_set");
9497
9498 rna_def_modifier_panel_open_prop(srna, "open_random_panel", 0);
9499 rna_def_modifier_panel_open_prop(srna, "open_curvature_panel", 1);
9500 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 2);
9501
9503
9504 prop = RNA_def_property(srna, "start_factor", PROP_FLOAT, PROP_NONE);
9505 RNA_def_property_float_sdna(prop, nullptr, "start_fac");
9506 RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1, 2);
9508 prop, "Start Factor", "Added length to the start of each stroke relative to its length");
9509 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9510
9511 prop = RNA_def_property(srna, "end_factor", PROP_FLOAT, PROP_NONE);
9512 RNA_def_property_float_sdna(prop, nullptr, "end_fac");
9513 RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1, 2);
9515 prop, "End Factor", "Added length to the end of each stroke relative to its length");
9516 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9517
9518 prop = RNA_def_property(srna, "start_length", PROP_FLOAT, PROP_DISTANCE);
9519 RNA_def_property_float_sdna(prop, nullptr, "start_fac");
9520 RNA_def_property_ui_range(prop, -100.0f, 100.0f, 0.1f, 3);
9522 prop, "Start Factor", "Absolute added length to the start of each stroke");
9523 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9524
9525 prop = RNA_def_property(srna, "end_length", PROP_FLOAT, PROP_DISTANCE);
9526 RNA_def_property_float_sdna(prop, nullptr, "end_fac");
9527 RNA_def_property_ui_range(prop, -100.0f, 100.0f, 0.1f, 3);
9528 RNA_def_property_ui_text(prop, "End Factor", "Absolute added length to the end of each stroke");
9529 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9530
9531 prop = RNA_def_property(srna, "random_start_factor", PROP_FLOAT, PROP_NONE);
9532 RNA_def_property_float_sdna(prop, nullptr, "rand_start_fac");
9533 RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1, 1);
9535 prop, "Random Start Factor", "Size of random length added to the start of each stroke");
9536 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9537
9538 prop = RNA_def_property(srna, "random_end_factor", PROP_FLOAT, PROP_NONE);
9539 RNA_def_property_float_sdna(prop, nullptr, "rand_end_fac");
9540 RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1, 1);
9542 prop, "Random End Factor", "Size of random length added to the end of each stroke");
9543 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9544
9545 prop = RNA_def_property(srna, "random_offset", PROP_FLOAT, PROP_NONE);
9546 RNA_def_property_float_sdna(prop, nullptr, "rand_offset");
9547 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 0.1, 3);
9549 prop, "Random Noise Offset", "Smoothly offset each stroke's random value");
9550 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9551
9552 prop = RNA_def_property(srna, "use_random", PROP_BOOLEAN, PROP_NONE);
9554 RNA_def_property_ui_text(prop, "Random", "Use random values over time");
9555 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9556
9557 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
9558 RNA_def_property_ui_text(prop, "Seed", "Random seed");
9559 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9560
9561 prop = RNA_def_property(srna, "step", PROP_INT, PROP_NONE);
9562 RNA_def_property_int_sdna(prop, nullptr, "step");
9563 RNA_def_property_range(prop, 1, 100);
9564 RNA_def_property_ui_text(prop, "Step", "Number of frames between randomization steps");
9565 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9566
9567 prop = RNA_def_property(srna, "overshoot_factor", PROP_FLOAT, PROP_FACTOR);
9568 RNA_def_property_float_sdna(prop, nullptr, "overshoot_fac");
9569 RNA_def_property_range(prop, 0.0f, 1.0f);
9571 prop,
9572 "Used Length",
9573 "Defines what portion of the stroke is used for the calculation of the extension");
9574 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9575
9576 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
9577 RNA_def_property_enum_sdna(prop, nullptr, "mode");
9578 RNA_def_property_enum_items(prop, gpencil_length_mode_items);
9579 RNA_def_property_ui_text(prop, "Mode", "Mode to define length");
9580 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9581
9582 prop = RNA_def_property(srna, "use_curvature", PROP_BOOLEAN, PROP_NONE);
9584 RNA_def_property_ui_text(prop, "Use Curvature", "Follow the curvature of the stroke");
9585 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9586
9587 prop = RNA_def_property(srna, "invert_curvature", PROP_BOOLEAN, PROP_NONE);
9590 prop, "Invert Curvature", "Invert the curvature of the stroke's extension");
9591 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9592
9593 prop = RNA_def_property(srna, "point_density", PROP_FLOAT, PROP_NONE);
9594 RNA_def_property_range(prop, 0.1f, 1000.0f);
9595 RNA_def_property_ui_range(prop, 0.1f, 1000.0f, 1.0f, 1);
9598 prop, "Point Density", "Multiplied by Start/End for the total added point count");
9599 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9600
9601 prop = RNA_def_property(srna, "segment_influence", PROP_FLOAT, PROP_FACTOR);
9602 RNA_def_property_range(prop, -2.0f, 3.0f);
9603 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 2);
9605 "Segment Influence",
9606 "Factor to determine how much the length of the individual segments "
9607 "should influence the final computed curvature. Higher factors makes "
9608 "small segments influence the overall curvature less.");
9609 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9610
9611 prop = RNA_def_property(srna, "max_angle", PROP_FLOAT, PROP_ANGLE);
9613 "Filter Angle",
9614 "Ignore points on the stroke that deviate from their neighbors by more "
9615 "than this angle when determining the extrapolation shape");
9616 RNA_def_property_range(prop, 0.0f, DEG2RAD(180.0f));
9617 RNA_def_property_ui_range(prop, 0.0f, DEG2RAD(179.5f), 10.0f, 1);
9618 RNA_def_property_update(prop, NC_SCENE, "rna_Modifier_update");
9619
9621}
9622
9624{
9625 StructRNA *srna;
9626 PropertyRNA *prop;
9627
9628 srna = RNA_def_struct(brna, "GreasePencilMirrorModifier", "Modifier");
9629 RNA_def_struct_ui_text(srna, "Grease Pencil Mirror Modifier", "");
9630 RNA_def_struct_sdna(srna, "GreasePencilMirrorModifierData");
9631 RNA_def_struct_ui_icon(srna, ICON_MOD_MIRROR);
9632
9635 srna, "rna_GreasePencilMirrorModifier_material_filter_set");
9636
9637 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
9638
9640
9641 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
9642 RNA_def_property_ui_text(prop, "Object", "Object used as center");
9644 prop, nullptr, "rna_GreasePencilMirrorModifier_object_set", nullptr, nullptr);
9646 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
9647
9648 prop = RNA_def_property(srna, "use_axis_x", PROP_BOOLEAN, PROP_NONE);
9650 RNA_def_property_ui_text(prop, "X", "Mirror the X axis");
9651 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9652
9653 prop = RNA_def_property(srna, "use_axis_y", PROP_BOOLEAN, PROP_NONE);
9655 RNA_def_property_ui_text(prop, "Y", "Mirror the Y axis");
9656 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9657
9658 prop = RNA_def_property(srna, "use_axis_z", PROP_BOOLEAN, PROP_NONE);
9660 RNA_def_property_ui_text(prop, "Z", "Mirror the Z axis");
9661 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9662
9664}
9665
9667{
9668 StructRNA *srna;
9669 PropertyRNA *prop;
9670
9671 srna = RNA_def_struct(brna, "GreasePencilThickModifierData", "Modifier");
9672 RNA_def_struct_ui_text(srna, "Grease Pencil Thickness Modifier", "Adjust stroke thickness");
9673 RNA_def_struct_sdna(srna, "GreasePencilThickModifierData");
9674 RNA_def_struct_ui_icon(srna, ICON_MOD_THICKNESS);
9675
9678 srna, "rna_GreasePencilThickModifier_material_filter_set");
9680 srna, "rna_GreasePencilThickModifier_vertex_group_name_set");
9682
9683 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
9684
9686
9687 prop = RNA_def_property(srna, "thickness", PROP_FLOAT, PROP_NONE);
9688 RNA_def_property_float_sdna(prop, nullptr, "thickness");
9689 RNA_def_property_range(prop, -10.0f, 100.0f);
9690 RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.005, 3);
9691 RNA_def_property_ui_text(prop, "Thickness", "Absolute thickness to apply everywhere");
9692 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9693
9694 prop = RNA_def_property(srna, "thickness_factor", PROP_FLOAT, PROP_NONE);
9695 RNA_def_property_float_sdna(prop, nullptr, "thickness_fac");
9696 RNA_def_property_range(prop, 0.0, FLT_MAX);
9697 RNA_def_property_ui_range(prop, 0.0, 10.0, 0.1, 3);
9698 RNA_def_property_ui_text(prop, "Thickness Factor", "Factor to multiply the thickness with");
9699 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9700
9701 prop = RNA_def_property(srna, "use_weight_factor", PROP_BOOLEAN, PROP_NONE);
9703 RNA_def_property_ui_text(prop, "Weighted", "Use weight to modulate effect");
9704 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9705
9706 prop = RNA_def_property(srna, "use_uniform_thickness", PROP_BOOLEAN, PROP_NONE);
9708 RNA_def_property_ui_text(prop, "Uniform Thickness", "Replace the stroke thickness");
9709 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9710
9712}
9713
9715{
9716 StructRNA *srna;
9717 PropertyRNA *prop;
9718
9719 srna = RNA_def_struct(brna, "GreasePencilArrayModifier", "Modifier");
9720 RNA_def_struct_ui_text(srna, "Instance Modifier", "Create grid of duplicate instances");
9721 RNA_def_struct_sdna(srna, "GreasePencilArrayModifierData");
9722 RNA_def_struct_ui_icon(srna, ICON_MOD_ARRAY);
9723
9726 srna, "rna_GreasePencilArrayModifier_material_filter_set");
9727
9728 rna_def_modifier_panel_open_prop(srna, "open_constant_offset_panel", 0);
9729 rna_def_modifier_panel_open_prop(srna, "open_relative_offset_panel", 1);
9730 rna_def_modifier_panel_open_prop(srna, "open_object_offset_panel", 2);
9731 rna_def_modifier_panel_open_prop(srna, "open_randomize_panel", 3);
9732 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 4);
9733
9735
9736 prop = RNA_def_property(srna, "count", PROP_INT, PROP_NONE);
9737 RNA_def_property_range(prop, 1, SHRT_MAX);
9738 RNA_def_property_ui_range(prop, 1, 50, 1, -1);
9739 RNA_def_property_ui_text(prop, "Count", "Number of items");
9740 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9741
9742 /* Offset parameters */
9743 prop = RNA_def_property(srna, "offset_object", PROP_POINTER, PROP_NONE);
9744 RNA_def_property_pointer_sdna(prop, nullptr, "object");
9746 prop,
9747 "Offset Object",
9748 "Use the location and rotation of another object to determine the distance and "
9749 "rotational change between arrayed items");
9751 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
9752
9753 prop = RNA_def_property(srna, "constant_offset", PROP_FLOAT, PROP_TRANSLATION);
9754 RNA_def_property_float_sdna(prop, nullptr, "offset");
9755 RNA_def_property_ui_text(prop, "Constant Offset", "Value for the distance between items");
9757 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9758
9759 prop = RNA_def_property(srna, "relative_offset", PROP_FLOAT, PROP_XYZ);
9760 RNA_def_property_float_sdna(prop, nullptr, "shift");
9762 prop,
9763 "Relative Offset",
9764 "The size of the geometry will determine the distance between arrayed items");
9766 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9767
9768 prop = RNA_def_property(srna, "random_offset", PROP_FLOAT, PROP_XYZ);
9769 RNA_def_property_float_sdna(prop, nullptr, "rnd_offset");
9770 RNA_def_property_ui_text(prop, "Random Offset", "Value for changes in location");
9772 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9773
9774 prop = RNA_def_property(srna, "random_rotation", PROP_FLOAT, PROP_EULER);
9775 RNA_def_property_float_sdna(prop, nullptr, "rnd_rot");
9776 RNA_def_property_ui_text(prop, "Random Rotation", "Value for changes in rotation");
9778 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9779
9780 prop = RNA_def_property(srna, "random_scale", PROP_FLOAT, PROP_XYZ);
9781 RNA_def_property_float_sdna(prop, nullptr, "rnd_scale");
9782 RNA_def_property_ui_text(prop, "Scale", "Value for changes in scale");
9784 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9785
9786 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
9787 RNA_def_property_ui_text(prop, "Seed", "Random seed");
9788 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9789
9790 prop = RNA_def_property(srna, "replace_material", PROP_INT, PROP_NONE);
9791 RNA_def_property_int_sdna(prop, nullptr, "mat_rpl");
9792 RNA_def_property_range(prop, 0, SHRT_MAX);
9794 prop,
9795 "Material",
9796 "Index of the material used for generated strokes (0 keep original material)");
9797 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9798
9799 prop = RNA_def_property(srna, "use_constant_offset", PROP_BOOLEAN, PROP_NONE);
9801 RNA_def_property_ui_text(prop, "Offset", "Enable offset");
9802 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9803
9804 prop = RNA_def_property(srna, "use_object_offset", PROP_BOOLEAN, PROP_NONE);
9807 prop, "Use Object Offset", "Add another object's transformation to the total offset");
9808 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9809
9810 prop = RNA_def_property(srna, "use_relative_offset", PROP_BOOLEAN, PROP_NONE);
9812 RNA_def_property_ui_text(prop, "Shift", "Add an offset relative to the object's bounding box");
9813 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9814
9815 prop = RNA_def_property(srna, "use_uniform_random_scale", PROP_BOOLEAN, PROP_NONE);
9817 prop, nullptr, "flag", MOD_GREASE_PENCIL_ARRAY_UNIFORM_RANDOM_SCALE);
9819 prop, "Uniform Scale", "Use the same random seed for each scale axis for a uniform scale");
9820 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9821
9823}
9824
9826{
9827 StructRNA *srna;
9828 PropertyRNA *prop;
9829
9830 srna = RNA_def_struct(brna, "GreasePencilLatticeModifier", "Modifier");
9832 srna, "Grease Pencil Lattice Modifier", "Deform strokes using a lattice object");
9833 RNA_def_struct_sdna(srna, "GreasePencilLatticeModifierData");
9834 RNA_def_struct_ui_icon(srna, ICON_MOD_LATTICE);
9835
9838 srna, "rna_GreasePencilLatticeModifier_material_filter_set");
9840 srna, "rna_GreasePencilLatticeModifier_vertex_group_name_set");
9841
9842 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
9843
9845
9846 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
9847 RNA_def_property_ui_text(prop, "Object", "Lattice object to deform with");
9849 nullptr,
9850 "rna_GreasePencilLatticeModifier_object_set",
9851 nullptr,
9852 "rna_Lattice_object_poll");
9854 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
9855
9856 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
9858 RNA_def_property_ui_range(prop, 0, 1, 10, 2);
9859 RNA_def_property_ui_text(prop, "Strength", "Strength of modifier effect");
9860 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9861
9863}
9864
9866{
9867 StructRNA *srna;
9868 PropertyRNA *prop;
9869
9870 srna = RNA_def_struct(brna, "GreasePencilDashModifierSegment", nullptr);
9871 RNA_def_struct_ui_text(srna, "Dash Modifier Segment", "Configuration for a single dash segment");
9872 RNA_def_struct_sdna(srna, "GreasePencilDashModifierSegment");
9873 RNA_def_struct_path_func(srna, "rna_GreasePencilDashModifierSegment_path");
9874
9875 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
9876 RNA_def_property_ui_text(prop, "Name", "Name of the dash segment");
9878 prop, nullptr, nullptr, "rna_GreasePencilDashModifierSegment_name_set");
9879 RNA_def_struct_name_property(srna, prop);
9881
9882 prop = RNA_def_property(srna, "dash", PROP_INT, PROP_NONE);
9885 prop,
9886 "Dash",
9887 "The number of consecutive points from the original stroke to include in this segment");
9888 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9889
9890 prop = RNA_def_property(srna, "gap", PROP_INT, PROP_NONE);
9892 RNA_def_property_ui_text(prop, "Gap", "The number of points skipped after this segment");
9893 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9894
9895 prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_FACTOR | PROP_UNSIGNED);
9896 RNA_def_property_ui_range(prop, 0, 1, 0.1, 2);
9898 prop, "Radius", "The factor to apply to the original point's radius for the new points");
9899 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9900
9901 prop = RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_FACTOR);
9902 RNA_def_property_ui_range(prop, 0, 1, 0.1, 2);
9904 prop, "Opacity", "The factor to apply to the original point's opacity for the new points");
9905 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9906
9907 prop = RNA_def_property(srna, "material_index", PROP_INT, PROP_NONE);
9908 RNA_def_property_int_sdna(prop, nullptr, "mat_nr");
9911 prop,
9912 "Material Index",
9913 "Use this index on generated segment. -1 means using the existing material.");
9914 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9915
9916 prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
9918 RNA_def_property_ui_text(prop, "Cyclic", "Enable cyclic on individual stroke dashes");
9919 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9920}
9921
9923{
9924 StructRNA *srna;
9925 PropertyRNA *prop;
9926
9927 srna = RNA_def_struct(brna, "GreasePencilDashModifierData", "Modifier");
9929 srna, "Grease Pencil Dash Modifier", "Create dot-dash effect for strokes");
9930 RNA_def_struct_sdna(srna, "GreasePencilDashModifierData");
9931 RNA_def_struct_ui_icon(srna, ICON_MOD_DASH);
9932
9935 srna, "rna_GreasePencilDashModifier_material_filter_set");
9936
9937 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
9938
9940
9941 prop = RNA_def_property(srna, "segments", PROP_COLLECTION, PROP_NONE);
9942 RNA_def_property_struct_type(prop, "GreasePencilDashModifierSegment");
9943 RNA_def_property_collection_sdna(prop, nullptr, "segments_array", nullptr);
9945 "rna_GreasePencilDashModifier_segments_begin",
9946 "rna_iterator_array_next",
9947 "rna_iterator_array_end",
9948 "rna_iterator_array_get",
9949 nullptr,
9950 nullptr,
9951 nullptr,
9952 nullptr);
9953 RNA_def_property_ui_text(prop, "Segments", "");
9954
9955 prop = RNA_def_property(srna, "segment_active_index", PROP_INT, PROP_UNSIGNED);
9957 RNA_def_property_ui_text(prop, "Active Dash Segment Index", "Active index in the segment list");
9958
9959 prop = RNA_def_property(srna, "dash_offset", PROP_INT, PROP_NONE);
9961 prop,
9962 "Offset",
9963 "Offset into each stroke before the beginning of the dashed segment generation");
9964 RNA_def_property_update(prop, 0, "rna_Modifier_update");
9965
9967}
9968
9970{
9971 StructRNA *srna;
9972 PropertyRNA *prop;
9973
9974 static const EnumPropertyItem axis_items[] = {
9975 {0, "X", 0, "X", ""},
9976 {1, "Y", 0, "Y", ""},
9977 {2, "Z", 0, "Z", ""},
9978 {0, nullptr, 0, nullptr, nullptr},
9979 };
9980
9981 static const EnumPropertyItem space_items[] = {
9982 {MOD_GREASE_PENCIL_WEIGHT_ANGLE_SPACE_LOCAL, "LOCAL", 0, "Local Space", ""},
9983 {MOD_GREASE_PENCIL_WEIGHT_ANGLE_SPACE_WORLD, "WORLD", 0, "World Space", ""},
9984 {0, nullptr, 0, nullptr, nullptr},
9985 };
9986
9987 srna = RNA_def_struct(brna, "GreasePencilWeightAngleModifier", "Modifier");
9988 RNA_def_struct_ui_text(srna, "Weight Modifier Angle", "Calculate Vertex Weight dynamically");
9989 RNA_def_struct_sdna(srna, "GreasePencilWeightAngleModifierData");
9990 RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT);
9991
9994 srna, "rna_GreasePencilWeightAngleModifier_material_filter_set");
9996 srna, "rna_GreasePencilWeightAngleModifier_vertex_group_name_set");
9997
9998 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
9999
10001
10002 prop = RNA_def_property(srna, "target_vertex_group", PROP_STRING, PROP_NONE);
10003 RNA_def_property_string_sdna(prop, nullptr, "target_vgname");
10004 RNA_def_property_ui_text(prop, "Vertex Group", "Output Vertex group");
10006 prop, nullptr, nullptr, "rna_GreasePencilWeightAngleModifier_target_vgname_set");
10007 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10008
10009 prop = RNA_def_property(srna, "use_multiply", PROP_BOOLEAN, PROP_NONE);
10012 prop,
10013 "Multiply Weights",
10014 "Multiply the calculated weights with the existing values in the vertex group");
10015 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10016
10017 prop = RNA_def_property(srna, "use_invert_output", PROP_BOOLEAN, PROP_NONE);
10019 RNA_def_property_ui_text(prop, "Invert", "Invert output weight values");
10020 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10021
10022 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
10023 RNA_def_property_float_sdna(prop, nullptr, "angle");
10024 RNA_def_property_ui_text(prop, "Angle", "Angle");
10025 RNA_def_property_range(prop, 0.0f, DEG2RAD(180.0f));
10026 RNA_def_property_update(prop, NC_SCENE, "rna_Modifier_update");
10027
10028 prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE);
10029 RNA_def_property_enum_sdna(prop, nullptr, "axis");
10030 RNA_def_property_enum_items(prop, axis_items);
10031 RNA_def_property_ui_text(prop, "Axis", "");
10032 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10033
10034 prop = RNA_def_property(srna, "space", PROP_ENUM, PROP_NONE);
10035 RNA_def_property_enum_sdna(prop, nullptr, "space");
10037 RNA_def_property_ui_text(prop, "Space", "Coordinates space");
10038 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10039
10040 prop = RNA_def_property(srna, "minimum_weight", PROP_FLOAT, PROP_FACTOR);
10041 RNA_def_property_float_sdna(prop, nullptr, "min_weight");
10042 RNA_def_property_ui_text(prop, "Minimum", "Minimum value for vertex weight");
10043 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10044
10046}
10047
10049{
10050 StructRNA *srna;
10051 PropertyRNA *prop;
10052
10053 srna = RNA_def_struct(brna, "GreasePencilMultiplyModifier", "Modifier");
10054 RNA_def_struct_ui_text(srna, "Multiply Modifier", "Generate multiple strokes from one stroke");
10055 RNA_def_struct_sdna(srna, "GreasePencilMultiModifierData");
10056 RNA_def_struct_ui_icon(srna, ICON_GP_MULTIFRAME_EDITING);
10057
10060 srna, "rna_GreasePencilMultiModifier_material_filter_set");
10061
10062 rna_def_modifier_panel_open_prop(srna, "open_fading_panel", 1);
10063 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
10064
10066
10067 prop = RNA_def_property(srna, "use_fade", PROP_BOOLEAN, PROP_NONE);
10069 RNA_def_property_ui_text(prop, "Fade", "Fade the stroke thickness for each generated stroke");
10070 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10071
10072 prop = RNA_def_property(srna, "duplicates", PROP_INT, PROP_NONE);
10073 RNA_def_property_int_sdna(prop, nullptr, "duplications");
10074 RNA_def_property_range(prop, 0, 999);
10075 RNA_def_property_ui_range(prop, 1, 10, 1, 1);
10076 RNA_def_property_ui_text(prop, "Duplicates", "How many copies of strokes be displayed");
10077 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10078
10079 prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
10081 RNA_def_property_ui_range(prop, 0.0, 1.0, 0.01, 3);
10082 RNA_def_property_ui_text(prop, "Distance", "Distance of duplications");
10083 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10084
10085 prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
10086 RNA_def_property_ui_range(prop, -1, 1, 0.01, 3);
10087 RNA_def_property_ui_text(prop, "Offset", "Offset of duplicates, -1 to 1 (inner to outer)");
10088 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10089
10090 prop = RNA_def_property(srna, "fading_thickness", PROP_FLOAT, PROP_NONE);
10091 RNA_def_property_range(prop, 0, 1);
10092 RNA_def_property_ui_text(prop, "Thickness", "Fade influence of stroke's thickness");
10093 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10094
10095 prop = RNA_def_property(srna, "fading_opacity", PROP_FLOAT, PROP_NONE);
10096 RNA_def_property_range(prop, 0, 1);
10097 RNA_def_property_ui_text(prop, "Opacity", "Fade influence of stroke's opacity");
10098 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10099
10100 prop = RNA_def_property(srna, "fading_center", PROP_FLOAT, PROP_FACTOR);
10101 RNA_def_property_range(prop, 0, 1);
10102 RNA_def_property_ui_text(prop, "Center", "Fade center");
10103 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10104
10106}
10107
10109{
10110 StructRNA *srna;
10111 PropertyRNA *prop;
10112
10113 static const EnumPropertyItem hook_falloff_items[] = {
10114 {MOD_GREASE_PENCIL_HOOK_Falloff_None, "NONE", 0, "No Falloff", ""},
10115 {MOD_GREASE_PENCIL_HOOK_Falloff_Curve, "CURVE", 0, "Curve", ""},
10116 {MOD_GREASE_PENCIL_HOOK_Falloff_Smooth, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
10117 {MOD_GREASE_PENCIL_HOOK_Falloff_Sphere, "SPHERE", ICON_SPHERECURVE, "Sphere", ""},
10118 {MOD_GREASE_PENCIL_HOOK_Falloff_Root, "ROOT", ICON_ROOTCURVE, "Root", ""},
10120 "INVERSE_SQUARE",
10121 ICON_ROOTCURVE,
10122 "Inverse Square",
10123 ""},
10124 {MOD_GREASE_PENCIL_HOOK_Falloff_Sharp, "SHARP", ICON_SHARPCURVE, "Sharp", ""},
10125 {MOD_GREASE_PENCIL_HOOK_Falloff_Linear, "LINEAR", ICON_LINCURVE, "Linear", ""},
10126 {MOD_GREASE_PENCIL_HOOK_Falloff_Const, "CONSTANT", ICON_NOCURVE, "Constant", ""},
10127 {0, nullptr, 0, nullptr, nullptr},
10128 };
10129
10130 srna = RNA_def_struct(brna, "GreasePencilHookModifier", "Modifier");
10132 srna, "Hook Modifier", "Hook modifier to modify the location of stroke points");
10133 RNA_def_struct_sdna(srna, "GreasePencilHookModifierData");
10134 RNA_def_struct_ui_icon(srna, ICON_HOOK);
10135
10138 srna, "rna_GreasePencilHookModifier_material_filter_set");
10140 srna, "rna_GreasePencilHookModifier_vertex_group_name_set");
10142
10143 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
10144 rna_def_modifier_panel_open_prop(srna, "open_falloff_panel", 1);
10145
10147
10148 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
10150 prop, "Object", "Parent Object for hook, also recalculates and clears offset");
10153 prop, nullptr, "rna_GreasePencilHookModifier_object_set", nullptr, nullptr);
10154 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
10155
10156 prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE);
10157 RNA_def_property_string_sdna(prop, nullptr, "subtarget");
10159 prop,
10160 "Sub-Target",
10161 "Name of Parent Bone for hook (if applicable), also recalculates and clears offset");
10162 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
10163
10164 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
10165 RNA_def_property_float_sdna(prop, nullptr, "force");
10166 RNA_def_property_range(prop, 0, 1);
10167 RNA_def_property_ui_text(prop, "Strength", "Relative force of the hook");
10168 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10169
10170 prop = RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
10171 RNA_def_property_enum_items(prop, hook_falloff_items); /* share the enum */
10172 RNA_def_property_ui_text(prop, "Falloff Type", "");
10174 BLT_I18NCONTEXT_ID_CURVE_LEGACY); /* Abusing id_curve :/ */
10175 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10176
10177 prop = RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_DISTANCE);
10178 RNA_def_property_float_sdna(prop, nullptr, "falloff");
10180 RNA_def_property_ui_range(prop, 0, 100, 100, 2);
10182 prop, "Radius", "If not zero, the distance from the hook where influence ends");
10183 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10184
10185 prop = RNA_def_property(srna, "center", PROP_FLOAT, PROP_NONE);
10186 RNA_def_property_float_sdna(prop, nullptr, "cent");
10187 RNA_def_property_ui_text(prop, "Hook Center", "");
10188 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10189
10190 prop = RNA_def_property(srna, "matrix_inverse", PROP_FLOAT, PROP_MATRIX);
10191 RNA_def_property_float_sdna(prop, nullptr, "parentinv");
10194 prop, "Matrix", "Reverse the transformation between this object and its target");
10195 RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Modifier_update");
10196
10197 prop = RNA_def_property(srna, "use_falloff_uniform", PROP_BOOLEAN, PROP_NONE);
10199 RNA_def_property_ui_text(prop, "Uniform Falloff", "Compensate for non-uniform object scale");
10200 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10201
10203}
10204
10206{
10207 StructRNA *srna;
10208 PropertyRNA *prop;
10209
10210 srna = RNA_def_struct(brna, "GreasePencilWeightProximityModifier", "Modifier");
10211 RNA_def_struct_ui_text(srna, "Weight Modifier Proximity", "Calculate Vertex Weight dynamically");
10212 RNA_def_struct_sdna(srna, "GreasePencilWeightProximityModifierData");
10213 RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT);
10214
10217 srna, "rna_GreasePencilWeightProximityModifier_material_filter_set");
10219 srna, "rna_GreasePencilWeightProximityModifier_vertex_group_name_set");
10220
10221 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
10222
10224
10225 prop = RNA_def_property(srna, "use_multiply", PROP_BOOLEAN, PROP_NONE);
10229 prop,
10230 "Multiply Weights",
10231 "Multiply the calculated weights with the existing values in the vertex group");
10232 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10233
10234 prop = RNA_def_property(srna, "use_invert_output", PROP_BOOLEAN, PROP_NONE);
10237 RNA_def_property_ui_text(prop, "Invert", "Invert output weight values");
10238 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10239
10240 prop = RNA_def_property(srna, "target_vertex_group", PROP_STRING, PROP_NONE);
10241 RNA_def_property_string_sdna(prop, nullptr, "target_vgname");
10242 RNA_def_property_ui_text(prop, "Vertex Group", "Output Vertex group");
10244 prop, nullptr, nullptr, "rna_GreasePencilWeightProximityModifier_target_vgname_set");
10245 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10246
10247 /* Distance reference object */
10248 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
10249 RNA_def_property_ui_text(prop, "Target Object", "Object used as distance reference");
10251 prop, nullptr, "rna_GreasePencilWeightProximityModifier_object_set", nullptr, nullptr);
10253 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
10254
10255 prop = RNA_def_property(srna, "distance_start", PROP_FLOAT, PROP_DISTANCE);
10256 RNA_def_property_float_sdna(prop, nullptr, "dist_start");
10257 RNA_def_property_range(prop, 0.0, FLT_MAX);
10258 RNA_def_property_ui_range(prop, 0.0, 1000.0, 1.0, 2);
10259 RNA_def_property_ui_text(prop, "Lowest", "Distance mapping to 0.0 weight");
10260 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10261
10262 prop = RNA_def_property(srna, "minimum_weight", PROP_FLOAT, PROP_FACTOR);
10263 RNA_def_property_float_sdna(prop, nullptr, "min_weight");
10264 RNA_def_property_ui_text(prop, "Minimum", "Minimum value for vertex weight");
10265 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10266
10267 prop = RNA_def_property(srna, "distance_end", PROP_FLOAT, PROP_DISTANCE);
10268 RNA_def_property_float_sdna(prop, nullptr, "dist_end");
10269 RNA_def_property_range(prop, 0.0, FLT_MAX);
10270 RNA_def_property_ui_range(prop, 0.0, 1000.0, 1.0, 2);
10271 RNA_def_property_ui_text(prop, "Highest", "Distance mapping to 1.0 weight");
10272 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10273
10275}
10276
10278{
10279 StructRNA *srna;
10280 PropertyRNA *prop;
10281
10282 static EnumPropertyItem prop_gpencil_simplify_mode_items[] = {
10284 "FIXED",
10285 ICON_IPO_CONSTANT,
10286 "Fixed",
10287 "Delete alternating vertices in the stroke, except extremes"},
10289 "ADAPTIVE",
10290 ICON_IPO_EASE_IN_OUT,
10291 "Adaptive",
10292 "Use a Ramer-Douglas-Peucker algorithm to simplify the stroke preserving main shape"},
10294 "SAMPLE",
10295 ICON_IPO_EASE_IN_OUT,
10296 "Sample",
10297 "Re-sample the stroke with segments of the specified length"},
10299 "MERGE",
10300 ICON_IPO_EASE_IN_OUT,
10301 "Merge",
10302 "Simplify the stroke by merging vertices closer than a given distance"},
10303 {0, nullptr, 0, nullptr, nullptr},
10304 };
10305
10306 srna = RNA_def_struct(brna, "GreasePencilSimplifyModifier", "Modifier");
10307 RNA_def_struct_ui_text(srna, "Simplify Modifier", "Simplify Stroke modifier");
10308 RNA_def_struct_sdna(srna, "GreasePencilSimplifyModifierData");
10309 RNA_def_struct_ui_icon(srna, ICON_MOD_SIMPLIFY);
10310
10313 srna, "rna_GreasePencilSimplifyModifier_material_filter_set");
10315 srna, "rna_GreasePencilSimplifyModifier_vertex_group_name_set");
10316
10317 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
10318
10319 prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_FACTOR);
10320 RNA_def_property_float_sdna(prop, nullptr, "factor");
10321 RNA_def_property_range(prop, 0, 100.0);
10322 RNA_def_property_ui_range(prop, 0, 5.0f, 1.0f, 3);
10323 RNA_def_property_ui_text(prop, "Factor", "Factor of Simplify");
10324 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10325
10326 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
10327 RNA_def_property_enum_items(prop, prop_gpencil_simplify_mode_items);
10328 RNA_def_property_ui_text(prop, "Mode", "How to simplify the stroke");
10329 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10330
10331 prop = RNA_def_property(srna, "step", PROP_INT, PROP_UNSIGNED);
10332 RNA_def_property_int_sdna(prop, nullptr, "step");
10333 RNA_def_property_range(prop, 1, 50);
10334 RNA_def_property_ui_text(prop, "Iterations", "Number of times to apply simplify");
10335 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10336
10337 prop = RNA_def_property(srna, "length", PROP_FLOAT, PROP_DISTANCE);
10338 RNA_def_property_float_sdna(prop, nullptr, "length");
10340 RNA_def_property_ui_range(prop, 0.005, 1.0, 0.05, 3);
10341 RNA_def_property_ui_text(prop, "Length", "Length of each segment");
10342 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10343
10344 prop = RNA_def_property(srna, "sharp_threshold", PROP_FLOAT, PROP_ANGLE);
10345 RNA_def_property_float_sdna(prop, nullptr, "sharp_threshold");
10346 RNA_def_property_range(prop, 0, M_PI);
10347 RNA_def_property_ui_range(prop, 0, M_PI, 1.0, 1);
10349 prop, "Sharp Threshold", "Preserve corners that have sharper angle than this threshold");
10350 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10351
10352 prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
10353 RNA_def_property_float_sdna(prop, nullptr, "distance");
10355 RNA_def_property_ui_range(prop, 0, 1.0, 0.01, 3);
10356 RNA_def_property_ui_text(prop, "Distance", "Distance between points");
10357 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10358
10360}
10361
10363{
10364 StructRNA *srna;
10365 PropertyRNA *prop;
10366
10367 srna = RNA_def_struct(brna, "GreasePencilArmatureModifier", "Modifier");
10368 RNA_def_struct_ui_text(srna, "Armature Modifier", "Deform stroke points using armature object");
10369 RNA_def_struct_sdna(srna, "GreasePencilArmatureModifierData");
10370 RNA_def_struct_ui_icon(srna, ICON_MOD_ARMATURE);
10371
10373 srna, "rna_GreasePencilArmatureModifier_vertex_group_name_set");
10374
10375 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
10376
10378
10379 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
10380 RNA_def_property_ui_text(prop, "Object", "Armature object to deform with");
10382 nullptr,
10383 "rna_GreasePencilArmatureModifier_object_set",
10384 nullptr,
10385 "rna_Armature_object_poll");
10387 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
10388
10389 prop = RNA_def_property(srna, "use_bone_envelopes", PROP_BOOLEAN, PROP_NONE);
10390 RNA_def_property_boolean_sdna(prop, nullptr, "deformflag", ARM_DEF_ENVELOPE);
10391 RNA_def_property_ui_text(prop, "Use Bone Envelopes", "Bind Bone envelopes to armature modifier");
10392 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10393
10394 prop = RNA_def_property(srna, "use_vertex_groups", PROP_BOOLEAN, PROP_NONE);
10395 RNA_def_property_boolean_sdna(prop, nullptr, "deformflag", ARM_DEF_VGROUP);
10396 RNA_def_property_ui_text(prop, "Use Vertex Groups", "Bind vertex groups to armature modifier");
10397 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10398
10399 prop = RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE);
10400 RNA_def_property_boolean_sdna(prop, nullptr, "deformflag", ARM_DEF_QUATERNION);
10402 prop, "Preserve Volume", "Deform rotation interpolation with quaternions");
10403 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10404
10406}
10407
10409{
10410 StructRNA *srna;
10411 PropertyRNA *prop;
10412
10413 static const EnumPropertyItem segment_mode_items[] = {
10415 "NORMAL",
10416 0,
10417 "Regular",
10418 "Apply offset in usual animation direction"},
10420 "REVERSE",
10421 0,
10422 "Reverse",
10423 "Apply offset in reverse animation direction"},
10425 "PINGPONG",
10426 0,
10427 "Ping Pong",
10428 "Loop back and forth"},
10429 {0, nullptr, 0, nullptr, nullptr},
10430 };
10431
10432 srna = RNA_def_struct(brna, "GreasePencilTimeModifierSegment", nullptr);
10433 RNA_def_struct_ui_text(srna, "Time Modifier Segment", "Configuration for a single dash segment");
10434 RNA_def_struct_sdna(srna, "GreasePencilTimeModifierSegment");
10435 RNA_def_struct_path_func(srna, "rna_GreasePencilTimeModifierSegment_path");
10436
10437 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
10438 RNA_def_property_ui_text(prop, "Name", "Name of the dash segment");
10440 prop, nullptr, nullptr, "rna_GreasePencilTimeModifierSegment_name_set");
10441 RNA_def_struct_name_property(srna, prop);
10443
10444 prop = RNA_def_property(srna, "segment_start", PROP_INT, PROP_NONE);
10446 RNA_def_property_ui_text(prop, "Frame Start", "First frame of the segment");
10447 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10448
10449 prop = RNA_def_property(srna, "segment_end", PROP_INT, PROP_NONE);
10451 RNA_def_property_ui_text(prop, "End", "Last frame of the segment");
10452 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10453
10454 prop = RNA_def_property(srna, "segment_repeat", PROP_INT, PROP_NONE);
10456 RNA_def_property_ui_text(prop, "Repeat", "Number of cycle repeats");
10457 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10458
10459 prop = RNA_def_property(srna, "segment_mode", PROP_ENUM, PROP_NONE);
10460 RNA_def_property_enum_sdna(prop, nullptr, "segment_mode");
10461 RNA_def_property_enum_items(prop, segment_mode_items);
10462 RNA_def_property_ui_text(prop, "Mode", "");
10463 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10464}
10465
10467{
10468 StructRNA *srna;
10469 PropertyRNA *prop;
10470
10471 static const EnumPropertyItem time_mode_items[] = {
10473 "NORMAL",
10474 0,
10475 "Regular",
10476 "Apply offset in usual animation direction"},
10478 "REVERSE",
10479 0,
10480 "Reverse",
10481 "Apply offset in reverse animation direction"},
10483 "FIX",
10484 0,
10485 "Fixed Frame",
10486 "Keep frame and do not change with time"},
10488 "PINGPONG",
10489 0,
10490 "Ping Pong",
10491 "Loop back and forth starting in reverse"},
10493 "CHAIN",
10494 0,
10495 "Chain",
10496 "List of chained animation segments"},
10497 {0, nullptr, 0, nullptr, nullptr},
10498 };
10499
10500 srna = RNA_def_struct(brna, "GreasePencilTimeModifier", "Modifier");
10501 RNA_def_struct_ui_text(srna, "Grease Pencil Time Modifier", "Offset keyframes");
10502 RNA_def_struct_sdna(srna, "GreasePencilTimeModifierData");
10503 RNA_def_struct_ui_icon(srna, ICON_MOD_TIME);
10504
10506
10507 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
10508 rna_def_modifier_panel_open_prop(srna, "open_custom_range_panel", 1);
10509
10511
10512 prop = RNA_def_property(srna, "segments", PROP_COLLECTION, PROP_NONE);
10513 RNA_def_property_struct_type(prop, "GreasePencilTimeModifierSegment");
10514 RNA_def_property_collection_sdna(prop, nullptr, "segments_array", nullptr);
10516 "rna_GreasePencilTimeModifier_segments_begin",
10517 "rna_iterator_array_next",
10518 "rna_iterator_array_end",
10519 "rna_iterator_array_get",
10520 nullptr,
10521 nullptr,
10522 nullptr,
10523 nullptr);
10524 RNA_def_property_ui_text(prop, "Segments", "");
10525
10526 prop = RNA_def_property(srna, "segment_active_index", PROP_INT, PROP_UNSIGNED);
10528 RNA_def_property_ui_text(prop, "Active Time Segment Index", "Active index in the segment list");
10529
10530 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
10531 RNA_def_property_enum_sdna(prop, nullptr, "mode");
10532 RNA_def_property_enum_items(prop, time_mode_items);
10533 RNA_def_property_ui_text(prop, "Mode", "");
10534 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10535
10536 prop = RNA_def_property(srna, "offset", PROP_INT, PROP_NONE);
10537 RNA_def_property_int_sdna(prop, nullptr, "offset");
10538 RNA_def_property_range(prop, SHRT_MIN, SHRT_MAX);
10540 prop, "Frame Offset", "Number of frames to offset original keyframe number or frame to fix");
10541 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10542
10543 prop = RNA_def_property(srna, "frame_scale", PROP_FLOAT, PROP_NONE);
10544 RNA_def_property_float_sdna(prop, nullptr, "frame_scale");
10545 RNA_def_property_range(prop, 0.001f, 100.0f);
10546 RNA_def_property_ui_text(prop, "Frame Scale", "Evaluation time in seconds");
10547 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10548
10549 prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
10551 RNA_def_property_int_sdna(prop, nullptr, "sfra");
10553 prop, nullptr, "rna_GreasePencilTimeModifier_start_frame_set", nullptr);
10555 RNA_def_property_ui_text(prop, "Start Frame", "First frame of the range");
10556 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10557
10558 prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
10560 RNA_def_property_int_sdna(prop, nullptr, "efra");
10561 RNA_def_property_int_funcs(prop, nullptr, "rna_GreasePencilTimeModifier_end_frame_set", nullptr);
10563 RNA_def_property_ui_text(prop, "End Frame", "Final frame of the range");
10564 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10565
10566 prop = RNA_def_property(srna, "use_keep_loop", PROP_BOOLEAN, PROP_NONE);
10569 prop, "Keep Loop", "Retiming end frames and move to start of animation to keep loop");
10570 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10571
10572 prop = RNA_def_property(srna, "use_custom_frame_range", PROP_BOOLEAN, PROP_NONE);
10575 prop, "Custom Range", "Define a custom range of frames to use in modifier");
10576 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10577
10579}
10580
10582{
10583 StructRNA *srna;
10584 PropertyRNA *prop;
10585
10586 static const EnumPropertyItem envelope_mode_items[] = {
10588 "DEFORM",
10589 0,
10590 "Deform",
10591 "Deform the stroke to best match the envelope shape"},
10593 "SEGMENTS",
10594 0,
10595 "Segments",
10596 "Add segments to create the envelope. Keep the original stroke."},
10598 "FILLS",
10599 0,
10600 "Fills",
10601 "Add fill segments to create the envelope. Don't keep the original stroke."},
10602 {0, nullptr, 0, nullptr, nullptr},
10603 };
10604
10605 srna = RNA_def_struct(brna, "GreasePencilEnvelopeModifier", "Modifier");
10607 srna, "Grease Pencil Envelope Modifier", "Envelope stroke effect modifier");
10608 RNA_def_struct_sdna(srna, "GreasePencilEnvelopeModifierData");
10609 RNA_def_struct_ui_icon(srna, ICON_MOD_ENVELOPE);
10610
10613 srna, "rna_GreasePencilEnvelopeModifier_material_filter_set");
10615 srna, "rna_GreasePencilEnvelopeModifier_vertex_group_name_set");
10616
10617 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
10618
10620
10621 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
10622 RNA_def_property_enum_sdna(prop, nullptr, "mode");
10623 RNA_def_property_enum_items(prop, envelope_mode_items);
10624 RNA_def_property_ui_text(prop, "Mode", "Algorithm to use for generating the envelope");
10625 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10626
10627 prop = RNA_def_property(srna, "spread", PROP_INT, PROP_NONE);
10628 RNA_def_property_int_sdna(prop, nullptr, "spread");
10629 RNA_def_property_range(prop, 1, INT_MAX);
10631 prop, "Spread Length", "The number of points to skip to create straight segments");
10632 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10633
10634 prop = RNA_def_property(srna, "mat_nr", PROP_INT, PROP_NONE);
10635 RNA_def_property_int_sdna(prop, nullptr, "mat_nr");
10637 RNA_def_property_ui_text(prop, "Material Index", "The material to use for the new strokes");
10638 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10639
10640 prop = RNA_def_property(srna, "thickness", PROP_FLOAT, PROP_FACTOR);
10641 RNA_def_property_float_sdna(prop, nullptr, "thickness");
10643 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
10644 RNA_def_property_ui_text(prop, "Thickness", "Multiplier for the thickness of the new strokes");
10645 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10646
10647 prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
10648 RNA_def_property_float_sdna(prop, nullptr, "strength");
10650 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
10651 RNA_def_property_ui_text(prop, "Strength", "Multiplier for the strength of the new strokes");
10653 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10654
10655 prop = RNA_def_property(srna, "skip", PROP_INT, PROP_NONE);
10656 RNA_def_property_int_sdna(prop, nullptr, "skip");
10657 RNA_def_property_range(prop, 0, INT_MAX);
10659 prop, "Skip Segments", "The number of generated segments to skip to reduce complexity");
10660 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10661
10663}
10664
10666{
10667 StructRNA *srna;
10668 PropertyRNA *prop;
10669
10670 srna = RNA_def_struct(brna, "GreasePencilOutlineModifier", "Modifier");
10671 RNA_def_struct_ui_text(srna, "Outline Modifier", "Outline of Strokes modifier from camera view");
10672 RNA_def_struct_sdna(srna, "GreasePencilOutlineModifierData");
10673 RNA_def_struct_ui_icon(srna, ICON_MOD_OUTLINE);
10674
10677 srna, "rna_GreasePencilOutlineModifier_material_filter_set");
10678
10679 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
10680
10682
10683 prop = RNA_def_property(srna, "thickness", PROP_INT, PROP_NONE);
10684 RNA_def_property_int_sdna(prop, nullptr, "thickness");
10685 RNA_def_property_range(prop, 1, 1000);
10686 RNA_def_property_ui_text(prop, "Thickness", "Thickness of the perimeter stroke");
10687 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10688
10689 prop = RNA_def_property(srna, "sample_length", PROP_FLOAT, PROP_NONE);
10690 RNA_def_property_float_sdna(prop, nullptr, "sample_length");
10691 RNA_def_property_ui_range(prop, 0.0f, 100.0f, 0.1f, 2);
10692 RNA_def_property_ui_text(prop, "Sample Length", "");
10693 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10694
10695 prop = RNA_def_property(srna, "subdivision", PROP_INT, PROP_NONE);
10696 RNA_def_property_int_sdna(prop, nullptr, "subdiv");
10697 RNA_def_property_range(prop, 0, 10);
10698 RNA_def_property_ui_text(prop, "Subdivisions", "Number of subdivisions");
10699 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10700
10701 prop = RNA_def_property(srna, "use_keep_shape", PROP_BOOLEAN, PROP_NONE);
10703 RNA_def_property_ui_text(prop, "Keep Shape", "Try to keep global shape");
10704 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10705
10706 prop = RNA_def_property(srna, "outline_material", PROP_POINTER, PROP_NONE);
10709 nullptr,
10710 "rna_GreasePencilOutlineModifier_outline_material_set",
10711 nullptr,
10712 "rna_GreasePencilModifier_material_poll");
10713 RNA_def_property_ui_text(prop, "Outline Material", "Material used for outline strokes");
10714 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10715
10716 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
10717 RNA_def_property_ui_text(prop, "Target Object", "Target object to define stroke start");
10720 prop, nullptr, "rna_GreasePencilOutlineModifier_object_set", nullptr, nullptr);
10721 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
10722
10724}
10725
10727{
10728 StructRNA *srna;
10729 PropertyRNA *prop;
10730
10731 srna = RNA_def_struct(brna, "GreasePencilShrinkwrapModifier", "Modifier");
10733 "Shrinkwrap Modifier",
10734 "Shrink wrapping modifier to shrink wrap an object to a target");
10735 RNA_def_struct_sdna(srna, "GreasePencilShrinkwrapModifierData");
10736 RNA_def_struct_ui_icon(srna, ICON_MOD_SHRINKWRAP);
10737
10740 srna, "rna_GreasePencilShrinkwrapModifier_material_filter_set");
10742 srna, "rna_GreasePencilShrinkwrapModifier_vertex_group_name_set");
10743
10744 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
10745
10747
10748 prop = RNA_def_property(srna, "wrap_method", PROP_ENUM, PROP_NONE);
10749 RNA_def_property_enum_sdna(prop, nullptr, "shrink_type");
10751 RNA_def_property_ui_text(prop, "Wrap Method", "");
10752 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
10753
10754 prop = RNA_def_property(srna, "wrap_mode", PROP_ENUM, PROP_NONE);
10755 RNA_def_property_enum_sdna(prop, nullptr, "shrink_mode");
10758 prop, "Snap Mode", "Select how vertices are constrained to the target surface");
10759 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
10760
10761 prop = RNA_def_property(srna, "cull_face", PROP_ENUM, PROP_NONE);
10762 RNA_def_property_enum_sdna(prop, nullptr, "shrink_opts");
10765 "rna_GreasePencilShrinkwrapModifier_face_cull_get",
10766 "rna_GreasePencilShrinkwrapModifier_face_cull_set",
10767 nullptr);
10769 prop,
10770 "Face Cull",
10771 "Stop vertices from projecting to a face on the target when facing towards/away");
10772 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10773
10774 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
10775 RNA_def_property_ui_text(prop, "Target", "Mesh target to shrink to");
10777 nullptr,
10778 "rna_GreasePencilShrinkwrapModifier_target_set",
10779 nullptr,
10780 "rna_Mesh_object_poll");
10782 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
10783
10784 prop = RNA_def_property(srna, "auxiliary_target", PROP_POINTER, PROP_NONE);
10785 RNA_def_property_pointer_sdna(prop, nullptr, "aux_target");
10786 RNA_def_property_ui_text(prop, "Auxiliary Target", "Additional mesh target to shrink to");
10788 nullptr,
10789 "rna_GreasePencilShrinkwrapModifier_aux_target_set",
10790 nullptr,
10791 "rna_Mesh_object_poll");
10793 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
10794
10795 prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_DISTANCE);
10796 RNA_def_property_float_sdna(prop, nullptr, "keep_dist");
10798 RNA_def_property_ui_range(prop, -100, 100, 1, 2);
10799 RNA_def_property_ui_text(prop, "Offset", "Distance to keep from the target");
10800 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10801
10802 prop = RNA_def_property(srna, "project_limit", PROP_FLOAT, PROP_DISTANCE);
10803 RNA_def_property_float_sdna(prop, nullptr, "proj_limit");
10804 RNA_def_property_range(prop, 0.0, FLT_MAX);
10805 RNA_def_property_ui_range(prop, 0, 100, 1, 2);
10807 prop, "Project Limit", "Limit the distance used for projection (zero disables)");
10808 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10809
10810 prop = RNA_def_property(srna, "use_project_x", PROP_BOOLEAN, PROP_NONE);
10812 RNA_def_property_ui_text(prop, "X", "");
10813 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10814
10815 prop = RNA_def_property(srna, "use_project_y", PROP_BOOLEAN, PROP_NONE);
10817 RNA_def_property_ui_text(prop, "Y", "");
10818 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10819
10820 prop = RNA_def_property(srna, "use_project_z", PROP_BOOLEAN, PROP_NONE);
10822 RNA_def_property_ui_text(prop, "Z", "");
10823 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10824
10825 prop = RNA_def_property(srna, "subsurf_levels", PROP_INT, PROP_NONE);
10826 RNA_def_property_int_sdna(prop, nullptr, "subsurf_levels");
10827 RNA_def_property_range(prop, 0, 6);
10828 RNA_def_property_ui_range(prop, 0, 6, 1, -1);
10830 prop,
10831 "Subdivision Levels",
10832 "Number of subdivisions that must be performed before extracting vertices' "
10833 "positions and normals");
10834 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10835
10836 prop = RNA_def_property(srna, "use_negative_direction", PROP_BOOLEAN, PROP_NONE);
10838 prop, nullptr, "shrink_opts", MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR);
10840 prop, "Negative", "Allow vertices to move in the negative direction of axis");
10841 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10842
10843 prop = RNA_def_property(srna, "use_positive_direction", PROP_BOOLEAN, PROP_NONE);
10845 prop, nullptr, "shrink_opts", MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR);
10847 prop, "Positive", "Allow vertices to move in the positive direction of axis");
10848 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10849
10850 prop = RNA_def_property(srna, "use_invert_cull", PROP_BOOLEAN, PROP_NONE);
10853 prop, "Invert Cull", "When projecting in the negative direction invert the face cull mode");
10854 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10855
10856 prop = RNA_def_property(srna, "smooth_factor", PROP_FLOAT, PROP_FACTOR);
10857 RNA_def_property_float_sdna(prop, nullptr, "smooth_factor");
10858 RNA_def_property_range(prop, 0, 1);
10859 RNA_def_property_ui_text(prop, "Smooth Factor", "Amount of smoothing to apply");
10860 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10861
10862 prop = RNA_def_property(srna, "smooth_step", PROP_INT, PROP_NONE);
10863 RNA_def_property_int_sdna(prop, nullptr, "smooth_step");
10864 RNA_def_property_range(prop, 1, 10);
10866 prop, "Steps", "Number of times to apply smooth (high numbers can reduce FPS)");
10867 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10868
10870}
10871
10873{
10874 static EnumPropertyItem prop_gpencil_build_mode_items[] = {
10876 "SEQUENTIAL",
10877 0,
10878 "Sequential",
10879 "Strokes appear/disappear one after the other, but only a single one changes at a time"},
10881 "CONCURRENT",
10882 0,
10883 "Concurrent",
10884 "Multiple strokes appear/disappear at once"},
10886 "ADDITIVE",
10887 0,
10888 "Additive",
10889 "Builds only new strokes (assuming 'additive' drawing)"},
10890 {0, nullptr, 0, nullptr, nullptr},
10891 };
10892
10893 static EnumPropertyItem prop_gpencil_build_transition_items[] = {
10895 "GROW",
10896 0,
10897 "Grow",
10898 "Show points in the order they occur in each stroke "
10899 "(e.g. for animating lines being drawn)"},
10901 "SHRINK",
10902 0,
10903 "Shrink",
10904 "Hide points from the end of each stroke to the start "
10905 "(e.g. for animating lines being erased)"},
10907 "FADE", /* "Fade" is the original id string kept for compatibility purpose. */
10908 0,
10909 "Vanish",
10910 "Hide points in the order they occur in each stroke "
10911 "(e.g. for animating ink fading or vanishing after getting drawn)"},
10912 {0, nullptr, 0, nullptr, nullptr},
10913 };
10914
10915 static EnumPropertyItem prop_gpencil_build_time_align_items[] = {
10917 "START",
10918 0,
10919 "Align Start",
10920 "All strokes start at same time (i.e. short strokes finish earlier)"},
10922 "END",
10923 0,
10924 "Align End",
10925 "All strokes end at same time (i.e. short strokes start later)"},
10926 {0, nullptr, 0, nullptr, nullptr},
10927 };
10928
10929 StructRNA *srna;
10930 PropertyRNA *prop;
10931
10932 srna = RNA_def_struct(brna, "GreasePencilBuildModifier", "Modifier");
10933 RNA_def_struct_ui_text(srna, "Build Modifier", "Animate strokes appearing and disappearing");
10934 RNA_def_struct_sdna(srna, "GreasePencilBuildModifierData");
10935 RNA_def_struct_ui_icon(srna, ICON_MOD_BUILD);
10936
10939 srna, "rna_GreasePencilBuildModifier_material_filter_set");
10940
10941 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
10942 rna_def_modifier_panel_open_prop(srna, "open_frame_range_panel", 1);
10943 rna_def_modifier_panel_open_prop(srna, "open_fading_panel", 2);
10944
10946
10947 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
10948 RNA_def_property_enum_items(prop, prop_gpencil_build_mode_items);
10949 RNA_def_property_ui_text(prop, "Mode", "How strokes are being built");
10951 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10952
10953 prop = RNA_def_property(srna, "transition", PROP_ENUM, PROP_NONE);
10954 RNA_def_property_enum_items(prop, prop_gpencil_build_transition_items);
10956 prop, "Transition", "How are strokes animated (i.e. are they appearing or disappearing)");
10957 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10958
10959 prop = RNA_def_property(srna, "start_delay", PROP_FLOAT, PROP_NONE);
10960 RNA_def_property_float_sdna(prop, nullptr, "start_delay");
10962 prop, "Delay", "Number of frames after each GP keyframe before the modifier has any effect");
10964 RNA_def_property_ui_range(prop, 0, 200, 1, -1);
10965 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10966
10967 prop = RNA_def_property(srna, "length", PROP_FLOAT, PROP_NONE);
10968 RNA_def_property_float_sdna(prop, nullptr, "length");
10970 "Length",
10971 "Maximum number of frames that the build effect can run for "
10972 "(unless another GP keyframe occurs before this time has elapsed)");
10974 RNA_def_property_ui_range(prop, 1, 1000, 1, -1);
10975 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10976
10977 prop = RNA_def_property(srna, "concurrent_time_alignment", PROP_ENUM, PROP_NONE);
10978 RNA_def_property_enum_sdna(prop, nullptr, "time_alignment");
10979 RNA_def_property_enum_items(prop, prop_gpencil_build_time_align_items);
10980 RNA_def_property_ui_text(prop, "Time Alignment", "How should strokes start to appear/disappear");
10981 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10982
10983 prop = RNA_def_property(srna, "time_mode", PROP_ENUM, PROP_NONE);
10984 RNA_def_property_enum_sdna(prop, nullptr, "time_mode");
10986 RNA_def_property_enum_funcs(prop, nullptr, nullptr, "grease_pencil_build_time_mode_filter");
10988 prop,
10989 "Timing",
10990 "Use drawing speed, a number of frames, or a manual factor to build strokes");
10991 RNA_def_property_update(prop, 0, "rna_Modifier_update");
10992
10993 /* Speed factor for MOD_GREASE_PENCIL_BUILD_TIMEMODE_DRAWSPEED. */
10994 /* TODO: Does it work? */
10995 prop = RNA_def_property(srna, "speed_factor", PROP_FLOAT, PROP_FACTOR);
10996 RNA_def_property_float_sdna(prop, nullptr, "speed_fac");
10997 RNA_def_property_ui_text(prop, "Speed Factor", "Multiply recorded drawing speed by a factor");
10998 RNA_def_property_range(prop, 0.0f, 100.0f);
10999 RNA_def_property_ui_range(prop, 0, 5, 0.001, -1);
11000 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11001
11002 /* Max gap in seconds between strokes for MOD_GREASE_PENCIL_BUILD_TIMEMODE_DRAWSPEED. */
11003 prop = RNA_def_property(srna, "speed_maxgap", PROP_FLOAT, PROP_NONE);
11004 RNA_def_property_float_sdna(prop, nullptr, "speed_maxgap");
11005 RNA_def_property_ui_text(prop, "Maximum Gap", "The maximum gap between strokes in seconds");
11006 RNA_def_property_range(prop, 0.0f, 100.0f);
11007 RNA_def_property_ui_range(prop, 0, 4, 0.01, -1);
11008 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11009
11010 prop = RNA_def_property(srna, "use_restrict_frame_range", PROP_BOOLEAN, PROP_NONE);
11013 prop, "Restrict Frame Range", "Only modify strokes during the specified frame range");
11014 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11015
11016 /* Use percentage bool (used by sequential & concurrent modes) */
11017 prop = RNA_def_property(srna, "use_percentage", PROP_BOOLEAN, PROP_NONE);
11019 prop, nullptr, "time_mode", MOD_GREASE_PENCIL_BUILD_TIMEMODE_PERCENTAGE);
11021 prop, "Restrict Visible Points", "Use a percentage factor to determine the visible points");
11022 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11023 prop = RNA_def_property(srna, "percentage_factor", PROP_FLOAT, PROP_FACTOR);
11024 RNA_def_property_float_sdna(prop, nullptr, "percentage_fac");
11025 RNA_def_property_ui_text(prop, "Factor", "Defines how much of the stroke is visible");
11026 RNA_def_property_range(prop, 0.0f, 1.0f);
11027 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11028
11029 prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
11030 RNA_def_property_float_sdna(prop, nullptr, "start_frame");
11032 prop, "Start Frame", "Start Frame (when Restrict Frame Range is enabled)");
11034 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11035
11036 prop = RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
11037 RNA_def_property_float_sdna(prop, nullptr, "end_frame");
11038 RNA_def_property_ui_text(prop, "End Frame", "End Frame (when Restrict Frame Range is enabled)");
11040 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11041
11042 prop = RNA_def_property(srna, "use_fading", PROP_BOOLEAN, PROP_NONE);
11044 RNA_def_property_ui_text(prop, "Use Fading", "Fade out strokes instead of directly cutting off");
11045 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11046
11047 prop = RNA_def_property(srna, "fade_factor", PROP_FLOAT, PROP_FACTOR);
11048 RNA_def_property_float_sdna(prop, nullptr, "fade_fac");
11049 RNA_def_property_ui_text(prop, "Fade Factor", "Defines how much of the stroke is fading in/out");
11050 RNA_def_property_range(prop, 0.0f, 1.0f);
11051 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11052
11053 prop = RNA_def_property(srna, "target_vertex_group", PROP_STRING, PROP_NONE);
11054 RNA_def_property_string_sdna(prop, nullptr, "target_vgname");
11055 RNA_def_property_ui_text(prop, "Vertex Group", "Output Vertex group");
11057 prop, nullptr, nullptr, "rna_GreasePencilBuildModifier_target_vgname_set");
11058 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11059
11060 prop = RNA_def_property(srna, "fade_opacity_strength", PROP_FLOAT, PROP_FACTOR);
11061 RNA_def_property_float_sdna(prop, nullptr, "fade_opacity_strength");
11063 prop, "Opacity Strength", "How much strength fading applies on top of stroke opacity");
11064 RNA_def_property_range(prop, 0.0f, 1.0f);
11065 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11066
11067 prop = RNA_def_property(srna, "fade_thickness_strength", PROP_FLOAT, PROP_FACTOR);
11068 RNA_def_property_float_sdna(prop, nullptr, "fade_thickness_strength");
11070 prop, "Thickness Strength", "How much strength fading applies on top of stroke thickness");
11071 RNA_def_property_range(prop, 0.0f, 1.0f);
11072 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11073
11074 prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
11075 RNA_def_property_ui_text(prop, "Object", "Object used as build starting position");
11077 prop, nullptr, "rna_GreasePencilBuildModifier_object_set", nullptr, nullptr);
11079 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
11080
11082}
11083
11085{
11086 StructRNA *srna;
11087 PropertyRNA *prop;
11088
11089 static const EnumPropertyItem fit_type_items[] = {
11091 "CONSTANT_LENGTH",
11092 0,
11093 "Constant Length",
11094 "Keep the texture at a constant length regardless of the length of each stroke"},
11096 "FIT_STROKE",
11097 0,
11098 "Stroke Length",
11099 "Scale the texture to fit the length of each stroke"},
11100 {0, nullptr, 0, nullptr, nullptr},
11101 };
11102
11103 static const EnumPropertyItem mode_items[] = {
11105 "STROKE",
11106 0,
11107 "Stroke",
11108 "Manipulate only stroke texture coordinates"},
11110 "FILL",
11111 0,
11112 "Fill",
11113 "Manipulate only fill texture coordinates"},
11115 "STROKE_AND_FILL",
11116 0,
11117 "Stroke & Fill",
11118 "Manipulate both stroke and fill texture coordinates"},
11119 {0, nullptr, 0, nullptr, nullptr},
11120 };
11121
11122 srna = RNA_def_struct(brna, "GreasePencilTextureModifier", "Modifier");
11124 srna, "Grease Pencil Texture Modifier", "Transform stroke texture coordinates Modifier");
11125 RNA_def_struct_sdna(srna, "GreasePencilTextureModifierData");
11126 RNA_def_struct_ui_icon(srna, ICON_MOD_UVPROJECT);
11127
11130 srna, "rna_GreasePencilTextureModifier_material_filter_set");
11131
11132 rna_def_modifier_panel_open_prop(srna, "open_influence_panel", 0);
11133
11135
11136 prop = RNA_def_property(srna, "uv_offset", PROP_FLOAT, PROP_NONE);
11137 RNA_def_property_float_sdna(prop, nullptr, "uv_offset");
11139 RNA_def_property_ui_range(prop, -100.0, 100.0, 0.1, 3);
11140 RNA_def_property_ui_text(prop, "UV Offset", "Offset value to add to stroke UVs");
11141 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11142
11143 prop = RNA_def_property(srna, "uv_scale", PROP_FLOAT, PROP_NONE);
11144 RNA_def_property_float_sdna(prop, nullptr, "uv_scale");
11145 RNA_def_property_range(prop, 0.0, FLT_MAX);
11146 RNA_def_property_ui_range(prop, 0.0, 100.0, 0.1, 3);
11147 RNA_def_property_ui_text(prop, "UV Scale", "Factor to scale the UVs");
11148 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11149
11150 /* Rotation of Dot Texture. */
11151 prop = RNA_def_property(srna, "alignment_rotation", PROP_FLOAT, PROP_ANGLE);
11152 RNA_def_property_float_sdna(prop, nullptr, "alignment_rotation");
11154 RNA_def_property_range(prop, -DEG2RADF(90.0f), DEG2RADF(90.0f));
11155 RNA_def_property_ui_range(prop, -DEG2RADF(90.0f), DEG2RADF(90.0f), 10, 3);
11157 prop, "Rotation", "Additional rotation applied to dots and square strokes");
11158 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11159
11160 prop = RNA_def_property(srna, "fill_rotation", PROP_FLOAT, PROP_ANGLE);
11161 RNA_def_property_float_sdna(prop, nullptr, "fill_rotation");
11162 RNA_def_property_ui_text(prop, "Fill Rotation", "Additional rotation of the fill UV");
11163 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11164
11165 prop = RNA_def_property(srna, "fill_offset", PROP_FLOAT, PROP_COORDS);
11166 RNA_def_property_float_sdna(prop, nullptr, "fill_offset");
11167 RNA_def_property_array(prop, 2);
11168 RNA_def_property_ui_text(prop, "Fill Offset", "Additional offset of the fill UV");
11169 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11170
11171 prop = RNA_def_property(srna, "fill_scale", PROP_FLOAT, PROP_COORDS);
11172 RNA_def_property_float_sdna(prop, nullptr, "fill_scale");
11173 RNA_def_property_range(prop, 0.01f, 100.0f);
11174 RNA_def_property_ui_text(prop, "Fill Scale", "Additional scale of the fill UV");
11175 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11176
11177 prop = RNA_def_property(srna, "fit_method", PROP_ENUM, PROP_NONE);
11178 RNA_def_property_enum_sdna(prop, nullptr, "fit_method");
11179 RNA_def_property_enum_items(prop, fit_type_items);
11180 RNA_def_property_ui_text(prop, "Fit Method", "");
11181 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
11182
11183 prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
11184 RNA_def_property_enum_sdna(prop, nullptr, "mode");
11185 RNA_def_property_enum_items(prop, mode_items);
11186 RNA_def_property_ui_text(prop, "Mode", "");
11187 RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
11188
11190}
11191
11193{
11194 StructRNA *srna;
11195 PropertyRNA *prop;
11196
11197 /* data */
11198 srna = RNA_def_struct(brna, "Modifier", nullptr);
11199 RNA_def_struct_ui_text(srna, "Modifier", "Modifier affecting the geometry data of an object");
11200 RNA_def_struct_refine_func(srna, "rna_Modifier_refine");
11201 RNA_def_struct_path_func(srna, "rna_Modifier_path");
11202 RNA_def_struct_sdna(srna, "ModifierData");
11203 RNA_def_struct_ui_icon(srna, ICON_MODIFIER);
11204
11205 /* strings */
11206 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
11207 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_Modifier_name_set");
11208 RNA_def_property_ui_text(prop, "Name", "Modifier name");
11209 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER | NA_RENAME, "rna_Modifier_name_update");
11210 RNA_def_struct_name_property(srna, prop);
11211
11212 /* enums */
11213 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
11215 RNA_def_property_enum_sdna(prop, nullptr, "type");
11217 RNA_def_property_ui_text(prop, "Type", "");
11218
11219 /* flags */
11220 prop = RNA_def_property(srna, "show_viewport", PROP_BOOLEAN, PROP_NONE);
11222 RNA_def_property_ui_text(prop, "Realtime", "Display modifier in viewport");
11225 RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Modifier_update");
11226 RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_ON, 1);
11227
11228 prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
11231 RNA_def_property_ui_text(prop, "Render", "Use modifier during render");
11232 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_ON, 1);
11234
11235 prop = RNA_def_property(srna, "show_in_editmode", PROP_BOOLEAN, PROP_NONE);
11237 RNA_def_property_ui_text(prop, "Edit Mode", "Display modifier in Edit mode");
11238 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11239 RNA_def_property_ui_icon(prop, ICON_EDITMODE_HLT, 0);
11240
11241 prop = RNA_def_property(srna, "show_on_cage", PROP_BOOLEAN, PROP_NONE);
11243 RNA_def_property_ui_text(prop, "On Cage", "Adjust edit cage to modifier result");
11244 RNA_def_property_ui_icon(prop, ICON_MESH_DATA, 0);
11245 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11246
11247 prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
11249 prop, "rna_Modifier_show_expanded_get", "rna_Modifier_show_expanded_set");
11251 RNA_def_property_boolean_sdna(prop, nullptr, "ui_expand_flag", 0);
11253 RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface");
11254 RNA_def_property_ui_icon(prop, ICON_RIGHTARROW, 1);
11256
11257 prop = RNA_def_property(srna, "is_active", PROP_BOOLEAN, PROP_NONE);
11259 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Modifier_is_active_set");
11263 RNA_def_property_ui_text(prop, "Active", "The active modifier in the list");
11265
11266 prop = RNA_def_property(srna, "use_pin_to_last", PROP_BOOLEAN, PROP_NONE);
11268 RNA_def_property_boolean_funcs(prop, nullptr, "rna_Modifier_use_pin_to_last_set");
11271 RNA_def_property_ui_text(prop, "Pin to Last", "Keep the modifier at the end of the list");
11273
11274 prop = RNA_def_boolean(srna,
11275 "is_override_data",
11276 false,
11277 "Override Modifier",
11278 "In a local override object, whether this modifier comes from the linked "
11279 "reference object, or is local to the override");
11282 prop, nullptr, "flag", eModifierFlag_OverrideLibrary_Local);
11283
11284 prop = RNA_def_property(srna, "use_apply_on_spline", PROP_BOOLEAN, PROP_NONE);
11287 prop,
11288 "Apply on Spline",
11289 "Apply this and all preceding deformation modifiers on splines' points rather than "
11290 "on filled curve/surface");
11291 RNA_def_property_ui_icon(prop, ICON_SURFACE_DATA, 0);
11292 RNA_def_property_update(prop, 0, "rna_Modifier_update");
11293
11294 prop = RNA_def_property(srna, "execution_time", PROP_FLOAT, PROP_TIME_ABSOLUTE);
11298 prop,
11299 "Execution Time",
11300 "Time in seconds that the modifier took to evaluate. This is only set on evaluated objects. "
11301 "If multiple modifiers run in parallel, execution time is not a reliable metric.");
11302
11303 prop = RNA_def_property(srna, "persistent_uid", PROP_INT, PROP_NONE);
11306 prop,
11307 "Persistent UID",
11308 "Uniquely identifies the modifier within the modifier stack that it is part of");
11309
11310 /* types */
11396}
11397
11398#endif
void BKE_animdata_fix_paths_rename_all(struct ID *ref_id, const char *prefix, const char *oldName, const char *newName)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
void BKE_curveprofile_init(struct CurveProfile *profile, short segments_len)
CustomData interface, see also DNA_customdata_types.h.
@ ME_VERT
@ ME_POLY
@ ME_LOOP
@ ME_EDGE
const char * CustomData_get_layer_name(const CustomData *data, eCustomDataType type, int n)
int CustomData_number_of_layers(const CustomData *data, eCustomDataType type)
bool CustomData_external_test(CustomData *data, eCustomDataType type)
int BKE_object_data_transfer_get_dttypes_item_types(int dtdata_types)
bool BKE_object_data_transfer_get_dttypes_capacity(int dtdata_types, bool *r_advanced_mixing, bool *r_threshold)
support for deformation groups and hooks.
const ListBase * BKE_object_defgroup_list(const Object *ob)
Definition deform.cc:585
void BKE_fluid_modifier_create_type_data(struct FluidModifierData *fmd)
Definition fluid.cc:4775
void BKE_fluid_modifier_free(struct FluidModifierData *fmd)
Definition fluid.cc:4764
void id_lib_extern(ID *id)
Definition lib_id.cc:290
void id_us_plus_no_lib(ID *id)
Definition lib_id.cc:342
void id_us_min(ID *id)
Definition lib_id.cc:366
General operations, lookup, etc. for materials.
int BKE_object_material_index_get(Object *ob, const Material *ma)
const ModifierTypeInfo * BKE_modifier_get_info(ModifierType type)
void BKE_modifier_unique_name(ListBase *modifiers, ModifierData *md)
void multires_force_external_reload(Object *object)
Definition multires.cc:339
General operations, lookup, etc. for blender objects.
Mesh * BKE_object_get_evaluated_mesh(const Object *object_eval)
Object * BKE_object_pose_armature_get(Object *ob)
void BKE_object_modifier_hook_reset(Object *ob, HookModifierData *hmd)
void BKE_ocean_free_modifier_cache(struct OceanModifierData *omd)
Definition ocean.cc:1670
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
@ RPT_ERROR
Definition BKE_report.hh:39
#define BLI_assert(a)
Definition BLI_assert.h:46
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:586
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:534
#define LISTBASE_FOREACH(type, var, list)
MINLINE int max_ii(int a, int b)
#define DEG2RAD(_deg)
#define DEG2RADF(_deg)
#define M_PI
int BLI_sortutil_cmp_int(const void *a_, const void *b_)
Definition sort_utils.cc:53
char * STRNCPY(char(&dst)[N], const char *src)
Definition BLI_string.h:693
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define SNPRINTF_UTF8(dst, format,...)
#define STRNCPY_UTF8(dst, src)
size_t void BLI_uniquename_cb(blender::FunctionRef< bool(blender::StringRefNull)> unique_check, const char *defname, char delim, char *name, size_t name_maxncpy) ATTR_NONNULL(2
#define CLAMP(a, b, c)
#define UNUSED_VARS_NDEBUG(...)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define STREQ(a, b)
#define CLAMP_MIN(a, b)
#define BLT_I18NCONTEXT_AMOUNT
#define BLT_I18NCONTEXT_MODIFIER
#define BLT_I18NCONTEXT_ID_CACHEFILE
#define BLT_I18NCONTEXT_ID_SIMULATION
#define BLT_I18NCONTEXT_ID_ID
#define BLT_I18NCONTEXT_ID_CURVE_LEGACY
#define BLT_I18NCONTEXT_ID_GPENCIL
#define BLT_I18NCONTEXT_ID_PARTICLESETTINGS
#define BLT_I18NCONTEXT_OPERATOR_DEFAULT
#define BLT_I18NCONTEXT_ID_MESH
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1074
#define ID_IS_LINKED(_id)
Definition DNA_ID.h:694
@ LIBOVERRIDE_OP_REPLACE
Definition DNA_ID.h:230
@ ARM_DEF_VGROUP
@ ARM_DEF_QUATERNION
@ ARM_DEF_INVERT_VGROUP
@ ARM_DEF_ENVELOPE
@ CU_PATH
@ CD_PROP_BYTE_COLOR
@ CD_PROP_COLOR
@ CD_PROP_FLOAT2
#define MAX_CUSTOMDATA_LAYER_NAME_NO_PREFIX
@ MOD_LINEART_EDGE_FLAG_PROJECTED_SHADOW
@ MOD_LINEART_EDGE_FLAG_CONTOUR
@ MOD_LINEART_EDGE_FLAG_LIGHT_CONTOUR
@ MOD_LINEART_EDGE_FLAG_INTERSECTION
@ MOD_LINEART_EDGE_FLAG_CREASE
@ MOD_LINEART_EDGE_FLAG_MATERIAL
@ MOD_LINEART_EDGE_FLAG_EDGE_MARK
@ MOD_LINEART_EDGE_FLAG_LOOSE
@ MOD_LINEART_FILTER_FACE_MARK
@ MOD_LINEART_FILTER_FACE_MARK_BOUNDARIES
@ MOD_LINEART_USE_CREASE_ON_SMOOTH_SURFACES
@ MOD_LINEART_USE_IMAGE_BOUNDARY_TRIMMING
@ MOD_LINEART_LOOSE_AS_CONTOUR
@ MOD_LINEART_CHAIN_PRESERVE_DETAILS
@ MOD_LINEART_USE_BACK_FACE_CULLING
@ MOD_LINEART_CHAIN_LOOSE_EDGES
@ MOD_LINEART_USE_CUSTOM_CAMERA
@ MOD_LINEART_USE_CREASE_ON_SHARP_EDGES
@ MOD_LINEART_INVERT_SOURCE_VGROUP
@ MOD_LINEART_EVERYTHING_AS_CONTOUR
@ MOD_LINEART_ALLOW_DUPLI_OBJECTS
@ MOD_LINEART_MATCH_OUTPUT_VGROUP
@ MOD_LINEART_CHAIN_GEOMETRY_SPACE
@ MOD_LINEART_FILTER_FACE_MARK_KEEP_CONTOUR
@ MOD_LINEART_INTERSECTION_AS_CONTOUR
@ MOD_LINEART_ALLOW_OVERLAP_EDGE_TYPES
@ MOD_LINEART_ALLOW_OVERLAPPING_EDGES
@ MOD_LINEART_ALLOW_CLIPPING_BOUNDARIES
@ MOD_LINEART_FILTER_FACE_MARK_INVERT
@ GP_LENGTH_INVERT_CURVATURE
@ GP_LENGTH_USE_RANDOM
@ GP_LENGTH_USE_CURVATURE
@ DT_LAYERS_VGROUP_SRC_BONE_SELECT
@ DT_LAYERS_VGROUP_SRC_BONE_DEFORM
@ DT_LAYERS_ALL_SRC
@ DT_LAYERS_ACTIVE_SRC
@ GP_LENGTH_ABSOLUTE
@ GP_LENGTH_RELATIVE
#define MOD_SHRINKWRAP_CULL_TARGET_MASK
@ DT_LAYERS_ACTIVE_DST
@ DT_LAYERS_INDEX_DST
@ DT_LAYERS_NAME_DST
@ DT_MULTILAYER_INDEX_MDEFORMVERT
@ DT_MULTILAYER_INDEX_UV
@ DT_MULTILAYER_INDEX_VCOL_VERT
@ DT_MULTILAYER_INDEX_VCOL_LOOP
@ MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS
@ MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS
@ MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS
@ MREMAP_MODE_VERT_EDGE_NEAREST
@ MREMAP_MODE_LOOP_POLYINTERP_NEAREST
@ MREMAP_MODE_VERT_POLYINTERP_VNORPROJ
@ MREMAP_MODE_VERT_FACE_NEAREST
@ MREMAP_MODE_EDGE_POLY_NEAREST
@ MREMAP_MODE_VERT_EDGEINTERP_NEAREST
@ MREMAP_MODE_VERT_NEAREST
@ MREMAP_MODE_LOOP_NEAREST_POLYNOR
@ MREMAP_MODE_EDGE_VERT_NEAREST
@ MREMAP_MODE_TOPOLOGY
@ MREMAP_MODE_EDGE_NEAREST
@ MREMAP_MODE_POLY_NOR
@ MREMAP_MODE_LOOP_POLYINTERP_LNORPROJ
@ MREMAP_MODE_LOOP_NEAREST_LOOPNOR
@ MREMAP_MODE_LOOP_POLY_NEAREST
@ MREMAP_MODE_EDGE_EDGEINTERP_VNORPROJ
@ MREMAP_MODE_POLY_POLYINTERP_PNORPROJ
@ MREMAP_MODE_POLY_NEAREST
@ MREMAP_MODE_VERT_POLYINTERP_NEAREST
@ MOD_SHRINKWRAP_TARGET_PROJECT
@ MOD_SHRINKWRAP_NEAREST_VERTEX
@ MOD_SHRINKWRAP_PROJECT
@ MOD_SHRINKWRAP_NEAREST_SURFACE
@ DT_TYPE_MLOOPCOL_LOOP
@ DT_TYPE_UV
@ DT_TYPE_MPROPCOL_VERT
@ DT_TYPE_VERT_ALL
@ DT_TYPE_BWEIGHT_VERT
@ DT_TYPE_FREESTYLE_FACE
@ DT_TYPE_CREASE
@ DT_TYPE_LOOP_ALL
@ DT_TYPE_SEAM
@ DT_TYPE_POLY_ALL
@ DT_TYPE_MLOOPCOL_VERT
@ DT_TYPE_LNOR
@ DT_TYPE_MPROPCOL_LOOP
@ DT_TYPE_EDGE_ALL
@ DT_TYPE_SHARP_FACE
@ DT_TYPE_MDEFORMVERT
@ DT_TYPE_BWEIGHT_EDGE
@ DT_TYPE_FREESTYLE_EDGE
@ DT_TYPE_SHARP_EDGE
@ MOD_SHRINKWRAP_ON_SURFACE
@ MOD_SHRINKWRAP_OUTSIDE
@ MOD_SHRINKWRAP_INSIDE
@ MOD_SHRINKWRAP_ABOVE_SURFACE
@ MOD_SHRINKWRAP_OUTSIDE_SURFACE
@ CDT_MIX_SUB
@ CDT_MIX_REPLACE_BELOW_THRESHOLD
@ CDT_MIX_REPLACE_ABOVE_THRESHOLD
@ CDT_MIX_ADD
@ CDT_MIX_MUL
@ CDT_MIX_TRANSFER
@ CDT_MIX_MIX
@ GP_NOISE_RANDOM_STEP
@ GP_NOISE_RANDOM_KEYFRAME
@ GP_NOISE_USE_RANDOM
@ MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR
@ MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE
@ MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR
@ MOD_SHRINKWRAP_CULL_TARGET_BACKFACE
@ MOD_SHRINKWRAP_INVERT_VGROUP
@ MOD_SHRINKWRAP_INVERT_CULL_TARGET
@ MOD_ARR_OFF_RELATIVE
@ MOD_ARR_OFF_CONST
@ MOD_ARR_OFF_OBJ
@ MOD_BEVEL_HARDEN_NORMALS
@ MOD_BEVEL_INVERT_VGROUP
@ MOD_BEVEL_WEIGHT
@ MOD_BEVEL_OVERLAP_OK
@ MOD_BEVEL_VGROUP
@ MOD_BEVEL_EVEN_WIDTHS
@ MOD_BEVEL_ANGLE
@ MOD_SMOOTH_Y
@ MOD_SMOOTH_INVERT_VGROUP
@ MOD_SMOOTH_X
@ MOD_SMOOTH_Z
@ eModifierFlag_PinLast
@ eModifierFlag_OverrideLibrary_Local
@ eModifierFlag_Active
@ NODES_MODIFIER_BAKE_TARGET_PACKED
@ NODES_MODIFIER_BAKE_TARGET_INHERIT
@ NODES_MODIFIER_BAKE_TARGET_DISK
@ MOD_GREASE_PENCIL_MULTIPLY_ENABLE_FADING
@ MOD_REMESH_FLOOD_FILL
@ MOD_REMESH_SMOOTH_SHADING
@ MOD_TRIANGULATE_QUAD_SHORTEDGE
@ MOD_TRIANGULATE_QUAD_FIXED
@ MOD_TRIANGULATE_QUAD_LONGEDGE
@ MOD_TRIANGULATE_QUAD_BEAUTY
@ MOD_TRIANGULATE_QUAD_ALTERNATE
@ eWarp_Falloff_Linear
@ eWarp_Falloff_Curve
@ eWarp_Falloff_Sharp
@ eWarp_Falloff_Const
@ eWarp_Falloff_InvSquare
@ eWarp_Falloff_Smooth
@ eWarp_Falloff_None
@ eWarp_Falloff_Sphere
@ eWarp_Falloff_Root
@ MOD_BEVEL_VMESH_ADJ
@ MOD_BEVEL_VMESH_CUTOFF
@ LINEART_SHADOW_FILTER_ILLUMINATED_ENCLOSED_SHAPES
@ LINEART_SHADOW_FILTER_NONE
@ LINEART_SHADOW_FILTER_SHADED
@ LINEART_SHADOW_FILTER_ILLUMINATED
@ MOD_MDEF_DYNAMIC_BIND
@ MOD_MDEF_INVERT_VGROUP
@ MOD_DATATRANSFER_USE_VERT
@ MOD_DATATRANSFER_USE_EDGE
@ MOD_DATATRANSFER_OBSRC_TRANSFORM
@ MOD_DATATRANSFER_MAP_MAXDIST
@ MOD_DATATRANSFER_INVERT_VGROUP
@ MOD_DATATRANSFER_USE_LOOP
@ MOD_DATATRANSFER_USE_POLY
@ MOD_GREASE_PENCIL_SMOOTH_MOD_LOCATION
@ MOD_GREASE_PENCIL_SMOOTH_MOD_STRENGTH
@ MOD_GREASE_PENCIL_SMOOTH_KEEP_SHAPE
@ MOD_GREASE_PENCIL_SMOOTH_MOD_UV
@ MOD_GREASE_PENCIL_SMOOTH_SMOOTH_ENDS
@ MOD_GREASE_PENCIL_SMOOTH_MOD_THICKNESS
@ eMultiresModifierFlag_UseSculptBaseMesh
@ eMultiresModifierFlag_UseCrease
@ eMultiresModifierFlag_UseCustomNormals
@ eMultiresModifierFlag_ControlEdges
@ MOD_OCEAN_GENERATE_NORMALS
@ MOD_OCEAN_GENERATE_FOAM
@ MOD_OCEAN_INVERT_SPRAY
@ MOD_OCEAN_GENERATE_SPRAY
@ LINEART_GPENCIL_INTERSECTION_MATCH
@ LINEART_GPENCIL_MATERIAL_MASK_MATCH
@ LINEART_GPENCIL_MATERIAL_MASK_ENABLE
@ eModifierMode_Render
@ eModifierMode_ApplyOnSpline
@ eModifierMode_Editmode
@ eModifierMode_Realtime
@ eModifierMode_OnCage
@ GREASE_PENCIL_INFLUENCE_USE_LAYER_GROUP_FILTER
@ GREASE_PENCIL_INFLUENCE_INVERT_VERTEX_GROUP
@ GREASE_PENCIL_INFLUENCE_USE_MATERIAL_PASS_FILTER
@ GREASE_PENCIL_INFLUENCE_USE_LAYER_PASS_FILTER
@ GREASE_PENCIL_INFLUENCE_INVERT_LAYER_FILTER
@ GREASE_PENCIL_INFLUENCE_USE_CUSTOM_CURVE
@ GREASE_PENCIL_INFLUENCE_INVERT_MATERIAL_PASS_FILTER
@ GREASE_PENCIL_INFLUENCE_INVERT_MATERIAL_FILTER
@ GREASE_PENCIL_INFLUENCE_INVERT_LAYER_PASS_FILTER
@ MOD_LAPLACIANSMOOTH_X
@ MOD_LAPLACIANSMOOTH_Y
@ MOD_LAPLACIANSMOOTH_PRESERVE_VOLUME
@ MOD_LAPLACIANSMOOTH_NORMALIZED
@ MOD_LAPLACIANSMOOTH_Z
@ MOD_LAPLACIANSMOOTH_INVERT_VGROUP
@ MOD_WEIGHTEDNORMAL_MODE_FACE
@ MOD_WEIGHTEDNORMAL_MODE_FACE_ANGLE
@ MOD_WEIGHTEDNORMAL_MODE_ANGLE
@ MOD_LATTICE_INVERT_VGROUP
@ MOD_SOLIDIFY_NONMANIFOLD_OFFSET_MODE_EVEN
@ MOD_SOLIDIFY_NONMANIFOLD_OFFSET_MODE_FIXED
@ MOD_SOLIDIFY_NONMANIFOLD_OFFSET_MODE_CONSTRAINTS
@ MOD_SDEF_INVERT_VGROUP
@ MOD_SDEF_SPARSE_BIND
@ eBooleanModifierSolver_Float
@ eBooleanModifierSolver_Manifold
@ eBooleanModifierSolver_Mesh_Arr
@ MOD_SKIN_SMOOTH_SHADING
@ MOD_GREASE_PENCIL_WEIGHT_ANGLE_SPACE_WORLD
@ MOD_GREASE_PENCIL_WEIGHT_ANGLE_SPACE_LOCAL
@ LINEART_SILHOUETTE_FILTER_NONE
@ LINEART_SILHOUETTE_FILTER_INDIVIDUAL
@ LINEART_SILHOUETTE_FILTER_GROUP
@ MOD_WVG_MIX_ADD
@ MOD_WVG_MIX_SUB
@ MOD_WVG_MIX_MIN
@ MOD_WVG_MIX_DIF
@ MOD_WVG_MIX_SET
@ MOD_WVG_MIX_MAX
@ MOD_WVG_MIX_DIV
@ MOD_WVG_MIX_AVG
@ MOD_WVG_MIX_MUL
@ eParticleInstanceFlag_Parents
@ eParticleInstanceFlag_Alive
@ eParticleInstanceFlag_Dead
@ eParticleInstanceFlag_Children
@ eParticleInstanceFlag_Unborn
@ eParticleInstanceFlag_Path
@ eParticleInstanceFlag_UseSize
@ eParticleInstanceFlag_KeepShape
@ MOD_GREASE_PENCIL_HOOK_UNIFORM_SPACE
@ MOD_SIMPLEDEFORM_LOCK_AXIS_Z
@ MOD_SIMPLEDEFORM_LOCK_AXIS_X
@ MOD_SIMPLEDEFORM_LOCK_AXIS_Y
@ MOD_GREASE_PENCIL_OFFSET_UNIFORM_RANDOM_SCALE
@ MOD_GREASE_PENCIL_MIRROR_AXIS_Z
@ MOD_GREASE_PENCIL_MIRROR_AXIS_X
@ MOD_GREASE_PENCIL_MIRROR_AXIS_Y
@ SUBSURF_TYPE_SIMPLE
@ SUBSURF_TYPE_CATMULL_CLARK
@ MOD_BEVEL_PROFILE_CUSTOM
@ MOD_BEVEL_PROFILE_SUPERELLIPSE
@ MOD_REMESH_VOXEL
@ MOD_REMESH_MASS_POINT
@ MOD_REMESH_SHARP_FEATURES
@ MOD_REMESH_CENTROID
@ MOD_MESHCACHE_INVERT_VERTEX_GROUP
@ eBooleanModifierMaterialMode_Index
@ eBooleanModifierMaterialMode_Transfer
@ MOD_GREASE_PENCIL_OPACITY_USE_WEIGHT_AS_FACTOR
@ MOD_GREASE_PENCIL_OPACITY_USE_UNIFORM_OPACITY
@ MOD_GREASE_PENCIL_ARRAY_USE_OFFSET
@ MOD_GREASE_PENCIL_ARRAY_USE_RELATIVE
@ MOD_GREASE_PENCIL_ARRAY_USE_OB_OFFSET
@ MOD_GREASE_PENCIL_ARRAY_UNIFORM_RANDOM_SCALE
@ MOD_NORMALEDIT_MODE_RADIAL
@ MOD_NORMALEDIT_MODE_DIRECTIONAL
@ MOD_WIREFRAME_OFS_EVEN
@ MOD_WIREFRAME_OFS_RELATIVE
@ MOD_WIREFRAME_INVERT_VGROUP
@ MOD_WIREFRAME_CREASE
@ MOD_WIREFRAME_BOUNDARY
@ MOD_WIREFRAME_REPLACE
@ MOD_MESHCACHE_FLIP_AXIS_X
@ MOD_WVG_EDIT_INVERT_VGROUP_MASK
@ MOD_WVG_EDIT_WEIGHTS_NORMALIZE
@ MOD_WVG_INVERT_FALLOFF
@ MOD_WVG_EDIT_REMFVG
@ MOD_WVG_EDIT_ADD2VG
@ SUBSURF_BOUNDARY_SMOOTH_ALL
@ SUBSURF_BOUNDARY_SMOOTH_PRESERVE_CORNERS
@ eBooleanModifierBMeshFlag_BMesh_NoDissolve
@ eBooleanModifierBMeshFlag_BMesh_Separate
@ eBooleanModifierBMeshFlag_BMesh_NoConnectRegions
@ MOD_EDGESPLIT_FROMANGLE
@ MOD_EDGESPLIT_FROMFLAG
@ MOD_ARR_FITCURVE
@ MOD_ARR_FIXEDCOUNT
@ MOD_ARR_FITLENGTH
@ MOD_WVG_PROXIMITY_WEIGHTS_NORMALIZE
@ MOD_WVG_PROXIMITY_INVERT_VGROUP_MASK
@ MOD_WVG_PROXIMITY_GEOM_VERTS
@ MOD_WVG_PROXIMITY_INVERT_FALLOFF
@ MOD_WVG_PROXIMITY_GEOM_EDGES
@ MOD_WVG_PROXIMITY_GEOM_FACES
@ MOD_DISP_SPACE_GLOBAL
@ MOD_DISP_SPACE_LOCAL
@ MOD_GREASE_PENCIL_BUILD_TIMEMODE_PERCENTAGE
@ MOD_GREASE_PENCIL_BUILD_TIMEMODE_DRAWSPEED
@ MOD_GREASE_PENCIL_BUILD_TIMEMODE_FRAMES
@ MOD_ARR_MERGE
@ MOD_ARR_MERGEFINAL
@ MOD_GREASE_PENCIL_BUILD_TIMEALIGN_START
@ MOD_GREASE_PENCIL_BUILD_TIMEALIGN_END
@ MOD_GREASE_PENCIL_THICK_WEIGHT_FACTOR
@ MOD_GREASE_PENCIL_THICK_NORMALIZE
@ MOD_GREASE_PENCIL_SIMPLIFY_FIXED
@ MOD_GREASE_PENCIL_SIMPLIFY_MERGE
@ MOD_GREASE_PENCIL_SIMPLIFY_ADAPTIVE
@ MOD_GREASE_PENCIL_SIMPLIFY_SAMPLE
@ NODES_MODIFIER_PANEL_MANAGE
@ NODES_MODIFIER_PANEL_WARNINGS
@ NODES_MODIFIER_PANEL_OUTPUT_ATTRIBUTES
@ NODES_MODIFIER_PANEL_NAMED_ATTRIBUTES
@ NODES_MODIFIER_PANEL_BAKE
@ NODES_MODIFIER_PANEL_BAKE_DATA_BLOCKS
@ MOD_GREASE_PENCIL_TIME_MODE_FIX
@ MOD_GREASE_PENCIL_TIME_MODE_CHAIN
@ MOD_GREASE_PENCIL_TIME_MODE_PINGPONG
@ MOD_GREASE_PENCIL_TIME_MODE_NORMAL
@ MOD_GREASE_PENCIL_TIME_MODE_REVERSE
@ MOD_OCEAN_GEOM_GENERATE
@ MOD_OCEAN_GEOM_SIM_ONLY
@ MOD_OCEAN_GEOM_DISPLACE
@ NODES_MODIFIER_BAKE_CUSTOM_PATH
@ NODES_MODIFIER_BAKE_CUSTOM_SIMULATION_FRAME_RANGE
@ MOD_GREASE_PENCIL_SUBDIV_CATMULL
@ MOD_GREASE_PENCIL_SUBDIV_SIMPLE
@ MOD_GREASE_PENCIL_COLOR_FILL
@ MOD_GREASE_PENCIL_COLOR_STROKE
@ MOD_GREASE_PENCIL_COLOR_BOTH
@ MOD_GREASE_PENCIL_COLOR_HARDNESS
@ MOD_GREASE_PENCIL_BUILD_MODE_SEQUENTIAL
@ MOD_GREASE_PENCIL_BUILD_MODE_ADDITIVE
@ MOD_GREASE_PENCIL_BUILD_MODE_CONCURRENT
@ MOD_HOOK_UNIFORM_SPACE
@ MOD_HOOK_INVERT_VGROUP
@ MOD_SIMPLEDEFORM_FLAG_INVERT_VGROUP
@ MOD_GREASE_PENCIL_TIME_KEEP_LOOP
@ MOD_GREASE_PENCIL_TIME_CUSTOM_RANGE
@ MOD_FLUID_TYPE_EFFEC
@ MOD_FLUID_TYPE_DOMAIN
@ MOD_FLUID_TYPE_FLOW
@ MOD_CAST_TYPE_CYLINDER
@ MOD_CAST_TYPE_SPHERE
@ MOD_CAST_TYPE_CUBOID
@ MOD_GREASE_PENCIL_BUILD_RESTRICT_TIME
@ MOD_GREASE_PENCIL_BUILD_USE_FADING
@ MOD_BEVEL_MARK_SHARP
@ MOD_BEVEL_MARK_SEAM
@ MOD_GREASE_PENCIL_DASH_USE_CYCLIC
@ NODES_MODIFIER_PANEL_OPEN
@ MOD_WELD_MODE_CONNECTED
@ MOD_WELD_MODE_ALL
@ eBooleanModifierFlag_Collection
@ eBooleanModifierFlag_Self
@ eBooleanModifierFlag_HoleTolerant
@ eBooleanModifierFlag_Object
@ MOD_CURVE_INVERT_VGROUP
@ MOD_SIMPLEDEFORM_MODE_TAPER
@ MOD_SIMPLEDEFORM_MODE_STRETCH
@ MOD_SIMPLEDEFORM_MODE_BEND
@ MOD_SIMPLEDEFORM_MODE_TWIST
@ MOD_MESHCACHE_DEFORM_INTEGRATE
@ MOD_MESHCACHE_DEFORM_OVERWRITE
@ MOD_MESHCACHE_PLAY_CFEA
@ MOD_MESHCACHE_PLAY_EVAL
@ MOD_DECIM_MODE_UNSUBDIV
@ MOD_DECIM_MODE_COLLAPSE
@ MOD_DECIM_MODE_DISSOLVE
@ MOD_GREASE_PENCIL_TINT_UNIFORM
@ MOD_GREASE_PENCIL_TINT_GRADIENT
@ MOD_GREASE_PENCIL_OUTLINE_KEEP_SHAPE
@ NODES_MODIFIER_HIDE_DATABLOCK_SELECTOR
@ NODES_MODIFIER_HIDE_MANAGE_PANEL
@ MOD_MESHCACHE_TIME_FRAME
@ MOD_MESHCACHE_TIME_FACTOR
@ MOD_MESHCACHE_TIME_SECONDS
@ MOD_CORRECTIVESMOOTH_ONLY_SMOOTH
@ MOD_CORRECTIVESMOOTH_PIN_BOUNDARY
@ MOD_CORRECTIVESMOOTH_INVERT_VGROUP
@ LINEART_SOURCE_SCENE
@ LINEART_SOURCE_OBJECT
@ LINEART_SOURCE_COLLECTION
@ MOD_WVG_MASK_TEX_USE_SAT
@ MOD_WVG_MASK_TEX_USE_BLUE
@ MOD_WVG_MASK_TEX_USE_INT
@ MOD_WVG_MASK_TEX_USE_ALPHA
@ MOD_WVG_MASK_TEX_USE_RED
@ MOD_WVG_MASK_TEX_USE_HUE
@ MOD_WVG_MASK_TEX_USE_VAL
@ MOD_WVG_MASK_TEX_USE_GREEN
@ MOD_GREASE_PENCIL_TINT_USE_WEIGHT_AS_FACTOR
@ eModifierType_MeshToVolume
@ eModifierType_GreasePencilSmooth
@ eModifierType_Weld
@ eModifierType_ParticleSystem
@ eModifierType_Mask
@ eModifierType_GreasePencilWeightProximity
@ eModifierType_MeshDeform
@ eModifierType_Solidify
@ eModifierType_Explode
@ eModifierType_Subsurf
@ eModifierType_LaplacianSmooth
@ eModifierType_Mirror
@ eModifierType_GreasePencilMirror
@ eModifierType_WeightVGProximity
@ eModifierType_Boolean
@ eModifierType_GreasePencilOffset
@ eModifierType_SimpleDeform
@ eModifierType_Curve
@ eModifierType_GreasePencilThickness
@ eModifierType_GreasePencilEnvelope
@ eModifierType_Lattice
@ eModifierType_Surface
@ eModifierType_NormalEdit
@ eModifierType_Skin
@ eModifierType_GreasePencilArmature
@ eModifierType_Wave
@ eModifierType_Cloth
@ eModifierType_Fluid
@ eModifierType_GreasePencilSubdiv
@ eModifierType_GreasePencilTint
@ eModifierType_GreasePencilNoise
@ eModifierType_VolumeToMesh
@ eModifierType_Shrinkwrap
@ eModifierType_MeshSequenceCache
@ eModifierType_EdgeSplit
@ eModifierType_Hook
@ eModifierType_GreasePencilMultiply
@ eModifierType_Wireframe
@ eModifierType_WeightVGMix
@ eModifierType_GreasePencilBuild
@ eModifierType_Screw
@ eModifierType_GreasePencilTime
@ eModifierType_VolumeDisplace
@ eModifierType_GreasePencilTexture
@ eModifierType_GreasePencilSimplify
@ eModifierType_Ocean
@ eModifierType_LaplacianDeform
@ eModifierType_GreasePencilColor
@ eModifierType_DataTransfer
@ eModifierType_UVProject
@ eModifierType_GreasePencilDash
@ eModifierType_Armature
@ eModifierType_UVWarp
@ eModifierType_SurfaceDeform
@ eModifierType_GreasePencilLineart
@ eModifierType_Warp
@ eModifierType_CorrectiveSmooth
@ eModifierType_ParticleInstance
@ eModifierType_Nodes
@ eModifierType_Collision
@ eModifierType_Smooth
@ eModifierType_Bevel
@ eModifierType_DynamicPaint
@ eModifierType_Remesh
@ eModifierType_MeshCache
@ eModifierType_WeightVGEdit
@ eModifierType_GreasePencilOutline
@ eModifierType_GreasePencilWeightAngle
@ eModifierType_Displace
@ eModifierType_GreasePencilOpacity
@ eModifierType_GreasePencilLength
@ eModifierType_Array
@ eModifierType_GreasePencilShrinkwrap
@ eModifierType_Softbody
@ eModifierType_Multires
@ eModifierType_GreasePencilLattice
@ eModifierType_Cast
@ eModifierType_WeightedNormal
@ eModifierType_GreasePencilHook
@ eModifierType_GreasePencilArray
@ eModifierType_Decimate
@ eModifierType_Build
@ eModifierType_Triangulate
@ MOD_MESHCACHE_INTERP_LINEAR
@ MOD_MESHCACHE_INTERP_NONE
@ MOD_CAST_USE_OB_TRANSFORM
@ MOD_CAST_INVERT_VGROUP
@ MOD_CAST_Y
@ MOD_CAST_X
@ MOD_CAST_Z
@ MOD_CAST_SIZE_FROM_RADIUS
@ MOD_NORMALEDIT_NO_POLYNORS_FIX
@ MOD_NORMALEDIT_INVERT_VGROUP
@ MOD_NORMALEDIT_USE_DIRECTION_PARALLEL
@ MOD_CURVE_NEGZ
@ MOD_CURVE_POSX
@ MOD_CURVE_NEGX
@ MOD_CURVE_POSZ
@ MOD_CURVE_NEGY
@ MOD_CURVE_POSY
@ MOD_UVWARP_INVERT_VGROUP
@ MOD_DISP_MAP_OBJECT
@ MOD_DISP_MAP_GLOBAL
@ MOD_DISP_MAP_LOCAL
@ MOD_DISP_MAP_UV
@ MOD_MESHSEQ_READ_COLOR
@ MOD_MESHSEQ_READ_VERT
@ MOD_MESHSEQ_INTERPOLATE_VERTICES
@ MOD_MESHSEQ_READ_ATTRIBUTES
@ MOD_MESHSEQ_READ_UV
@ MOD_MESHSEQ_READ_POLY
@ LINEART_GPENCIL_INVERT_COLLECTION
@ LINEART_GPENCIL_OFFSET_TOWARDS_CUSTOM_CAMERA
@ LINEART_GPENCIL_INVERT_SILHOUETTE_FILTER
@ LINEART_GPENCIL_IS_BAKED
@ LINEART_GPENCIL_USE_CACHE
@ MOD_WARP_VOLUME_PRESERVE
@ MOD_WARP_INVERT_VGROUP
@ MOD_SOLIDIFY_MODE_NONMANIFOLD
@ MOD_SOLIDIFY_MODE_EXTRUDE
@ MOD_SKIN_SYMM_X
@ MOD_SKIN_SYMM_Z
@ MOD_SKIN_SYMM_Y
@ MOD_CORRECTIVESMOOTH_SMOOTH_LENGTH_WEIGHT
@ MOD_CORRECTIVESMOOTH_SMOOTH_SIMPLE
@ MOD_WVG_PROXIMITY_OBJECT
@ MOD_WVG_PROXIMITY_GEOMETRY
@ MOD_WVG_MIX_INVERT_VGROUP_MASK
@ MOD_WVG_MIX_INVERT_VGROUP_B
@ MOD_WVG_MIX_WEIGHTS_NORMALIZE
@ MOD_WVG_MIX_INVERT_VGROUP_A
@ MOD_SOLIDIFY_NONMANIFOLD_BOUNDARY_MODE_FLAT
@ MOD_SOLIDIFY_NONMANIFOLD_BOUNDARY_MODE_ROUND
@ MOD_SOLIDIFY_NONMANIFOLD_BOUNDARY_MODE_NONE
@ MOD_DISP_INVERT_VGROUP
@ MOD_MIR_MIRROR_U
@ MOD_MIR_BISECT_AXIS_X
@ MOD_MIR_CLIPPING
@ MOD_MIR_MIRROR_V
@ MOD_MIR_AXIS_X
@ MOD_MIR_BISECT_FLIP_AXIS_X
@ MOD_MIR_VGROUP
@ MOD_MIR_NO_MERGE
@ MOD_MIR_MIRROR_UDIM
@ MOD_SCREW_NORMAL_CALC
@ MOD_SCREW_SMOOTH_SHADING
@ MOD_SCREW_UV_STRETCH_V
@ MOD_SCREW_MERGE
@ MOD_SCREW_UV_STRETCH_U
@ MOD_SCREW_NORMAL_FLIP
@ MOD_SCREW_OBJECT_OFFSET
@ MOD_GREASE_PENCIL_HOOK_Falloff_None
@ MOD_GREASE_PENCIL_HOOK_Falloff_Root
@ MOD_GREASE_PENCIL_HOOK_Falloff_InvSquare
@ MOD_GREASE_PENCIL_HOOK_Falloff_Const
@ MOD_GREASE_PENCIL_HOOK_Falloff_Linear
@ MOD_GREASE_PENCIL_HOOK_Falloff_Sphere
@ MOD_GREASE_PENCIL_HOOK_Falloff_Smooth
@ MOD_GREASE_PENCIL_HOOK_Falloff_Curve
@ MOD_GREASE_PENCIL_HOOK_Falloff_Sharp
@ MOD_DISP_DIR_RGB_XYZ
@ MOD_DISP_DIR_Z
@ MOD_DISP_DIR_Y
@ MOD_DISP_DIR_NOR
@ MOD_DISP_DIR_X
@ MOD_DISP_DIR_CLNOR
@ VOLUME_TO_MESH_USE_SMOOTH_SHADE
@ MOD_BEVEL_FACE_STRENGTH_NONE
@ MOD_BEVEL_FACE_STRENGTH_AFFECTED
@ MOD_BEVEL_FACE_STRENGTH_NEW
@ MOD_BEVEL_FACE_STRENGTH_ALL
@ MOD_WEIGHTEDNORMAL_KEEP_SHARP
@ MOD_WEIGHTEDNORMAL_FACE_INFLUENCE
@ MOD_WEIGHTEDNORMAL_INVERT_VGROUP
@ eExplodeFlag_Alive
@ eExplodeFlag_Dead
@ eExplodeFlag_EdgeCut
@ eExplodeFlag_INVERT_VGROUP
@ eExplodeFlag_PaSize
@ eExplodeFlag_Unborn
@ MOD_BEVEL_MITER_PATCH
@ MOD_BEVEL_MITER_SHARP
@ MOD_BEVEL_MITER_ARC
@ eSubsurfModifierFlag_UseRecursiveSubdivision
@ eSubsurfModifierFlag_UseCrease
@ eSubsurfModifierFlag_UseAdaptiveSubdivision
@ eSubsurfModifierFlag_ControlEdges
@ eSubsurfModifierFlag_UseCustomNormals
@ MOD_GREASE_PENCIL_TEXTURE_STROKE_AND_FILL
@ MOD_GREASE_PENCIL_TEXTURE_FILL
@ MOD_GREASE_PENCIL_TEXTURE_STROKE
@ MOD_MASK_SMOOTH
@ MOD_MASK_INV
@ MOD_LAPLACIANDEFORM_BIND
@ MOD_LAPLACIANDEFORM_INVERT_VGROUP
@ MOD_BUILD_FLAG_REVERSE
@ MOD_BUILD_FLAG_RANDOMIZE
@ SUBSURF_ADAPTIVE_SPACE_PIXEL
@ SUBSURF_ADAPTIVE_SPACE_OBJECT
@ MOD_WAVE_NORM_Y
@ MOD_WAVE_NORM_X
@ MOD_WAVE_CYCL
@ MOD_WAVE_INVERT_VGROUP
@ MOD_WAVE_Y
@ MOD_WAVE_NORM
@ MOD_WAVE_X
@ MOD_WAVE_NORM_Z
@ MOD_WELD_LOOSE_EDGES
@ MOD_WELD_INVERT_VGROUP
@ MOD_NORMALEDIT_MIX_COPY
@ MOD_NORMALEDIT_MIX_ADD
@ MOD_NORMALEDIT_MIX_SUB
@ MOD_NORMALEDIT_MIX_MUL
@ MESH_TO_VOLUME_RESOLUTION_MODE_VOXEL_SIZE
@ MESH_TO_VOLUME_RESOLUTION_MODE_VOXEL_AMOUNT
@ MOD_BEVEL_AMT_DEPTH
@ MOD_BEVEL_AMT_PERCENT
@ MOD_BEVEL_AMT_OFFSET
@ MOD_BEVEL_AMT_ABSOLUTE
@ MOD_BEVEL_AMT_WIDTH
@ MOD_MESHCACHE_TYPE_PC2
@ MOD_MESHCACHE_TYPE_MDD
@ VOLUME_TO_MESH_RESOLUTION_MODE_VOXEL_SIZE
@ VOLUME_TO_MESH_RESOLUTION_MODE_GRID
@ VOLUME_TO_MESH_RESOLUTION_MODE_VOXEL_AMOUNT
@ MOD_GREASE_PENCIL_WEIGHT_PROXIMITY_INVERT_OUTPUT
@ MOD_GREASE_PENCIL_WEIGHT_PROXIMITY_MULTIPLY_DATA
@ MOD_GREASE_PENCIL_ENVELOPE_SEGMENTS
@ MOD_GREASE_PENCIL_ENVELOPE_FILLS
@ MOD_GREASE_PENCIL_ENVELOPE_DEFORM
@ MOD_VOLUME_DISPLACE_MAP_GLOBAL
@ MOD_VOLUME_DISPLACE_MAP_LOCAL
@ MOD_VOLUME_DISPLACE_MAP_OBJECT
@ MOD_GREASE_PENCIL_BUILD_TRANSITION_VANISH
@ MOD_GREASE_PENCIL_BUILD_TRANSITION_SHRINK
@ MOD_GREASE_PENCIL_BUILD_TRANSITION_GROW
@ MOD_TRIANGULATE_KEEP_CUSTOMLOOP_NORMALS
@ MOD_WVG_SET_AND
@ MOD_WVG_SET_B
@ MOD_WVG_SET_ALL
@ MOD_WVG_SET_OR
@ MOD_WVG_SET_A
#define MOD_UVPROJECT_MAXPROJECTORS
@ MOD_DECIM_FLAG_INVERT_VGROUP
@ MOD_DECIM_FLAG_SYMMETRY
@ MOD_DECIM_FLAG_TRIANGULATE
@ MOD_DECIM_FLAG_ALL_BOUNDARY_VERTS
@ MOD_CORRECTIVESMOOTH_RESTSOURCE_ORCO
@ MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND
@ MOD_GREASE_PENCIL_TEXTURE_FIT_STROKE
@ MOD_GREASE_PENCIL_TEXTURE_CONSTANT_LENGTH
@ eBooleanModifierOp_Intersect
@ eBooleanModifierOp_Union
@ eBooleanModifierOp_Difference
@ MOD_OCEAN_SPECTRUM_TEXEL_MARSEN_ARSLOE
@ MOD_OCEAN_SPECTRUM_JONSWAP
@ MOD_OCEAN_SPECTRUM_PHILLIPS
@ MOD_OCEAN_SPECTRUM_PIERSON_MOSKOWITZ
@ eParticleInstanceSpace_World
@ eParticleInstanceSpace_Local
@ MOD_GREASE_PENCIL_OFFSET_STROKE
@ MOD_GREASE_PENCIL_OFFSET_MATERIAL
@ MOD_GREASE_PENCIL_OFFSET_LAYER
@ MOD_GREASE_PENCIL_OFFSET_RANDOM
@ MOD_MASK_MODE_ARM
@ MOD_MASK_MODE_VGROUP
@ MOD_TRIANGULATE_NGON_BEAUTY
@ MOD_TRIANGULATE_NGON_EARCLIP
@ MOD_GREASE_PENCIL_TIME_SEG_MODE_NORMAL
@ MOD_GREASE_PENCIL_TIME_SEG_MODE_REVERSE
@ MOD_GREASE_PENCIL_TIME_SEG_MODE_PINGPONG
@ NODES_MODIFIER_BAKE_MODE_STILL
@ NODES_MODIFIER_BAKE_MODE_ANIMATION
@ SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_AND_JUNCTIONS
@ SUBSURF_UV_SMOOTH_ALL
@ SUBSURF_UV_SMOOTH_PRESERVE_CORNERS
@ SUBSURF_UV_SMOOTH_NONE
@ SUBSURF_UV_SMOOTH_PRESERVE_BOUNDARIES
@ SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_JUNCTIONS_AND_CONCAVE
@ MOD_SOLIDIFY_RIM
@ MOD_SOLIDIFY_FLIP
@ MOD_SOLIDIFY_NORMAL_CALC
@ MOD_SOLIDIFY_EVEN
@ MOD_SOLIDIFY_OFFSET_ANGLE_CLAMP
@ MOD_SOLIDIFY_NONMANIFOLD_FLAT_FACES
@ MOD_SOLIDIFY_VGROUP_INV
@ MOD_SOLIDIFY_NOSHELL
@ MOD_BEVEL_AFFECT_EDGES
@ MOD_BEVEL_AFFECT_VERTICES
@ MOD_WVG_MAPPING_SHARP
@ MOD_WVG_MAPPING_SPHERE
@ MOD_WVG_MAPPING_STEP
@ MOD_WVG_MAPPING_NONE
@ MOD_WVG_MAPPING_ROOT
@ MOD_WVG_MAPPING_CURVE
@ MOD_WVG_MAPPING_RANDOM
@ MOD_WVG_MAPPING_SMOOTH
@ GEO_NODE_ASSET_MODIFIER
@ NTREE_GEOMETRY
@ OB_WIRE
Object is a sort of wrapper for general info.
@ OB_LATTICE
@ OB_EMPTY
@ OB_ARMATURE
@ OB_MESH
@ OB_CURVES_LEGACY
#define MAX_VGROUP_NAME
#define MINFRAME
#define MAXFRAMEF
#define MINAFRAMEF
#define MAXFRAME
@ UI_PANEL_DATA_EXPAND_ROOT
#define MEM_SAFE_FREE(v)
void MOD_nodes_update_interface(Object *object, NodesModifierData *nmd)
Definition MOD_nodes.cc:449
#define RNA_PROP_END
#define RNA_PROP_BEGIN(sptr, itemptr, prop)
StructRNA * ID_code_to_RNA_type(short idcode)
#define RNA_MAX_ARRAY_LENGTH
Definition RNA_define.hh:24
#define RNA_MAX_ARRAY_DIMENSION
Definition RNA_define.hh:27
@ PARM_REQUIRED
Definition RNA_types.hh:545
@ PROP_SCALE_LOG
Definition RNA_types.hh:210
@ PROP_SCALE_CUBIC
Definition RNA_types.hh:215
@ FUNC_USE_REPORTS
Definition RNA_types.hh:914
@ PROP_STRING_SEARCH_SUGGESTION
Definition RNA_types.hh:792
@ PROP_FLOAT
Definition RNA_types.hh:164
@ PROP_BOOLEAN
Definition RNA_types.hh:162
@ PROP_ENUM
Definition RNA_types.hh:166
@ PROP_INT
Definition RNA_types.hh:163
@ PROP_STRING
Definition RNA_types.hh:165
@ PROP_POINTER
Definition RNA_types.hh:167
@ PROP_COLLECTION
Definition RNA_types.hh:168
#define RNA_TRANSLATION_PREC_DEFAULT
Definition RNA_types.hh:224
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition RNA_types.hh:503
@ PROPOVERRIDE_NO_COMPARISON
Definition RNA_types.hh:511
@ PROP_DYNAMIC
Definition RNA_types.hh:428
@ PROP_ANIMATABLE
Definition RNA_types.hh:319
@ PROP_PROPORTIONAL
Definition RNA_types.hh:349
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
Definition RNA_types.hh:456
@ PROP_EDITABLE
Definition RNA_types.hh:306
@ PROP_ENUM_FLAG
Definition RNA_types.hh:404
@ PROP_LIB_EXCEPTION
Definition RNA_types.hh:312
@ PROP_NEVER_NULL
Definition RNA_types.hh:377
@ PROP_NO_DEG_UPDATE
Definition RNA_types.hh:439
@ PROP_ID_SELF_CHECK
Definition RNA_types.hh:370
@ PROP_ID_REFCOUNT
Definition RNA_types.hh:364
#define RNA_ENUM_ITEM_HEADING(name, description)
Definition RNA_types.hh:673
@ PROP_TIME
Definition RNA_types.hh:253
@ PROP_MATRIX
Definition RNA_types.hh:265
@ PROP_XYZ
Definition RNA_types.hh:269
@ PROP_DISTANCE
Definition RNA_types.hh:256
@ PROP_COLOR
Definition RNA_types.hh:260
@ PROP_PIXEL
Definition RNA_types.hh:248
@ PROP_ANGLE
Definition RNA_types.hh:252
@ PROP_TIME_ABSOLUTE
Definition RNA_types.hh:254
@ PROP_EULER
Definition RNA_types.hh:266
@ PROP_COORDS
Definition RNA_types.hh:274
@ PROP_NONE
Definition RNA_types.hh:233
@ PROP_DIRPATH
Definition RNA_types.hh:237
@ PROP_PERCENTAGE
Definition RNA_types.hh:250
@ PROP_FACTOR
Definition RNA_types.hh:251
@ PROP_TRANSLATION
Definition RNA_types.hh:261
@ PROP_UNSIGNED
Definition RNA_types.hh:249
@ PROP_FILEPATH
Definition RNA_types.hh:236
@ PROP_VELOCITY
Definition RNA_types.hh:263
#define C
Definition RandGen.cpp:29
#define NC_NODE
Definition WM_types.hh:394
#define NC_SCENE
Definition WM_types.hh:378
#define ND_MODIFIER
Definition WM_types.hh:462
#define NA_EDITED
Definition WM_types.hh:584
#define ND_TRANSFORM
Definition WM_types.hh:456
#define NA_RENAME
Definition WM_types.hh:588
#define NC_OBJECT
Definition WM_types.hh:379
PyObject * self
BPy_StructRNA * depsgraph
long long int int64_t
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
const ComputeContextHash & hash() const
constexpr bool contains_ptr(const T *ptr) const
Definition BLI_span.hh:291
KDTree_3d * tree
static ushort indices[]
#define INT16_MAX
#define external
#define log
float length(VecOp< float, D >) RET
static char ** types
Definition makesdna.cc:71
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
Definition mallocn.cc:133
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
Segment< FEdge *, Vec3r > segment
bool allow_procedural_attribute_access(StringRef attribute_name)
bool modifier_move_to_index(ReportList *reports, eReportType error_type, Object *ob, ModifierData *md, int index, bool allow_partial)
void free_shared_data(T **data, const ImplicitSharingInfo **sharing_info)
const char * name
const EnumPropertyItem rna_enum_id_type_items[]
Definition rna_ID.cc:29
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
const PointerRNA PointerRNA_NULL
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
int RNA_int_get(PointerRNA *ptr, const char *name)
void RNA_property_update_main(Main *bmain, Scene *scene, PointerRNA *ptr, PropertyRNA *prop)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
const char * RNA_property_identifier(const PropertyRNA *prop)
PointerRNA RNA_id_pointer_create(ID *id)
PropertyRNA * RNA_def_float_factor(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
PropertyRNA * RNA_def_int_array(StructOrFunctionRNA *cont_, const char *identifier, const int len, const int *default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_define_lib_overridable(const bool make_overridable)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_struct_system_idprops_func(StructRNA *srna, const char *system_idproperties)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_string_search_func(PropertyRNA *prop, const char *search, const eStringPropertySearchFlag search_flag)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_bitset_array_sdna(PropertyRNA *prop, const char *structname, const char *propname, const int64_t booleanbit, const int length)
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength)
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
const int rna_matrix_dimsize_4x4[]
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
PropertyRNA * RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
PropertyRNA * RNA_def_float_array(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_struct_idprops_func(StructRNA *srna, const char *idproperties)
void RNA_def_property_override_funcs(PropertyRNA *prop, const char *diff, const char *store, const char *apply)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_ui_scale_type(PropertyRNA *prop, PropertyScaleType ui_scale_type)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_override_clear_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_enum_item_add_separator(EnumPropertyItem **items, int *totitem)
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_enum_items_add_value(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item, int value)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
const EnumPropertyItem rna_enum_prop_dynamicpaint_type_items[]
int rna_object_vgroup_name_index_length(PointerRNA *ptr, int index)
void rna_object_vgroup_name_index_set(PointerRNA *ptr, const char *value, short *index)
void rna_object_vgroup_name_index_get(PointerRNA *ptr, char *value, int index)
const EnumPropertyItem rna_enum_mesh_delimit_mode_items[]
Definition rna_mesh.cc:26
const EnumPropertyItem rna_enum_axis_xy_items[]
static void rna_def_modifier_nodes(BlenderRNA *brna)
static void rna_def_modifier_fluid(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_hook(BlenderRNA *brna)
static void rna_def_modifier_smooth(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_weight_angle(BlenderRNA *brna)
const EnumPropertyItem rna_enum_subdivision_uv_smooth_items[]
const EnumPropertyItem rna_enum_dt_method_loop_items[]
static void rna_def_modifier_nodes_warning(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_vertex_group(StructRNA *srna, const char *vertex_group_name_set_fn)
static void rna_def_modifier_screw(BlenderRNA *brna)
static void rna_def_modifier_uvproject(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_lattice(BlenderRNA *brna)
static void rna_def_modifier_particleinstance(BlenderRNA *brna)
static void rna_def_modifier_nodes_panels(BlenderRNA *brna)
static void rna_def_modifier_edgesplit(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_dash(BlenderRNA *brna)
static void rna_def_modifier_bevel(BlenderRNA *brna)
const EnumPropertyItem rna_enum_dt_method_edge_items[]
static void rna_def_modifier_cloth(BlenderRNA *brna)
static void rna_def_modifier_shrinkwrap(BlenderRNA *brna)
static void rna_def_modifier_uvwarp(BlenderRNA *brna)
static void rna_def_modifier_meshseqcache(BlenderRNA *brna)
static void rna_def_modifier_simpledeform(BlenderRNA *brna)
static void rna_def_modifier_datatransfer(BlenderRNA *brna)
static void rna_def_modifier_weightvgmix(BlenderRNA *brna)
static void rna_def_modifier_meshdeform(BlenderRNA *brna)
static void rna_def_modifier_laplaciandeform(BlenderRNA *brna)
const EnumPropertyItem rna_enum_dt_method_poly_items[]
static void rna_def_modifier_grease_pencil_dash_segment(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_weight_proximity(BlenderRNA *brna)
static void rna_def_modifier_nodes_bakes(BlenderRNA *brna)
static void rna_def_modifier_explode(BlenderRNA *brna)
const EnumPropertyItem rna_enum_axis_flag_xyz_items[]
static void rna_def_modifier_grease_pencil_multiply(BlenderRNA *brna)
static const EnumPropertyItem modifier_warp_falloff_items[]
static void rna_def_modifier_particlesystem(BlenderRNA *brna)
static void rna_def_modifier_dynamic_paint(BlenderRNA *brna)
static void rna_def_modifier_generic_map_info(StructRNA *srna)
static void rna_def_modifier_grease_pencil_armature(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_layer_filter(StructRNA *srna)
const EnumPropertyItem rna_enum_modifier_triangulate_ngon_method_items[]
static void rna_def_modifier_nodes_panel(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_lineart(BlenderRNA *brna)
static void rna_def_modifier_mirror(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_custom_curve(StructRNA *srna)
static void rna_def_modifier_normaledit(BlenderRNA *brna)
static void rna_def_modifier_displace(BlenderRNA *brna)
const EnumPropertyItem rna_enum_shrinkwrap_face_cull_items[]
static void rna_def_modifier_meshcache(BlenderRNA *brna)
static void rna_def_modifier_skin(BlenderRNA *brna)
const EnumPropertyItem rna_enum_object_modifier_type_items[]
static void rna_def_modifier_weightvgedit(BlenderRNA *brna)
const EnumPropertyItem rna_enum_dt_mix_mode_items[]
static void rna_def_modifier_weld(BlenderRNA *brna)
static void rna_def_modifier_cast(BlenderRNA *brna)
static void rna_def_modifier_surface(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_simplify(BlenderRNA *brna)
static void rna_def_modifier_nodes_data_block(BlenderRNA *brna)
static void rna_def_modifier_panel_open_prop(StructRNA *srna, const char *identifier, const int id)
static void rna_def_modifier_curve(BlenderRNA *brna)
static void rna_def_modifier_wireframe(BlenderRNA *brna)
static void rna_def_modifier_softbody(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_shrinkwrap(BlenderRNA *brna)
const EnumPropertyItem rna_enum_dt_layers_select_src_items[]
static void rna_def_modifier_nodes_bake_data_blocks(BlenderRNA *brna)
static void rna_def_modifier_subsurf(BlenderRNA *brna)
static void rna_def_modifier_volume_displace(BlenderRNA *brna)
const EnumPropertyItem rna_enum_shrinkwrap_type_items[]
const EnumPropertyItem rna_enum_node_warning_type_items[]
static void rna_def_modifier_wave(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_time_segment(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_opacity(BlenderRNA *brna)
static EnumPropertyItem bake_target_in_node_items[]
static void rna_def_modifier_surfacedeform(BlenderRNA *brna)
const EnumPropertyItem rna_enum_axis_xyz_items[]
static void rna_def_modifier_lattice(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_thickness(BlenderRNA *brna)
static void rna_def_property_subdivision_common(StructRNA *srna)
static void rna_def_modifier_grease_pencil_material_filter(StructRNA *srna, const char *material_set_fn)
const EnumPropertyItem rna_enum_dt_method_vertex_items[]
const EnumPropertyItem rna_enum_modifier_triangulate_quad_method_items[]
void RNA_def_modifier(BlenderRNA *brna)
static void rna_def_modifier_multires(BlenderRNA *brna)
static void rna_def_modifier_triangulate(BlenderRNA *brna)
static void rna_def_modifier_mask(BlenderRNA *brna)
static void rna_def_modifier_warp(BlenderRNA *brna)
static void rna_def_modifier_weightvgproximity(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_mirror(BlenderRNA *brna)
static const EnumPropertyItem grease_pencil_build_time_mode_items[]
static void rna_def_modifier_grease_pencil_subdiv(BlenderRNA *brna)
static void rna_def_modifier_laplaciansmooth(BlenderRNA *brna)
static void rna_def_modifier_hook(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_envelope(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_array(BlenderRNA *brna)
static void rna_def_modifier_solidify(BlenderRNA *brna)
static void rna_def_modifier_nodes_bake(BlenderRNA *brna)
static void rna_def_modifier_ocean(BlenderRNA *brna)
static void rna_def_modifier_array(BlenderRNA *brna)
static void rna_def_modifier_collision(BlenderRNA *brna)
static void rna_def_modifier_armature(BlenderRNA *brna)
static void rna_def_modifier_weightednormal(BlenderRNA *brna)
static void rna_def_modifier_decimate(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_texture(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_color(BlenderRNA *brna)
static EnumPropertyItem bake_target_in_modifier_items[]
static void rna_def_modifier_grease_pencil_outline(BlenderRNA *brna)
static void rna_def_modifier_mesh_to_volume(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_offset(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_tint(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_length(BlenderRNA *brna)
const EnumPropertyItem rna_enum_dt_layers_select_dst_items[]
static void rna_def_modifier_grease_pencil_time(BlenderRNA *brna)
static void rna_def_modifier_boolean(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_smooth(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_build(BlenderRNA *brna)
const EnumPropertyItem rna_enum_subdivision_boundary_smooth_items[]
static void rna_def_modifier_remesh(BlenderRNA *brna)
static void rna_def_modifier_build(BlenderRNA *brna)
static void rna_def_modifier_grease_pencil_noise(BlenderRNA *brna)
static void rna_def_modifier_weightvg_mask(BlenderRNA *, StructRNA *srna, const char *mask_flags, const int invert_vgroup_mask_flag, const char *mask_vgroup_setter, const char *mask_uvlayer_setter)
const EnumPropertyItem rna_enum_modifier_shrinkwrap_mode_items[]
static void rna_def_modifier_correctivesmooth(BlenderRNA *brna)
static void rna_def_modifier_volume_to_mesh(BlenderRNA *brna)
const EnumPropertyItem rna_enum_object_axis_items[]
static const EnumPropertyItem space_items[]
static const EnumPropertyItem prop_solver_items[]
Definition rna_pose.cc:745
static const EnumPropertyItem prop_direction_items[]
#define min(a, b)
Definition sort.cc:36
#define FLT_MAX
Definition stdcycles.h:14
union CollectionPropertyIterator::@220100362304005352221007113371015217044252346141 internal
const char * identifier
Definition RNA_types.hh:657
GreasePencilDashModifierSegment * segments_array
GreasePencilTimeModifierSegment * segments_array
Definition DNA_ID.h:414
char name[258]
Definition DNA_ID.h:432
void * first
CustomData corner_data
CustomData vert_data
struct ModifierData * next
struct ModifierData * prev
uint16_t layout_panel_open_flag
struct bNodeTree * node_group
NodesModifierRuntimeHandle * runtime
struct NodesModifierSettings settings
NodesModifierBake * bakes
struct IDProperty * properties
ListBase particlesystem
ListBase modifiers
struct PartDeflect * pd
struct SoftBody * soft
ID * owner_id
Definition RNA_types.hh:51
void * data
Definition RNA_types.hh:53
IDOverrideLibraryPropertyOperation * liboverride_operation
struct PointCache * pointcache
struct SoftBody_Shared * shared
struct bDeformGroup * next
struct GeometryNodeAssetTraits * geometry_node_asset_traits
i
Definition text_draw.cc:230
max
Definition text_draw.cc:251
#define N_(msgid)
void WM_main_add_notifier(uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4238