forked from bartvdbraak/blender
Code cleanup: remove test code to disable motion blur, no longer useful.
This commit is contained in:
parent
a33a5880f7
commit
5cf032678f
@ -222,9 +222,7 @@ void BlenderSync::sync_data(BL::RenderSettings& b_render,
|
|||||||
|
|
||||||
void BlenderSync::sync_integrator()
|
void BlenderSync::sync_integrator()
|
||||||
{
|
{
|
||||||
#ifdef __CAMERA_MOTION__
|
|
||||||
BL::RenderSettings r = b_scene.render();
|
BL::RenderSettings r = b_scene.render();
|
||||||
#endif
|
|
||||||
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
|
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
|
||||||
|
|
||||||
experimental = (get_enum(cscene, "feature_set") != 0);
|
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_direct = get_float(cscene, "sample_clamp_direct");
|
||||||
integrator->sample_clamp_indirect = get_float(cscene, "sample_clamp_indirect");
|
integrator->sample_clamp_indirect = get_float(cscene, "sample_clamp_indirect");
|
||||||
#ifdef __CAMERA_MOTION__
|
|
||||||
if(!preview) {
|
if(!preview) {
|
||||||
if(integrator->motion_blur != r.use_motion_blur()) {
|
if(integrator->motion_blur != r.use_motion_blur()) {
|
||||||
scene->object_manager->tag_update(scene);
|
scene->object_manager->tag_update(scene);
|
||||||
@ -278,7 +275,6 @@ void BlenderSync::sync_integrator()
|
|||||||
|
|
||||||
integrator->motion_blur = r.use_motion_blur();
|
integrator->motion_blur = r.use_motion_blur();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
integrator->method = (Integrator::Method)get_enum(cscene,
|
integrator->method = (Integrator::Method)get_enum(cscene,
|
||||||
"progressive",
|
"progressive",
|
||||||
|
@ -306,7 +306,7 @@ void Camera::update()
|
|||||||
|
|
||||||
void Camera::device_update(Device *device, DeviceScene *dscene, Scene *scene)
|
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();
|
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) {
|
else if(need_motion == Scene::MOTION_BLUR) {
|
||||||
if(use_motion) {
|
if(use_motion) {
|
||||||
transform_motion_decompose(&kcam->motion, &motion, &matrix);
|
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;
|
kcam->have_perspective_motion = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* depth of field */
|
/* depth of field */
|
||||||
kcam->aperturesize = aperturesize;
|
kcam->aperturesize = aperturesize;
|
||||||
@ -379,7 +377,6 @@ void Camera::device_update(Device *device, DeviceScene *dscene, Scene *scene)
|
|||||||
kcam->bladesrotation = bladesrotation;
|
kcam->bladesrotation = bladesrotation;
|
||||||
|
|
||||||
/* motion blur */
|
/* motion blur */
|
||||||
#ifdef __CAMERA_MOTION__
|
|
||||||
kcam->shuttertime = (need_motion == Scene::MOTION_BLUR) ? shuttertime: -1.0f;
|
kcam->shuttertime = (need_motion == Scene::MOTION_BLUR) ? shuttertime: -1.0f;
|
||||||
|
|
||||||
scene->lookup_tables->remove_table(&shutter_table_offset);
|
scene->lookup_tables->remove_table(&shutter_table_offset);
|
||||||
@ -395,9 +392,6 @@ void Camera::device_update(Device *device, DeviceScene *dscene, Scene *scene)
|
|||||||
shutter_table);
|
shutter_table);
|
||||||
kcam->shutter_table_offset = (int)shutter_table_offset;
|
kcam->shutter_table_offset = (int)shutter_table_offset;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
kcam->shuttertime = -1.0f;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* type */
|
/* type */
|
||||||
kcam->type = type;
|
kcam->type = type;
|
||||||
|
@ -2103,12 +2103,8 @@ void MeshManager::device_update(Device *device, DeviceScene *dscene, Scene *scen
|
|||||||
shader->need_update_attributes = false;
|
shader->need_update_attributes = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __OBJECT_MOTION__
|
Scene::MotionType need_motion = scene->need_motion();
|
||||||
Scene::MotionType need_motion = scene->need_motion(device->info.advanced_shading);
|
|
||||||
bool motion_blur = need_motion == Scene::MOTION_BLUR;
|
bool motion_blur = need_motion == Scene::MOTION_BLUR;
|
||||||
#else
|
|
||||||
bool motion_blur = false;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Update objects. */
|
/* Update objects. */
|
||||||
vector<Object *> volume_objects;
|
vector<Object *> volume_objects;
|
||||||
|
@ -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+0], &mtfm.pre, sizeof(float4)*3);
|
||||||
memcpy(&objects_vector[object_index*OBJECT_VECTOR_SIZE+3], &mtfm.post, 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) {
|
else if(state->need_motion == Scene::MOTION_BLUR) {
|
||||||
if(ob->use_motion) {
|
if(ob->use_motion) {
|
||||||
/* decompose transformations for interpolation. */
|
/* decompose transformations for interpolation. */
|
||||||
@ -410,7 +409,6 @@ void ObjectManager::device_update_object_transform(UpdateObejctTransformState *s
|
|||||||
state->have_motion = true;
|
state->have_motion = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Dupli object coords and motion info. */
|
/* Dupli object coords and motion info. */
|
||||||
int totalsteps = mesh->motion_steps;
|
int totalsteps = mesh->motion_steps;
|
||||||
@ -482,7 +480,7 @@ void ObjectManager::device_update_transforms(Device *device,
|
|||||||
Progress& progress)
|
Progress& progress)
|
||||||
{
|
{
|
||||||
UpdateObejctTransformState state;
|
UpdateObejctTransformState state;
|
||||||
state.need_motion = scene->need_motion(device->info.advanced_shading);
|
state.need_motion = scene->need_motion();
|
||||||
state.have_motion = false;
|
state.have_motion = false;
|
||||||
state.have_curves = false;
|
state.have_curves = false;
|
||||||
state.scene = scene;
|
state.scene = scene;
|
||||||
@ -694,14 +692,9 @@ void ObjectManager::apply_static_transforms(DeviceScene *dscene, Scene *scene, u
|
|||||||
|
|
||||||
/* counter mesh users */
|
/* counter mesh users */
|
||||||
map<Mesh*, int> mesh_users;
|
map<Mesh*, int> mesh_users;
|
||||||
#ifdef __OBJECT_MOTION__
|
|
||||||
Scene::MotionType need_motion = scene->need_motion();
|
Scene::MotionType need_motion = scene->need_motion();
|
||||||
bool motion_blur = need_motion == Scene::MOTION_BLUR;
|
bool motion_blur = need_motion == Scene::MOTION_BLUR;
|
||||||
bool apply_to_motion = need_motion != Scene::MOTION_PASS;
|
bool apply_to_motion = need_motion != Scene::MOTION_PASS;
|
||||||
#else
|
|
||||||
bool motion_blur = false;
|
|
||||||
bool apply_to_motion = false;
|
|
||||||
#endif
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
bool have_instancing = false;
|
bool have_instancing = false;
|
||||||
|
|
||||||
|
@ -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)
|
if(integrator->motion_blur)
|
||||||
return (advanced_shading)? MOTION_BLUR: MOTION_NONE;
|
return MOTION_BLUR;
|
||||||
else if(Pass::contains(film->passes, PASS_MOTION))
|
else if(Pass::contains(film->passes, PASS_MOTION))
|
||||||
return MOTION_PASS;
|
return MOTION_PASS;
|
||||||
else
|
else
|
||||||
|
@ -213,7 +213,7 @@ public:
|
|||||||
void need_global_attributes(AttributeRequestSet& attributes);
|
void need_global_attributes(AttributeRequestSet& attributes);
|
||||||
|
|
||||||
enum MotionType { MOTION_NONE = 0, MOTION_PASS, MOTION_BLUR };
|
enum MotionType { MOTION_NONE = 0, MOTION_PASS, MOTION_BLUR };
|
||||||
MotionType need_motion(bool advanced_shading = true);
|
MotionType need_motion();
|
||||||
float motion_shutter_time();
|
float motion_shutter_time();
|
||||||
|
|
||||||
bool need_update();
|
bool need_update();
|
||||||
|
Loading…
Reference in New Issue
Block a user