Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/blender_object.cpp
| Show First 20 Lines • Show All 429 Lines • ▼ Show 20 Lines | void BlenderSync::sync_motion(BL::RenderSettings &b_render, | ||||
| if (scene->need_motion() == Scene::MOTION_NONE) | if (scene->need_motion() == Scene::MOTION_NONE) | ||||
| return; | return; | ||||
| /* get camera object here to deal with camera switch */ | /* get camera object here to deal with camera switch */ | ||||
| BL::Object b_cam = b_scene.camera(); | BL::Object b_cam = b_scene.camera(); | ||||
| if (b_override) | if (b_override) | ||||
| b_cam = b_override; | b_cam = b_override; | ||||
| Camera prevcam = *(scene->camera); | |||||
| int frame_center = b_scene.frame_current(); | int frame_center = b_scene.frame_current(); | ||||
| float subframe_center = b_scene.frame_subframe(); | float subframe_center = b_scene.frame_subframe(); | ||||
| float frame_center_delta = 0.0f; | float frame_center_delta = 0.0f; | ||||
| if (scene->need_motion() != Scene::MOTION_PASS && | if (scene->need_motion() != Scene::MOTION_PASS && | ||||
| scene->camera->motion_position != Camera::MOTION_POSITION_CENTER) { | scene->camera->motion_position != Camera::MOTION_POSITION_CENTER) { | ||||
| float shuttertime = scene->camera->shuttertime; | float shuttertime = scene->camera->shuttertime; | ||||
| if (scene->camera->motion_position == Camera::MOTION_POSITION_END) { | if (scene->camera->motion_position == Camera::MOTION_POSITION_END) { | ||||
| ▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | void BlenderSync::sync_motion(BL::RenderSettings &b_render, | ||||
| } | } | ||||
| /* we need to set the python thread state again because this | /* we need to set the python thread state again because this | ||||
| * function assumes it is being executed from python and will | * function assumes it is being executed from python and will | ||||
| * try to save the thread state */ | * try to save the thread state */ | ||||
| python_thread_state_restore(python_thread_state); | python_thread_state_restore(python_thread_state); | ||||
| b_engine.frame_set(frame_center, subframe_center); | b_engine.frame_set(frame_center, subframe_center); | ||||
| python_thread_state_save(python_thread_state); | python_thread_state_save(python_thread_state); | ||||
| /* tag camera for motion update */ | |||||
| if (scene->camera->motion_modified(prevcam)) | |||||
| scene->camera->tag_update(); | |||||
| } | } | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||