Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_gpencil.c
| Show First 20 Lines • Show All 1,045 Lines • ▼ Show 20 Lines | static void rna_def_gpencil_strokes_api(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| parm = RNA_def_string(func, "colorname", 0, MAX_NAME, "Color", "Name of the color"); | parm = RNA_def_string(func, "colorname", 0, MAX_NAME, "Color", "Name of the color"); | ||||
| parm = RNA_def_pointer(func, "stroke", "GPencilStroke", "", "The newly created stroke"); | parm = RNA_def_pointer(func, "stroke", "GPencilStroke", "", "The newly created stroke"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "remove", "rna_GPencil_stroke_remove"); | func = RNA_def_function(srna, "remove", "rna_GPencil_stroke_remove"); | ||||
| RNA_def_function_ui_description(func, "Remove a grease pencil stroke"); | RNA_def_function_ui_description(func, "Remove a grease pencil stroke"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| parm = RNA_def_pointer(func, "stroke", "GPencilStroke", "Stroke", "The stroke to remove"); | parm = RNA_def_pointer(func, "stroke", "GPencilStroke", "Stroke", "The stroke to remove"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | ||||
| RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); | ||||
| } | } | ||||
| static void rna_def_gpencil_frame(BlenderRNA *brna) | static void rna_def_gpencil_frame(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| ▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | static void rna_def_gpencil_frames_api(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| RNA_def_struct_sdna(srna, "bGPDlayer"); | RNA_def_struct_sdna(srna, "bGPDlayer"); | ||||
| RNA_def_struct_ui_text(srna, "Grease Pencil Frames", "Collection of grease pencil frames"); | RNA_def_struct_ui_text(srna, "Grease Pencil Frames", "Collection of grease pencil frames"); | ||||
| func = RNA_def_function(srna, "new", "rna_GPencil_frame_new"); | func = RNA_def_function(srna, "new", "rna_GPencil_frame_new"); | ||||
| RNA_def_function_ui_description(func, "Add a new grease pencil frame"); | RNA_def_function_ui_description(func, "Add a new grease pencil frame"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| parm = RNA_def_int(func, "frame_number", 1, MINAFRAME, MAXFRAME, "Frame Number", | parm = RNA_def_int(func, "frame_number", 1, MINAFRAME, MAXFRAME, "Frame Number", | ||||
| "The frame on which this sketch appears", MINAFRAME, MAXFRAME); | "The frame on which this sketch appears", MINAFRAME, MAXFRAME); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| parm = RNA_def_pointer(func, "frame", "GPencilFrame", "", "The newly created frame"); | parm = RNA_def_pointer(func, "frame", "GPencilFrame", "", "The newly created frame"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "remove", "rna_GPencil_frame_remove"); | func = RNA_def_function(srna, "remove", "rna_GPencil_frame_remove"); | ||||
| RNA_def_function_ui_description(func, "Remove a grease pencil frame"); | RNA_def_function_ui_description(func, "Remove a grease pencil frame"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| parm = RNA_def_pointer(func, "frame", "GPencilFrame", "Frame", "The frame to remove"); | parm = RNA_def_pointer(func, "frame", "GPencilFrame", "Frame", "The frame to remove"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | ||||
| RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); | ||||
| func = RNA_def_function(srna, "copy", "rna_GPencil_frame_copy"); | func = RNA_def_function(srna, "copy", "rna_GPencil_frame_copy"); | ||||
| RNA_def_function_ui_description(func, "Copy a grease pencil frame"); | RNA_def_function_ui_description(func, "Copy a grease pencil frame"); | ||||
| parm = RNA_def_pointer(func, "source", "GPencilFrame", "Source", "The source frame"); | parm = RNA_def_pointer(func, "source", "GPencilFrame", "Source", "The source frame"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| parm = RNA_def_pointer(func, "copy", "GPencilFrame", "", "The newly copied frame"); | parm = RNA_def_pointer(func, "copy", "GPencilFrame", "", "The newly copied frame"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| } | } | ||||
| static void rna_def_gpencil_layer(BlenderRNA *brna) | static void rna_def_gpencil_layer(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| ▲ Show 20 Lines • Show All 210 Lines • ▼ Show 20 Lines | static void rna_def_gpencil_layers_api(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| RNA_def_property_srna(cprop, "GreasePencilLayers"); | RNA_def_property_srna(cprop, "GreasePencilLayers"); | ||||
| srna = RNA_def_struct(brna, "GreasePencilLayers", NULL); | srna = RNA_def_struct(brna, "GreasePencilLayers", NULL); | ||||
| RNA_def_struct_sdna(srna, "bGPdata"); | RNA_def_struct_sdna(srna, "bGPdata"); | ||||
| RNA_def_struct_ui_text(srna, "Grease Pencil Layers", "Collection of grease pencil layers"); | RNA_def_struct_ui_text(srna, "Grease Pencil Layers", "Collection of grease pencil layers"); | ||||
| func = RNA_def_function(srna, "new", "rna_GPencil_layer_new"); | func = RNA_def_function(srna, "new", "rna_GPencil_layer_new"); | ||||
| RNA_def_function_ui_description(func, "Add a new grease pencil layer"); | RNA_def_function_ui_description(func, "Add a new grease pencil layer"); | ||||
| parm = RNA_def_string(func, "name", "GPencilLayer", MAX_NAME, "Name", "Name of the layer"); | parm = RNA_def_string(func, "name", "GPencilLayer", MAX_NAME, "Name", "Name of the layer"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| RNA_def_boolean(func, "set_active", true, "Set Active", "Set the newly created layer to the active layer"); | RNA_def_boolean(func, "set_active", true, "Set Active", "Set the newly created layer to the active layer"); | ||||
| parm = RNA_def_pointer(func, "layer", "GPencilLayer", "", "The newly created layer"); | parm = RNA_def_pointer(func, "layer", "GPencilLayer", "", "The newly created layer"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "remove", "rna_GPencil_layer_remove"); | func = RNA_def_function(srna, "remove", "rna_GPencil_layer_remove"); | ||||
| RNA_def_function_ui_description(func, "Remove a grease pencil layer"); | RNA_def_function_ui_description(func, "Remove a grease pencil layer"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| parm = RNA_def_pointer(func, "layer", "GPencilLayer", "", "The layer to remove"); | parm = RNA_def_pointer(func, "layer", "GPencilLayer", "", "The layer to remove"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | ||||
| RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); | ||||
| prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "GPencilLayer"); | RNA_def_property_struct_type(prop, "GPencilLayer"); | ||||
| RNA_def_property_pointer_funcs(prop, "rna_GPencil_active_layer_get", "rna_GPencil_active_layer_set", NULL, NULL); | RNA_def_property_pointer_funcs(prop, "rna_GPencil_active_layer_get", "rna_GPencil_active_layer_set", NULL, NULL); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | RNA_def_property_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text(prop, "Active Layer", "Active grease pencil layer"); | RNA_def_property_ui_text(prop, "Active Layer", "Active grease pencil layer"); | ||||
| prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); | prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); | ||||
| ▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | static void rna_def_gpencil_palettecolors_api(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| RNA_def_function_ui_description(func, "Add a new color to the palette"); | RNA_def_function_ui_description(func, "Add a new color to the palette"); | ||||
| parm = RNA_def_pointer(func, "color", "GPencilPaletteColor", "", "The newly created color"); | parm = RNA_def_pointer(func, "color", "GPencilPaletteColor", "", "The newly created color"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "remove", "rna_GPencilPalette_color_remove"); | func = RNA_def_function(srna, "remove", "rna_GPencilPalette_color_remove"); | ||||
| RNA_def_function_ui_description(func, "Remove a color from the palette"); | RNA_def_function_ui_description(func, "Remove a color from the palette"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| parm = RNA_def_pointer(func, "color", "GPencilPaletteColor", "", "The color to remove"); | parm = RNA_def_pointer(func, "color", "GPencilPaletteColor", "", "The color to remove"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | ||||
| RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); | ||||
| prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "GPencilPaletteColor"); | RNA_def_property_struct_type(prop, "GPencilPaletteColor"); | ||||
| RNA_def_property_pointer_funcs(prop, "rna_GPencilPalette_active_color_get", "rna_GPencilPalette_active_color_set", NULL, NULL); | RNA_def_property_pointer_funcs(prop, "rna_GPencilPalette_active_color_get", "rna_GPencilPalette_active_color_set", NULL, NULL); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | RNA_def_property_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text(prop, "Active Palette Color", "Current active color"); | RNA_def_property_ui_text(prop, "Active Palette Color", "Current active color"); | ||||
| prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); | prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); | ||||
| ▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | static void rna_def_gpencil_palettes_api(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| RNA_def_property_srna(cprop, "GreasePencilPalettes"); | RNA_def_property_srna(cprop, "GreasePencilPalettes"); | ||||
| srna = RNA_def_struct(brna, "GreasePencilPalettes", NULL); | srna = RNA_def_struct(brna, "GreasePencilPalettes", NULL); | ||||
| RNA_def_struct_sdna(srna, "bGPdata"); | RNA_def_struct_sdna(srna, "bGPdata"); | ||||
| RNA_def_struct_ui_text(srna, "Grease Pencil Palettes", "Collection of grease pencil palettes"); | RNA_def_struct_ui_text(srna, "Grease Pencil Palettes", "Collection of grease pencil palettes"); | ||||
| func = RNA_def_function(srna, "new", "rna_GPencil_palette_new"); | func = RNA_def_function(srna, "new", "rna_GPencil_palette_new"); | ||||
| RNA_def_function_ui_description(func, "Add a new grease pencil palette"); | RNA_def_function_ui_description(func, "Add a new grease pencil palette"); | ||||
| parm = RNA_def_string(func, "name", "GPencilPalette", MAX_NAME, "Name", "Name of the palette"); | parm = RNA_def_string(func, "name", "GPencilPalette", MAX_NAME, "Name", "Name of the palette"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| RNA_def_boolean(func, "set_active", true, "Set Active", "Activate the newly created palette"); | RNA_def_boolean(func, "set_active", true, "Set Active", "Activate the newly created palette"); | ||||
| parm = RNA_def_pointer(func, "palette", "GPencilPalette", "", "The newly created palette"); | parm = RNA_def_pointer(func, "palette", "GPencilPalette", "", "The newly created palette"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "remove", "rna_GPencil_palette_remove"); | func = RNA_def_function(srna, "remove", "rna_GPencil_palette_remove"); | ||||
| RNA_def_function_ui_description(func, "Remove a grease pencil palette"); | RNA_def_function_ui_description(func, "Remove a grease pencil palette"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| parm = RNA_def_pointer(func, "palette", "GPencilPalette", "", "The palette to remove"); | parm = RNA_def_pointer(func, "palette", "GPencilPalette", "", "The palette to remove"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | ||||
| RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); | ||||
| prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "GPencilPalette"); | RNA_def_property_struct_type(prop, "GPencilPalette"); | ||||
| RNA_def_property_pointer_funcs(prop, "rna_GPencil_active_palette_get", "rna_GPencil_active_palette_set", | RNA_def_property_pointer_funcs(prop, "rna_GPencil_active_palette_get", "rna_GPencil_active_palette_set", | ||||
| NULL, NULL); | NULL, NULL); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | RNA_def_property_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text(prop, "Active Palette", "Current active palette"); | RNA_def_property_ui_text(prop, "Active Palette", "Current active palette"); | ||||
| ▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines | |||||