Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_gpencil.c
| Show First 20 Lines • Show All 1,095 Lines • ▼ Show 20 Lines | static void rna_GPencil_layer_mask_remove(bGPDlayer *gpl, | ||||
| } | } | ||||
| BKE_gpencil_layer_mask_remove(gpl, mask); | BKE_gpencil_layer_mask_remove(gpl, mask); | ||||
| RNA_POINTER_INVALIDATE(mask_ptr); | RNA_POINTER_INVALIDATE(mask_ptr); | ||||
| WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | ||||
| } | } | ||||
| static void rna_GPencil_frame_clear(bGPDframe *frame) | static void rna_GPencil_frame_clear(ID *id, bGPDframe *frame) | ||||
| { | { | ||||
| BKE_gpencil_free_strokes(frame); | BKE_gpencil_free_strokes(frame); | ||||
| bGPdata *gpd = (bGPdata *)id; | |||||
| DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); | |||||
| WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | ||||
| } | } | ||||
| static void rna_GPencil_layer_clear(bGPDlayer *layer) | static void rna_GPencil_layer_clear(ID *id, bGPDlayer *layer) | ||||
| { | { | ||||
| BKE_gpencil_free_frames(layer); | BKE_gpencil_free_frames(layer); | ||||
| bGPdata *gpd = (bGPdata *)id; | |||||
| DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); | |||||
| WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | ||||
| } | } | ||||
| static void rna_GPencil_clear(bGPdata *gpd) | static void rna_GPencil_clear(bGPdata *gpd) | ||||
| { | { | ||||
| BKE_gpencil_free_layers(&gpd->layers); | BKE_gpencil_free_layers(&gpd->layers); | ||||
| DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); | |||||
| WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | ||||
| } | } | ||||
| static char *rna_GreasePencilGrid_path(const PointerRNA *UNUSED(ptr)) | static char *rna_GreasePencilGrid_path(const PointerRNA *UNUSED(ptr)) | ||||
| { | { | ||||
| return BLI_strdup("grid"); | return BLI_strdup("grid"); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 706 Lines • ▼ Show 20 Lines | static void rna_def_gpencil_frame(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_SELECT); | RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_SELECT); | ||||
| RNA_def_property_ui_text(prop, "Select", "Frame is selected for editing in the Dope Sheet"); | RNA_def_property_ui_text(prop, "Select", "Frame is selected for editing in the Dope Sheet"); | ||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); | RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); | ||||
| /* API */ | /* API */ | ||||
| func = RNA_def_function(srna, "clear", "rna_GPencil_frame_clear"); | func = RNA_def_function(srna, "clear", "rna_GPencil_frame_clear"); | ||||
| RNA_def_function_ui_description(func, "Remove all the grease pencil frame data"); | RNA_def_function_ui_description(func, "Remove all the grease pencil frame data"); | ||||
| RNA_def_function_flag(func, FUNC_USE_SELF_ID); | |||||
| } | } | ||||
| static void rna_def_gpencil_frames_api(BlenderRNA *brna, PropertyRNA *cprop) | static void rna_def_gpencil_frames_api(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | PropertyRNA *parm; | ||||
| ▲ Show 20 Lines • Show All 447 Lines • ▼ Show 20 Lines | static void rna_def_gpencil_layer(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "is_parented", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "is_parented", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_GPencilLayer_is_parented_get", NULL); | RNA_def_property_boolean_funcs(prop, "rna_GPencilLayer_is_parented_get", NULL); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text(prop, "Is Parented", "True when the layer parent object is set"); | RNA_def_property_ui_text(prop, "Is Parented", "True when the layer parent object is set"); | ||||
| /* Layers API */ | /* Layers API */ | ||||
| func = RNA_def_function(srna, "clear", "rna_GPencil_layer_clear"); | func = RNA_def_function(srna, "clear", "rna_GPencil_layer_clear"); | ||||
| RNA_def_function_ui_description(func, "Remove all the grease pencil layer data"); | RNA_def_function_ui_description(func, "Remove all the grease pencil layer data"); | ||||
| RNA_def_function_flag(func, FUNC_USE_SELF_ID); | |||||
| } | } | ||||
| static void rna_def_gpencil_layers_api(BlenderRNA *brna, PropertyRNA *cprop) | static void rna_def_gpencil_layers_api(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| ▲ Show 20 Lines • Show All 435 Lines • Show Last 20 Lines | |||||