Revision: 17588
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17588
Author: aligorith
Date: 2008-11-27 00:13:59 +0100 (Thu, 27 Nov 2008)
Log Message:
-----------
Added access for start/end frames in RNA.
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c
2008-11-26 22:52:01 UTC (rev 17587)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c
2008-11-26 23:13:59 UTC (rev 17588)
@@ -55,6 +55,20 @@
}
}
+static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
+{
+ Scene *data= (Scene*)ptr->data;
+ CLAMP(value, 1, data->r.efra);
+ data->r.sfra= value;
+}
+
+static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
+{
+ Scene *data= (Scene*)ptr->data;
+ CLAMP(value, data->r.sfra, 300000);
+ data->r.efra= value;
+}
+
#else
void RNA_def_scene(BlenderRNA *brna)
@@ -105,6 +119,18 @@
RNA_def_property_int_sdna(prop, NULL, "r.cfra");
RNA_def_property_range(prop, MINFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Current Frame", "Current frame.");
+
+ prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_DRIVEABLE);
+ RNA_def_property_int_sdna(prop, NULL, "r.sfra");
+ RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set",
NULL);
+ RNA_def_property_ui_text(prop, "Start Frame", "Start frame.");
+
+ prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NOT_DRIVEABLE);
+ RNA_def_property_int_sdna(prop, NULL, "r.efra");
+ RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
+ RNA_def_property_ui_text(prop, "End Frame", "End frame.");
prop= RNA_def_property(srna, "stamp_note", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata");
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs