[Bf-cycles] Motion Blur Implementation

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Jun 12 11:49:54 CEST 2013


On Wed, Jun 12, 2013 at 6:50 AM, Gavin Howard <gavin.d.howard at gmail.com> wrote:
> First of all, Brecht, you mentioned scene.frame_set(frame, subframe).
> Subframe is between 0.0 and 1.0. Does that mean that I have to get the
> previous frame and set subframes from there if I want to access
> subframes BEFORE the current frame?

You set a frame and subframe at the same time, it's a matter of
converting from some full frame number like 35.879 to 35 and 0.879:

int frame = floorf(full_frame);
float subframe = full_frame - floorf(full_frame);

scene.frame_set(frame, subframe);

> Also, I have found the part of the code that I need to modify to add
> multi-step export. However, I have run into a snag: an unknown
> variable. In the function BlenderSync::sync_motion() on line 473 of
> intern/cycles/blender/blender_object.cpp, it has the for loop that
> sets the frames. In the for loop, the controlling variable is called
> motion. I have noticed that motion is used within functions called by
> sync_motion(), like sync_camera_motion() and sync_objects(). I have
> taken a look inside those functions, and I can't figure out what
> motion is for, but I know that I can't modify its use without breaking
> something. I would like to know what motion's purpose is. Maybe that
> way I can figure out a way to modify its use safely, or maybe change
> things around completely if necessary.

motion is either 0, -1 or 1 depending if the current frame (and all
other data), previous frame motion or next frame motion is exported.

> One last question: it is now BCon3, which is fixing only. No new
> features. Technically, the patch that I am working on (using shutter
> time for motion blur) could be considered a new feature. It will
> definitely be a new feature if I add in multi-step export, which looks
> like it could be very easy to add once I get this working. Brecht,
> Ton, if I get this done before BCon4, could it still be added for
> release? If so, should it be only the shutter time patch, or can I
> include the multi-step export? (Oh, by the way, I have already
> submitted a patch to change the UI for multi-step export.) If it
> cannot be added for 2.68, should I submit it after release, or simply
> put it into my branch to wait until my GSoC project is finished?

Probably it's best to leave this for after the release, since I don't
think multi step would be very easy to add, it requires changes to the
kernel too.


More information about the Bf-cycles mailing list