diff options
author | Thomas Dinges <blender@dingto.org> | 2010-08-17 13:59:55 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2010-08-17 13:59:55 +0400 |
commit | a3d28f4899f2bfb60d053b556aefda780e4eb77d (patch) | |
tree | 1e8b4b053f29ebff67d351dcc212863e106e6385 /source/blender/makesrna | |
parent | 13da233a628edad4b5b3b02ff720987ce2fb78c5 (diff) |
2.5 Nodes:
* Range Limit function for Image Output Frame Start/End properties.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index b5a11b8619c..b3714c3d4ed 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -139,6 +139,24 @@ static void rna_Matte_t2_set(PointerRNA *ptr, float value) chroma->t2 = value; } +static void rna_Image_start_frame_set(PointerRNA *ptr, int value) +{ + bNode *node= (bNode*)ptr->data; + NodeImageFile *image = node->storage; + + CLAMP(value, MINFRAME, image->efra); + image->sfra= value; +} + +static void rna_Image_end_frame_set(PointerRNA *ptr, int value) +{ + bNode *node= (bNode*)ptr->data; + NodeImageFile *image = node->storage; + + CLAMP(value, image->sfra, MAXFRAME); + image->efra= value; +} + static void node_update(Main *bmain, Scene *scene, bNodeTree *ntree, bNode *node) { ED_node_generic_update(bmain, scene, ntree, node); @@ -1146,16 +1164,17 @@ static void def_cmp_output_file(StructRNA *srna) RNA_def_property_range(prop, 1, 100); RNA_def_property_ui_text(prop, "Quality", ""); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); - - // TODO: should these be limited to the extents of the each other so that no cross-over occurs? + prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "sfra"); + RNA_def_property_int_funcs(prop, NULL, "rna_Image_start_frame_set", NULL); RNA_def_property_range(prop, MINFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Start Frame", ""); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "efra"); + RNA_def_property_int_funcs(prop, NULL, "rna_Image_end_frame_set", NULL); RNA_def_property_range(prop, MINFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "End Frame", ""); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); |