Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_modifier.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | const EnumPropertyItem rna_enum_object_modifier_type_items[] = { | ||||
| {eModifierType_Explode, "EXPLODE", ICON_MOD_EXPLODE, "Explode", ""}, | {eModifierType_Explode, "EXPLODE", ICON_MOD_EXPLODE, "Explode", ""}, | ||||
| {eModifierType_Fluidsim, "FLUID_SIMULATION", ICON_MOD_FLUIDSIM, "Fluid Simulation", ""}, | {eModifierType_Fluidsim, "FLUID_SIMULATION", ICON_MOD_FLUIDSIM, "Fluid Simulation", ""}, | ||||
| {eModifierType_Ocean, "OCEAN", ICON_MOD_OCEAN, "Ocean", ""}, | {eModifierType_Ocean, "OCEAN", ICON_MOD_OCEAN, "Ocean", ""}, | ||||
| {eModifierType_ParticleInstance, "PARTICLE_INSTANCE", ICON_MOD_PARTICLES, "Particle Instance", ""}, | {eModifierType_ParticleInstance, "PARTICLE_INSTANCE", ICON_MOD_PARTICLES, "Particle Instance", ""}, | ||||
| {eModifierType_ParticleSystem, "PARTICLE_SYSTEM", ICON_MOD_PARTICLES, "Particle System", ""}, | {eModifierType_ParticleSystem, "PARTICLE_SYSTEM", ICON_MOD_PARTICLES, "Particle System", ""}, | ||||
| {eModifierType_Smoke, "SMOKE", ICON_MOD_SMOKE, "Smoke", ""}, | {eModifierType_Smoke, "SMOKE", ICON_MOD_SMOKE, "Smoke", ""}, | ||||
| {eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""}, | {eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""}, | ||||
| {eModifierType_Surface, "SURFACE", ICON_MOD_PHYSICS, "Surface", ""}, | {eModifierType_Surface, "SURFACE", ICON_MOD_PHYSICS, "Surface", ""}, | ||||
| {0, "", 0, N_("Grease Pencil"), "" }, | |||||
| {eModifierType_GpencilArray, "GP_ARRAY", ICON_MOD_ARRAY, "Array", "Create grid of duplicate instances" }, | |||||
| {eModifierType_GpencilDupli, "GP_DUPLI", ICON_GROUP_VERTEX, "Duplication", "Create duplication of strokes" }, | |||||
| {eModifierType_GpencilNoise, "GP_NOISE", ICON_RNDCURVE, "Noise", "Add noise to strokes" }, | |||||
| {eModifierType_GpencilSubdiv, "GP_SUBDIV", ICON_MOD_SUBSURF, "Subdivide", "Subdivide stroke adding more control points to strokes" }, | |||||
| {eModifierType_GpencilSimplify, "GP_SIMPLIFY", ICON_MOD_DECIM, "Simplify", "Simplify stroke reducing number of points" }, | |||||
| {eModifierType_GpencilLattice, "GP_LATTICE", ICON_MOD_LATTICE, "Lattice", "Change stroke using lattice to deform" }, | |||||
| {eModifierType_GpencilThick, "GP_THICK", ICON_MAN_ROT, "Thickness", "Change stroke thickness" }, | |||||
| {eModifierType_GpencilTint, "GP_TINT", ICON_COLOR, "Tint", "Tint strokes with new color" }, | |||||
| {eModifierType_GpencilColor, "GP_COLOR", ICON_GROUP_VCOL, "Hue/Saturation", "Apply changes to color" }, | |||||
| {eModifierType_GpencilOpacity, "GP_OPACITY", ICON_MOD_MASK, "Opacity", "Opacity of the strokes" }, | |||||
| { 0, "", 0, N_("VFX"), "" }, | |||||
| {eModifierType_GpencilBlur, "GP_BLUR", ICON_SOLO_ON, "Gaussian Blur", "Apply Gaussian Blur to object" }, | |||||
| {eModifierType_GpencilWave, "GP_WAVE", ICON_SOLO_ON, "Wave Distorsion", "Apply Sinusoidal Deformation" }, | |||||
| {eModifierType_GpencilPixel, "GP_PIXEL", ICON_SOLO_ON, "Pixelate", "Pixelate image" }, | |||||
| {eModifierType_GpencilSwirl, "GP_SWIRL", ICON_SOLO_ON, "Swirl", "Create a rotation distorsion" }, | |||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| const EnumPropertyItem rna_enum_modifier_triangulate_quad_method_items[] = { | const EnumPropertyItem rna_enum_modifier_triangulate_quad_method_items[] = { | ||||
| {MOD_TRIANGULATE_QUAD_BEAUTY, "BEAUTY", 0, "Beauty ", "Split the quads in nice triangles, slower method"}, | {MOD_TRIANGULATE_QUAD_BEAUTY, "BEAUTY", 0, "Beauty ", "Split the quads in nice triangles, slower method"}, | ||||
| {MOD_TRIANGULATE_QUAD_FIXED, "FIXED", 0, "Fixed", "Split the quads on the first and third vertices"}, | {MOD_TRIANGULATE_QUAD_FIXED, "FIXED", 0, "Fixed", "Split the quads on the first and third vertices"}, | ||||
| {MOD_TRIANGULATE_QUAD_ALTERNATE, "FIXED_ALTERNATE", 0, "Fixed Alternate", | {MOD_TRIANGULATE_QUAD_ALTERNATE, "FIXED_ALTERNATE", 0, "Fixed Alternate", | ||||
| "Split the quads on the 2nd and 4th vertices"}, | "Split the quads on the 2nd and 4th vertices"}, | ||||
| ▲ Show 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | |||||
| const EnumPropertyItem rna_enum_axis_flag_xyz_items[] = { | const EnumPropertyItem rna_enum_axis_flag_xyz_items[] = { | ||||
| {(1 << 0), "X", 0, "X", ""}, | {(1 << 0), "X", 0, "X", ""}, | ||||
| {(1 << 1), "Y", 0, "Y", ""}, | {(1 << 1), "Y", 0, "Y", ""}, | ||||
| {(1 << 2), "Z", 0, "Z", ""}, | {(1 << 2), "Z", 0, "Z", ""}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| EnumPropertyItem rna_enum_gpencil_lockshift_items[] = { | |||||
| { GP_LOCKAXIS_X, "GP_LOCKAXIS_X", 0, "X", "Use X axis" }, | |||||
| { GP_LOCKAXIS_Y, "GP_LOCKAXIS_Y", 0, "Y", "Use Y axis" }, | |||||
| { GP_LOCKAXIS_Z, "GP_LOCKAXIS_Z", 0, "Z", "Use Z axis" }, | |||||
| { 0, NULL, 0, NULL, NULL } | |||||
| }; | |||||
| #ifdef RNA_RUNTIME | #ifdef RNA_RUNTIME | ||||
| #include "DNA_particle_types.h" | #include "DNA_particle_types.h" | ||||
| #include "DNA_curve_types.h" | #include "DNA_curve_types.h" | ||||
| #include "DNA_smoke_types.h" | #include "DNA_smoke_types.h" | ||||
| #include "BKE_cachefile.h" | #include "BKE_cachefile.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_library.h" | #include "BKE_library.h" | ||||
| #include "BKE_modifier.h" | #include "BKE_modifier.h" | ||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| #include "BKE_particle.h" | #include "BKE_particle.h" | ||||
| #include "BKE_gpencil.h" | |||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "DEG_depsgraph_build.h" | #include "DEG_depsgraph_build.h" | ||||
| #ifdef WITH_ALEMBIC | #ifdef WITH_ALEMBIC | ||||
| # include "ABC_alembic.h" | # include "ABC_alembic.h" | ||||
| #endif | #endif | ||||
| ▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | switch ((ModifierType)md->type) { | ||||
| case eModifierType_NormalEdit: | case eModifierType_NormalEdit: | ||||
| return &RNA_NormalEditModifier; | return &RNA_NormalEditModifier; | ||||
| case eModifierType_CorrectiveSmooth: | case eModifierType_CorrectiveSmooth: | ||||
| return &RNA_CorrectiveSmoothModifier; | return &RNA_CorrectiveSmoothModifier; | ||||
| case eModifierType_MeshSequenceCache: | case eModifierType_MeshSequenceCache: | ||||
| return &RNA_MeshSequenceCacheModifier; | return &RNA_MeshSequenceCacheModifier; | ||||
| case eModifierType_SurfaceDeform: | case eModifierType_SurfaceDeform: | ||||
| return &RNA_SurfaceDeformModifier; | return &RNA_SurfaceDeformModifier; | ||||
| case eModifierType_GpencilNoise: | |||||
| return &RNA_GpencilNoiseModifier; | |||||
| case eModifierType_GpencilSubdiv: | |||||
| return &RNA_GpencilSubdivModifier; | |||||
| case eModifierType_GpencilSimplify: | |||||
| return &RNA_GpencilSimplifyModifier; | |||||
| case eModifierType_GpencilThick: | |||||
| return &RNA_GpencilThickModifier; | |||||
| case eModifierType_GpencilTint: | |||||
| return &RNA_GpencilTintModifier; | |||||
| case eModifierType_GpencilColor: | |||||
| return &RNA_GpencilColorModifier; | |||||
| case eModifierType_GpencilArray: | |||||
| return &RNA_GpencilArrayModifier; | |||||
| case eModifierType_GpencilDupli: | |||||
| return &RNA_GpencilDupliModifier; | |||||
| case eModifierType_GpencilOpacity: | |||||
| return &RNA_GpencilOpacityModifier; | |||||
| case eModifierType_GpencilLattice: | |||||
| return &RNA_GpencilLatticeModifier; | |||||
| case eModifierType_GpencilBlur: | |||||
| return &RNA_GpencilBlurModifier; | |||||
| case eModifierType_GpencilWave: | |||||
| return &RNA_GpencilWaveModifier; | |||||
| case eModifierType_GpencilPixel: | |||||
| return &RNA_GpencilPixelModifier; | |||||
| case eModifierType_GpencilSwirl: | |||||
| return &RNA_GpencilSwirlModifier; | |||||
| /* Default */ | /* Default */ | ||||
| case eModifierType_None: | case eModifierType_None: | ||||
| case eModifierType_ShapeKey: | case eModifierType_ShapeKey: | ||||
| case NUM_MODIFIER_TYPES: | case NUM_MODIFIER_TYPES: | ||||
| return &RNA_Modifier; | return &RNA_Modifier; | ||||
| } | } | ||||
| return &RNA_Modifier; | return &RNA_Modifier; | ||||
| } | } | ||||
| Show All 26 Lines | static char *rna_Modifier_path(PointerRNA *ptr) | ||||
| BLI_strescape(name_esc, md->name, sizeof(name_esc)); | BLI_strescape(name_esc, md->name, sizeof(name_esc)); | ||||
| return BLI_sprintfN("modifiers[\"%s\"]", name_esc); | return BLI_sprintfN("modifiers[\"%s\"]", name_esc); | ||||
| } | } | ||||
| static void rna_Modifier_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | static void rna_Modifier_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | ||||
| { | { | ||||
| DEG_id_tag_update(ptr->id.data, OB_RECALC_DATA); | DEG_id_tag_update(ptr->id.data, OB_RECALC_DATA); | ||||
| /* update grease pencil cache. This could be moved to desgraph, but it has no sense to | |||||
| * repeat this process in any blender area, when only is needed here. This approach can be less | |||||
| * cleaner, but faster. | |||||
| */ | |||||
| Object *obj = (Object *)ptr->id.data; | |||||
| if ((obj) && (obj->type == OB_GPENCIL)) { | |||||
| if (obj->gpd) { | |||||
| BKE_gpencil_batch_cache_dirty(obj->gpd); | |||||
| } | |||||
| } | |||||
| WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ptr->id.data); | WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ptr->id.data); | ||||
| } | } | ||||
| static void rna_Modifier_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr) | static void rna_Modifier_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr) | ||||
| { | { | ||||
| rna_Modifier_update(bmain, scene, ptr); | rna_Modifier_update(bmain, scene, ptr); | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| } | } | ||||
| Show All 32 Lines | |||||
| RNA_MOD_VGROUP_NAME_SET(WeightVGEdit, defgrp_name); | RNA_MOD_VGROUP_NAME_SET(WeightVGEdit, defgrp_name); | ||||
| RNA_MOD_VGROUP_NAME_SET(WeightVGEdit, mask_defgrp_name); | RNA_MOD_VGROUP_NAME_SET(WeightVGEdit, mask_defgrp_name); | ||||
| RNA_MOD_VGROUP_NAME_SET(WeightVGMix, defgrp_name_a); | RNA_MOD_VGROUP_NAME_SET(WeightVGMix, defgrp_name_a); | ||||
| RNA_MOD_VGROUP_NAME_SET(WeightVGMix, defgrp_name_b); | RNA_MOD_VGROUP_NAME_SET(WeightVGMix, defgrp_name_b); | ||||
| RNA_MOD_VGROUP_NAME_SET(WeightVGMix, mask_defgrp_name); | RNA_MOD_VGROUP_NAME_SET(WeightVGMix, mask_defgrp_name); | ||||
| RNA_MOD_VGROUP_NAME_SET(WeightVGProximity, defgrp_name); | RNA_MOD_VGROUP_NAME_SET(WeightVGProximity, defgrp_name); | ||||
| RNA_MOD_VGROUP_NAME_SET(WeightVGProximity, mask_defgrp_name); | RNA_MOD_VGROUP_NAME_SET(WeightVGProximity, mask_defgrp_name); | ||||
| RNA_MOD_VGROUP_NAME_SET(Wireframe, defgrp_name); | RNA_MOD_VGROUP_NAME_SET(Wireframe, defgrp_name); | ||||
| RNA_MOD_VGROUP_NAME_SET(GpencilNoise, vgname); | |||||
| RNA_MOD_VGROUP_NAME_SET(GpencilThick, vgname); | |||||
| RNA_MOD_VGROUP_NAME_SET(GpencilOpacity, vgname); | |||||
| RNA_MOD_VGROUP_NAME_SET(GpencilLattice, vgname); | |||||
| static void rna_ExplodeModifier_vgroup_get(PointerRNA *ptr, char *value) | static void rna_ExplodeModifier_vgroup_get(PointerRNA *ptr, char *value) | ||||
| { | { | ||||
| ExplodeModifierData *emd = (ExplodeModifierData *)ptr->data; | ExplodeModifierData *emd = (ExplodeModifierData *)ptr->data; | ||||
| rna_object_vgroup_name_index_get(ptr, value, emd->vgroup); | rna_object_vgroup_name_index_get(ptr, value, emd->vgroup); | ||||
| } | } | ||||
| static int rna_ExplodeModifier_vgroup_length(PointerRNA *ptr) | static int rna_ExplodeModifier_vgroup_length(PointerRNA *ptr) | ||||
| ▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | |||||
| RNA_MOD_OBJECT_SET(DataTransfer, ob_source, OB_MESH); | RNA_MOD_OBJECT_SET(DataTransfer, ob_source, OB_MESH); | ||||
| RNA_MOD_OBJECT_SET(Lattice, object, OB_LATTICE); | RNA_MOD_OBJECT_SET(Lattice, object, OB_LATTICE); | ||||
| RNA_MOD_OBJECT_SET(Mask, ob_arm, OB_ARMATURE); | RNA_MOD_OBJECT_SET(Mask, ob_arm, OB_ARMATURE); | ||||
| RNA_MOD_OBJECT_SET(MeshDeform, object, OB_MESH); | RNA_MOD_OBJECT_SET(MeshDeform, object, OB_MESH); | ||||
| RNA_MOD_OBJECT_SET(NormalEdit, target, OB_EMPTY); | RNA_MOD_OBJECT_SET(NormalEdit, target, OB_EMPTY); | ||||
| RNA_MOD_OBJECT_SET(Shrinkwrap, target, OB_MESH); | RNA_MOD_OBJECT_SET(Shrinkwrap, target, OB_MESH); | ||||
| RNA_MOD_OBJECT_SET(Shrinkwrap, auxTarget, OB_MESH); | RNA_MOD_OBJECT_SET(Shrinkwrap, auxTarget, OB_MESH); | ||||
| RNA_MOD_OBJECT_SET(SurfaceDeform, target, OB_MESH); | RNA_MOD_OBJECT_SET(SurfaceDeform, target, OB_MESH); | ||||
| RNA_MOD_OBJECT_SET(GpencilLattice, object, OB_LATTICE); | |||||
| static void rna_HookModifier_object_set(PointerRNA *ptr, PointerRNA value) | static void rna_HookModifier_object_set(PointerRNA *ptr, PointerRNA value) | ||||
| { | { | ||||
| HookModifierData *hmd = ptr->data; | HookModifierData *hmd = ptr->data; | ||||
| Object *ob = (Object *)value.data; | Object *ob = (Object *)value.data; | ||||
| hmd->object = ob; | hmd->object = ob; | ||||
| id_lib_extern((ID *)ob); | id_lib_extern((ID *)ob); | ||||
| ▲ Show 20 Lines • Show All 4,198 Lines • ▼ Show 20 Lines | static void rna_def_modifier_surfacedeform(BlenderRNA *brna) | ||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | RNA_def_property_update(prop, 0, "rna_Modifier_update"); | ||||
| prop = RNA_def_property(srna, "is_bound", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "is_bound", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_SurfaceDeformModifier_is_bound_get", NULL); | RNA_def_property_boolean_funcs(prop, "rna_SurfaceDeformModifier_is_bound_get", NULL); | ||||
| RNA_def_property_ui_text(prop, "Bound", "Whether geometry has been bound to target mesh"); | RNA_def_property_ui_text(prop, "Bound", "Whether geometry has been bound to target mesh"); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| } | } | ||||
| static void rna_def_modifier_gpencilnoise(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| srna = RNA_def_struct(brna, "GpencilNoiseModifier", "Modifier"); | |||||
| RNA_def_struct_ui_text(srna, "Noise Modifier", "Noise effect modifier"); | |||||
| RNA_def_struct_sdna(srna, "GpencilNoiseModifierData"); | |||||
| RNA_def_struct_ui_icon(srna, ICON_RNDCURVE); | |||||
| prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_sdna(prop, NULL, "layername"); | |||||
| RNA_def_property_ui_text(prop, "Layer", "Layer name"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_sdna(prop, NULL, "vgname"); | |||||
| RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the deform"); | |||||
| RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GpencilNoiseModifier_vgname_set"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "factor"); | |||||
| RNA_def_property_range(prop, 0, 30.0); | |||||
| RNA_def_property_ui_text(prop, "Factor", "Amount of noise to apply"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "random", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_USE_RANDOM); | |||||
| RNA_def_property_ui_text(prop, "Random", "Use random values"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "affect_position", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_MOD_LOCATION); | |||||
| RNA_def_property_ui_text(prop, "Affect Position", "The modifier affects the position of the point"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "affect_strength", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_MOD_STRENGTH); | |||||
| RNA_def_property_ui_text(prop, "Affect Strength", "The modifier affects the color strength of the point"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "affect_thickness", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_MOD_THICKNESS); | |||||
| RNA_def_property_ui_text(prop, "Affect Thickness", "The modifier affects the thickness of the point"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "full_stroke", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_FULL_STROKE); | |||||
| RNA_def_property_ui_text(prop, "Full Stroke", "The noise moves the stroke as a whole, not point by point"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "move_extreme", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_MOVE_EXTREME); | |||||
| RNA_def_property_ui_text(prop, "Move Extremes", "The noise moves the stroke extreme points"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "passindex", PROP_INT, PROP_NONE); | |||||
campbellbarton: should use separator `pass_index` | |||||
| RNA_def_property_int_sdna(prop, NULL, "passindex"); | |||||
| RNA_def_property_range(prop, 0, 100); | |||||
| RNA_def_property_ui_text(prop, "Pass", "Pass index"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "step", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "step"); | |||||
| RNA_def_property_range(prop, 1, 100); | |||||
| RNA_def_property_ui_text(prop, "Step", "Number of frames before recalculate random values again"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_layers", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_INVERSE_LAYER); | |||||
| RNA_def_property_ui_text(prop, "Inverse Layers", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_pass", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_INVERSE_PASS); | |||||
| RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_vertex", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_INVERSE_VGROUP); | |||||
| RNA_def_property_ui_text(prop, "Inverse VertexGroup", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| } | |||||
| static void rna_def_modifier_gpencilsubdiv(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| srna = RNA_def_struct(brna, "GpencilSubdivModifier", "Modifier"); | |||||
| RNA_def_struct_ui_text(srna, "Subdivision Modifier", "Subdivide Stroke modifier"); | |||||
| RNA_def_struct_sdna(srna, "GpencilSubdivModifierData"); | |||||
| RNA_def_struct_ui_icon(srna, ICON_MOD_SUBSURF); | |||||
| prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_sdna(prop, NULL, "layername"); | |||||
| RNA_def_property_ui_text(prop, "Layer", "Layer name"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "level", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "level"); | |||||
| RNA_def_property_range(prop, 0, 5); | |||||
| RNA_def_property_ui_text(prop, "Level", "Number of subdivisions"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "simple", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SUBDIV_SIMPLE); | |||||
| RNA_def_property_ui_text(prop, "Simple", "The modifier only add control points"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "passindex", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "passindex"); | |||||
| RNA_def_property_range(prop, 0, 100); | |||||
| RNA_def_property_ui_text(prop, "Pass", "Pass index"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_layers", PROP_BOOLEAN, PROP_NONE); | |||||
Not Done Inline Actionsinverse -> invert all RNA naming. campbellbarton: inverse -> invert all RNA naming. | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SUBDIV_INVERSE_LAYER); | |||||
| RNA_def_property_ui_text(prop, "Inverse Layers", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_pass", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SUBDIV_INVERSE_PASS); | |||||
| RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| } | |||||
| static void rna_def_modifier_gpencilsimplify(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| srna = RNA_def_struct(brna, "GpencilSimplifyModifier", "Modifier"); | |||||
| RNA_def_struct_ui_text(srna, "Simplify Modifier", "Simplify Stroke modifier"); | |||||
| RNA_def_struct_sdna(srna, "GpencilSimplifyModifierData"); | |||||
| RNA_def_struct_ui_icon(srna, ICON_MOD_DECIM); | |||||
| prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_sdna(prop, NULL, "layername"); | |||||
| RNA_def_property_ui_text(prop, "Layer", "Layer name"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "factor"); | |||||
| RNA_def_property_range(prop, 0, 100.0); | |||||
| RNA_def_property_ui_range(prop, 0, 100.0, 1.0f, 3); | |||||
| RNA_def_property_ui_text(prop, "Factor", "Factor of Simplify"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "passindex", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "passindex"); | |||||
| RNA_def_property_range(prop, 0, 100); | |||||
| RNA_def_property_ui_text(prop, "Pass", "Pass index"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_layers", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SIMPLIFY_INVERSE_LAYER); | |||||
| RNA_def_property_ui_text(prop, "Inverse Layers", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_pass", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SIMPLIFY_INVERSE_PASS); | |||||
| RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| } | |||||
| static void rna_def_modifier_gpencilthick(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| srna = RNA_def_struct(brna, "GpencilThickModifier", "Modifier"); | |||||
| RNA_def_struct_ui_text(srna, "Thick Modifier", "Subdivide and Smooth Stroke modifier"); | |||||
| RNA_def_struct_sdna(srna, "GpencilThickModifierData"); | |||||
| RNA_def_struct_ui_icon(srna, ICON_MAN_ROT); | |||||
| prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_sdna(prop, NULL, "layername"); | |||||
| RNA_def_property_ui_text(prop, "Layer", "Layer name"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_sdna(prop, NULL, "vgname"); | |||||
| RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the deform"); | |||||
| RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GpencilThickModifier_vgname_set"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "thickness", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "thickness"); | |||||
| RNA_def_property_range(prop, -100, 500); | |||||
| RNA_def_property_ui_text(prop, "Thickness", "Factor of thickness change"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "passindex", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "passindex"); | |||||
| RNA_def_property_range(prop, 0, 100); | |||||
| RNA_def_property_ui_text(prop, "Pass", "Pass index"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_layers", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_THICK_INVERSE_LAYER); | |||||
| RNA_def_property_ui_text(prop, "Inverse Layers", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_pass", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_THICK_INVERSE_PASS); | |||||
| RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_vertex", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_THICK_INVERSE_VGROUP); | |||||
| RNA_def_property_ui_text(prop, "Inverse VertexGroup", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "use_custom_curve", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_THICK_CUSTOM_CURVE); | |||||
| RNA_def_property_ui_text(prop, "Custom Curve", "Use a custom curve to define thickness changes"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_pointer_sdna(prop, NULL, "cur_thickness"); | |||||
| RNA_def_property_ui_text(prop, "Curve", "Custom Thickness Curve"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| } | |||||
| static void rna_def_modifier_gpenciltint(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| srna = RNA_def_struct(brna, "GpencilTintModifier", "Modifier"); | |||||
| RNA_def_struct_ui_text(srna, "Tint Modifier", "Tint Stroke Color modifier"); | |||||
| RNA_def_struct_sdna(srna, "GpencilTintModifierData"); | |||||
| RNA_def_struct_ui_icon(srna, ICON_COLOR); | |||||
| prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_sdna(prop, NULL, "layername"); | |||||
| RNA_def_property_ui_text(prop, "Layer", "Layer name"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA); | |||||
| RNA_def_property_range(prop, 0.0, 1.0); | |||||
| RNA_def_property_float_sdna(prop, NULL, "rgb"); | |||||
| RNA_def_property_array(prop, 3); | |||||
| RNA_def_property_ui_text(prop, "Color", "Color used for tinting"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "factor"); | |||||
| RNA_def_property_ui_range(prop, 0, 2.0, 0.1, 3); | |||||
| RNA_def_property_ui_text(prop, "Factor", "Factor for mixing color"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "create_colors", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_TINT_CREATE_COLORS); | |||||
| RNA_def_property_ui_text(prop, "Create Colors", "When apply modifier, create new color in the palette"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "passindex", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "passindex"); | |||||
| RNA_def_property_range(prop, 0, 100); | |||||
| RNA_def_property_ui_text(prop, "Pass", "Pass index"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_layers", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_TINT_INVERSE_LAYER); | |||||
| RNA_def_property_ui_text(prop, "Inverse Layers", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_pass", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_TINT_INVERSE_PASS); | |||||
| RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| } | |||||
| static void rna_def_modifier_gpencilcolor(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| srna = RNA_def_struct(brna, "GpencilColorModifier", "Modifier"); | |||||
| RNA_def_struct_ui_text(srna, "Hue/Saturation Modifier", "Change Hue/Saturation modifier"); | |||||
| RNA_def_struct_sdna(srna, "GpencilColorModifierData"); | |||||
| RNA_def_struct_ui_icon(srna, ICON_GROUP_VCOL); | |||||
| prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_sdna(prop, NULL, "layername"); | |||||
| RNA_def_property_ui_text(prop, "Layer", "Layer name"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "hue", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_range(prop, 0.0, 2.0); | |||||
| RNA_def_property_ui_range(prop, 0.0, 2.0, 0.1, 3); | |||||
| RNA_def_property_float_sdna(prop, NULL, "hsv[0]"); | |||||
| RNA_def_property_ui_text(prop, "Hue", "Color Hue"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_range(prop, 0.0, 2.0); | |||||
| RNA_def_property_ui_range(prop, 0.0, 2.0, 0.1, 3); | |||||
| RNA_def_property_float_sdna(prop, NULL, "hsv[1]"); | |||||
| RNA_def_property_ui_text(prop, "Saturation", "Color Saturation"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_range(prop, 0.0, 2.0); | |||||
| RNA_def_property_ui_range(prop, 0.0, 2.0, 0.1, 3); | |||||
| RNA_def_property_float_sdna(prop, NULL, "hsv[2]"); | |||||
| RNA_def_property_ui_text(prop, "Value", "Color Value"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "create_colors", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_COLOR_CREATE_COLORS); | |||||
| RNA_def_property_ui_text(prop, "Create Colors", "When apply modifier, create new color in the palette"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "passindex", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "passindex"); | |||||
| RNA_def_property_range(prop, 0, 100); | |||||
| RNA_def_property_ui_text(prop, "Pass", "Pass index"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_layers", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_COLOR_INVERSE_LAYER); | |||||
| RNA_def_property_ui_text(prop, "Inverse Layers", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_pass", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_COLOR_INVERSE_PASS); | |||||
| RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| } | |||||
| static void rna_def_modifier_gpencilopacity(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| srna = RNA_def_struct(brna, "GpencilOpacityModifier", "Modifier"); | |||||
| RNA_def_struct_ui_text(srna, "Opacity Modifier", "Opacity of Strokes modifier"); | |||||
| RNA_def_struct_sdna(srna, "GpencilOpacityModifierData"); | |||||
| RNA_def_struct_ui_icon(srna, ICON_MOD_MASK); | |||||
| prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_sdna(prop, NULL, "layername"); | |||||
| RNA_def_property_ui_text(prop, "Layer", "Layer name"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_sdna(prop, NULL, "vgname"); | |||||
| RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the deform"); | |||||
| RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GpencilOpacityModifier_vgname_set"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "factor"); | |||||
| RNA_def_property_ui_range(prop, 0, 2.0, 0.1, 3); | |||||
| RNA_def_property_ui_text(prop, "Factor", "Factor of Opacity"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "passindex", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "passindex"); | |||||
| RNA_def_property_range(prop, 0, 100); | |||||
| RNA_def_property_ui_text(prop, "Pass", "Pass index"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_layers", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_OPACITY_INVERSE_LAYER); | |||||
| RNA_def_property_ui_text(prop, "Inverse Layers", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_pass", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_OPACITY_INVERSE_PASS); | |||||
| RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_vertex", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_OPACITY_INVERSE_VGROUP); | |||||
| RNA_def_property_ui_text(prop, "Inverse VertexGroup", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| } | |||||
| static void rna_def_modifier_gpencilarray(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| srna = RNA_def_struct(brna, "GpencilArrayModifier", "Modifier"); | |||||
| RNA_def_struct_ui_text(srna, "Array Modifier", "Create grid of duplicate instances"); | |||||
| RNA_def_struct_sdna(srna, "GpencilArrayModifierData"); | |||||
| RNA_def_struct_ui_icon(srna, ICON_MOD_ARRAY); | |||||
| prop = RNA_def_property(srna, "count", PROP_INT, PROP_XYZ); | |||||
| RNA_def_property_range(prop, 1, INT_MAX); | |||||
| RNA_def_property_ui_text(prop, "Count", "Number of items"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| /* Offset parameters */ | |||||
| prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TRANSLATION); | |||||
| RNA_def_property_float_sdna(prop, NULL, "offset"); | |||||
| RNA_def_property_ui_text(prop, "Offset", "Value for the distance between items"); | |||||
| RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "shift", PROP_FLOAT, PROP_TRANSLATION); | |||||
| RNA_def_property_float_sdna(prop, NULL, "shift"); | |||||
| RNA_def_property_ui_text(prop, "Shift", "Shiftness value"); | |||||
| RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "lock_axis", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_sdna(prop, NULL, "lock_axis"); | |||||
| RNA_def_property_enum_items(prop, rna_enum_gpencil_lockshift_items); | |||||
| //RNA_def_property_flag(prop, PROP_ENUM_FLAG); | |||||
| RNA_def_property_ui_text(prop, "Axis", ""); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER); | |||||
| RNA_def_property_float_sdna(prop, NULL, "rot"); | |||||
| RNA_def_property_ui_text(prop, "Rotation", "Value for chages in rotation"); | |||||
| RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); | |||||
| RNA_def_property_float_sdna(prop, NULL, "scale"); | |||||
| RNA_def_property_ui_text(prop, "Scale", "Value for changes in scale"); | |||||
| RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "random_rot", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_ARRAY_RANDOM_ROT); | |||||
| RNA_def_property_ui_text(prop, "Random Rotation", "Use random factors for rotation"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "rot_factor", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "rnd_rot"); | |||||
| RNA_def_property_ui_text(prop, "Rotation Factor", "Random factor for rotation"); | |||||
| RNA_def_property_range(prop, -10.0, 10.0); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "random_scale", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_ARRAY_RANDOM_SIZE); | |||||
| RNA_def_property_ui_text(prop, "Random Scale", "Use random factors for scale"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "scale_factor", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "rnd_size"); | |||||
| RNA_def_property_ui_text(prop, "Scale Factor", "Random factor for scale"); | |||||
| RNA_def_property_range(prop, -10.0, 10.0); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| } | |||||
| static void rna_def_modifier_gpencildupli(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| srna = RNA_def_struct(brna, "GpencilDupliModifier", "Modifier"); | |||||
| RNA_def_struct_ui_text(srna, "Duplication Modifier", "Create array of duplicate strokes"); | |||||
| RNA_def_struct_sdna(srna, "GpencilDupliModifierData"); | |||||
| RNA_def_struct_ui_icon(srna, ICON_GROUP_VERTEX); | |||||
| prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_sdna(prop, NULL, "layername"); | |||||
| RNA_def_property_ui_text(prop, "Layer", "Layer name"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "passindex", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "passindex"); | |||||
| RNA_def_property_range(prop, 0, 100); | |||||
| RNA_def_property_ui_text(prop, "Pass", "Pass index"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "count", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_range(prop, 1, INT_MAX); | |||||
| RNA_def_property_ui_range(prop, 1, 1000, 1, -1); | |||||
| RNA_def_property_ui_text(prop, "Count", "Number of duplicates to make"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| /* Offset parameters */ | |||||
| prop = RNA_def_property(srna, "constant_offset_displace", PROP_FLOAT, PROP_TRANSLATION); | |||||
| RNA_def_property_float_sdna(prop, NULL, "offset"); | |||||
| RNA_def_property_ui_text(prop, "Constant Offset Displacement", "Value for the distance between arrayed items"); | |||||
| RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER); | |||||
| RNA_def_property_float_sdna(prop, NULL, "rot"); | |||||
| RNA_def_property_ui_text(prop, "Rotation", "Value for chages in rotation"); | |||||
| RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); | |||||
| RNA_def_property_float_sdna(prop, NULL, "scale"); | |||||
| RNA_def_property_ui_text(prop, "Scale", "Value for changes in scale"); | |||||
| RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "random_rot", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DUPLI_RANDOM_ROT); | |||||
| RNA_def_property_ui_text(prop, "Random Rotation", "Use random factors for rotation"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "rot_factor", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "rnd_rot"); | |||||
| RNA_def_property_ui_text(prop, "Rotation Factor", "Random factor for rotation"); | |||||
| RNA_def_property_range(prop, -10.0, 10.0); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "random_scale", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DUPLI_RANDOM_SIZE); | |||||
| RNA_def_property_ui_text(prop, "Random Scale", "Use random factors for scale"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "scale_factor", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "rnd_size"); | |||||
| RNA_def_property_ui_text(prop, "Scale Factor", "Random factor for scale"); | |||||
| RNA_def_property_range(prop, -10.0, 10.0); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_layers", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DUPLI_INVERSE_LAYER); | |||||
| RNA_def_property_ui_text(prop, "Inverse Layers", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_pass", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DUPLI_INVERSE_PASS); | |||||
| RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| } | |||||
| static void rna_def_modifier_gpencillattice(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| srna = RNA_def_struct(brna, "GpencilLatticeModifier", "Modifier"); | |||||
| RNA_def_struct_ui_text(srna, "Lattice Modifier", "Change stroke using lattice to deform modifier"); | |||||
| RNA_def_struct_sdna(srna, "GpencilLatticeModifierData"); | |||||
| RNA_def_struct_ui_icon(srna, ICON_MOD_LATTICE); | |||||
| prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_sdna(prop, NULL, "layername"); | |||||
| RNA_def_property_ui_text(prop, "Layer", "Layer name"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_sdna(prop, NULL, "vgname"); | |||||
| RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the deform"); | |||||
| RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GpencilLatticeModifier_vgname_set"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "passindex", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "passindex"); | |||||
| RNA_def_property_range(prop, 0, 100); | |||||
| RNA_def_property_ui_text(prop, "Pass", "Pass index"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_layers", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LATTICE_INVERSE_LAYER); | |||||
| RNA_def_property_ui_text(prop, "Inverse Layers", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_pass", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LATTICE_INVERSE_PASS); | |||||
| RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "inverse_vertex", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LATTICE_INVERSE_VGROUP); | |||||
| RNA_def_property_ui_text(prop, "Inverse VertexGroup", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_ui_text(prop, "Object", "Lattice object to deform with"); | |||||
| RNA_def_property_pointer_funcs(prop, NULL, "rna_GpencilLatticeModifier_object_set", NULL, "rna_Lattice_object_poll"); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); | |||||
| RNA_def_property_ui_range(prop, 0, 1, 10, 2); | |||||
| RNA_def_property_ui_text(prop, "Strength", "Strength of modifier effect"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| } | |||||
| static void rna_def_modifier_gpencilblur(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| srna = RNA_def_struct(brna, "GpencilBlurModifier", "Modifier"); | |||||
| RNA_def_struct_ui_text(srna, "Gaussian Blur Modifier", "Gaussian Blur modifier"); | |||||
| RNA_def_struct_sdna(srna, "GpencilBlurModifierData"); | |||||
| RNA_def_struct_ui_icon(srna, ICON_SOLO_ON); | |||||
| prop = RNA_def_property(srna, "factor", PROP_INT, PROP_PIXEL); | |||||
| RNA_def_property_int_sdna(prop, NULL, "radius"); | |||||
| RNA_def_property_range(prop, 0, INT_MAX); | |||||
| RNA_def_property_ui_text(prop, "Factor", "Factor of Blur"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| } | |||||
| static void rna_def_modifier_gpencilwave(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| static EnumPropertyItem prop_gpencil_wave_type_items[] = { | |||||
| { 0, "HORIZONTAL", 0, "Horizontal", "" }, | |||||
| { 1, "VERTICAL", 0, "Vertical", "" }, | |||||
| { 0, NULL, 0, NULL, NULL } | |||||
| }; | |||||
| srna = RNA_def_struct(brna, "GpencilWaveModifier", "Modifier"); | |||||
| RNA_def_struct_ui_text(srna, "Wave Deformation Modifier", "Wave Deformation modifier"); | |||||
| RNA_def_struct_sdna(srna, "GpencilWaveModifierData"); | |||||
| RNA_def_struct_ui_icon(srna, ICON_SOLO_ON); | |||||
| prop = RNA_def_property(srna, "orientation", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_sdna(prop, NULL, "orientation"); | |||||
| RNA_def_property_enum_items(prop, prop_gpencil_wave_type_items); | |||||
| RNA_def_property_ui_text(prop, "Orientation", "Direction of the wave"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "amplitude"); | |||||
| RNA_def_property_range(prop, 0, FLT_MAX); | |||||
| RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of Wave"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "period", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "period"); | |||||
| RNA_def_property_range(prop, 0, FLT_MAX); | |||||
| RNA_def_property_ui_text(prop, "Period", "Period of Wave"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "phase", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "phase"); | |||||
| RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); | |||||
| RNA_def_property_ui_text(prop, "Phase", "Phase Shift of Wave"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| } | |||||
| static void rna_def_modifier_gpencilpixel(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| srna = RNA_def_struct(brna, "GpencilPixelModifier", "Modifier"); | |||||
| RNA_def_struct_ui_text(srna, "Pixelate Modifier", "Pixelate modifier"); | |||||
| RNA_def_struct_sdna(srna, "GpencilPixelModifierData"); | |||||
| RNA_def_struct_ui_icon(srna, ICON_SOLO_ON); | |||||
| prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL); | |||||
| RNA_def_property_int_sdna(prop, NULL, "size"); | |||||
| RNA_def_property_range(prop, 1, INT_MAX); | |||||
| RNA_def_property_ui_text(prop, "Size", "Pixel size"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA); | |||||
| RNA_def_property_range(prop, 0.0, 1.0); | |||||
| RNA_def_property_float_sdna(prop, NULL, "rgba"); | |||||
| RNA_def_property_array(prop, 4); | |||||
| RNA_def_property_ui_text(prop, "Color", "Color used for lines"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "use_lines", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_PIXEL_USE_LINES); | |||||
| RNA_def_property_ui_text(prop, "Lines", "Display lines between pixels"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| } | |||||
| static void rna_def_modifier_gpencilswirl(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| srna = RNA_def_struct(brna, "GpencilSwirlModifier", "Modifier"); | |||||
| RNA_def_struct_ui_text(srna, "Swirl Modifier", "Swirl modifier"); | |||||
| RNA_def_struct_sdna(srna, "GpencilSwirlModifierData"); | |||||
| RNA_def_struct_ui_icon(srna, ICON_SOLO_ON); | |||||
| prop = RNA_def_property(srna, "center", PROP_INT, PROP_PIXEL); | |||||
| RNA_def_property_int_sdna(prop, NULL, "center"); | |||||
| RNA_def_property_range(prop, 0, INT_MAX); | |||||
| RNA_def_property_ui_text(prop, "Center", "Rotation Center point"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "radius", PROP_INT, PROP_PIXEL); | |||||
| RNA_def_property_int_sdna(prop, NULL, "radius"); | |||||
| RNA_def_property_range(prop, 0, INT_MAX); | |||||
| RNA_def_property_ui_text(prop, "Radius", "Radius to apply"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "angle"); | |||||
| RNA_def_property_range(prop, DEG2RAD(-5 * 360), DEG2RAD(5 * 360)); | |||||
| RNA_def_property_ui_range(prop, DEG2RAD(-5 * 360), DEG2RAD(5 * 360), 5, 2); | |||||
| RNA_def_property_ui_text(prop, "Angle", "Angle of rotation"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "transparent", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SWIRL_MAKE_TRANSPARENT); | |||||
| RNA_def_property_ui_text(prop, "Transparent", "Make image transparent outside of radius"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| prop = RNA_def_property(srna, "use_loc", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SWIRL_USE_OB_LOC); | |||||
| RNA_def_property_ui_text(prop, "Use Location", "Use object location as center"); | |||||
| RNA_def_property_update(prop, 0, "rna_Modifier_update"); | |||||
| } | |||||
| void RNA_def_modifier(BlenderRNA *brna) | void RNA_def_modifier(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| /* data */ | /* data */ | ||||
| srna = RNA_def_struct(brna, "Modifier", NULL); | srna = RNA_def_struct(brna, "Modifier", NULL); | ||||
| RNA_def_struct_ui_text(srna, "Modifier", "Modifier affecting the geometry data of an object"); | RNA_def_struct_ui_text(srna, "Modifier", "Modifier affecting the geometry data of an object"); | ||||
| ▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | void RNA_def_modifier(BlenderRNA *brna) | ||||
| rna_def_modifier_triangulate(brna); | rna_def_modifier_triangulate(brna); | ||||
| rna_def_modifier_meshcache(brna); | rna_def_modifier_meshcache(brna); | ||||
| rna_def_modifier_laplaciandeform(brna); | rna_def_modifier_laplaciandeform(brna); | ||||
| rna_def_modifier_wireframe(brna); | rna_def_modifier_wireframe(brna); | ||||
| rna_def_modifier_datatransfer(brna); | rna_def_modifier_datatransfer(brna); | ||||
| rna_def_modifier_normaledit(brna); | rna_def_modifier_normaledit(brna); | ||||
| rna_def_modifier_meshseqcache(brna); | rna_def_modifier_meshseqcache(brna); | ||||
| rna_def_modifier_surfacedeform(brna); | rna_def_modifier_surfacedeform(brna); | ||||
| rna_def_modifier_gpencilnoise(brna); | |||||
| rna_def_modifier_gpencilsubdiv(brna); | |||||
| rna_def_modifier_gpencilsimplify(brna); | |||||
| rna_def_modifier_gpencilthick(brna); | |||||
| rna_def_modifier_gpenciltint(brna); | |||||
| rna_def_modifier_gpencilcolor(brna); | |||||
| rna_def_modifier_gpencilarray(brna); | |||||
| rna_def_modifier_gpencildupli(brna); | |||||
| rna_def_modifier_gpencilopacity(brna); | |||||
| rna_def_modifier_gpencillattice(brna); | |||||
| rna_def_modifier_gpencilblur(brna); | |||||
| rna_def_modifier_gpencilwave(brna); | |||||
| rna_def_modifier_gpencilpixel(brna); | |||||
| rna_def_modifier_gpencilswirl(brna); | |||||
| } | } | ||||
| #endif | #endif | ||||
should use separator pass_index