Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_camera.c
| Show First 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | RNA_def_struct_ui_text( | ||||
| srna, "Background Image", "Image and settings for display in the 3D View background"); | srna, "Background Image", "Image and settings for display in the 3D View background"); | ||||
| RNA_define_lib_overridable(true); | RNA_define_lib_overridable(true); | ||||
| prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "source"); | RNA_def_property_enum_sdna(prop, NULL, "source"); | ||||
| RNA_def_property_enum_items(prop, bgpic_source_items); | RNA_def_property_enum_items(prop, bgpic_source_items); | ||||
| RNA_def_property_ui_text(prop, "Background Source", "Data source used for background"); | RNA_def_property_ui_text(prop, "Background Source", "Data source used for background"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); | ||||
| prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "ima"); | RNA_def_property_pointer_sdna(prop, NULL, "ima"); | ||||
| RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space"); | RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space"); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | RNA_def_property_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); | ||||
| prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "clip"); | RNA_def_property_pointer_sdna(prop, NULL, "clip"); | ||||
| RNA_def_property_ui_text(prop, "MovieClip", "Movie clip displayed and edited in this space"); | RNA_def_property_ui_text(prop, "MovieClip", "Movie clip displayed and edited in this space"); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | RNA_def_property_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); | RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); | ||||
| prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_flag(prop, PROP_NEVER_NULL); | RNA_def_property_flag(prop, PROP_NEVER_NULL); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "iuser"); | RNA_def_property_pointer_sdna(prop, NULL, "iuser"); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, | prop, | ||||
| "Image User", | "Image User", | ||||
| "Parameters defining which layer, pass and frame of the image is displayed"); | "Parameters defining which layer, pass and frame of the image is displayed"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); | ||||
| prop = RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_flag(prop, PROP_NEVER_NULL); | RNA_def_property_flag(prop, PROP_NEVER_NULL); | ||||
| RNA_def_property_struct_type(prop, "MovieClipUser"); | RNA_def_property_struct_type(prop, "MovieClipUser"); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "cuser"); | RNA_def_property_pointer_sdna(prop, NULL, "cuser"); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Clip User", "Parameters defining which frame of the movie clip is displayed"); | prop, "Clip User", "Parameters defining which frame of the movie clip is displayed"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); | ||||
| prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_XYZ); | prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_XYZ); | ||||
| RNA_def_property_float_sdna(prop, NULL, "offset"); | RNA_def_property_float_sdna(prop, NULL, "offset"); | ||||
| RNA_def_property_ui_text(prop, "Offset", ""); | RNA_def_property_ui_text(prop, "Offset", ""); | ||||
| RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 0.1, RNA_TRANSLATION_PREC_DEFAULT); | RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 0.1, RNA_TRANSLATION_PREC_DEFAULT); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); | ||||
| prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_float_sdna(prop, NULL, "scale"); | RNA_def_property_float_sdna(prop, NULL, "scale"); | ||||
| RNA_def_property_ui_text(prop, "Scale", "Scale the background image"); | RNA_def_property_ui_text(prop, "Scale", "Scale the background image"); | ||||
| RNA_def_property_range(prop, 0.0, FLT_MAX); | RNA_def_property_range(prop, 0.0, FLT_MAX); | ||||
| RNA_def_property_ui_range(prop, 0.0, 10.0, 0.100, RNA_TRANSLATION_PREC_DEFAULT); | RNA_def_property_ui_range(prop, 0.0, 10.0, 0.100, RNA_TRANSLATION_PREC_DEFAULT); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); | ||||
| prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ANGLE); | prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ANGLE); | ||||
| RNA_def_property_float_sdna(prop, NULL, "rotation"); | RNA_def_property_float_sdna(prop, NULL, "rotation"); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Rotation", "Rotation for the background image (ortho view only)"); | prop, "Rotation", "Rotation for the background image (ortho view only)"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); | ||||
| prop = RNA_def_property(srna, "use_flip_x", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_flip_x", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_BGIMG_FLAG_FLIP_X); | RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_BGIMG_FLAG_FLIP_X); | ||||
| RNA_def_property_ui_text(prop, "Flip Horizontally", "Flip the background image horizontally"); | RNA_def_property_ui_text(prop, "Flip Horizontally", "Flip the background image horizontally"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); | ||||
| prop = RNA_def_property(srna, "use_flip_y", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_flip_y", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_BGIMG_FLAG_FLIP_Y); | RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_BGIMG_FLAG_FLIP_Y); | ||||
| RNA_def_property_ui_text(prop, "Flip Vertically", "Flip the background image vertically"); | RNA_def_property_ui_text(prop, "Flip Vertically", "Flip the background image vertically"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); | ||||
| prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_float_sdna(prop, NULL, "alpha"); | RNA_def_property_float_sdna(prop, NULL, "alpha"); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Opacity", "Image opacity to blend the image against the background color"); | prop, "Opacity", "Image opacity to blend the image against the background color"); | ||||
| RNA_def_property_range(prop, 0.0, 1.0); | RNA_def_property_range(prop, 0.0, 1.0); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); | ||||
| prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE); | RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_BGIMG_FLAG_EXPANDED); | RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_BGIMG_FLAG_EXPANDED); | ||||
| RNA_def_property_ui_text(prop, "Show Expanded", "Show the expanded in the user interface"); | RNA_def_property_ui_text(prop, "Show Expanded", "Show the expanded in the user interface"); | ||||
| RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1); | RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1); | ||||
| prop = RNA_def_property(srna, "use_camera_clip", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_camera_clip", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_BGIMG_FLAG_CAMERACLIP); | RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_BGIMG_FLAG_CAMERACLIP); | ||||
| RNA_def_property_ui_text(prop, "Camera Clip", "Use movie clip from active scene camera"); | RNA_def_property_ui_text(prop, "Camera Clip", "Use movie clip from active scene camera"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); | ||||
| prop = RNA_def_property(srna, "show_background_image", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "show_background_image", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CAM_BGIMG_FLAG_DISABLED); | RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CAM_BGIMG_FLAG_DISABLED); | ||||
| RNA_def_property_ui_text(prop, "Show Background Image", "Show this image as background"); | RNA_def_property_ui_text(prop, "Show Background Image", "Show this image as background"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); | ||||
| prop = RNA_def_property(srna, "show_on_foreground", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "show_on_foreground", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_BGIMG_FLAG_FOREGROUND); | RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_BGIMG_FLAG_FOREGROUND); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Show On Foreground", "Show this image in front of objects in viewport"); | prop, "Show On Foreground", "Show this image in front of objects in viewport"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); | ||||
| /* expose 1 flag as a enum of 2 items */ | /* expose 1 flag as a enum of 2 items */ | ||||
| prop = RNA_def_property(srna, "display_depth", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "display_depth", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); | RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); | ||||
| RNA_def_property_enum_items(prop, bgpic_display_depth_items); | RNA_def_property_enum_items(prop, bgpic_display_depth_items); | ||||
| RNA_def_property_ui_text(prop, "Depth", "Display under or over everything"); | RNA_def_property_ui_text(prop, "Depth", "Display under or over everything"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); | ||||
| /* expose 2 flags as a enum of 3 items */ | /* expose 2 flags as a enum of 3 items */ | ||||
| prop = RNA_def_property(srna, "frame_method", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "frame_method", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); | RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); | ||||
| RNA_def_property_enum_items(prop, bgpic_camera_frame_items); | RNA_def_property_enum_items(prop, bgpic_camera_frame_items); | ||||
| RNA_def_property_ui_text(prop, "Frame Method", "How the image fits in the camera frame"); | RNA_def_property_ui_text(prop, "Frame Method", "How the image fits in the camera frame"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); | ||||
| RNA_define_lib_overridable(false); | RNA_define_lib_overridable(false); | ||||
| } | } | ||||
| static void rna_def_camera_background_images(BlenderRNA *brna, PropertyRNA *cprop) | static void rna_def_camera_background_images(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| ▲ Show 20 Lines • Show All 429 Lines • ▼ Show 20 Lines | void RNA_def_camera(BlenderRNA *brna) | ||||
| RNA_def_property_struct_type(prop, "CameraDOFSettings"); | RNA_def_property_struct_type(prop, "CameraDOFSettings"); | ||||
| RNA_def_property_ui_text(prop, "Depth Of Field", ""); | RNA_def_property_ui_text(prop, "Depth Of Field", ""); | ||||
| RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); | RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); | ||||
| prop = RNA_def_property(srna, "background_images", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "background_images", PROP_COLLECTION, PROP_NONE); | ||||
| RNA_def_property_collection_sdna(prop, NULL, "bg_images", NULL); | RNA_def_property_collection_sdna(prop, NULL, "bg_images", NULL); | ||||
| RNA_def_property_struct_type(prop, "CameraBackgroundImage"); | RNA_def_property_struct_type(prop, "CameraBackgroundImage"); | ||||
| RNA_def_property_ui_text(prop, "Background Images", "List of background images"); | RNA_def_property_ui_text(prop, "Background Images", "List of background images"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); | ||||
| RNA_define_lib_overridable(false); | RNA_define_lib_overridable(false); | ||||
| rna_def_animdata_common(srna); | rna_def_animdata_common(srna); | ||||
| rna_def_camera_background_image(brna); | rna_def_camera_background_image(brna); | ||||
| rna_def_camera_background_images(brna, prop); | rna_def_camera_background_images(brna, prop); | ||||
| Show All 12 Lines | |||||