Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_gpencil_modifier.c
| Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | const EnumPropertyItem rna_enum_object_greasepencil_modifier_type_items[] = { | ||||
| ICON_MOD_MIRROR, | ICON_MOD_MIRROR, | ||||
| "Mirror", | "Mirror", | ||||
| "Duplicate strokes like a mirror"}, | "Duplicate strokes like a mirror"}, | ||||
| {eGpencilModifierType_Multiply, | {eGpencilModifierType_Multiply, | ||||
| "GP_MULTIPLY", | "GP_MULTIPLY", | ||||
| ICON_GP_MULTIFRAME_EDITING, | ICON_GP_MULTIFRAME_EDITING, | ||||
| "Multiple Strokes", | "Multiple Strokes", | ||||
| "Produce multiple strokes along one stroke"}, | "Produce multiple strokes along one stroke"}, | ||||
| {eGpencilModifierType_Outline, | |||||
| "GP_OUTLINE", | |||||
| ICON_MOD_SKIN, | |||||
| "Outline", | |||||
| "Convert stroke to perimeter"}, | |||||
| {eGpencilModifierType_Simplify, | {eGpencilModifierType_Simplify, | ||||
| "GP_SIMPLIFY", | "GP_SIMPLIFY", | ||||
| ICON_MOD_SIMPLIFY, | ICON_MOD_SIMPLIFY, | ||||
| "Simplify", | "Simplify", | ||||
| "Simplify stroke reducing number of points"}, | "Simplify stroke reducing number of points"}, | ||||
| {eGpencilModifierType_Subdiv, | {eGpencilModifierType_Subdiv, | ||||
| "GP_SUBDIV", | "GP_SUBDIV", | ||||
| ICON_MOD_SUBSURF, | ICON_MOD_SUBSURF, | ||||
| ▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | static const EnumPropertyItem modifier_gphook_falloff_items[] = { | ||||
| {eGPHook_Falloff_Const, "CONSTANT", ICON_NOCURVE, "Constant", ""}, | {eGPHook_Falloff_Const, "CONSTANT", ICON_NOCURVE, "Constant", ""}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| static const EnumPropertyItem rna_enum_time_mode_items[] = { | static const EnumPropertyItem rna_enum_time_mode_items[] = { | ||||
| {GP_TIME_MODE_NORMAL, "NORMAL", 0, "Regular", "Apply offset in usual animation direction"}, | {GP_TIME_MODE_NORMAL, "NORMAL", 0, "Regular", "Apply offset in usual animation direction"}, | ||||
| {GP_TIME_MODE_REVERSE, "REVERSE", 0, "Reverse", "Apply offset in reverse animation direction"}, | {GP_TIME_MODE_REVERSE, "REVERSE", 0, "Reverse", "Apply offset in reverse animation direction"}, | ||||
| {GP_TIME_MODE_FIX, "FIX", 0, "Fixed Frame", "Keep frame and do not change with time"}, | {GP_TIME_MODE_FIX, "FIX", 0, "Fixed Frame", "Keep frame and do not change with time"}, | ||||
| {GP_TIME_MODE_PINGPONG, "PINGPONG", 0, "Ping Pong", "Loop back and forth"}, | {GP_TIME_MODE_PINGPONG, "PINGPONG", 0, "Ping Pong", "Loop back and forth starting in reverse"}, | ||||
| {GP_TIME_MODE_CHAIN, "CHAIN", 0, "Chain", "List of chained animation segments"}, | |||||
| {0, NULL, 0, NULL, NULL}, | |||||
| }; | |||||
| static const EnumPropertyItem rna_enum_time_seg_mode_items[] = { | |||||
| {GP_TIME_SEG_MODE_NORMAL, "NORMAL", 0, "Regular", "Apply offset in usual animation direction"}, | |||||
| {GP_TIME_SEG_MODE_REVERSE, | |||||
| "REVERSE", | |||||
| 0, | |||||
| "Reverse", | |||||
| "Apply offset in reverse animation direction"}, | |||||
| {GP_TIME_SEG_MODE_PINGPONG, "PINGPONG", 0, "Ping Pong", "Loop back and forth"}, | |||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| static const EnumPropertyItem gpencil_subdivision_type_items[] = { | static const EnumPropertyItem gpencil_subdivision_type_items[] = { | ||||
| {GP_SUBDIV_CATMULL, "CATMULL_CLARK", 0, "Catmull-Clark", ""}, | {GP_SUBDIV_CATMULL, "CATMULL_CLARK", 0, "Catmull-Clark", ""}, | ||||
| {GP_SUBDIV_SIMPLE, "SIMPLE", 0, "Simple", ""}, | {GP_SUBDIV_SIMPLE, "SIMPLE", 0, "Simple", ""}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | switch ((GpencilModifierType)md->type) { | ||||
| case eGpencilModifierType_Color: | case eGpencilModifierType_Color: | ||||
| return &RNA_ColorGpencilModifier; | return &RNA_ColorGpencilModifier; | ||||
| case eGpencilModifierType_Array: | case eGpencilModifierType_Array: | ||||
| return &RNA_ArrayGpencilModifier; | return &RNA_ArrayGpencilModifier; | ||||
| case eGpencilModifierType_Build: | case eGpencilModifierType_Build: | ||||
| return &RNA_BuildGpencilModifier; | return &RNA_BuildGpencilModifier; | ||||
| case eGpencilModifierType_Opacity: | case eGpencilModifierType_Opacity: | ||||
| return &RNA_OpacityGpencilModifier; | return &RNA_OpacityGpencilModifier; | ||||
| case eGpencilModifierType_Outline: | |||||
| return &RNA_OutlineGpencilModifier; | |||||
| case eGpencilModifierType_Lattice: | case eGpencilModifierType_Lattice: | ||||
| return &RNA_LatticeGpencilModifier; | return &RNA_LatticeGpencilModifier; | ||||
| case eGpencilModifierType_Length: | case eGpencilModifierType_Length: | ||||
| return &RNA_LengthGpencilModifier; | return &RNA_LengthGpencilModifier; | ||||
| case eGpencilModifierType_Mirror: | case eGpencilModifierType_Mirror: | ||||
| return &RNA_MirrorGpencilModifier; | return &RNA_MirrorGpencilModifier; | ||||
| case eGpencilModifierType_Shrinkwrap: | case eGpencilModifierType_Shrinkwrap: | ||||
| return &RNA_ShrinkwrapGpencilModifier; | return &RNA_ShrinkwrapGpencilModifier; | ||||
| ▲ Show 20 Lines • Show All 366 Lines • ▼ Show 20 Lines | static void rna_OpacityGpencilModifier_material_set(PointerRNA *ptr, | ||||
| struct ReportList *reports) | struct ReportList *reports) | ||||
| { | { | ||||
| OpacityGpencilModifierData *omd = (OpacityGpencilModifierData *)ptr->data; | OpacityGpencilModifierData *omd = (OpacityGpencilModifierData *)ptr->data; | ||||
| Material **ma_target = &omd->material; | Material **ma_target = &omd->material; | ||||
| rna_GpencilModifier_material_set(ptr, value, ma_target, reports); | rna_GpencilModifier_material_set(ptr, value, ma_target, reports); | ||||
| } | } | ||||
| static void rna_OutlineGpencilModifier_object_set(PointerRNA *ptr, | |||||
| PointerRNA value, | |||||
| struct ReportList *UNUSED(reports)) | |||||
| { | |||||
| OutlineGpencilModifierData *omd = ptr->data; | |||||
| Object *ob = (Object *)value.data; | |||||
| omd->object = ob; | |||||
| id_lib_extern((ID *)ob); | |||||
| } | |||||
| static void rna_OutlineGpencilModifier_material_set(PointerRNA *ptr, | |||||
| PointerRNA value, | |||||
| struct ReportList *reports) | |||||
| { | |||||
| OutlineGpencilModifierData *omd = (OutlineGpencilModifierData *)ptr->data; | |||||
| Material **ma_target = &omd->material; | |||||
| rna_GpencilModifier_material_set(ptr, value, ma_target, reports); | |||||
| } | |||||
| static void rna_OutlineStrokeGpencilModifier_material_set(PointerRNA *ptr, | |||||
| PointerRNA value, | |||||
| struct ReportList *reports) | |||||
| { | |||||
| OutlineGpencilModifierData *omd = (OutlineGpencilModifierData *)ptr->data; | |||||
| Material **ma_target = &omd->outline_material; | |||||
| rna_GpencilModifier_material_set(ptr, value, ma_target, reports); | |||||
| } | |||||
| static void rna_LatticeGpencilModifier_material_set(PointerRNA *ptr, | static void rna_LatticeGpencilModifier_material_set(PointerRNA *ptr, | ||||
| PointerRNA value, | PointerRNA value, | ||||
| struct ReportList *reports) | struct ReportList *reports) | ||||
| { | { | ||||
| LatticeGpencilModifierData *lmd = (LatticeGpencilModifierData *)ptr->data; | LatticeGpencilModifierData *lmd = (LatticeGpencilModifierData *)ptr->data; | ||||
| Material **ma_target = &lmd->material; | Material **ma_target = &lmd->material; | ||||
| rna_GpencilModifier_material_set(ptr, value, ma_target, reports); | rna_GpencilModifier_material_set(ptr, value, ma_target, reports); | ||||
| ▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | |||||
| static void rna_GpencilDash_segments_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) | static void rna_GpencilDash_segments_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) | ||||
| { | { | ||||
| DashGpencilModifierData *dmd = (DashGpencilModifierData *)ptr->data; | DashGpencilModifierData *dmd = (DashGpencilModifierData *)ptr->data; | ||||
| rna_iterator_array_begin( | rna_iterator_array_begin( | ||||
| iter, dmd->segments, sizeof(DashGpencilModifierSegment), dmd->segments_len, false, NULL); | iter, dmd->segments, sizeof(DashGpencilModifierSegment), dmd->segments_len, false, NULL); | ||||
| } | } | ||||
| static void rna_GpencilTime_segments_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) | |||||
| { | |||||
| TimeGpencilModifierData *gpmd = (TimeGpencilModifierData *)ptr->data; | |||||
| rna_iterator_array_begin( | |||||
| iter, gpmd->segments, sizeof(TimeGpencilModifierSegment), gpmd->segments_len, false, NULL); | |||||
| } | |||||
| static char *rna_TimeGpencilModifierSegment_path(const PointerRNA *ptr) | |||||
| { | |||||
| TimeGpencilModifierSegment *ds = (TimeGpencilModifierSegment *)ptr->data; | |||||
| TimeGpencilModifierData *gpmd = (TimeGpencilModifierData *)ds->gpmd; | |||||
| BLI_assert(gpmd != NULL); | |||||
| char name_esc[sizeof(gpmd->modifier.name) * 2]; | |||||
| BLI_str_escape(name_esc, gpmd->modifier.name, sizeof(name_esc)); | |||||
| char ds_name_esc[sizeof(ds->name) * 2]; | |||||
| BLI_str_escape(ds_name_esc, ds->name, sizeof(ds_name_esc)); | |||||
| return BLI_sprintfN("grease_pencil_modifiers[\"%s\"].segments[\"%s\"]", name_esc, ds_name_esc); | |||||
| } | |||||
| static char *rna_DashGpencilModifierSegment_path(const PointerRNA *ptr) | static char *rna_DashGpencilModifierSegment_path(const PointerRNA *ptr) | ||||
| { | { | ||||
| const DashGpencilModifierSegment *ds = (DashGpencilModifierSegment *)ptr->data; | const DashGpencilModifierSegment *ds = (DashGpencilModifierSegment *)ptr->data; | ||||
| const DashGpencilModifierData *dmd = (DashGpencilModifierData *)ds->dmd; | const DashGpencilModifierData *dmd = (DashGpencilModifierData *)ds->dmd; | ||||
| BLI_assert(dmd != NULL); | BLI_assert(dmd != NULL); | ||||
| char name_esc[sizeof(dmd->modifier.name) * 2]; | char name_esc[sizeof(dmd->modifier.name) * 2]; | ||||
| Show All 11 Lines | static bool dash_segment_name_exists_fn(void *arg, const char *name) | ||||
| for (int i = 0; i < dmd->segments_len; i++) { | for (int i = 0; i < dmd->segments_len; i++) { | ||||
| if (STREQ(dmd->segments[i].name, name) && dmd->segments[i].name != name) { | if (STREQ(dmd->segments[i].name, name) && dmd->segments[i].name != name) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| static bool time_segment_name_exists_fn(void *arg, const char *name) | |||||
| { | |||||
| const TimeGpencilModifierData *gpmd = (const TimeGpencilModifierData *)arg; | |||||
| for (int i = 0; i < gpmd->segments_len; i++) { | |||||
| if (STREQ(gpmd->segments[i].name, name) && gpmd->segments[i].name != name) { | |||||
| return true; | |||||
| } | |||||
| } | |||||
| return false; | |||||
| } | |||||
| static void rna_DashGpencilModifierSegment_name_set(PointerRNA *ptr, const char *value) | static void rna_DashGpencilModifierSegment_name_set(PointerRNA *ptr, const char *value) | ||||
| { | { | ||||
| DashGpencilModifierSegment *ds = ptr->data; | DashGpencilModifierSegment *ds = ptr->data; | ||||
| char oldname[sizeof(ds->name)]; | char oldname[sizeof(ds->name)]; | ||||
| BLI_strncpy(oldname, ds->name, sizeof(ds->name)); | BLI_strncpy(oldname, ds->name, sizeof(ds->name)); | ||||
| BLI_strncpy_utf8(ds->name, value, sizeof(ds->name)); | BLI_strncpy_utf8(ds->name, value, sizeof(ds->name)); | ||||
| BLI_assert(ds->dmd != NULL); | BLI_assert(ds->dmd != NULL); | ||||
| BLI_uniquename_cb( | BLI_uniquename_cb( | ||||
| dash_segment_name_exists_fn, ds->dmd, "Segment", '.', ds->name, sizeof(ds->name)); | dash_segment_name_exists_fn, ds->dmd, "Segment", '.', ds->name, sizeof(ds->name)); | ||||
| char name_esc[sizeof(ds->dmd->modifier.name) * 2]; | char name_esc[sizeof(ds->dmd->modifier.name) * 2]; | ||||
| BLI_str_escape(name_esc, ds->dmd->modifier.name, sizeof(name_esc)); | BLI_str_escape(name_esc, ds->dmd->modifier.name, sizeof(name_esc)); | ||||
| char prefix[36 + sizeof(name_esc) + 1]; | char prefix[36 + sizeof(name_esc) + 1]; | ||||
| SNPRINTF(prefix, "grease_pencil_modifiers[\"%s\"].segments", name_esc); | SNPRINTF(prefix, "grease_pencil_modifiers[\"%s\"].segments", name_esc); | ||||
| /* Fix all the animation data which may link to this. */ | /* Fix all the animation data which may link to this. */ | ||||
| BKE_animdata_fix_paths_rename_all(NULL, prefix, oldname, ds->name); | BKE_animdata_fix_paths_rename_all(NULL, prefix, oldname, ds->name); | ||||
| } | } | ||||
| static void rna_TimeGpencilModifierSegment_name_set(PointerRNA *ptr, const char *value) | |||||
| { | |||||
| TimeGpencilModifierSegment *ds = ptr->data; | |||||
| char oldname[sizeof(ds->name)]; | |||||
| BLI_strncpy(oldname, ds->name, sizeof(ds->name)); | |||||
| BLI_strncpy_utf8(ds->name, value, sizeof(ds->name)); | |||||
| BLI_assert(ds->gpmd != NULL); | |||||
| BLI_uniquename_cb( | |||||
| time_segment_name_exists_fn, ds->gpmd, "Segment", '.', ds->name, sizeof(ds->name)); | |||||
| char name_esc[sizeof(ds->gpmd->modifier.name) * 2]; | |||||
| BLI_str_escape(name_esc, ds->gpmd->modifier.name, sizeof(name_esc)); | |||||
| char prefix[36 + sizeof(name_esc) + 1]; | |||||
| SNPRINTF(prefix, "grease_pencil_modifiers[\"%s\"].segments", name_esc); | |||||
| /* Fix all the animation data which may link to this. */ | |||||
| BKE_animdata_fix_paths_rename_all(NULL, prefix, oldname, ds->name); | |||||
| } | |||||
| static int rna_ShrinkwrapGpencilModifier_face_cull_get(PointerRNA *ptr) | static int rna_ShrinkwrapGpencilModifier_face_cull_get(PointerRNA *ptr) | ||||
| { | { | ||||
| ShrinkwrapGpencilModifierData *swm = (ShrinkwrapGpencilModifierData *)ptr->data; | ShrinkwrapGpencilModifierData *swm = (ShrinkwrapGpencilModifierData *)ptr->data; | ||||
| return swm->shrink_opts & MOD_SHRINKWRAP_CULL_TARGET_MASK; | return swm->shrink_opts & MOD_SHRINKWRAP_CULL_TARGET_MASK; | ||||
| } | } | ||||
| static void rna_ShrinkwrapGpencilModifier_face_cull_set(struct PointerRNA *ptr, int value) | static void rna_ShrinkwrapGpencilModifier_face_cull_set(struct PointerRNA *ptr, int value) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 860 Lines • ▼ Show 20 Lines | static void rna_def_modifier_gpenciltint(BlenderRNA *brna) | ||||
| RNA_define_lib_overridable(false); | RNA_define_lib_overridable(false); | ||||
| } | } | ||||
| static void rna_def_modifier_gpenciltime(BlenderRNA *brna) | static void rna_def_modifier_gpenciltime(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| srna = RNA_def_struct(brna, "TimeGpencilModifierSegment", NULL); | |||||
| RNA_def_struct_ui_text(srna, "Time Modifier Segment", "Configuration for a single dash segment"); | |||||
| RNA_def_struct_sdna(srna, "TimeGpencilModifierSegment"); | |||||
| RNA_def_struct_path_func(srna, "rna_TimeGpencilModifierSegment_path"); | |||||
| prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_ui_text(prop, "Name", "Name of the dash segment"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| RNA_def_property_string_funcs(prop, NULL, NULL, "rna_TimeGpencilModifierSegment_name_set"); | |||||
| RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER | NA_RENAME, NULL); | |||||
| RNA_def_struct_name_property(srna, prop); | |||||
| prop = RNA_def_property(srna, "seg_start", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_range(prop, 0, INT16_MAX); | |||||
| RNA_def_property_ui_text(prop, "Frame Start", "First frame of the segment"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "seg_end", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_range(prop, 0, INT16_MAX); | |||||
| RNA_def_property_ui_text(prop, "End", "Last frame of the segment"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "seg_repeat", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_range(prop, 1, INT16_MAX); | |||||
| RNA_def_property_ui_text(prop, "Repeat", "Number of cycle repeats"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "seg_mode", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_sdna(prop, NULL, "seg_mode"); | |||||
| RNA_def_property_enum_items(prop, rna_enum_time_seg_mode_items); | |||||
| RNA_def_property_ui_text(prop, "Mode", ""); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| srna = RNA_def_struct(brna, "TimeGpencilModifier", "GpencilModifier"); | srna = RNA_def_struct(brna, "TimeGpencilModifier", "GpencilModifier"); | ||||
| RNA_def_struct_ui_text(srna, "Time Offset Modifier", "Time offset modifier"); | RNA_def_struct_ui_text(srna, "Time Offset Modifier", "Time offset modifier"); | ||||
| RNA_def_struct_sdna(srna, "TimeGpencilModifierData"); | RNA_def_struct_sdna(srna, "TimeGpencilModifierData"); | ||||
| RNA_def_struct_ui_icon(srna, ICON_MOD_TIME); | RNA_def_struct_ui_icon(srna, ICON_MOD_TIME); | ||||
| RNA_define_lib_overridable(true); | RNA_define_lib_overridable(true); | ||||
| prop = RNA_def_property(srna, "segments", PROP_COLLECTION, PROP_NONE); | |||||
| RNA_def_property_struct_type(prop, "TimeGpencilModifierSegment"); | |||||
| RNA_def_property_collection_sdna(prop, NULL, "segments", NULL); | |||||
| RNA_def_property_collection_funcs(prop, | |||||
| "rna_GpencilTime_segments_begin", | |||||
| "rna_iterator_array_next", | |||||
| "rna_iterator_array_end", | |||||
| "rna_iterator_array_get", | |||||
| NULL, | |||||
| NULL, | |||||
| NULL, | |||||
| NULL); | |||||
| RNA_def_property_ui_text(prop, "Segments", ""); | |||||
| prop = RNA_def_property(srna, "segment_active_index", PROP_INT, PROP_UNSIGNED); | |||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | |||||
| RNA_def_property_ui_text(prop, "Active Dash Segment Index", "Active index in the segment list"); | |||||
| prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "mode"); | RNA_def_property_enum_sdna(prop, NULL, "mode"); | ||||
| RNA_def_property_enum_items(prop, rna_enum_time_mode_items); | RNA_def_property_enum_items(prop, rna_enum_time_mode_items); | ||||
| RNA_def_property_ui_text(prop, "Mode", ""); | RNA_def_property_ui_text(prop, "Mode", ""); | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | ||||
| prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE); | prop = RNA_def_property(srna, "layer", PROP_STRING, PROP_NONE); | ||||
| RNA_def_property_string_sdna(prop, NULL, "layername"); | RNA_def_property_string_sdna(prop, NULL, "layername"); | ||||
| ▲ Show 20 Lines • Show All 268 Lines • ▼ Show 20 Lines | static void rna_def_modifier_gpencilopacity(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "curve_intensity"); | RNA_def_property_pointer_sdna(prop, NULL, "curve_intensity"); | ||||
| RNA_def_property_ui_text(prop, "Curve", "Custom curve to apply effect"); | RNA_def_property_ui_text(prop, "Curve", "Custom curve to apply effect"); | ||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | ||||
| RNA_define_lib_overridable(false); | RNA_define_lib_overridable(false); | ||||
| } | } | ||||
| static void rna_def_modifier_gpenciloutline(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| srna = RNA_def_struct(brna, "OutlineGpencilModifier", "GpencilModifier"); | |||||
| RNA_def_struct_ui_text(srna, "Outline Modifier", "Outline of Strokes modifier from camera view"); | |||||
| RNA_def_struct_sdna(srna, "OutlineGpencilModifierData"); | |||||
| // TODO: add new icon | |||||
| RNA_def_struct_ui_icon(srna, ICON_MOD_SKIN); | |||||
| RNA_define_lib_overridable(true); | |||||
| 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_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_pointer_funcs(prop, | |||||
| NULL, | |||||
| "rna_OutlineGpencilModifier_material_set", | |||||
| NULL, | |||||
| "rna_GpencilModifier_material_poll"); | |||||
| RNA_def_property_ui_text(prop, "Material", "Material used for filtering effect"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "pass_index"); | |||||
| RNA_def_property_range(prop, 0, 100); | |||||
| RNA_def_property_ui_text(prop, "Pass", "Pass index"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "invert_layers", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_OUTLINE_INVERT_LAYER); | |||||
| RNA_def_property_ui_text(prop, "Inverse Layers", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "invert_materials", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_OUTLINE_INVERT_MATERIAL); | |||||
| RNA_def_property_ui_text(prop, "Inverse Materials", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "invert_material_pass", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_OUTLINE_INVERT_PASS); | |||||
| RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "layer_pass", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "layer_pass"); | |||||
| RNA_def_property_range(prop, 0, 100); | |||||
| RNA_def_property_ui_text(prop, "Pass", "Layer pass index"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "invert_layer_pass", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_OUTLINE_INVERT_LAYERPASS); | |||||
| RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "thickness", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "thickness"); | |||||
| RNA_def_property_range(prop, 1, 1000); | |||||
| RNA_def_property_ui_text(prop, "Thickness", "Thickness of the perimeter stroke"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "sample_length", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "sample_length"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 100.0f, 0.1f, 2); | |||||
| RNA_def_property_ui_text(prop, "Sample Length", ""); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "subdivision", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "subdiv"); | |||||
| RNA_def_property_range(prop, 0, 10); | |||||
| RNA_def_property_ui_text(prop, "Subdivisions", "Number of subdivisions"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "use_keep_shape", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_OUTLINE_KEEP_SHAPE); | |||||
| RNA_def_property_ui_text(prop, "Keep Shape", "Try to keep global shape"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "outline_material", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_pointer_funcs(prop, | |||||
| NULL, | |||||
| "rna_OutlineStrokeGpencilModifier_material_set", | |||||
| NULL, | |||||
| "rna_GpencilModifier_material_poll"); | |||||
| RNA_def_property_ui_text(prop, "Outline Material", "Material used for outline strokes"); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); | |||||
| prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_ui_text(prop, "Target Object", "Target object to define stroke start"); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); | |||||
| RNA_def_property_pointer_funcs(prop, NULL, "rna_OutlineGpencilModifier_object_set", NULL, NULL); | |||||
| RNA_def_property_update(prop, 0, "rna_GpencilModifier_dependency_update"); | |||||
| RNA_define_lib_overridable(false); | |||||
| } | |||||
| static void rna_def_modifier_gpencilarray(BlenderRNA *brna) | static void rna_def_modifier_gpencilarray(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| srna = RNA_def_struct(brna, "ArrayGpencilModifier", "GpencilModifier"); | srna = RNA_def_struct(brna, "ArrayGpencilModifier", "GpencilModifier"); | ||||
| RNA_def_struct_ui_text(srna, "Instance Modifier", "Create grid of duplicate instances"); | RNA_def_struct_ui_text(srna, "Instance Modifier", "Create grid of duplicate instances"); | ||||
| RNA_def_struct_sdna(srna, "ArrayGpencilModifierData"); | RNA_def_struct_sdna(srna, "ArrayGpencilModifierData"); | ||||
| ▲ Show 20 Lines • Show All 2,365 Lines • ▼ Show 20 Lines | void RNA_def_greasepencil_modifier(BlenderRNA *brna) | ||||
| rna_def_modifier_gpencilthick(brna); | rna_def_modifier_gpencilthick(brna); | ||||
| rna_def_modifier_gpenciloffset(brna); | rna_def_modifier_gpenciloffset(brna); | ||||
| rna_def_modifier_gpenciltint(brna); | rna_def_modifier_gpenciltint(brna); | ||||
| rna_def_modifier_gpenciltime(brna); | rna_def_modifier_gpenciltime(brna); | ||||
| rna_def_modifier_gpencilcolor(brna); | rna_def_modifier_gpencilcolor(brna); | ||||
| rna_def_modifier_gpencilarray(brna); | rna_def_modifier_gpencilarray(brna); | ||||
| rna_def_modifier_gpencilbuild(brna); | rna_def_modifier_gpencilbuild(brna); | ||||
| rna_def_modifier_gpencilopacity(brna); | rna_def_modifier_gpencilopacity(brna); | ||||
| rna_def_modifier_gpenciloutline(brna); | |||||
| rna_def_modifier_gpencillattice(brna); | rna_def_modifier_gpencillattice(brna); | ||||
| rna_def_modifier_gpencilmirror(brna); | rna_def_modifier_gpencilmirror(brna); | ||||
| rna_def_modifier_gpencilhook(brna); | rna_def_modifier_gpencilhook(brna); | ||||
| rna_def_modifier_gpencilarmature(brna); | rna_def_modifier_gpencilarmature(brna); | ||||
| rna_def_modifier_gpencilmultiply(brna); | rna_def_modifier_gpencilmultiply(brna); | ||||
| rna_def_modifier_gpenciltexture(brna); | rna_def_modifier_gpenciltexture(brna); | ||||
| rna_def_modifier_gpencilweight_angle(brna); | rna_def_modifier_gpencilweight_angle(brna); | ||||
| rna_def_modifier_gpencilweight_proximity(brna); | rna_def_modifier_gpencilweight_proximity(brna); | ||||
| rna_def_modifier_gpencillineart(brna); | rna_def_modifier_gpencillineart(brna); | ||||
| rna_def_modifier_gpencillength(brna); | rna_def_modifier_gpencillength(brna); | ||||
| rna_def_modifier_gpencildash(brna); | rna_def_modifier_gpencildash(brna); | ||||
| rna_def_modifier_gpencilshrinkwrap(brna); | rna_def_modifier_gpencilshrinkwrap(brna); | ||||
| rna_def_modifier_gpencilenvelope(brna); | rna_def_modifier_gpencilenvelope(brna); | ||||
| } | } | ||||
| #endif | #endif | ||||