Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_camera.c
| Show First 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | |||||
| #else | #else | ||||
| static void rna_def_camera_background_image(BlenderRNA *brna) | static void rna_def_camera_background_image(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| static const EnumPropertyItem bgpic_source_items[] = { | static const EnumPropertyItem bgpic_source_items[] = { | ||||
brecht: I'm not sure why -10..10 limits were added here. If the intent was only to get a better step… | |||||
| {CAM_BGIMG_SOURCE_IMAGE, "IMAGE", 0, "Image", ""}, | {CAM_BGIMG_SOURCE_IMAGE, "IMAGE", 0, "Image", ""}, | ||||
| {CAM_BGIMG_SOURCE_MOVIE, "MOVIE_CLIP", 0, "Movie Clip", ""}, | {CAM_BGIMG_SOURCE_MOVIE, "MOVIE_CLIP", 0, "Movie Clip", ""}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| static const EnumPropertyItem bgpic_camera_frame_items[] = { | static const EnumPropertyItem bgpic_camera_frame_items[] = { | ||||
| {0, "STRETCH", 0, "Stretch", ""}, | {0, "STRETCH", 0, "Stretch", ""}, | ||||
| {CAM_BGIMG_FLAG_CAMERA_ASPECT, "FIT", 0, "Fit", ""}, | {CAM_BGIMG_FLAG_CAMERA_ASPECT, "FIT", 0, "Fit", ""}, | ||||
| ▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | static void rna_def_camera_background_image(BlenderRNA *brna) | ||||
| 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_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | ||||
| prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_FACTOR); | ||||
| 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.001, RNA_TRANSLATION_PREC_DEFAULT); | |||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, 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(prop, "Rotation", "Rotation for the background image (ortho view only)"); | RNA_def_property_ui_text(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_SPACE | ND_SPACE_VIEW3D, 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); | ||||
| ▲ Show 20 Lines • Show All 428 Lines • Show Last 20 Lines | |||||
I'm not sure why -10..10 limits were added here. If the intent was only to get a better step size and precision then I think "-FLT_MAX" and "FLT_MAX" would be better as soft limits.