Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2010-08-10 07:28:06 +0400
committerMatt Ebb <matt@mke3.net>2010-08-10 07:28:06 +0400
commitb525dfb298880ff74116c8217bc07762344fc988 (patch)
tree59d7d2aa2d1e288ef1f6f1304977f77a1ee638c8 /source/blender/makesrna/intern/rna_scene_api.c
parent0d9898ac7341580c13fe0cf231aff370dd3f99b7 (diff)
Added additional (optional) subframe argument to RNA API function: scene.set_frame()
This is used to set the current frame to a floating point subframe state between 0.0 and 1.0 added to the integer frame. A main usage for this is retrieving geometry at sub-frame intervals for use in multi-segment motion blur: http://mke3.net/projects/3Delight_blender/renders/multisegment_blur.mov Example: scene.set_frame(5) or scene.set_frame(5, 0.25)
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_scene_api.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c
index c3b60514d2a..8ec210f2046 100644
--- a/source/blender/makesrna/intern/rna_scene_api.c
+++ b/source/blender/makesrna/intern/rna_scene_api.c
@@ -47,9 +47,11 @@
-static void rna_Scene_set_frame(Scene *scene, int frame)
+static void rna_Scene_set_frame(Scene *scene, int frame, float subframe)
{
scene->r.cfra= frame;
+ scene->r.subframe= subframe;
+
CLAMP(scene->r.cfra, MINAFRAME, MAXFRAME);
scene_update_for_newframe(G.main, scene, (1<<20) - 1);
@@ -107,6 +109,7 @@ void RNA_api_scene(StructRNA *srna)
RNA_def_function_ui_description(func, "Set scene frame updating all objects immediately.");
parm= RNA_def_int(func, "frame", 0, MINAFRAME, MAXFRAME, "", "Frame number to set.", MINAFRAME, MAXFRAME);
RNA_def_property_flag(parm, PROP_REQUIRED);
+ parm= RNA_def_float(func, "subframe", 0.0, 0.0, 1.0, "", "Sub-frame time, between 0.0 and 1.0", 0.0, 1.0);
func= RNA_def_function(srna, "update", "rna_Scene_update_tagged");
RNA_def_function_ui_description(func, "Update data tagged to be updated from previous access to data or operators.");