Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_scene.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show All 33 Lines | |||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_layer_types.h" | #include "DNA_layer_types.h" | ||||
| #include "DNA_linestyle_types.h" | #include "DNA_linestyle_types.h" | ||||
| #include "DNA_userdef_types.h" | #include "DNA_userdef_types.h" | ||||
| #include "DNA_world_types.h" | #include "DNA_world_types.h" | ||||
| #include "DNA_gpencil_types.h" | #include "DNA_gpencil_types.h" | ||||
| #include "DNA_view3d_types.h" | #include "DNA_view3d_types.h" | ||||
| #include "DNA_screen_types.h" /* TransformOrientation */ | #include "DNA_screen_types.h" /* TransformOrientation */ | ||||
| #include "DNA_lanpr_types.h" | |||||
| #include "IMB_imbuf_types.h" | #include "IMB_imbuf_types.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_string_utils.h" | #include "BLI_string_utils.h" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| ▲ Show 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | const EnumPropertyItem rna_enum_proportional_falloff_curve_only_items[] = { | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| const EnumPropertyItem rna_enum_proportional_editing_items[] = { | const EnumPropertyItem rna_enum_proportional_editing_items[] = { | ||||
| {PROP_EDIT_OFF, "DISABLED", ICON_PROP_OFF, "Disable", "Proportional Editing disabled"}, | {PROP_EDIT_OFF, "DISABLED", ICON_PROP_OFF, "Disable", "Proportional Editing disabled"}, | ||||
| {PROP_EDIT_ON, "ENABLED", ICON_PROP_ON, "Enable", "Proportional Editing enabled"}, | {PROP_EDIT_ON, "ENABLED", ICON_PROP_ON, "Enable", "Proportional Editing enabled"}, | ||||
| {PROP_EDIT_PROJECTED, "PROJECTED", ICON_PROP_ON, "Projected (2D)", | {PROP_EDIT_PROJECTED, "PROJECTED", ICON_PROP_ON, "Projected (2D)", | ||||
| "Proportional Editing using screen space locations"}, | "Proportional Editing using screen space locations"}, | ||||
| {PROP_EDIT_CONNECTED, "CONNECTED", ICON_PROP_CON, "Connected", | {PROP_EDIT_CONNECTED, "CONNECTED", ICON_PROP_CON, "Connected", | ||||
| "Proportional Editing using connected geometry only"}, | "Proportional Editing using connected geometry only"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| /* keep for operators, not used here */ | /* keep for operators, not used here */ | ||||
| const EnumPropertyItem rna_enum_mesh_select_mode_items[] = { | const EnumPropertyItem rna_enum_mesh_select_mode_items[] = { | ||||
| {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode"}, | {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode"}, | ||||
| {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode"}, | {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode"}, | ||||
| {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode"}, | {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode"}, | ||||
| Show All 31 Lines | static const EnumPropertyItem snap_uv_element_items[] = { | ||||
| {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"}, | {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| #endif | #endif | ||||
| const EnumPropertyItem rna_enum_curve_fit_method_items[] = { | const EnumPropertyItem rna_enum_curve_fit_method_items[] = { | ||||
| {CURVE_PAINT_FIT_METHOD_REFIT, "REFIT", 0, "Refit", "Incrementally re-fit the curve (high quality)"}, | {CURVE_PAINT_FIT_METHOD_REFIT, "REFIT", 0, "Refit", "Incrementally re-fit the curve (high quality)"}, | ||||
| {CURVE_PAINT_FIT_METHOD_SPLIT, "SPLIT", 0, "Split", "Split the curve until the tolerance is met (fast)"}, | {CURVE_PAINT_FIT_METHOD_SPLIT, "SPLIT", 0, "Split", "Split the curve until the tolerance is met (fast)"}, | ||||
| {0, NULL, 0, NULL, NULL}}; | {0, NULL, 0, NULL, NULL} | ||||
| }; | |||||
| /* workaround for duplicate enums, | /* workaround for duplicate enums, | ||||
| * have each enum line as a define then conditionally set it or not | * have each enum line as a define then conditionally set it or not | ||||
| */ | */ | ||||
| #define R_IMF_ENUM_BMP {R_IMF_IMTYPE_BMP, "BMP", ICON_FILE_IMAGE, "BMP", "Output image in bitmap format"}, | #define R_IMF_ENUM_BMP {R_IMF_IMTYPE_BMP, "BMP", ICON_FILE_IMAGE, "BMP", "Output image in bitmap format"}, | ||||
| #define R_IMF_ENUM_IRIS {R_IMF_IMTYPE_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", \ | #define R_IMF_ENUM_IRIS {R_IMF_IMTYPE_IRIS, "IRIS", ICON_FILE_IMAGE, "Iris", \ | ||||
| "Output image in (old!) SGI IRIS format"}, | "Output image in (old!) SGI IRIS format"}, | ||||
| #define R_IMF_ENUM_PNG {R_IMF_IMTYPE_PNG, "PNG", ICON_FILE_IMAGE, "PNG", "Output image in PNG format"}, | #define R_IMF_ENUM_PNG {R_IMF_IMTYPE_PNG, "PNG", ICON_FILE_IMAGE, "PNG", "Output image in PNG format"}, | ||||
| #define R_IMF_ENUM_JPEG {R_IMF_IMTYPE_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", "Output image in JPEG format"}, | #define R_IMF_ENUM_JPEG {R_IMF_IMTYPE_JPEG90, "JPEG", ICON_FILE_IMAGE, "JPEG", "Output image in JPEG format"}, | ||||
| #define R_IMF_ENUM_TAGA {R_IMF_IMTYPE_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", "Output image in Targa format"}, | #define R_IMF_ENUM_TAGA {R_IMF_IMTYPE_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", "Output image in Targa format"}, | ||||
| #define R_IMF_ENUM_TAGA_RAW {R_IMF_IMTYPE_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", \ | #define R_IMF_ENUM_TAGA_RAW {R_IMF_IMTYPE_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", \ | ||||
| "Output image in uncompressed Targa format"}, | "Output image in uncompressed Targa format"}, | ||||
| #if 0 /* UNUSED (so far) */ | #if 0 /* UNUSED (so far) */ | ||||
| #ifdef WITH_DDS | #ifdef WITH_DDS | ||||
| # define R_IMF_ENUM_DDS {R_IMF_IMTYPE_DDS, "DDS", ICON_FILE_IMAGE, "DDS", "Output image in DDS format"}, | # define R_IMF_ENUM_DDS {R_IMF_IMTYPE_DDS, "DDS", ICON_FILE_IMAGE, "DDS", "Output image in DDS format"}, | ||||
| #else | #else | ||||
| # define R_IMF_ENUM_DDS | # define R_IMF_ENUM_DDS | ||||
| #endif | #endif | ||||
| #endif | #endif | ||||
| #ifdef WITH_OPENJPEG | #ifdef WITH_OPENJPEG | ||||
| # define R_IMF_ENUM_JPEG2K {R_IMF_IMTYPE_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", \ | # define R_IMF_ENUM_JPEG2K {R_IMF_IMTYPE_JP2, "JPEG2000", ICON_FILE_IMAGE, "JPEG 2000", \ | ||||
| "Output image in JPEG 2000 format"}, | "Output image in JPEG 2000 format"}, | ||||
| #else | #else | ||||
| # define R_IMF_ENUM_JPEG2K | # define R_IMF_ENUM_JPEG2K | ||||
| #endif | #endif | ||||
| #ifdef WITH_CINEON | #ifdef WITH_CINEON | ||||
| # define R_IMF_ENUM_CINEON {R_IMF_IMTYPE_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", \ | # define R_IMF_ENUM_CINEON {R_IMF_IMTYPE_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", \ | ||||
| "Output image in Cineon format"}, | "Output image in Cineon format"}, | ||||
| # define R_IMF_ENUM_DPX {R_IMF_IMTYPE_DPX, "DPX", ICON_FILE_IMAGE, "DPX", "Output image in DPX format"}, | # define R_IMF_ENUM_DPX {R_IMF_IMTYPE_DPX, "DPX", ICON_FILE_IMAGE, "DPX", "Output image in DPX format"}, | ||||
| #else | #else | ||||
| # define R_IMF_ENUM_CINEON | # define R_IMF_ENUM_CINEON | ||||
| # define R_IMF_ENUM_DPX | # define R_IMF_ENUM_DPX | ||||
| #endif | #endif | ||||
| #ifdef WITH_OPENEXR | #ifdef WITH_OPENEXR | ||||
| # define R_IMF_ENUM_EXR_MULTILAYER {R_IMF_IMTYPE_MULTILAYER, "OPEN_EXR_MULTILAYER", ICON_FILE_IMAGE, \ | # define R_IMF_ENUM_EXR_MULTILAYER {R_IMF_IMTYPE_MULTILAYER, "OPEN_EXR_MULTILAYER", ICON_FILE_IMAGE, \ | ||||
| "OpenEXR MultiLayer", \ | "OpenEXR MultiLayer", \ | ||||
| "Output image in multilayer OpenEXR format"}, | "Output image in multilayer OpenEXR format"}, | ||||
| # define R_IMF_ENUM_EXR {R_IMF_IMTYPE_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", \ | # define R_IMF_ENUM_EXR {R_IMF_IMTYPE_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", \ | ||||
| "Output image in OpenEXR format"}, | "Output image in OpenEXR format"}, | ||||
| #else | #else | ||||
| # define R_IMF_ENUM_EXR_MULTILAYER | # define R_IMF_ENUM_EXR_MULTILAYER | ||||
| # define R_IMF_ENUM_EXR | # define R_IMF_ENUM_EXR | ||||
| #endif | #endif | ||||
| #ifdef WITH_HDR | #ifdef WITH_HDR | ||||
| # define R_IMF_ENUM_HDR {R_IMF_IMTYPE_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", \ | # define R_IMF_ENUM_HDR {R_IMF_IMTYPE_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", \ | ||||
| "Output image in Radiance HDR format"}, | "Output image in Radiance HDR format"}, | ||||
| #else | #else | ||||
| # define R_IMF_ENUM_HDR | # define R_IMF_ENUM_HDR | ||||
| #endif | #endif | ||||
| #ifdef WITH_TIFF | #ifdef WITH_TIFF | ||||
| # define R_IMF_ENUM_TIFF {R_IMF_IMTYPE_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", "Output image in TIFF format"}, | # define R_IMF_ENUM_TIFF {R_IMF_IMTYPE_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", "Output image in TIFF format"}, | ||||
| #else | #else | ||||
| # define R_IMF_ENUM_TIFF | # define R_IMF_ENUM_TIFF | ||||
| ▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | |||||
| const EnumPropertyItem rna_enum_bake_save_mode_items[] = { | const EnumPropertyItem rna_enum_bake_save_mode_items[] = { | ||||
| {R_BAKE_SAVE_INTERNAL, "INTERNAL", 0, "Internal", "Save the baking map in an internal image data-block"}, | {R_BAKE_SAVE_INTERNAL, "INTERNAL", 0, "Internal", "Save the baking map in an internal image data-block"}, | ||||
| {R_BAKE_SAVE_EXTERNAL, "EXTERNAL", 0, "External", "Save the baking map in an external file"}, | {R_BAKE_SAVE_EXTERNAL, "EXTERNAL", 0, "External", "Save the baking map in an external file"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| #define R_IMF_VIEWS_ENUM_IND {R_IMF_VIEWS_INDIVIDUAL, "INDIVIDUAL", 0, "Individual", \ | #define R_IMF_VIEWS_ENUM_IND {R_IMF_VIEWS_INDIVIDUAL, "INDIVIDUAL", 0, "Individual", \ | ||||
| "Individual files for each view with the prefix as defined by the scene views"}, | "Individual files for each view with the prefix as defined by the scene views"}, | ||||
| #define R_IMF_VIEWS_ENUM_S3D {R_IMF_VIEWS_STEREO_3D, "STEREO_3D", 0, "Stereo 3D", \ | #define R_IMF_VIEWS_ENUM_S3D {R_IMF_VIEWS_STEREO_3D, "STEREO_3D", 0, "Stereo 3D", \ | ||||
| "Single file with an encoded stereo pair"}, | "Single file with an encoded stereo pair"}, | ||||
| #define R_IMF_VIEWS_ENUM_MV {R_IMF_VIEWS_MULTIVIEW, "MULTIVIEW", 0, "Multi-View", "Single file with all the views"}, | #define R_IMF_VIEWS_ENUM_MV {R_IMF_VIEWS_MULTIVIEW, "MULTIVIEW", 0, "Multi-View", "Single file with all the views"}, | ||||
| const EnumPropertyItem rna_enum_views_format_items[] = { | const EnumPropertyItem rna_enum_views_format_items[] = { | ||||
| R_IMF_VIEWS_ENUM_IND | R_IMF_VIEWS_ENUM_IND | ||||
| R_IMF_VIEWS_ENUM_S3D | R_IMF_VIEWS_ENUM_S3D | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | static const EnumPropertyItem rna_enum_gpencil_interpolation_mode_items[] = { | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| #endif | #endif | ||||
| const EnumPropertyItem rna_enum_transform_pivot_items_full[] = { | const EnumPropertyItem rna_enum_transform_pivot_items_full[] = { | ||||
| {V3D_AROUND_CENTER_BOUNDS, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", | {V3D_AROUND_CENTER_BOUNDS, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", | ||||
| "Pivot around bounding box center of selected object(s)"}, | "Pivot around bounding box center of selected object(s)"}, | ||||
| {V3D_AROUND_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", "Pivot around the 3D cursor"}, | {V3D_AROUND_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", "Pivot around the 3D cursor"}, | ||||
| {V3D_AROUND_LOCAL_ORIGINS, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, | {V3D_AROUND_LOCAL_ORIGINS, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, | ||||
| "Individual Origins", "Pivot around each object's own origin"}, | "Individual Origins", "Pivot around each object's own origin"}, | ||||
| {V3D_AROUND_CENTER_MEAN, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point", | {V3D_AROUND_CENTER_MEAN, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point", | ||||
| "Pivot around the median point of selected objects"}, | "Pivot around the median point of selected objects"}, | ||||
| {V3D_AROUND_ACTIVE, "ACTIVE_ELEMENT", ICON_ROTACTIVE, "Active Element", "Pivot around active object"}, | {V3D_AROUND_ACTIVE, "ACTIVE_ELEMENT", ICON_ROTACTIVE, "Active Element", "Pivot around active object"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| /* Icons could be made a consistent set of images. */ | /* Icons could be made a consistent set of images. */ | ||||
| static const EnumPropertyItem transform_orientation_items[] = { | static const EnumPropertyItem transform_orientation_items[] = { | ||||
| {V3D_MANIP_GLOBAL, "GLOBAL", ICON_SCENE_DATA, "Global", "Align the transformation axes to world space"}, | {V3D_MANIP_GLOBAL, "GLOBAL", ICON_SCENE_DATA, "Global", "Align the transformation axes to world space"}, | ||||
| {V3D_MANIP_LOCAL, "LOCAL", ICON_MANIPUL, "Local", "Align the transformation axes to the selected objects' local space"}, | {V3D_MANIP_LOCAL, "LOCAL", ICON_MANIPUL, "Local", "Align the transformation axes to the selected objects' local space"}, | ||||
| {V3D_MANIP_NORMAL, "NORMAL", ICON_SNAP_NORMAL, "Normal", | {V3D_MANIP_NORMAL, "NORMAL", ICON_SNAP_NORMAL, "Normal", | ||||
| "Align the transformation axes to average normal of selected elements " | "Align the transformation axes to average normal of selected elements " | ||||
| "(bone Y axis for pose mode)"}, | "(bone Y axis for pose mode)"}, | ||||
| {V3D_MANIP_GIMBAL, "GIMBAL", ICON_NDOF_DOM, "Gimbal", "Align each axis to the Euler rotation axis as used for input"}, | {V3D_MANIP_GIMBAL, "GIMBAL", ICON_NDOF_DOM, "Gimbal", "Align each axis to the Euler rotation axis as used for input"}, | ||||
| {V3D_MANIP_VIEW, "VIEW", ICON_VISIBLE_IPO_ON, "View", "Align the transformation axes to the window"}, | {V3D_MANIP_VIEW, "VIEW", ICON_VISIBLE_IPO_ON, "View", "Align the transformation axes to the window"}, | ||||
| {V3D_MANIP_CURSOR, "CURSOR", ICON_CURSOR, "Cursor", "Align the transformation axes to the 3D cursor"}, | {V3D_MANIP_CURSOR, "CURSOR", ICON_CURSOR, "Cursor", "Align the transformation axes to the 3D cursor"}, | ||||
| // {V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"}, | // {V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| #ifdef RNA_RUNTIME | #ifdef RNA_RUNTIME | ||||
| ▲ Show 20 Lines • Show All 516 Lines • ▼ Show 20 Lines | static void rna_ImageFormatSettings_file_format_set(PointerRNA *ptr, int value) | ||||
| } | } | ||||
| /* ensure usable depth */ | /* ensure usable depth */ | ||||
| { | { | ||||
| const int depth_ok = BKE_imtype_valid_depths(imf->imtype); | const int depth_ok = BKE_imtype_valid_depths(imf->imtype); | ||||
| if ((imf->depth & depth_ok) == 0) { | if ((imf->depth & depth_ok) == 0) { | ||||
| /* set first available depth */ | /* set first available depth */ | ||||
| char depth_ls[] = {R_IMF_CHAN_DEPTH_32, | char depth_ls[] = {R_IMF_CHAN_DEPTH_32, | ||||
| R_IMF_CHAN_DEPTH_24, | R_IMF_CHAN_DEPTH_24, | ||||
| R_IMF_CHAN_DEPTH_16, | R_IMF_CHAN_DEPTH_16, | ||||
| R_IMF_CHAN_DEPTH_12, | R_IMF_CHAN_DEPTH_12, | ||||
| R_IMF_CHAN_DEPTH_10, | R_IMF_CHAN_DEPTH_10, | ||||
| R_IMF_CHAN_DEPTH_8, | R_IMF_CHAN_DEPTH_8, | ||||
| R_IMF_CHAN_DEPTH_1, | R_IMF_CHAN_DEPTH_1, | ||||
| 0}; | 0}; | ||||
| int i; | int i; | ||||
| for (i = 0; depth_ls[i]; i++) { | for (i = 0; depth_ls[i]; i++) { | ||||
| if (depth_ok & depth_ls[i]) { | if (depth_ok & depth_ls[i]) { | ||||
| imf->depth = depth_ls[i]; | imf->depth = depth_ls[i]; | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if (id && GS(id->name) == ID_SCE) { | if (id && GS(id->name) == ID_SCE) { | ||||
| Scene *scene = ptr->id.data; | Scene *scene = ptr->id.data; | ||||
| RenderData *rd = &scene->r; | RenderData *rd = &scene->r; | ||||
| #ifdef WITH_FFMPEG | #ifdef WITH_FFMPEG | ||||
| BKE_ffmpeg_image_type_verify(rd, imf); | BKE_ffmpeg_image_type_verify(rd, imf); | ||||
| #endif | #endif | ||||
| (void)rd; | (void)rd; | ||||
| } | } | ||||
| } | } | ||||
| static const EnumPropertyItem *rna_ImageFormatSettings_file_format_itemf( | static const EnumPropertyItem *rna_ImageFormatSettings_file_format_itemf( | ||||
| bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *UNUSED(r_free)) | bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *UNUSED(r_free)) | ||||
| { | { | ||||
| ID *id = ptr->id.data; | ID *id = ptr->id.data; | ||||
| if (id && GS(id->name) == ID_SCE) { | if (id && GS(id->name) == ID_SCE) { | ||||
| return rna_enum_image_type_items; | return rna_enum_image_type_items; | ||||
| } | } | ||||
| else { | else { | ||||
| return image_only_type_items; | return image_only_type_items; | ||||
| } | } | ||||
| } | } | ||||
| static const EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf( | static const EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf( | ||||
| bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) | bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) | ||||
| { | { | ||||
| ImageFormatData *imf = (ImageFormatData *)ptr->data; | ImageFormatData *imf = (ImageFormatData *)ptr->data; | ||||
| ID *id = ptr->id.data; | ID *id = ptr->id.data; | ||||
| const bool is_render = (id && GS(id->name) == ID_SCE); | const bool is_render = (id && GS(id->name) == ID_SCE); | ||||
| /* note, we need to act differently for render | /* note, we need to act differently for render | ||||
| * where 'BW' will force grayscale even if the output format writes | * where 'BW' will force grayscale even if the output format writes | ||||
| * as RGBA, this is age old blender convention and not sure how useful | * as RGBA, this is age old blender convention and not sure how useful | ||||
| Show All 16 Lines | #endif | ||||
| if (chan_flag == (IMA_CHAN_FLAG_BW | IMA_CHAN_FLAG_RGB | IMA_CHAN_FLAG_ALPHA)) { | if (chan_flag == (IMA_CHAN_FLAG_BW | IMA_CHAN_FLAG_RGB | IMA_CHAN_FLAG_ALPHA)) { | ||||
| return rna_enum_image_color_mode_items; | return rna_enum_image_color_mode_items; | ||||
| } | } | ||||
| else { | else { | ||||
| int totitem = 0; | int totitem = 0; | ||||
| EnumPropertyItem *item = NULL; | EnumPropertyItem *item = NULL; | ||||
| if (chan_flag & IMA_CHAN_FLAG_BW) RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_BW); | if (chan_flag & IMA_CHAN_FLAG_BW) RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_BW); | ||||
| if (chan_flag & IMA_CHAN_FLAG_RGB) RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGB); | if (chan_flag & IMA_CHAN_FLAG_RGB) RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGB); | ||||
| if (chan_flag & IMA_CHAN_FLAG_ALPHA) RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGBA); | if (chan_flag & IMA_CHAN_FLAG_ALPHA) RNA_enum_item_add(&item, &totitem, &IMAGE_COLOR_MODE_RGBA); | ||||
| RNA_enum_item_end(&item, &totitem); | RNA_enum_item_end(&item, &totitem); | ||||
| *r_free = true; | *r_free = true; | ||||
| return item; | return item; | ||||
| } | } | ||||
| } | } | ||||
| static const EnumPropertyItem *rna_ImageFormatSettings_color_depth_itemf( | static const EnumPropertyItem *rna_ImageFormatSettings_color_depth_itemf( | ||||
| bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) | bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) | ||||
| { | { | ||||
| ImageFormatData *imf = (ImageFormatData *)ptr->data; | ImageFormatData *imf = (ImageFormatData *)ptr->data; | ||||
| if (imf == NULL) { | if (imf == NULL) { | ||||
| return rna_enum_image_color_depth_items; | return rna_enum_image_color_depth_items; | ||||
| } | } | ||||
| else { | else { | ||||
| const int depth_ok = BKE_imtype_valid_depths(imf->imtype); | const int depth_ok = BKE_imtype_valid_depths(imf->imtype); | ||||
| ▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | else { | ||||
| RNA_enum_item_end(&item, &totitem); | RNA_enum_item_end(&item, &totitem); | ||||
| *r_free = true; | *r_free = true; | ||||
| return item; | return item; | ||||
| } | } | ||||
| } | } | ||||
| static const EnumPropertyItem *rna_ImageFormatSettings_views_format_itemf( | static const EnumPropertyItem *rna_ImageFormatSettings_views_format_itemf( | ||||
| bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *UNUSED(r_free)) | bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *UNUSED(r_free)) | ||||
| { | { | ||||
| ImageFormatData *imf = (ImageFormatData *)ptr->data; | ImageFormatData *imf = (ImageFormatData *)ptr->data; | ||||
| if (imf == NULL) { | if (imf == NULL) { | ||||
| return rna_enum_views_format_items; | return rna_enum_views_format_items; | ||||
| } | } | ||||
| else if (imf->imtype == R_IMF_IMTYPE_OPENEXR) { | else if (imf->imtype == R_IMF_IMTYPE_OPENEXR) { | ||||
| return rna_enum_views_format_multiview_items; | return rna_enum_views_format_multiview_items; | ||||
| } | } | ||||
| else if (imf->imtype == R_IMF_IMTYPE_MULTILAYER) { | else if (imf->imtype == R_IMF_IMTYPE_MULTILAYER) { | ||||
| return rna_enum_views_format_multilayer_items; | return rna_enum_views_format_multilayer_items; | ||||
| } | } | ||||
| else { | else { | ||||
| return rna_enum_views_format_items; | return rna_enum_views_format_items; | ||||
| } | } | ||||
| } | } | ||||
| #ifdef WITH_OPENEXR | #ifdef WITH_OPENEXR | ||||
| /* OpenEXR */ | /* OpenEXR */ | ||||
| static const EnumPropertyItem *rna_ImageFormatSettings_exr_codec_itemf( | static const EnumPropertyItem *rna_ImageFormatSettings_exr_codec_itemf( | ||||
| bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) | bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) | ||||
| { | { | ||||
| ImageFormatData *imf = (ImageFormatData *)ptr->data; | ImageFormatData *imf = (ImageFormatData *)ptr->data; | ||||
| EnumPropertyItem *item = NULL; | EnumPropertyItem *item = NULL; | ||||
| int i = 1, totitem = 0; | int i = 1, totitem = 0; | ||||
| if (imf->depth == 16) | if (imf->depth == 16) | ||||
| return rna_enum_exr_codec_items; /* All compression types are defined for halfs */ | return rna_enum_exr_codec_items; /* All compression types are defined for halfs */ | ||||
| Show All 27 Lines | static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *str) | ||||
| RenderData *rd = (RenderData *)ptr->data; | RenderData *rd = (RenderData *)ptr->data; | ||||
| str[0] = '\0'; | str[0] = '\0'; | ||||
| BKE_image_path_ensure_ext_from_imformat(str, &rd->im_format); | BKE_image_path_ensure_ext_from_imformat(str, &rd->im_format); | ||||
| } | } | ||||
| #ifdef WITH_FFMPEG | #ifdef WITH_FFMPEG | ||||
| static void rna_FFmpegSettings_lossless_output_set(PointerRNA *ptr, bool value) | static void rna_FFmpegSettings_lossless_output_set(PointerRNA *ptr, bool value) | ||||
| { | { | ||||
| Scene *scene = (Scene *) ptr->id.data; | Scene *scene = (Scene *)ptr->id.data; | ||||
| RenderData *rd = &scene->r; | RenderData *rd = &scene->r; | ||||
| if (value) | if (value) | ||||
| rd->ffcodecdata.flags |= FFMPEG_LOSSLESS_OUTPUT; | rd->ffcodecdata.flags |= FFMPEG_LOSSLESS_OUTPUT; | ||||
| else | else | ||||
| rd->ffcodecdata.flags &= ~FFMPEG_LOSSLESS_OUTPUT; | rd->ffcodecdata.flags &= ~FFMPEG_LOSSLESS_OUTPUT; | ||||
| BKE_ffmpeg_codec_settings_verify(rd); | BKE_ffmpeg_codec_settings_verify(rd); | ||||
| } | } | ||||
| static void rna_FFmpegSettings_codec_settings_update(Main *UNUSED(bmain), Scene *UNUSED(scene_unused), PointerRNA *ptr) | static void rna_FFmpegSettings_codec_settings_update(Main *UNUSED(bmain), Scene *UNUSED(scene_unused), PointerRNA *ptr) | ||||
| { | { | ||||
| Scene *scene = (Scene *) ptr->id.data; | Scene *scene = (Scene *)ptr->id.data; | ||||
| RenderData *rd = &scene->r; | RenderData *rd = &scene->r; | ||||
| BKE_ffmpeg_codec_settings_verify(rd); | BKE_ffmpeg_codec_settings_verify(rd); | ||||
| } | } | ||||
| #endif | #endif | ||||
| static int rna_RenderSettings_active_view_index_get(PointerRNA *ptr) | static int rna_RenderSettings_active_view_index_get(PointerRNA *ptr) | ||||
| { | { | ||||
| RenderData *rd = (RenderData *)ptr->data; | RenderData *rd = (RenderData *)ptr->data; | ||||
| return rd->actview; | return rd->actview; | ||||
| } | } | ||||
| static void rna_RenderSettings_active_view_index_set(PointerRNA *ptr, int value) | static void rna_RenderSettings_active_view_index_set(PointerRNA *ptr, int value) | ||||
| { | { | ||||
| RenderData *rd = (RenderData *)ptr->data; | RenderData *rd = (RenderData *)ptr->data; | ||||
| rd->actview = value; | rd->actview = value; | ||||
| } | } | ||||
| static void rna_RenderSettings_active_view_index_range( | static void rna_RenderSettings_active_view_index_range( | ||||
| PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) | PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) | ||||
| { | { | ||||
| RenderData *rd = (RenderData *)ptr->data; | RenderData *rd = (RenderData *)ptr->data; | ||||
| *min = 0; | *min = 0; | ||||
| *max = max_ii(0, BLI_listbase_count(&rd->views) - 1); | *max = max_ii(0, BLI_listbase_count(&rd->views) - 1); | ||||
| } | } | ||||
| static PointerRNA rna_RenderSettings_active_view_get(PointerRNA *ptr) | static PointerRNA rna_RenderSettings_active_view_get(PointerRNA *ptr) | ||||
| Show All 18 Lines | static SceneRenderView *rna_RenderView_new(ID *id, RenderData *UNUSED(rd), const char *name) | ||||
| SceneRenderView *srv = BKE_scene_add_render_view(scene, name); | SceneRenderView *srv = BKE_scene_add_render_view(scene, name); | ||||
| WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL); | WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL); | ||||
| return srv; | return srv; | ||||
| } | } | ||||
| static void rna_RenderView_remove( | static void rna_RenderView_remove( | ||||
| ID *id, RenderData *UNUSED(rd), Main *UNUSED(bmain), ReportList *reports, PointerRNA *srv_ptr) | ID *id, RenderData *UNUSED(rd), Main *UNUSED(bmain), ReportList *reports, PointerRNA *srv_ptr) | ||||
| { | { | ||||
| SceneRenderView *srv = srv_ptr->data; | SceneRenderView *srv = srv_ptr->data; | ||||
| Scene *scene = (Scene *)id; | Scene *scene = (Scene *)id; | ||||
| if (!BKE_scene_remove_render_view(scene, srv)) { | if (!BKE_scene_remove_render_view(scene, srv)) { | ||||
| BKE_reportf(reports, RPT_ERROR, "Render view '%s' could not be removed from scene '%s'", | BKE_reportf(reports, RPT_ERROR, "Render view '%s' could not be removed from scene '%s'", | ||||
| srv->name, scene->id.name + 2); | srv->name, scene->id.name + 2); | ||||
| return; | return; | ||||
| Show All 25 Lines | static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value) | ||||
| if (type) { | if (type) { | ||||
| BLI_strncpy_utf8(rd->engine, type->idname, sizeof(rd->engine)); | BLI_strncpy_utf8(rd->engine, type->idname, sizeof(rd->engine)); | ||||
| DEG_id_tag_update(ptr->id.data, DEG_TAG_COPY_ON_WRITE); | DEG_id_tag_update(ptr->id.data, DEG_TAG_COPY_ON_WRITE); | ||||
| } | } | ||||
| } | } | ||||
| static const EnumPropertyItem *rna_RenderSettings_engine_itemf( | static const EnumPropertyItem *rna_RenderSettings_engine_itemf( | ||||
| bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free) | bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free) | ||||
| { | { | ||||
| RenderEngineType *type; | RenderEngineType *type; | ||||
| EnumPropertyItem *item = NULL; | EnumPropertyItem *item = NULL; | ||||
| EnumPropertyItem tmp = {0, "", 0, "", ""}; | EnumPropertyItem tmp = {0, "", 0, "", ""}; | ||||
| int a = 0, totitem = 0; | int a = 0, totitem = 0; | ||||
| for (type = R_engines.first; type; type = type->next, a++) { | for (type = R_engines.first; type; type = type->next, a++) { | ||||
| tmp.value = a; | tmp.value = a; | ||||
| ▲ Show 20 Lines • Show All 441 Lines • ▼ Show 20 Lines | void rna_FreestyleLineSet_linestyle_set(PointerRNA *ptr, PointerRNA value) | ||||
| if (lineset->linestyle) | if (lineset->linestyle) | ||||
| id_us_min(&lineset->linestyle->id); | id_us_min(&lineset->linestyle->id); | ||||
| lineset->linestyle = (FreestyleLineStyle *)value.data; | lineset->linestyle = (FreestyleLineStyle *)value.data; | ||||
| id_us_plus(&lineset->linestyle->id); | id_us_plus(&lineset->linestyle->id); | ||||
| } | } | ||||
| FreestyleLineSet *rna_FreestyleSettings_lineset_add( | FreestyleLineSet *rna_FreestyleSettings_lineset_add( | ||||
| ID *id, FreestyleSettings *config, Main *bmain, const char *name) | ID *id, FreestyleSettings *config, Main *bmain, const char *name) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = (Scene *)id; | ||||
| FreestyleLineSet *lineset = BKE_freestyle_lineset_add(bmain, (FreestyleConfig *)config, name); | FreestyleLineSet *lineset = BKE_freestyle_lineset_add(bmain, (FreestyleConfig *)config, name); | ||||
| DEG_id_tag_update(&scene->id, 0); | DEG_id_tag_update(&scene->id, 0); | ||||
| WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL); | WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL); | ||||
| return lineset; | return lineset; | ||||
| } | } | ||||
| void rna_FreestyleSettings_lineset_remove( | void rna_FreestyleSettings_lineset_remove( | ||||
| ID *id, FreestyleSettings *config, ReportList *reports, PointerRNA *lineset_ptr) | ID *id, FreestyleSettings *config, ReportList *reports, PointerRNA *lineset_ptr) | ||||
| { | { | ||||
| FreestyleLineSet *lineset = lineset_ptr->data; | FreestyleLineSet *lineset = lineset_ptr->data; | ||||
| Scene *scene = (Scene *)id; | Scene *scene = (Scene *)id; | ||||
| if (!BKE_freestyle_lineset_delete((FreestyleConfig *)config, lineset)) { | if (!BKE_freestyle_lineset_delete((FreestyleConfig *)config, lineset)) { | ||||
| BKE_reportf(reports, RPT_ERROR, "Line set '%s' could not be removed", lineset->name); | BKE_reportf(reports, RPT_ERROR, "Line set '%s' could not be removed", lineset->name); | ||||
| return; | return; | ||||
| } | } | ||||
| RNA_POINTER_INVALIDATE(lineset_ptr); | RNA_POINTER_INVALIDATE(lineset_ptr); | ||||
| DEG_id_tag_update(&scene->id, 0); | DEG_id_tag_update(&scene->id, 0); | ||||
| WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL); | WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL); | ||||
| } | } | ||||
| PointerRNA rna_FreestyleSettings_active_lineset_get(PointerRNA *ptr) | PointerRNA rna_FreestyleSettings_active_lineset_get(PointerRNA *ptr) | ||||
| { | { | ||||
| FreestyleConfig *config = (FreestyleConfig *)ptr->data; | FreestyleConfig *config = (FreestyleConfig *)ptr->data; | ||||
| FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config); | FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config); | ||||
| return rna_pointer_inherit_refine(ptr, &RNA_FreestyleLineSet, lineset); | return rna_pointer_inherit_refine(ptr, &RNA_FreestyleLineSet, lineset); | ||||
| } | } | ||||
| void rna_FreestyleSettings_active_lineset_index_range( | void rna_FreestyleSettings_active_lineset_index_range( | ||||
| PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) | PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) | ||||
| { | { | ||||
| FreestyleConfig *config = (FreestyleConfig *)ptr->data; | FreestyleConfig *config = (FreestyleConfig *)ptr->data; | ||||
| *min = 0; | *min = 0; | ||||
| *max = max_ii(0, BLI_listbase_count(&config->linesets) - 1); | *max = max_ii(0, BLI_listbase_count(&config->linesets) - 1); | ||||
| } | } | ||||
| int rna_FreestyleSettings_active_lineset_index_get(PointerRNA *ptr) | int rna_FreestyleSettings_active_lineset_index_get(PointerRNA *ptr) | ||||
| Show All 15 Lines | FreestyleModuleConfig *rna_FreestyleSettings_module_add(ID *id, FreestyleSettings *config) | ||||
| DEG_id_tag_update(&scene->id, 0); | DEG_id_tag_update(&scene->id, 0); | ||||
| WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL); | WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL); | ||||
| return module; | return module; | ||||
| } | } | ||||
| void rna_FreestyleSettings_module_remove( | void rna_FreestyleSettings_module_remove( | ||||
| ID *id, FreestyleSettings *config, ReportList *reports, PointerRNA *module_ptr) | ID *id, FreestyleSettings *config, ReportList *reports, PointerRNA *module_ptr) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = (Scene *)id; | ||||
| FreestyleModuleConfig *module = module_ptr->data; | FreestyleModuleConfig *module = module_ptr->data; | ||||
| if (!BKE_freestyle_module_delete((FreestyleConfig *)config, module)) { | if (!BKE_freestyle_module_delete((FreestyleConfig *)config, module)) { | ||||
| if (module->script) | if (module->script) | ||||
| BKE_reportf(reports, RPT_ERROR, "Style module '%s' could not be removed", module->script->id.name + 2); | BKE_reportf(reports, RPT_ERROR, "Style module '%s' could not be removed", module->script->id.name + 2); | ||||
| else | else | ||||
| ▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | if (id && GS(id->name) == ID_IM) { | ||||
| if (ibuf) { | if (ibuf) { | ||||
| BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_FREE); | BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_FREE); | ||||
| } | } | ||||
| BKE_image_release_ibuf(ima, ibuf, lock); | BKE_image_release_ibuf(ima, ibuf, lock); | ||||
| } | } | ||||
| } | } | ||||
| static ViewLayer *rna_ViewLayer_new( | static ViewLayer *rna_ViewLayer_new( | ||||
| ID *id, Scene *UNUSED(sce), Main *bmain, const char *name) | ID *id, Scene *UNUSED(sce), Main *bmain, const char *name) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = (Scene *)id; | ||||
| ViewLayer *view_layer = BKE_view_layer_add(scene, name); | ViewLayer *view_layer = BKE_view_layer_add(scene, name); | ||||
| DEG_id_tag_update(&scene->id, 0); | DEG_id_tag_update(&scene->id, 0); | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL); | WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL); | ||||
| return view_layer; | return view_layer; | ||||
| } | } | ||||
| static void rna_ViewLayer_remove( | static void rna_ViewLayer_remove( | ||||
| ID *id, Scene *UNUSED(sce), Main *bmain, ReportList *reports, PointerRNA *sl_ptr) | ID *id, Scene *UNUSED(sce), Main *bmain, ReportList *reports, PointerRNA *sl_ptr) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = (Scene *)id; | ||||
| ViewLayer *view_layer = sl_ptr->data; | ViewLayer *view_layer = sl_ptr->data; | ||||
| if (ED_scene_view_layer_delete(bmain, scene, view_layer, reports)) { | if (ED_scene_view_layer_delete(bmain, scene, view_layer, reports)) { | ||||
| RNA_POINTER_INVALIDATE(sl_ptr); | RNA_POINTER_INVALIDATE(sl_ptr); | ||||
| } | } | ||||
| } | } | ||||
| static int rna_Scene_transform_orientation_get(PointerRNA *ptr) | static int rna_Scene_transform_orientation_get(PointerRNA *ptr) | ||||
| { | { | ||||
| Scene *scene = ptr->data; | Scene *scene = ptr->data; | ||||
| /* convert to enum value */ | /* convert to enum value */ | ||||
| return (scene->orientation_type == V3D_MANIP_CUSTOM) ? | return (scene->orientation_type == V3D_MANIP_CUSTOM) ? | ||||
| (scene->orientation_type + scene->orientation_index_custom) : scene->orientation_type; | (scene->orientation_type + scene->orientation_index_custom) : scene->orientation_type; | ||||
| } | } | ||||
| void rna_Scene_transform_orientation_set(PointerRNA *ptr, int value) | void rna_Scene_transform_orientation_set(PointerRNA *ptr, int value) | ||||
| { | { | ||||
| Scene *scene = ptr->data; | Scene *scene = ptr->data; | ||||
| BIF_selectTransformOrientationValue(scene, value); | BIF_selectTransformOrientationValue(scene, value); | ||||
| } | } | ||||
| static PointerRNA rna_Scene_current_orientation_get(PointerRNA *ptr) | static PointerRNA rna_Scene_current_orientation_get(PointerRNA *ptr) | ||||
| { | { | ||||
| Scene *scene = ptr->data; | Scene *scene = ptr->data; | ||||
| TransformOrientation *orientation; | TransformOrientation *orientation; | ||||
| if (scene->orientation_type < V3D_MANIP_CUSTOM) { | if (scene->orientation_type < V3D_MANIP_CUSTOM) { | ||||
| orientation = NULL; | orientation = NULL; | ||||
| } | } | ||||
| else { | else { | ||||
| orientation = BKE_scene_transform_orientation_find(scene, scene->orientation_index_custom); | orientation = BKE_scene_transform_orientation_find(scene, scene->orientation_index_custom); | ||||
| } | } | ||||
| return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, orientation); | return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, orientation); | ||||
| } | } | ||||
| const EnumPropertyItem *rna_TransformOrientation_itemf( | const EnumPropertyItem *rna_TransformOrientation_itemf( | ||||
| bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) | bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) | ||||
| { | { | ||||
| EnumPropertyItem tmp = {0, "", 0, "", ""}; | EnumPropertyItem tmp = {0, "", 0, "", ""}; | ||||
| EnumPropertyItem *item = NULL; | EnumPropertyItem *item = NULL; | ||||
| int i = V3D_MANIP_CUSTOM, totitem = 0; | int i = V3D_MANIP_CUSTOM, totitem = 0; | ||||
| RNA_enum_items_add(&item, &totitem, transform_orientation_items); | RNA_enum_items_add(&item, &totitem, transform_orientation_items); | ||||
| Scene *scene; | Scene *scene; | ||||
| Show All 18 Lines | const EnumPropertyItem *rna_TransformOrientation_itemf( | ||||
| RNA_enum_item_end(&item, &totitem); | RNA_enum_item_end(&item, &totitem); | ||||
| *r_free = true; | *r_free = true; | ||||
| return item; | return item; | ||||
| } | } | ||||
| /* lanpr */ | |||||
| void rna_lanpr_active_line_layer_index_range( | |||||
| PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) | |||||
| { | |||||
| SceneLANPR *lanpr = (SceneLANPR *)ptr->data; | |||||
| *min = 0; | |||||
| *max = max_ii(0, BLI_listbase_count(&lanpr->line_layers) - 1); | |||||
| } | |||||
| int rna_lanpr_active_line_layer_index_get(PointerRNA *ptr) | |||||
| { | |||||
| SceneLANPR *lanpr = (SceneLANPR *)ptr->data; | |||||
| LANPR_LineLayer *ls; | |||||
| int i = 0; | |||||
| for (ls = lanpr->line_layers.first; ls; ls = ls->next) { | |||||
| if (ls == lanpr->active_layer) return i; | |||||
| i++; | |||||
| } | |||||
| return 0; | |||||
| } | |||||
| void rna_lanpr_active_line_layer_index_set(PointerRNA *ptr, int value) | |||||
| { | |||||
| SceneLANPR *lanpr = (SceneLANPR *)ptr->data; | |||||
| LANPR_LineLayer *ls; | |||||
| int i = 0; | |||||
| for (ls = lanpr->line_layers.first; ls; ls = ls->next) { | |||||
| if (i == value) { | |||||
| lanpr->active_layer = ls; | |||||
| return; | |||||
| } | |||||
| i++; | |||||
| } | |||||
| lanpr->active_layer = 0; | |||||
| } | |||||
| PointerRNA rna_lanpr_active_line_layer_get(PointerRNA *ptr) | |||||
| { | |||||
| SceneLANPR *lanpr = (SceneLANPR *)ptr->data; | |||||
| LANPR_LineLayer *ls = lanpr->active_layer; | |||||
| return rna_pointer_inherit_refine(ptr, &RNA_LANPR_LineLayer, ls); | |||||
| } | |||||
| void rna_lanpr_active_line_layer_set(PointerRNA *ptr, PointerRNA value) | |||||
| { | |||||
| SceneLANPR *lanpr = (SceneLANPR *)ptr->data; | |||||
| lanpr->active_layer = value.data; | |||||
| } | |||||
| #else | #else | ||||
| /* Grease Pencil Interpolation tool settings */ | /* Grease Pencil Interpolation tool settings */ | ||||
| static void rna_def_gpencil_interpolate(BlenderRNA *brna) | static void rna_def_gpencil_interpolate(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| ▲ Show 20 Lines • Show All 373 Lines • ▼ Show 20 Lines | static void rna_def_tool_settings(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "Use Additive Drawing", | RNA_def_property_ui_text(prop, "Use Additive Drawing", | ||||
| "When creating new frames, the strokes from the previous/active frame " | "When creating new frames, the strokes from the previous/active frame " | ||||
| "are included as the basis for the new one"); | "are included as the basis for the new one"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); | ||||
| prop = RNA_def_property(srna, "use_gpencil_draw_onback", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_gpencil_draw_onback", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_PAINT_ONBACK); | RNA_def_property_boolean_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_PAINT_ONBACK); | ||||
| RNA_def_property_ui_text(prop, "Draw Strokes on Back", | RNA_def_property_ui_text(prop, "Draw Strokes on Back", | ||||
| "When draw new strokes, the new stroke is drawn below of all strokes in the layer"); | "When draw new strokes, the new stroke is drawn below of all strokes in the layer"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); | ||||
| prop = RNA_def_property(srna, "use_gpencil_thumbnail_list", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_gpencil_thumbnail_list", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_negative_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_THUMBNAIL_LIST); | RNA_def_property_boolean_negative_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_THUMBNAIL_LIST); | ||||
| RNA_def_property_ui_text(prop, "Compact List", | RNA_def_property_ui_text(prop, "Compact List", | ||||
| "Show compact list of color instead of thumbnails"); | "Show compact list of color instead of thumbnails"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, 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"); | ||||
| RNA_def_property_struct_type(prop, "GPencilSculptSettings"); | RNA_def_property_struct_type(prop, "GPencilSculptSettings"); | ||||
| RNA_def_property_ui_text(prop, "Grease Pencil Sculpt", | RNA_def_property_ui_text(prop, "Grease Pencil Sculpt", | ||||
| "Settings for stroke sculpting tools and brushes"); | "Settings for stroke sculpting tools and brushes"); | ||||
| prop = RNA_def_property(srna, "gpencil_interpolate", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "gpencil_interpolate", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "gp_interpolate"); | RNA_def_property_pointer_sdna(prop, NULL, "gp_interpolate"); | ||||
| RNA_def_property_struct_type(prop, "GPencilInterpolateSettings"); | RNA_def_property_struct_type(prop, "GPencilInterpolateSettings"); | ||||
| RNA_def_property_ui_text(prop, "Grease Pencil Interpolate", | RNA_def_property_ui_text(prop, "Grease Pencil Interpolate", | ||||
| "Settings for Grease Pencil Interpolation tools"); | "Settings for Grease Pencil Interpolation tools"); | ||||
| /* 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"); | ||||
| RNA_def_property_enum_items(prop, gpencil_stroke_placement_items); | RNA_def_property_enum_items(prop, gpencil_stroke_placement_items); | ||||
| RNA_def_property_ui_text(prop, "Stroke Placement (3D View)", ""); | RNA_def_property_ui_text(prop, "Stroke Placement (3D View)", ""); | ||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | ||||
| ▲ Show 20 Lines • Show All 232 Lines • ▼ Show 20 Lines | static void rna_def_curve_paint_settings(BlenderRNA *brna) | ||||
| srna = RNA_def_struct(brna, "CurvePaintSettings", NULL); | srna = RNA_def_struct(brna, "CurvePaintSettings", NULL); | ||||
| RNA_def_struct_path_func(srna, "rna_CurvePaintSettings_path"); | RNA_def_struct_path_func(srna, "rna_CurvePaintSettings_path"); | ||||
| RNA_def_struct_ui_text(srna, "Curve Paint Settings", ""); | RNA_def_struct_ui_text(srna, "Curve Paint Settings", ""); | ||||
| static const EnumPropertyItem curve_type_items[] = { | static const EnumPropertyItem curve_type_items[] = { | ||||
| {CU_POLY, "POLY", 0, "Poly", ""}, | {CU_POLY, "POLY", 0, "Poly", ""}, | ||||
| {CU_BEZIER, "BEZIER", 0, "Bezier", ""}, | {CU_BEZIER, "BEZIER", 0, "Bezier", ""}, | ||||
| {0, NULL, 0, NULL, NULL}}; | {0, NULL, 0, NULL, NULL} | ||||
| }; | |||||
| prop = RNA_def_property(srna, "curve_type", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "curve_type", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "curve_type"); | RNA_def_property_enum_sdna(prop, NULL, "curve_type"); | ||||
| RNA_def_property_enum_items(prop, curve_type_items); | RNA_def_property_enum_items(prop, curve_type_items); | ||||
| RNA_def_property_ui_text(prop, "Type", "Type of curve to use for new strokes"); | RNA_def_property_ui_text(prop, "Type", "Type of curve to use for new strokes"); | ||||
| prop = RNA_def_property(srna, "use_corners_detect", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_corners_detect", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", CURVE_PAINT_FLAG_CORNERS_DETECT); | RNA_def_property_boolean_sdna(prop, NULL, "flag", CURVE_PAINT_FLAG_CORNERS_DETECT); | ||||
| ▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | static void rna_def_curve_paint_settings(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "surface_offset", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "surface_offset", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_range(prop, -10.0, 10.0); | RNA_def_property_range(prop, -10.0, 10.0); | ||||
| RNA_def_property_ui_range(prop, -1.0f, 1.0, 1, 2); | RNA_def_property_ui_range(prop, -1.0f, 1.0, 1, 2); | ||||
| RNA_def_property_ui_text(prop, "Offset", "Offset the stroke from the surface"); | RNA_def_property_ui_text(prop, "Offset", "Offset the stroke from the surface"); | ||||
| static const EnumPropertyItem depth_mode_items[] = { | static const EnumPropertyItem depth_mode_items[] = { | ||||
| {CURVE_PAINT_PROJECT_CURSOR, "CURSOR", 0, "Cursor", ""}, | {CURVE_PAINT_PROJECT_CURSOR, "CURSOR", 0, "Cursor", ""}, | ||||
| {CURVE_PAINT_PROJECT_SURFACE, "SURFACE", 0, "Surface", ""}, | {CURVE_PAINT_PROJECT_SURFACE, "SURFACE", 0, "Surface", ""}, | ||||
| {0, NULL, 0, NULL, NULL}}; | {0, NULL, 0, NULL, NULL} | ||||
| }; | |||||
| prop = RNA_def_property(srna, "depth_mode", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "depth_mode", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "depth_mode"); | RNA_def_property_enum_sdna(prop, NULL, "depth_mode"); | ||||
| RNA_def_property_enum_items(prop, depth_mode_items); | RNA_def_property_enum_items(prop, depth_mode_items); | ||||
| RNA_def_property_ui_text(prop, "Depth", "Method of projecting depth"); | RNA_def_property_ui_text(prop, "Depth", "Method of projecting depth"); | ||||
| static const EnumPropertyItem surface_plane_items[] = { | static const EnumPropertyItem surface_plane_items[] = { | ||||
| {CURVE_PAINT_SURFACE_PLANE_NORMAL_VIEW, "NORMAL_VIEW", 0, "Normal/View", "Draw perpendicular to the surface"}, | {CURVE_PAINT_SURFACE_PLANE_NORMAL_VIEW, "NORMAL_VIEW", 0, "Normal/View", "Draw perpendicular to the surface"}, | ||||
| {CURVE_PAINT_SURFACE_PLANE_NORMAL_SURFACE, "NORMAL_SURFACE", 0, "Normal/Surface", "Draw aligned to the surface"}, | {CURVE_PAINT_SURFACE_PLANE_NORMAL_SURFACE, "NORMAL_SURFACE", 0, "Normal/Surface", "Draw aligned to the surface"}, | ||||
| {CURVE_PAINT_SURFACE_PLANE_VIEW, "VIEW", 0, "View", "Draw aligned to the viewport"}, | {CURVE_PAINT_SURFACE_PLANE_VIEW, "VIEW", 0, "View", "Draw aligned to the viewport"}, | ||||
| {0, NULL, 0, NULL, NULL}}; | {0, NULL, 0, NULL, NULL} | ||||
| }; | |||||
| prop = RNA_def_property(srna, "surface_plane", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "surface_plane", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "surface_plane"); | RNA_def_property_enum_sdna(prop, NULL, "surface_plane"); | ||||
| RNA_def_property_enum_items(prop, surface_plane_items); | RNA_def_property_enum_items(prop, surface_plane_items); | ||||
| RNA_def_property_ui_text(prop, "Plane", "Plane for projected stroke"); | RNA_def_property_ui_text(prop, "Plane", "Plane for projected stroke"); | ||||
| } | } | ||||
| static void rna_def_statvis(BlenderRNA *brna) | static void rna_def_statvis(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| static const EnumPropertyItem stat_type[] = { | static const EnumPropertyItem stat_type[] = { | ||||
| {SCE_STATVIS_OVERHANG, "OVERHANG", 0, "Overhang", ""}, | {SCE_STATVIS_OVERHANG, "OVERHANG", 0, "Overhang", ""}, | ||||
| {SCE_STATVIS_THICKNESS, "THICKNESS", 0, "Thickness", ""}, | {SCE_STATVIS_THICKNESS, "THICKNESS", 0, "Thickness", ""}, | ||||
| {SCE_STATVIS_INTERSECT, "INTERSECT", 0, "Intersect", ""}, | {SCE_STATVIS_INTERSECT, "INTERSECT", 0, "Intersect", ""}, | ||||
| {SCE_STATVIS_DISTORT, "DISTORT", 0, "Distortion", ""}, | {SCE_STATVIS_DISTORT, "DISTORT", 0, "Distortion", ""}, | ||||
| {SCE_STATVIS_SHARP, "SHARP", 0, "Sharp", ""}, | {SCE_STATVIS_SHARP, "SHARP", 0, "Sharp", ""}, | ||||
| {0, NULL, 0, NULL, NULL}}; | {0, NULL, 0, NULL, NULL} | ||||
| }; | |||||
| srna = RNA_def_struct(brna, "MeshStatVis", NULL); | srna = RNA_def_struct(brna, "MeshStatVis", NULL); | ||||
| RNA_def_struct_path_func(srna, "rna_MeshStatVis_path"); | RNA_def_struct_path_func(srna, "rna_MeshStatVis_path"); | ||||
| RNA_def_struct_ui_text(srna, "Mesh Visualize Statistics", ""); | RNA_def_struct_ui_text(srna, "Mesh Visualize Statistics", ""); | ||||
| prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_items(prop, stat_type); | RNA_def_property_enum_items(prop, stat_type); | ||||
| RNA_def_property_ui_text(prop, "Type", "Type of data to visualize/check"); | RNA_def_property_ui_text(prop, "Type", "Type of data to visualize/check"); | ||||
| ▲ Show 20 Lines • Show All 446 Lines • ▼ Show 20 Lines | |||||
| void rna_def_freestyle_settings(BlenderRNA *brna) | void rna_def_freestyle_settings(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| static const EnumPropertyItem edge_type_negation_items[] = { | static const EnumPropertyItem edge_type_negation_items[] = { | ||||
| {0, "INCLUSIVE", 0, "Inclusive", "Select feature edges satisfying the given edge type conditions"}, | {0, "INCLUSIVE", 0, "Inclusive", "Select feature edges satisfying the given edge type conditions"}, | ||||
| {FREESTYLE_LINESET_FE_NOT, "EXCLUSIVE", 0, "Exclusive", | {FREESTYLE_LINESET_FE_NOT, "EXCLUSIVE", 0, "Exclusive", | ||||
| "Select feature edges not satisfying the given edge type conditions"}, | "Select feature edges not satisfying the given edge type conditions"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| static const EnumPropertyItem edge_type_combination_items[] = { | static const EnumPropertyItem edge_type_combination_items[] = { | ||||
| {0, "OR", 0, "Logical OR", "Select feature edges satisfying at least one of edge type conditions"}, | {0, "OR", 0, "Logical OR", "Select feature edges satisfying at least one of edge type conditions"}, | ||||
| {FREESTYLE_LINESET_FE_AND, "AND", 0, "Logical AND", | {FREESTYLE_LINESET_FE_AND, "AND", 0, "Logical AND", | ||||
| "Select feature edges satisfying all edge type conditions"}, | "Select feature edges satisfying all edge type conditions"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| static const EnumPropertyItem group_negation_items[] = { | static const EnumPropertyItem group_negation_items[] = { | ||||
| {0, "INCLUSIVE", 0, "Inclusive", "Select feature edges belonging to some object in the group"}, | {0, "INCLUSIVE", 0, "Inclusive", "Select feature edges belonging to some object in the group"}, | ||||
| {FREESTYLE_LINESET_GR_NOT, "EXCLUSIVE", 0, "Exclusive", | {FREESTYLE_LINESET_GR_NOT, "EXCLUSIVE", 0, "Exclusive", | ||||
| "Select feature edges not belonging to any object in the group"}, | "Select feature edges not belonging to any object in the group"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| static const EnumPropertyItem face_mark_negation_items[] = { | static const EnumPropertyItem face_mark_negation_items[] = { | ||||
| {0, "INCLUSIVE", 0, "Inclusive", "Select feature edges satisfying the given face mark conditions"}, | {0, "INCLUSIVE", 0, "Inclusive", "Select feature edges satisfying the given face mark conditions"}, | ||||
| {FREESTYLE_LINESET_FM_NOT, "EXCLUSIVE", 0, "Exclusive", | {FREESTYLE_LINESET_FM_NOT, "EXCLUSIVE", 0, "Exclusive", | ||||
| "Select feature edges not satisfying the given face mark conditions"}, | "Select feature edges not satisfying the given face mark conditions"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| static const EnumPropertyItem face_mark_condition_items[] = { | static const EnumPropertyItem face_mark_condition_items[] = { | ||||
| {0, "ONE", 0, "One Face", "Select a feature edge if either of its adjacent faces is marked"}, | {0, "ONE", 0, "One Face", "Select a feature edge if either of its adjacent faces is marked"}, | ||||
| {FREESTYLE_LINESET_FM_BOTH, "BOTH", 0, "Both Faces", | {FREESTYLE_LINESET_FM_BOTH, "BOTH", 0, "Both Faces", | ||||
| "Select a feature edge if both of its adjacent faces are marked"}, | "Select a feature edge if both of its adjacent faces are marked"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| static const EnumPropertyItem freestyle_ui_mode_items[] = { | static const EnumPropertyItem freestyle_ui_mode_items[] = { | ||||
| {FREESTYLE_CONTROL_SCRIPT_MODE, "SCRIPT", 0, "Python Scripting Mode", | {FREESTYLE_CONTROL_SCRIPT_MODE, "SCRIPT", 0, "Python Scripting Mode", | ||||
| "Advanced mode for using style modules written in Python"}, | "Advanced mode for using style modules written in Python"}, | ||||
| {FREESTYLE_CONTROL_EDITOR_MODE, "EDITOR", 0, "Parameter Editor Mode", | {FREESTYLE_CONTROL_EDITOR_MODE, "EDITOR", 0, "Parameter Editor Mode", | ||||
| "Basic mode for interactive style parameter editing"}, | "Basic mode for interactive style parameter editing"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| static const EnumPropertyItem visibility_items[] = { | static const EnumPropertyItem visibility_items[] = { | ||||
| {FREESTYLE_QI_VISIBLE, "VISIBLE", 0, "Visible", "Select visible feature edges"}, | {FREESTYLE_QI_VISIBLE, "VISIBLE", 0, "Visible", "Select visible feature edges"}, | ||||
| {FREESTYLE_QI_HIDDEN, "HIDDEN", 0, "Hidden", "Select hidden feature edges"}, | {FREESTYLE_QI_HIDDEN, "HIDDEN", 0, "Hidden", "Select hidden feature edges"}, | ||||
| {FREESTYLE_QI_RANGE, "RANGE", 0, "QI Range", | {FREESTYLE_QI_RANGE, "RANGE", 0, "QI Range", | ||||
| "Select feature edges within a range of quantitative invisibility (QI) values"}, | "Select feature edges within a range of quantitative invisibility (QI) values"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| /* FreestyleLineSet */ | /* FreestyleLineSet */ | ||||
| srna = RNA_def_struct(brna, "FreestyleLineSet", NULL); | srna = RNA_def_struct(brna, "FreestyleLineSet", NULL); | ||||
| RNA_def_struct_ui_text(srna, "Freestyle Line Set", "Line set for associating lines and style parameters"); | RNA_def_struct_ui_text(srna, "Freestyle Line Set", "Line set for associating lines and style parameters"); | ||||
| ▲ Show 20 Lines • Show All 823 Lines • ▼ Show 20 Lines | #endif | ||||
| RNA_def_property_ui_text(prop, "Quality", "Quality for image formats that support lossy compression"); | RNA_def_property_ui_text(prop, "Quality", "Quality for image formats that support lossy compression"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); | ||||
| /* was shared with file_quality */ | /* was shared with file_quality */ | ||||
| prop = RNA_def_property(srna, "compression", PROP_INT, PROP_PERCENTAGE); | prop = RNA_def_property(srna, "compression", PROP_INT, PROP_PERCENTAGE); | ||||
| RNA_def_property_int_sdna(prop, NULL, "compress"); | RNA_def_property_int_sdna(prop, NULL, "compress"); | ||||
| RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */ | RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */ | ||||
| RNA_def_property_ui_text(prop, "Compression", "Amount of time to determine best compression: " | RNA_def_property_ui_text(prop, "Compression", "Amount of time to determine best compression: " | ||||
| "0 = no compression with fast file output, " | "0 = no compression with fast file output, " | ||||
| "100 = maximum lossless compression with slow file output"); | "100 = maximum lossless compression with slow file output"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); | ||||
| /* flag */ | /* flag */ | ||||
| prop = RNA_def_property(srna, "use_zbuffer", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_zbuffer", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", R_IMF_FLAG_ZBUF); | RNA_def_property_boolean_sdna(prop, NULL, "flag", R_IMF_FLAG_ZBUF); | ||||
| RNA_def_property_ui_text(prop, "Z Buffer", "Save the z-depth per pixel (32 bit unsigned int z-buffer)"); | RNA_def_property_ui_text(prop, "Z Buffer", "Save the z-depth per pixel (32 bit unsigned int z-buffer)"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); | ||||
| ▲ Show 20 Lines • Show All 390 Lines • ▼ Show 20 Lines | static void rna_def_scene_render_data(BlenderRNA *brna) | ||||
| static const EnumPropertyItem engine_items[] = { | static const EnumPropertyItem engine_items[] = { | ||||
| {0, "BLENDER_EEVEE", 0, "Eevee", ""}, | {0, "BLENDER_EEVEE", 0, "Eevee", ""}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| static const EnumPropertyItem freestyle_thickness_items[] = { | static const EnumPropertyItem freestyle_thickness_items[] = { | ||||
| {R_LINE_THICKNESS_ABSOLUTE, "ABSOLUTE", 0, "Absolute", "Specify unit line thickness in pixels"}, | {R_LINE_THICKNESS_ABSOLUTE, "ABSOLUTE", 0, "Absolute", "Specify unit line thickness in pixels"}, | ||||
| {R_LINE_THICKNESS_RELATIVE, "RELATIVE", 0, "Relative", | {R_LINE_THICKNESS_RELATIVE, "RELATIVE", 0, "Relative", | ||||
| "Unit line thickness is scaled by the proportion of the present vertical image " | "Unit line thickness is scaled by the proportion of the present vertical image " | ||||
| "resolution to 480 pixels"}, | "resolution to 480 pixels"}, | ||||
| {0, NULL, 0, NULL, NULL}}; | {0, NULL, 0, NULL, NULL} | ||||
| }; | |||||
| static const EnumPropertyItem views_format_items[] = { | static const EnumPropertyItem views_format_items[] = { | ||||
| {SCE_VIEWS_FORMAT_STEREO_3D, "STEREO_3D", 0, "Stereo 3D", | {SCE_VIEWS_FORMAT_STEREO_3D, "STEREO_3D", 0, "Stereo 3D", | ||||
| "Single stereo camera system, adjust the stereo settings in the camera panel"}, | "Single stereo camera system, adjust the stereo settings in the camera panel"}, | ||||
| {SCE_VIEWS_FORMAT_MULTIVIEW, "MULTIVIEW", 0, "Multi-View", | {SCE_VIEWS_FORMAT_MULTIVIEW, "MULTIVIEW", 0, "Multi-View", | ||||
| "Multi camera system, adjust the cameras individually"}, | "Multi camera system, adjust the cameras individually"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| static const EnumPropertyItem hair_shape_type_items[] = { | static const EnumPropertyItem hair_shape_type_items[] = { | ||||
| {SCE_HAIR_SHAPE_STRAND, "STRAND", 0, "Strand", ""}, | {SCE_HAIR_SHAPE_STRAND, "STRAND", 0, "Strand", ""}, | ||||
| {SCE_HAIR_SHAPE_STRIP, "STRIP", 0, "Strip", ""}, | {SCE_HAIR_SHAPE_STRIP, "STRIP", 0, "Strip", ""}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | static void rna_def_scene_render_data(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "Tile Y", "Vertical tile size to use while rendering"); | RNA_def_property_ui_text(prop, "Tile Y", "Vertical tile size to use while rendering"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); | ||||
| prop = RNA_def_property(srna, "preview_start_resolution", PROP_INT, PROP_NONE); | prop = RNA_def_property(srna, "preview_start_resolution", PROP_INT, PROP_NONE); | ||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | ||||
| RNA_def_property_range(prop, 8, 16384); | RNA_def_property_range(prop, 8, 16384); | ||||
| RNA_def_property_int_default(prop, 64); | RNA_def_property_int_default(prop, 64); | ||||
| RNA_def_property_ui_text(prop, "Start Resolution", "Resolution to start rendering preview at, " | RNA_def_property_ui_text(prop, "Start Resolution", "Resolution to start rendering preview at, " | ||||
| "progressively increasing it to the full viewport size"); | "progressively increasing it to the full viewport size"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); | ||||
| prop = RNA_def_property(srna, "preview_pixel_size", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "preview_pixel_size", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "preview_pixel_size"); | RNA_def_property_enum_sdna(prop, NULL, "preview_pixel_size"); | ||||
| RNA_def_property_enum_items(prop, pixel_size_items); | RNA_def_property_enum_items(prop, pixel_size_items); | ||||
| RNA_def_property_ui_text(prop, "Pixel Size", "Pixel size for viewport rendering"); | RNA_def_property_ui_text(prop, "Pixel Size", "Pixel size for viewport rendering"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); | ||||
| ▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | static void rna_def_scene_render_data(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur"); | RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur"); | ||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); | RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); | ||||
| prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_UNSIGNED); | prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_UNSIGNED); | ||||
| RNA_def_property_float_sdna(prop, NULL, "blurfac"); | RNA_def_property_float_sdna(prop, NULL, "blurfac"); | ||||
| RNA_def_property_ui_range(prop, 0.01f, 2.0f, 1, 2); | RNA_def_property_ui_range(prop, 0.01f, 2.0f, 1, 2); | ||||
| RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close " | RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close " | ||||
| "(NOTE: Blender Internal does not support animated shutter)"); | "(NOTE: Blender Internal does not support animated shutter)"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); | RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); | ||||
| prop = RNA_def_property(srna, "motion_blur_shutter_curve", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "motion_blur_shutter_curve", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "mblur_shutter_curve"); | RNA_def_property_pointer_sdna(prop, NULL, "mblur_shutter_curve"); | ||||
| RNA_def_property_struct_type(prop, "CurveMapping"); | RNA_def_property_struct_type(prop, "CurveMapping"); | ||||
| RNA_def_property_ui_text(prop, "Shutter Curve", "Curve defining the shutter's openness over time"); | RNA_def_property_ui_text(prop, "Shutter Curve", "Curve defining the shutter's openness over time"); | ||||
| /* Hairs */ | /* Hairs */ | ||||
| ▲ Show 20 Lines • Show All 360 Lines • ▼ Show 20 Lines | #endif | ||||
| prop = RNA_def_property(srna, "views", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "views", PROP_COLLECTION, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "SceneRenderView"); | RNA_def_property_struct_type(prop, "SceneRenderView"); | ||||
| RNA_def_property_ui_text(prop, "Render Views", ""); | RNA_def_property_ui_text(prop, "Render Views", ""); | ||||
| rna_def_render_views(brna, prop); | rna_def_render_views(brna, prop); | ||||
| prop = RNA_def_property(srna, "stereo_views", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "stereo_views", PROP_COLLECTION, PROP_NONE); | ||||
| RNA_def_property_collection_sdna(prop, NULL, "views", NULL); | RNA_def_property_collection_sdna(prop, NULL, "views", NULL); | ||||
| RNA_def_property_collection_funcs(prop, "rna_RenderSettings_stereoViews_begin", "rna_iterator_listbase_next", | RNA_def_property_collection_funcs(prop, "rna_RenderSettings_stereoViews_begin", "rna_iterator_listbase_next", | ||||
| "rna_iterator_listbase_end", "rna_iterator_listbase_get", | "rna_iterator_listbase_end", "rna_iterator_listbase_get", | ||||
| NULL, NULL, NULL, NULL); | NULL, NULL, NULL, NULL); | ||||
| RNA_def_property_struct_type(prop, "SceneRenderView"); | RNA_def_property_struct_type(prop, "SceneRenderView"); | ||||
| RNA_def_property_ui_text(prop, "Render Views", ""); | RNA_def_property_ui_text(prop, "Render Views", ""); | ||||
| prop = RNA_def_property(srna, "use_multiview", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_multiview", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_MULTIVIEW); | RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_MULTIVIEW); | ||||
| RNA_def_property_ui_text(prop, "Multiple Views", "Use multiple views in the scene"); | RNA_def_property_ui_text(prop, "Multiple Views", "Use multiple views in the scene"); | ||||
| RNA_def_property_update(prop, NC_WINDOW, NULL); | RNA_def_property_update(prop, NC_WINDOW, NULL); | ||||
| ▲ Show 20 Lines • Show All 349 Lines • ▼ Show 20 Lines | static void rna_def_scene_display(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "Shading Settings", "Shading settings for OpenGL render engine"); | RNA_def_property_ui_text(prop, "Shading Settings", "Shading settings for OpenGL render engine"); | ||||
| } | } | ||||
| static void rna_def_scene_eevee(BlenderRNA *brna) | static void rna_def_scene_eevee(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| static const EnumPropertyItem eevee_shadow_method_items[] = { | static const EnumPropertyItem eevee_shadow_method_items[] = { | ||||
| {SHADOW_ESM, "ESM", 0, "ESM", "Exponential Shadow Mapping"}, | {SHADOW_ESM, "ESM", 0, "ESM", "Exponential Shadow Mapping"}, | ||||
| {SHADOW_VSM, "VSM", 0, "VSM", "Variance Shadow Mapping"}, | {SHADOW_VSM, "VSM", 0, "VSM", "Variance Shadow Mapping"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| static const EnumPropertyItem eevee_shadow_size_items[] = { | static const EnumPropertyItem eevee_shadow_size_items[] = { | ||||
| {64, "64", 0, "64px", ""}, | {64, "64", 0, "64px", ""}, | ||||
| {128, "128", 0, "128px", ""}, | {128, "128", 0, "128px", ""}, | ||||
| Show All 26 Lines | static void rna_def_scene_eevee(BlenderRNA *brna) | ||||
| srna = RNA_def_struct(brna, "SceneEEVEE", NULL); | srna = RNA_def_struct(brna, "SceneEEVEE", NULL); | ||||
| RNA_def_struct_path_func(srna, "rna_SceneEEVEE_path"); | RNA_def_struct_path_func(srna, "rna_SceneEEVEE_path"); | ||||
| RNA_def_struct_ui_text(srna, "Scene Display", "Scene display settings for 3d viewport"); | RNA_def_struct_ui_text(srna, "Scene Display", "Scene display settings for 3d viewport"); | ||||
| /* Indirect Lighting */ | /* Indirect Lighting */ | ||||
| prop = RNA_def_property(srna, "gi_diffuse_bounces", PROP_INT, PROP_NONE); | prop = RNA_def_property(srna, "gi_diffuse_bounces", PROP_INT, PROP_NONE); | ||||
| RNA_def_property_int_default(prop, 3); | RNA_def_property_int_default(prop, 3); | ||||
| RNA_def_property_ui_text(prop, "Diffuse Bounces", "Number of time the light is reinjected inside light grids, " | RNA_def_property_ui_text(prop, "Diffuse Bounces", "Number of time the light is reinjected inside light grids, " | ||||
| "0 disable indirect diffuse light"); | "0 disable indirect diffuse light"); | ||||
| RNA_def_property_range(prop, 0, INT_MAX); | RNA_def_property_range(prop, 0, INT_MAX); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | ||||
| prop = RNA_def_property(srna, "gi_cubemap_resolution", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "gi_cubemap_resolution", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_items(prop, eevee_shadow_size_items); | RNA_def_property_enum_items(prop, eevee_shadow_size_items); | ||||
| RNA_def_property_enum_default(prop, 512); | RNA_def_property_enum_default(prop, 512); | ||||
| RNA_def_property_ui_text(prop, "Cubemap Size", "Size of every cubemaps"); | RNA_def_property_ui_text(prop, "Cubemap Size", "Size of every cubemaps"); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | ||||
| prop = RNA_def_property(srna, "gi_visibility_resolution", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "gi_visibility_resolution", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_items(prop, eevee_gi_visibility_size_items); | RNA_def_property_enum_items(prop, eevee_gi_visibility_size_items); | ||||
| RNA_def_property_enum_default(prop, 32); | RNA_def_property_enum_default(prop, 32); | ||||
| RNA_def_property_ui_text(prop, "Irradiance Visibility Size", | RNA_def_property_ui_text(prop, "Irradiance Visibility Size", | ||||
| "Size of the shadow map applied to each irradiance sample"); | "Size of the shadow map applied to each irradiance sample"); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | ||||
| prop = RNA_def_property(srna, "gi_show_irradiance", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "gi_show_irradiance", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SHOW_IRRADIANCE); | RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SHOW_IRRADIANCE); | ||||
| RNA_def_property_boolean_default(prop, 0); | RNA_def_property_boolean_default(prop, 0); | ||||
| RNA_def_property_ui_text(prop, "Show Irradiance Cache", "Display irradiance samples in the viewport"); | RNA_def_property_ui_text(prop, "Show Irradiance Cache", "Display irradiance samples in the viewport"); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | ||||
| Show All 35 Lines | static void rna_def_scene_eevee(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "Render Samples", "Number of samples per pixels for rendering"); | RNA_def_property_ui_text(prop, "Render Samples", "Number of samples per pixels for rendering"); | ||||
| RNA_def_property_range(prop, 1, INT_MAX); | RNA_def_property_range(prop, 1, INT_MAX); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | ||||
| prop = RNA_def_property(srna, "use_taa_reprojection", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_taa_reprojection", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_TAA_REPROJECTION); | RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_TAA_REPROJECTION); | ||||
| RNA_def_property_boolean_default(prop, 1); | RNA_def_property_boolean_default(prop, 1); | ||||
| RNA_def_property_ui_text(prop, "Viewport Denoising", "Denoise image using temporal reprojection " | RNA_def_property_ui_text(prop, "Viewport Denoising", "Denoise image using temporal reprojection " | ||||
| "(can leave some ghosting)"); | "(can leave some ghosting)"); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | ||||
| /* Screen Space Subsurface Scattering */ | /* Screen Space Subsurface Scattering */ | ||||
| prop = RNA_def_property(srna, "use_sss", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_sss", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SSS_ENABLED); | RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SSS_ENABLED); | ||||
| RNA_def_property_boolean_default(prop, 0); | RNA_def_property_boolean_default(prop, 0); | ||||
| RNA_def_property_ui_text(prop, "Subsurface Scattering", "Enable screen space subsurface scattering"); | RNA_def_property_ui_text(prop, "Subsurface Scattering", "Enable screen space subsurface scattering"); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | ||||
| Show All 9 Lines | static void rna_def_scene_eevee(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "Jitter Threshold", "Rotate samples that are below this threshold"); | RNA_def_property_ui_text(prop, "Jitter Threshold", "Rotate samples that are below this threshold"); | ||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | RNA_def_property_range(prop, 0.0f, 1.0f); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | ||||
| prop = RNA_def_property(srna, "use_sss_separate_albedo", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_sss_separate_albedo", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SSS_SEPARATE_ALBEDO); | RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SSS_SEPARATE_ALBEDO); | ||||
| RNA_def_property_boolean_default(prop, 0); | RNA_def_property_boolean_default(prop, 0); | ||||
| RNA_def_property_ui_text(prop, "Separate Albedo", "Avoid albedo being blured by the subsurface scattering " | RNA_def_property_ui_text(prop, "Separate Albedo", "Avoid albedo being blured by the subsurface scattering " | ||||
| "but uses more video memory"); | "but uses more video memory"); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | ||||
| /* Screen Space Reflection */ | /* Screen Space Reflection */ | ||||
| prop = RNA_def_property(srna, "use_ssr", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_ssr", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SSR_ENABLED); | RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SSR_ENABLED); | ||||
| RNA_def_property_boolean_default(prop, 0); | RNA_def_property_boolean_default(prop, 0); | ||||
| RNA_def_property_ui_text(prop, "Screen Space Reflections", "Enable screen space reflection"); | RNA_def_property_ui_text(prop, "Screen Space Reflections", "Enable screen space reflection"); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | ||||
| ▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | static void rna_def_scene_eevee(BlenderRNA *brna) | ||||
| RNA_def_property_range(prop, 1e-6f, FLT_MAX); | RNA_def_property_range(prop, 1e-6f, FLT_MAX); | ||||
| RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3); | RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | ||||
| prop = RNA_def_property(srna, "volumetric_tile_size", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "volumetric_tile_size", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_default(prop, 8); | RNA_def_property_enum_default(prop, 8); | ||||
| RNA_def_property_enum_items(prop, eevee_volumetric_tile_size_items); | RNA_def_property_enum_items(prop, eevee_volumetric_tile_size_items); | ||||
| RNA_def_property_ui_text(prop, "Tile Size", "Control the quality of the volumetric effects " | RNA_def_property_ui_text(prop, "Tile Size", "Control the quality of the volumetric effects " | ||||
| "(lower size increase vram usage and quality)"); | "(lower size increase vram usage and quality)"); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | ||||
| prop = RNA_def_property(srna, "volumetric_samples", PROP_INT, PROP_NONE); | prop = RNA_def_property(srna, "volumetric_samples", PROP_INT, PROP_NONE); | ||||
| RNA_def_property_int_default(prop, 64); | RNA_def_property_int_default(prop, 64); | ||||
| RNA_def_property_ui_text(prop, "Samples", "Number of samples to compute volumetric effects"); | RNA_def_property_ui_text(prop, "Samples", "Number of samples to compute volumetric effects"); | ||||
| RNA_def_property_range(prop, 1, 256); | RNA_def_property_range(prop, 1, 256); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | ||||
| Show All 38 Lines | static void rna_def_scene_eevee(BlenderRNA *brna) | ||||
| RNA_def_property_boolean_default(prop, 1); | RNA_def_property_boolean_default(prop, 1); | ||||
| RNA_def_property_ui_text(prop, "Bent Normals", "Compute main non occluded direction to sample the environment"); | RNA_def_property_ui_text(prop, "Bent Normals", "Compute main non occluded direction to sample the environment"); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | ||||
| prop = RNA_def_property(srna, "use_gtao_bounce", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_gtao_bounce", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_GTAO_BOUNCE); | RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_GTAO_BOUNCE); | ||||
| RNA_def_property_boolean_default(prop, 1); | RNA_def_property_boolean_default(prop, 1); | ||||
| RNA_def_property_ui_text(prop, "Bounces Approximation", "An approximation to simulate light bounces " | RNA_def_property_ui_text(prop, "Bounces Approximation", "An approximation to simulate light bounces " | ||||
| "giving less occlusion on brighter objects"); | "giving less occlusion on brighter objects"); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | ||||
| prop = RNA_def_property(srna, "gtao_factor", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "gtao_factor", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_default(prop, 1.0f); | RNA_def_property_float_default(prop, 1.0f); | ||||
| RNA_def_property_ui_text(prop, "Factor", "Factor for ambient occlusion blending"); | RNA_def_property_ui_text(prop, "Factor", "Factor for ambient occlusion blending"); | ||||
| RNA_def_property_range(prop, 0.0f, FLT_MAX); | RNA_def_property_range(prop, 0.0f, FLT_MAX); | ||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 2); | RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 2); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | ||||
| ▲ Show 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | static void rna_def_scene_eevee(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "use_shadow_high_bitdepth", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_shadow_high_bitdepth", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SHADOW_HIGH_BITDEPTH); | RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_EEVEE_SHADOW_HIGH_BITDEPTH); | ||||
| RNA_def_property_boolean_default(prop, 0); | RNA_def_property_boolean_default(prop, 0); | ||||
| RNA_def_property_ui_text(prop, "High Bitdepth", "Use 32bit shadows"); | RNA_def_property_ui_text(prop, "High Bitdepth", "Use 32bit shadows"); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); | ||||
| } | } | ||||
| static void rna_def_scene_lanpr(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| static const EnumPropertyItem DEBUG_rna_enum_lanpr_reload[] = { | |||||
| {0, "IDLE", 0, "Idle", "Idle"}, | |||||
aligorith: There's no need for the icons here, especially if you're only going to set them to all be the… | |||||
| {1, "RELOAD", 0, "RELOAD", "Force reload the scene"}, | |||||
| {0, NULL, 0, NULL, NULL} | |||||
| }; | |||||
| static const EnumPropertyItem rna_enum_lanpr_master_mode[] = { | |||||
| {LANPR_MASTER_MODE_SOFTWARE, "SOFTWARE", 0, "Software", "Software edge calculation" }, | |||||
Not Done Inline ActionsAt some point, it would be good to get feedback from the UI team (@venomgfx and @William Reynish (billrey)) about the names/labels used in the interface. Currently, it's unclear to most users what "DPIX", "Snake", and "Lanpr" mean. But this is all stuff that we can easily work on. aligorith: At some point, it would be good to get feedback from the UI team (@venomgfx and @billrey) about… | |||||
| {LANPR_MASTER_MODE_DPIX, "DPIX", 0, "DPIX", "DPIX GPU edge calculation"}, | |||||
| {LANPR_MASTER_MODE_SNAKE, "SNAKE", 0, "Snake", "Image filter and GPU tracing method"}, | |||||
| {0, NULL, 0, NULL, NULL} | |||||
| }; | |||||
| static const EnumPropertyItem rna_enum_lanpr_enable_post_processing[] = { | |||||
| {LANPR_POST_PROCESSING_DISABLED, "DISABLED", 0, "Disabled", "LANPR does not compute anything"}, | |||||
| {LANPR_POST_PROCESSING_ENABLED, "ENABLED", 0, "Enabled", "LANPR will compute feature lines in image post processing"}, | |||||
| {0, NULL, 0, NULL, NULL} | |||||
| }; | |||||
| static const EnumPropertyItem rna_enum_lanpr_display_thinning_result[] = { | |||||
| {LANPR_POST_PROCESSING_DISABLED, "DISABLED", 0, "Edge Detection", "Display edge detector result"}, | |||||
| {LANPR_POST_PROCESSING_ENABLED, "ENABLED", 0, "Thinning", "Apply thinning filters for vector usage"}, | |||||
| {0, NULL, 0, NULL, NULL} | |||||
| }; | |||||
| static const EnumPropertyItem rna_enum_lanpr_use_same_taper[] = { | |||||
| {LANPR_USE_DIFFERENT_TAPER, "DISABLED", 0, "Different", "Use different taper value"}, | |||||
| {LANPR_USE_SAME_TAPER, "ENABLED", 0, "Same", "Use same taper value for both sides of the line"}, | |||||
| {0, NULL, 0, NULL, NULL} | |||||
| }; | |||||
| static const EnumPropertyItem rna_enum_lanpr_enable_tip_extend[] = { | |||||
| {LANPR_DISABLE_TIP_EXTEND, "DISABLED", 0, "Disable", "Do not extend curve tips"}, | |||||
| {LANPR_ENABLE_TIP_EXTEND, "ENABLED", 0, "Enable", "Extend curve tips to a user specified length"}, | |||||
| {0, NULL, 0, NULL, NULL} | |||||
| }; | |||||
| srna = RNA_def_struct(brna, "SceneLANPR", NULL); | |||||
| RNA_def_struct_sdna(srna, "SceneLANPR"); | |||||
| RNA_def_struct_ui_text(srna, "Scene LANPR Config", "LANPR global config"); | |||||
| prop = RNA_def_property(srna, "reloaded", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, DEBUG_rna_enum_lanpr_reload); | |||||
| RNA_def_property_enum_default(prop, 0); | |||||
| RNA_def_property_ui_text(prop, "Reload", "Reload the scene"); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "master_mode", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, rna_enum_lanpr_master_mode); | |||||
| RNA_def_property_enum_default(prop, LANPR_MASTER_MODE_DPIX); | |||||
| RNA_def_property_ui_text(prop, "Master Mode", "Choose calculation mode for NPR Line"); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "enable_vector_trace", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, rna_enum_lanpr_enable_post_processing); | |||||
| RNA_def_property_enum_default(prop, LANPR_POST_PROCESSING_DISABLED); | |||||
| RNA_def_property_ui_text(prop, "Enable Post Processing", "Draw image post processing line or not"); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "display_thinning_result", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, rna_enum_lanpr_display_thinning_result); | |||||
| RNA_def_property_enum_default(prop, LANPR_POST_PROCESSING_DISABLED); | |||||
| RNA_def_property_ui_text(prop, "Display", "Display mode"); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "depth_clamp", PROP_FLOAT, PROP_PERCENTAGE); | |||||
| RNA_def_property_float_default(prop, 0.001f); | |||||
| RNA_def_property_ui_text(prop, "Depth Clamp", "Depth clamp value for edge extraction"); | |||||
| RNA_def_property_ui_range(prop, 0.0, 0.01, 0.0001, 5); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "depth_strength", PROP_FLOAT, PROP_PERCENTAGE); | |||||
| RNA_def_property_float_default(prop, 800); | |||||
| RNA_def_property_ui_text(prop, "Depth Strength", "Depth strength value for edge extraction"); | |||||
| RNA_def_property_ui_range(prop, 0, 1000, 10, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "normal_clamp", PROP_FLOAT, PROP_PERCENTAGE); | |||||
| RNA_def_property_float_default(prop, 2); | |||||
| RNA_def_property_ui_text(prop, "Normal Clamp", "Normal clamp value for edge extraction"); | |||||
| RNA_def_property_ui_range(prop, 0, 5, 0.1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "normal_strength", PROP_FLOAT, PROP_PERCENTAGE); | |||||
| RNA_def_property_float_default(prop, 10); | |||||
| RNA_def_property_ui_text(prop, "Normal Strength", "Normal strength value for edge extraction"); | |||||
| RNA_def_property_ui_range(prop, 0, 20, 1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "line_thickness", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_default(prop, 2.0f); | |||||
| RNA_def_property_ui_text(prop, "Line Thickness", "Thickness of extracted line"); | |||||
| RNA_def_property_ui_range(prop, 0.01f, 10.0f, 0.1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "depth_width_influence", PROP_FLOAT, PROP_PERCENTAGE); | |||||
| RNA_def_property_float_default(prop, 0.3f); | |||||
| RNA_def_property_ui_text(prop, "Width Influence", "Use camera distance to control line width."); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.05, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "depth_width_curve", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_default(prop, 0.3f); | |||||
| RNA_def_property_ui_text(prop, "Width Curve", "Width curve"); | |||||
| RNA_def_property_ui_range(prop, -5.0f, 0.90f, 0.1, 1); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "depth_alpha_influence", PROP_FLOAT, PROP_PERCENTAGE); | |||||
| RNA_def_property_float_default(prop, 0.3f); | |||||
| RNA_def_property_ui_text(prop, "Alpha Influence", "Use camera distance to control line alpha."); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.05, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "depth_alpha_curve", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_default(prop, 0.3f); | |||||
| RNA_def_property_ui_text(prop, "Alpha Curve", "alpha curve"); | |||||
| RNA_def_property_ui_range(prop, -5.0f, 0.90f, 0.1, 1); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "taper_left_distance", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_default(prop, 20.0f); | |||||
| RNA_def_property_ui_text(prop, "Distance Left", "Left side taper distance"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 100.0f, 0.1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "taper_right_distance", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_default(prop, 20.0f); | |||||
| RNA_def_property_ui_text(prop, "Distance right", "Right side taper distance"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 100.0f, 0.1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "taper_left_strength", PROP_FLOAT, PROP_FACTOR); | |||||
| RNA_def_property_float_default(prop, 1.0f); | |||||
| RNA_def_property_ui_text(prop, "Strength left", "Left side taper strength"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "taper_right_strength", PROP_FLOAT, PROP_FACTOR); | |||||
| RNA_def_property_float_default(prop, 1.0f); | |||||
| RNA_def_property_ui_text(prop, "Strength right", "Right side taper strength"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "use_same_taper", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, rna_enum_lanpr_use_same_taper); | |||||
| RNA_def_property_enum_default(prop, LANPR_USE_DIFFERENT_TAPER); | |||||
| RNA_def_property_ui_text(prop, "Taper", "Same/Different taper value"); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "line_color", PROP_FLOAT, PROP_COLOR); | |||||
| RNA_def_property_float_default(prop, 1.0f); | |||||
| RNA_def_property_array(prop, 4); | |||||
| RNA_def_property_ui_text(prop, "Line Color", "Drawing lines using this color"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "background_color", PROP_FLOAT, PROP_COLOR); | |||||
| RNA_def_property_float_default(prop, 1.0f); | |||||
| RNA_def_property_array(prop, 4); | |||||
| RNA_def_property_ui_text(prop, "Background Color", "Background Color"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "enable_tip_extend", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, rna_enum_lanpr_enable_tip_extend); | |||||
| RNA_def_property_enum_default(prop, LANPR_DISABLE_TIP_EXTEND); | |||||
| RNA_def_property_ui_text(prop, "Extend Tips", "Extending tips of curves"); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "extend_length", PROP_FLOAT, PROP_FACTOR); | |||||
| RNA_def_property_float_default(prop, 1.0f); | |||||
| RNA_def_property_ui_text(prop, "Extend Length", "Extend lenght of curves"); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 100.0f, 0.1, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "crease_threshold", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_default(prop, 0.5f); | |||||
| RNA_def_property_ui_text(prop, "Crease Threshold", "cosine value of face angle"); | |||||
| RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.01, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "crease_fade_threshold", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_default(prop, 0.5f); | |||||
| RNA_def_property_ui_text(prop, "Crease Fade", "cosine value of face angle"); | |||||
| RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.01, 2); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_update(prop, NC_SCENE, NULL); | |||||
| prop = RNA_def_property(srna, "enable_intersections", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_default(prop, 1); | |||||
| RNA_def_property_ui_text(prop, "Calculate Intersections", "Calculate Intersections or not"); | |||||
| prop = RNA_def_property(srna, "enable_chaining", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_default(prop, 1); | |||||
| RNA_def_property_ui_text(prop, "Enable Chaining", "Chain Feature Lines After Occlusion Test"); | |||||
| /* these shall go into LANPR_LineLayer */ | |||||
| /* here's the collection stuff.... */ | |||||
| prop = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE); | |||||
| RNA_def_property_collection_sdna(prop, NULL, "line_layers", NULL); | |||||
| RNA_def_property_struct_type(prop, "LANPR_LineLayer"); | |||||
| RNA_def_property_ui_text(prop, "Line Layers", "LANPR Line Layers"); | |||||
| /* this part I refered to gpencil's and freestyle's and it seems that there's no difference */ | |||||
| RNA_def_property_srna(prop, "LineLayers"); | |||||
| srna = RNA_def_struct(brna, "LineLayers", NULL); | |||||
| RNA_def_struct_sdna(srna, "SceneLANPR"); | |||||
| RNA_def_struct_ui_text(srna, "LANPR Line Layers", ""); | |||||
| prop = RNA_def_property(srna, "active_layer", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_struct_type(prop, "LANPR_LineLayer"); | |||||
| RNA_def_property_pointer_funcs(prop, "rna_lanpr_active_line_layer_get", "rna_lanpr_active_line_layer_set", NULL, NULL); | |||||
| RNA_def_property_ui_text(prop, "Active Line Layer", "Active line layer being displayed"); | |||||
| RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); | |||||
| prop = RNA_def_property(srna, "active_layer_index", PROP_INT, PROP_UNSIGNED); | |||||
| RNA_def_property_int_funcs(prop, "rna_lanpr_active_line_layer_index_get", | |||||
| "rna_lanpr_active_line_layer_index_set", | |||||
| "rna_lanpr_active_line_layer_index_range"); | |||||
| RNA_def_property_ui_text(prop, "Active Line Layer Index", "Index of active line layer slot"); | |||||
| RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); | |||||
| } | |||||
| void RNA_def_scene(BlenderRNA *brna) | void RNA_def_scene(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | PropertyRNA *parm; | ||||
| ▲ Show 20 Lines • Show All 432 Lines • ▼ Show 20 Lines | #endif | ||||
| RNA_def_property_struct_type(prop, "SceneDisplay"); | RNA_def_property_struct_type(prop, "SceneDisplay"); | ||||
| RNA_def_property_ui_text(prop, "Scene Display", "Scene display settings for 3d viewport"); | RNA_def_property_ui_text(prop, "Scene Display", "Scene display settings for 3d viewport"); | ||||
| /* EEVEE */ | /* EEVEE */ | ||||
| prop = RNA_def_property(srna, "eevee", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "eevee", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "SceneEEVEE"); | RNA_def_property_struct_type(prop, "SceneEEVEE"); | ||||
| RNA_def_property_ui_text(prop, "EEVEE", "EEVEE settings for the scene"); | RNA_def_property_ui_text(prop, "EEVEE", "EEVEE settings for the scene"); | ||||
| /* LANPR */ | |||||
| prop = RNA_def_property(srna, "lanpr", PROP_POINTER, PROP_NONE); | |||||
| //RNA_def_property_pointer_sdna(prop, NULL, "lanpr"); | |||||
| RNA_def_property_struct_type(prop, "SceneLANPR"); | |||||
| RNA_def_property_ui_text(prop, "LANPR", "LANPR settings for the scene"); | |||||
| /* Nestled Data */ | /* Nestled Data */ | ||||
| /* *** Non-Animated *** */ | /* *** Non-Animated *** */ | ||||
| RNA_define_animate_sdna(false); | RNA_define_animate_sdna(false); | ||||
| rna_def_tool_settings(brna); | rna_def_tool_settings(brna); | ||||
| rna_def_gpencil_interpolate(brna); | rna_def_gpencil_interpolate(brna); | ||||
| rna_def_unified_paint_settings(brna); | rna_def_unified_paint_settings(brna); | ||||
| rna_def_curve_paint_settings(brna); | rna_def_curve_paint_settings(brna); | ||||
| rna_def_statvis(brna); | rna_def_statvis(brna); | ||||
| rna_def_unit_settings(brna); | rna_def_unit_settings(brna); | ||||
| rna_def_scene_image_format_data(brna); | rna_def_scene_image_format_data(brna); | ||||
| rna_def_transform_orientation(brna); | rna_def_transform_orientation(brna); | ||||
| rna_def_selected_uv_element(brna); | rna_def_selected_uv_element(brna); | ||||
| rna_def_display_safe_areas(brna); | rna_def_display_safe_areas(brna); | ||||
| rna_def_scene_display(brna); | rna_def_scene_display(brna); | ||||
| rna_def_scene_eevee(brna); | rna_def_scene_eevee(brna); | ||||
| rna_def_scene_lanpr(brna); | |||||
| RNA_define_animate_sdna(true); | RNA_define_animate_sdna(true); | ||||
| /* *** Animated *** */ | /* *** Animated *** */ | ||||
| rna_def_scene_render_data(brna); | rna_def_scene_render_data(brna); | ||||
| rna_def_gpu_fx(brna); | rna_def_gpu_fx(brna); | ||||
| rna_def_scene_render_view(brna); | rna_def_scene_render_view(brna); | ||||
| /* Scene API */ | /* Scene API */ | ||||
| RNA_api_scene(srna); | RNA_api_scene(srna); | ||||
| } | } | ||||
| #endif | #endif | ||||
There's no need for the icons here, especially if you're only going to set them to all be the same