diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-14 20:55:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-14 20:55:55 +0400 |
commit | ffc9e340b12ffbebbf193f573a3bbe072b9f5df6 (patch) | |
tree | 447a70a6e04bddb073dede542912e94b99bc50ab /source/blender/makesrna/intern/rna_nodetree.c | |
parent | 550824968ce4ecea3718e5744b48812be6c5d554 (diff) |
new scaling options to scale footage without stretching - add stretch/fit/crop to compositor scale node, default behavior isnt changed.
this is only added for the old compositor, will add to the new compositor next.
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 762e5ef0dfa..9567226f722 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -2077,20 +2077,35 @@ static void def_cmp_dilate_erode(StructRNA *srna) static void def_cmp_scale(StructRNA *srna) { PropertyRNA *prop; - + static EnumPropertyItem space_items[] = { - {0, "RELATIVE", 0, "Relative", ""}, - {1, "ABSOLUTE", 0, "Absolute", ""}, - {2, "SCENE_SIZE", 0, "Scene Size", ""}, - {3, "RENDER_SIZE", 0, "Render Size", ""}, + {CMP_SCALE_RELATIVE, "RELATIVE", 0, "Relative", ""}, + {CMP_SCALE_ABSOLUTE, "ABSOLUTE", 0, "Absolute", ""}, + {CMP_SCALE_SCENEPERCENT, "SCENE_SIZE", 0, "Scene Size", ""}, + {CMP_SCALE_RENDERPERCENT, "RENDER_SIZE", 0, "Render Size", ""}, {0, NULL, 0, NULL, NULL} }; + /* matching bgpic_camera_frame_items[] */ + static const EnumPropertyItem space_frame_items[] = { + {0, "STRETCH", 0, "Stretch", ""}, + {CMP_SCALE_RENDERSIZE_FRAME_ASPECT, "FIT", 0, "Fit", ""}, + {CMP_SCALE_RENDERSIZE_FRAME_ASPECT | CMP_SCALE_RENDERSIZE_FRAME_CROP, "CROP", 0, "Crop", ""}, + {0, NULL, 0, NULL, NULL} + }; + prop = RNA_def_property(srna, "space", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, space_items); RNA_def_property_ui_text(prop, "Space", "Coordinate space to scale relative to"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + + /* expose 2 flags as a enum of 3 items */ + prop = RNA_def_property(srna, "frame_method", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "custom2"); + RNA_def_property_enum_items(prop, space_frame_items); + RNA_def_property_ui_text(prop, "Frame Method", "How the image fits in the camera frame"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); } static void def_cmp_rotate(StructRNA *srna) |