Code cleanup: remove test code to disable motion blur, no longer useful.

This commit is contained in:
Brecht Van Lommel 2018-01-12 19:56:52 +01:00
parent a33a5880f7
commit 5cf032678f
6 changed files with 6 additions and 27 deletions

View File

@ -222,9 +222,7 @@ void BlenderSync::sync_data(BL::RenderSettings& b_render,
void BlenderSync::sync_integrator()
{
#ifdef __CAMERA_MOTION__
BL::RenderSettings r = b_scene.render();
#endif
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
experimental = (get_enum(cscene, "feature_set") != 0);
@ -269,7 +267,6 @@ void BlenderSync::sync_integrator()
integrator->sample_clamp_direct = get_float(cscene, "sample_clamp_direct");
integrator->sample_clamp_indirect = get_float(cscene, "sample_clamp_indirect");
#ifdef __CAMERA_MOTION__
if(!preview) {
if(integrator->motion_blur != r.use_motion_blur()) {
scene->object_manager->tag_update(scene);
@ -278,7 +275,6 @@ void BlenderSync::sync_integrator()
integrator->motion_blur = r.use_motion_blur();
}
#endif
integrator->method = (Integrator::Method)get_enum(cscene,
"progressive",

View File

@ -306,7 +306,7 @@ void Camera::update()
void Camera::device_update(Device *device, DeviceScene *dscene, Scene *scene)
{
Scene::MotionType need_motion = scene->need_motion(device->info.advanced_shading);
Scene::MotionType need_motion = scene->need_motion();
update();
@ -359,7 +359,6 @@ void Camera::device_update(Device *device, DeviceScene *dscene, Scene *scene)
}
}
}
#ifdef __CAMERA_MOTION__
else if(need_motion == Scene::MOTION_BLUR) {
if(use_motion) {
transform_motion_decompose(&kcam->motion, &motion, &matrix);
@ -370,7 +369,6 @@ void Camera::device_update(Device *device, DeviceScene *dscene, Scene *scene)
kcam->have_perspective_motion = 1;
}
}
#endif
/* depth of field */
kcam->aperturesize = aperturesize;
@ -379,7 +377,6 @@ void Camera::device_update(Device *device, DeviceScene *dscene, Scene *scene)
kcam->bladesrotation = bladesrotation;
/* motion blur */
#ifdef __CAMERA_MOTION__
kcam->shuttertime = (need_motion == Scene::MOTION_BLUR) ? shuttertime: -1.0f;
scene->lookup_tables->remove_table(&shutter_table_offset);
@ -395,9 +392,6 @@ void Camera::device_update(Device *device, DeviceScene *dscene, Scene *scene)
shutter_table);
kcam->shutter_table_offset = (int)shutter_table_offset;
}
#else
kcam->shuttertime = -1.0f;
#endif
/* type */
kcam->type = type;

View File

@ -2103,12 +2103,8 @@ void MeshManager::device_update(Device *device, DeviceScene *dscene, Scene *scen
shader->need_update_attributes = false;
}
#ifdef __OBJECT_MOTION__
Scene::MotionType need_motion = scene->need_motion(device->info.advanced_shading);
Scene::MotionType need_motion = scene->need_motion();
bool motion_blur = need_motion == Scene::MOTION_BLUR;
#else
bool motion_blur = false;
#endif
/* Update objects. */
vector<Object *> volume_objects;

View File

@ -398,7 +398,6 @@ void ObjectManager::device_update_object_transform(UpdateObejctTransformState *s
memcpy(&objects_vector[object_index*OBJECT_VECTOR_SIZE+0], &mtfm.pre, sizeof(float4)*3);
memcpy(&objects_vector[object_index*OBJECT_VECTOR_SIZE+3], &mtfm.post, sizeof(float4)*3);
}
#ifdef __OBJECT_MOTION__
else if(state->need_motion == Scene::MOTION_BLUR) {
if(ob->use_motion) {
/* decompose transformations for interpolation. */
@ -410,7 +409,6 @@ void ObjectManager::device_update_object_transform(UpdateObejctTransformState *s
state->have_motion = true;
}
}
#endif
/* Dupli object coords and motion info. */
int totalsteps = mesh->motion_steps;
@ -482,7 +480,7 @@ void ObjectManager::device_update_transforms(Device *device,
Progress& progress)
{
UpdateObejctTransformState state;
state.need_motion = scene->need_motion(device->info.advanced_shading);
state.need_motion = scene->need_motion();
state.have_motion = false;
state.have_curves = false;
state.scene = scene;
@ -694,14 +692,9 @@ void ObjectManager::apply_static_transforms(DeviceScene *dscene, Scene *scene, u
/* counter mesh users */
map<Mesh*, int> mesh_users;
#ifdef __OBJECT_MOTION__
Scene::MotionType need_motion = scene->need_motion();
bool motion_blur = need_motion == Scene::MOTION_BLUR;
bool apply_to_motion = need_motion != Scene::MOTION_PASS;
#else
bool motion_blur = false;
bool apply_to_motion = false;
#endif
int i = 0;
bool have_instancing = false;

View File

@ -291,10 +291,10 @@ void Scene::device_update(Device *device_, Progress& progress)
}
}
Scene::MotionType Scene::need_motion(bool advanced_shading)
Scene::MotionType Scene::need_motion()
{
if(integrator->motion_blur)
return (advanced_shading)? MOTION_BLUR: MOTION_NONE;
return MOTION_BLUR;
else if(Pass::contains(film->passes, PASS_MOTION))
return MOTION_PASS;
else

View File

@ -213,7 +213,7 @@ public:
void need_global_attributes(AttributeRequestSet& attributes);
enum MotionType { MOTION_NONE = 0, MOTION_PASS, MOTION_BLUR };
MotionType need_motion(bool advanced_shading = true);
MotionType need_motion();
float motion_shutter_time();
bool need_update();