Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_scene.c
| Context not available. | |||||
| #endif | #endif | ||||
| /* loaded dynamic only defined as dummy */ | |||||
| EnumPropertyItem rna_enum_gpencil_drawing_brushes_items[] = { | |||||
| { 0, "BASIC", ICON_BRUSH_SCULPT_DRAW, "Basic", "Basic drawing brush" }, | |||||
| { 0, NULL, 0, NULL, NULL } | |||||
| }; | |||||
| const EnumPropertyItem rna_enum_layer_collection_mode_settings_type_items[] = { | const EnumPropertyItem rna_enum_layer_collection_mode_settings_type_items[] = { | ||||
| {COLLECTION_MODE_OBJECT, "OBJECT", 0, "Object", ""}, | {COLLECTION_MODE_OBJECT, "OBJECT", 0, "Object", ""}, | ||||
| {COLLECTION_MODE_EDIT, "EDIT", 0, "Edit", ""}, | {COLLECTION_MODE_EDIT, "EDIT", 0, "Edit", ""}, | ||||
| Context not available. | |||||
| #include "FRS_freestyle.h" | #include "FRS_freestyle.h" | ||||
| #endif | #endif | ||||
| /* Grease Pencil update cache */ | |||||
| static void rna_GPencil_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr)) | |||||
| { | |||||
| BKE_gpencil_batch_cache_alldirty(); | |||||
| WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL); | |||||
| } | |||||
| /* Grease Pencil Interpolation settings */ | /* Grease Pencil Interpolation settings */ | ||||
| static char *rna_GPencilInterpolateSettings_path(PointerRNA *UNUSED(ptr)) | static char *rna_GPencilInterpolateSettings_path(PointerRNA *UNUSED(ptr)) | ||||
| { | { | ||||
| Context not available. | |||||
| BLI_uniquename(&ts->gp_brushes, brush, DATA_("GP_Brush"), '.', offsetof(bGPDbrush, info), sizeof(brush->info)); | BLI_uniquename(&ts->gp_brushes, brush, DATA_("GP_Brush"), '.', offsetof(bGPDbrush, info), sizeof(brush->info)); | ||||
| } | } | ||||
| /* Dynamic Enums of GP Brushes */ | |||||
| static EnumPropertyItem *rna_GPencilBrush_enum_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), | |||||
| bool *r_free) | |||||
| { | |||||
| ToolSettings *ts = ((Scene *)ptr->id.data)->toolsettings; | |||||
| bGPDbrush *brush; | |||||
| EnumPropertyItem *item = NULL, item_tmp = { 0 }; | |||||
| int totitem = 0; | |||||
| int i = 0; | |||||
| if (ELEM(NULL, ts)) { | |||||
| return rna_enum_gpencil_drawing_brushes_items; | |||||
| } | |||||
| /* Existing brushes */ | |||||
| for (brush = ts->gp_brushes.first; brush; brush = brush->next, i++) { | |||||
| item_tmp.identifier = brush->info; | |||||
| item_tmp.name = brush->info; | |||||
| item_tmp.value = i; | |||||
| item_tmp.icon = ICON_BRUSH_DATA; | |||||
| RNA_enum_item_add(&item, &totitem, &item_tmp); | |||||
| } | |||||
| RNA_enum_item_end(&item, &totitem); | |||||
| *r_free = true; | |||||
| return item; | |||||
| } | |||||
| /* ----------------- end of Grease pencil drawing brushes ------------*/ | /* ----------------- end of Grease pencil drawing brushes ------------*/ | ||||
| static void rna_SpaceImageEditor_uv_sculpt_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr)) | static void rna_SpaceImageEditor_uv_sculpt_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr)) | ||||
| Context not available. | |||||
| prop = RNA_def_property(srna, "line_width", PROP_INT, PROP_PIXEL); | prop = RNA_def_property(srna, "line_width", PROP_INT, PROP_PIXEL); | ||||
| RNA_def_property_int_sdna(prop, NULL, "thickness"); | RNA_def_property_int_sdna(prop, NULL, "thickness"); | ||||
| RNA_def_property_range(prop, 1, 300); | RNA_def_property_range(prop, 1, 300); | ||||
| RNA_def_property_ui_range(prop, 1, 10, 1, 0); | RNA_def_property_ui_range(prop, 1, 100, 1, 0); | ||||
| RNA_def_property_ui_text(prop, "Thickness", "Thickness of strokes (in pixels)"); | RNA_def_property_ui_text(prop, "Thickness", "Thickness of strokes (in pixels)"); | ||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | ||||
| Context not available. | |||||
| RNA_def_property_ui_text(prop, "Random Strength", "Use random value for strength"); | RNA_def_property_ui_text(prop, "Random Strength", "Use random value for strength"); | ||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | ||||
| /* Cursor Color */ | |||||
| static float default_1[3] = { 1.0f, 1.0f, 1.0f }; | |||||
| prop = RNA_def_property(srna, "cursor_color", PROP_FLOAT, PROP_COLOR_GAMMA); | |||||
| RNA_def_property_float_sdna(prop, NULL, "curcolor"); | |||||
| RNA_def_property_array(prop, 3); | |||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | |||||
| RNA_def_property_float_array_default(prop, default_1); | |||||
| RNA_def_property_ui_text(prop, "Cursor Color", "Color for the cursor"); | |||||
| prop = RNA_def_property(srna, "use_cursor", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_ENABLE_CURSOR); | |||||
| RNA_def_property_boolean_default(prop, true); | |||||
| RNA_def_property_ui_text(prop, "Enable Cursor", "Enable cursor on screen"); | |||||
| } | } | ||||
| /* Grease Pencil Drawing Brushes API */ | /* Grease Pencil Drawing Brushes API */ | ||||
| Context not available. | |||||
| }; | }; | ||||
| static const EnumPropertyItem gpencil_stroke_placement_items[] = { | static const EnumPropertyItem gpencil_stroke_placement_items[] = { | ||||
| {GP_PROJECT_VIEWSPACE, "CURSOR", 0, "Cursor", "Draw stroke at the 3D cursor"}, | {GP_PROJECT_VIEWSPACE, "ORIGIN", ICON_OBJECT_ORIGIN, "Origin", "Draw stroke at Object origin"}, | ||||
| {0, "VIEW", 0, "View", "Stick stroke to the view "}, /* weird, GP_PROJECT_VIEWALIGN is inverted */ | {GP_PROJECT_VIEWSPACE | GP_PROJECT_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", "Draw stroke at 3D cursor location" }, | ||||
| {GP_PROJECT_VIEWSPACE | GP_PROJECT_DEPTH_VIEW, "SURFACE", 0, "Surface", "Stick stroke to surfaces"}, | // {0, "VIEW", ICON_VISIBLE_IPO_ON, "View", "Stick stroke to the view "}, /* weird, GP_PROJECT_VIEWALIGN is inverted */ | ||||
| {GP_PROJECT_VIEWSPACE | GP_PROJECT_DEPTH_STROKE, "STROKE", 0, "Stroke", "Stick stroke to other strokes"}, | {GP_PROJECT_VIEWSPACE | GP_PROJECT_DEPTH_VIEW, "SURFACE", ICON_FACESEL, "Surface", "Stick stroke to surfaces"}, | ||||
| //{GP_PROJECT_VIEWSPACE | GP_PROJECT_DEPTH_STROKE, "STROKE", ICON_GREASEPENCIL, "Stroke", "Stick stroke to other strokes"}, | |||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| Context not available. | |||||
| RNA_def_property_enum_items(prop, gpencil_source_3d_items); | RNA_def_property_enum_items(prop, gpencil_source_3d_items); | ||||
| RNA_def_property_ui_text(prop, "Grease Pencil Source", | RNA_def_property_ui_text(prop, "Grease Pencil Source", | ||||
| "Data-block where active Grease Pencil data is found from"); | "Data-block where active Grease Pencil data is found from"); | ||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS | NC_GPENCIL | ND_DATA | ND_SPACE_PROPERTIES, NULL); | ||||
| prop = RNA_def_property(srna, "gpencil_sculpt", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "gpencil_sculpt", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "gp_sculpt"); | RNA_def_property_pointer_sdna(prop, NULL, "gp_sculpt"); | ||||
| Context not available. | |||||
| RNA_def_property_ui_text(prop, "Grease Pencil Brushes", "Grease Pencil drawing brushes"); | RNA_def_property_ui_text(prop, "Grease Pencil Brushes", "Grease Pencil drawing brushes"); | ||||
| rna_def_gpencil_brushes(brna, prop); | rna_def_gpencil_brushes(brna, prop); | ||||
| prop = RNA_def_property(srna, "gpencil_brushes_enum", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, rna_enum_gpencil_drawing_brushes_items); | |||||
| RNA_def_property_enum_funcs(prop, "rna_GPencilBrushes_index_get", "rna_GPencilBrushes_index_set", "rna_GPencilBrush_enum_itemf"); | |||||
| RNA_def_property_ui_text(prop, "Enum of drawing brushes", ""); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* Grease Pencil - 3D View Stroke Placement */ | /* Grease Pencil - 3D View Stroke Placement */ | ||||
| prop = RNA_def_property(srna, "gpencil_stroke_placement_view3d", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "gpencil_stroke_placement_view3d", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_bitflag_sdna(prop, NULL, "gpencil_v3d_align"); | RNA_def_property_enum_bitflag_sdna(prop, NULL, "gpencil_v3d_align"); | ||||
| Context not available. | |||||
| RNA_def_property_ui_text(prop, "Stroke Placement (Image Editor)", ""); | RNA_def_property_ui_text(prop, "Stroke Placement (Image Editor)", ""); | ||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | ||||
| /* Grease Pencil - Simplify Options */ | |||||
| prop = RNA_def_property(srna, "gpencil_simplify", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gpencil_simplify", GP_TOOL_FLAG_SIMPLIFY); | |||||
| RNA_def_property_ui_text(prop, "Simplify", "Simplify Grease Pencil Drawing"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); | |||||
| prop = RNA_def_property(srna, "gpencil_simplify_onplay", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gpencil_simplify", GP_TOOL_FLAG_SIMPLIFY_ON_PLAY); | |||||
| RNA_def_property_ui_text(prop, "On Play", "Simplify Grease Pencil only when play animation"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); | |||||
| prop = RNA_def_property(srna, "gpencil_simplify_view_fill", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gpencil_simplify", GP_TOOL_FLAG_SIMPLIFY_VIEW_FILL); | |||||
| RNA_def_property_ui_text(prop, "Fill", "Do not fill strokes on viewport"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); | |||||
| prop = RNA_def_property(srna, "gpencil_simplify_remove_lines", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gpencil_simplify", GP_TOOL_FLAG_SIMPLIFY_REMOVE_LINE); | |||||
| RNA_def_property_ui_text(prop, "Remove Lines", "Remove External Lines of Filling Strokes"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); | |||||
| prop = RNA_def_property(srna, "gpencil_simplify_view_modifier", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gpencil_simplify", GP_TOOL_FLAG_SIMPLIFY_VIEW_MODIF); | |||||
| RNA_def_property_ui_text(prop, "Fill", "Do not apply modifiers on viewport"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); | |||||
| prop = RNA_def_property(srna, "gpencil_simplify_view_vfx", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gpencil_simplify", GP_TOOL_FLAG_SIMPLIFY_VIEW_VFX); | |||||
| RNA_def_property_ui_text(prop, "Fill", "Do not apply VFX modifiers on viewport"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); | |||||
| prop = RNA_def_property(srna, "gpencil_simplify_render_fill", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gpencil_simplify", GP_TOOL_FLAG_SIMPLIFY_RENDER_FILL); | |||||
| RNA_def_property_ui_text(prop, "Fill", "Do not fill strokes on render"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); | |||||
| prop = RNA_def_property(srna, "gpencil_simplify_render_modifier", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gpencil_simplify", GP_TOOL_FLAG_SIMPLIFY_RENDER_MODIF); | |||||
| RNA_def_property_ui_text(prop, "Fill", "Do not apply modifiers on render"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); | |||||
| prop = RNA_def_property(srna, "gpencil_simplify_render_vfx", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gpencil_simplify", GP_TOOL_FLAG_SIMPLIFY_RENDER_VFX); | |||||
| RNA_def_property_ui_text(prop, "Fill", "Do not apply VFX modifiers on render"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); | |||||
| prop = RNA_def_property(srna, "gpencil_disable_fast_drawing", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gpencil_simplify", GP_TOOL_FLAG_DISABLE_FAST_DRAWING); | |||||
| RNA_def_property_ui_text(prop, "Disable Fast Drawing", "Disable fast drawing while painting"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); | |||||
| /* Auto Keying */ | /* Auto Keying */ | ||||
| prop = RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON); | RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON); | ||||
| Context not available. | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); | RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); | ||||
| RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil data-block"); | RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil data-block"); | ||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | RNA_def_property_update(prop, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | ||||
| prop = RNA_def_property(srna, "gpencil_object", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_pointer_sdna(prop, NULL, "gp_object"); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_GPencil_object_poll"); | |||||
| RNA_def_property_ui_text(prop, "GPencil Object", "Grease Pencil object where scene annotations are stored by default"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | NA_EDITED, NULL); | |||||
| /* active MovieClip */ | /* active MovieClip */ | ||||
| prop = RNA_def_property(srna, "active_clip", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "active_clip", PROP_POINTER, PROP_NONE); | ||||
| Context not available. | |||||