Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/blender_sync.cpp
| Show First 20 Lines • Show All 200 Lines • ▼ Show 20 Lines | void BlenderSync::sync_data(BL::RenderSettings &b_render, | ||||
| int width, | int width, | ||||
| int height, | int height, | ||||
| void **python_thread_state) | void **python_thread_state) | ||||
| { | { | ||||
| BL::ViewLayer b_view_layer = b_depsgraph.view_layer_eval(); | BL::ViewLayer b_view_layer = b_depsgraph.view_layer_eval(); | ||||
| sync_view_layer(b_v3d, b_view_layer); | sync_view_layer(b_v3d, b_view_layer); | ||||
| sync_integrator(); | sync_integrator(); | ||||
| sync_film(); | sync_film(b_v3d); | ||||
| sync_shaders(b_depsgraph, b_v3d); | sync_shaders(b_depsgraph, b_v3d); | ||||
| sync_images(); | sync_images(); | ||||
| sync_curve_settings(); | sync_curve_settings(); | ||||
| mesh_synced.clear(); /* use for objects and motion sync */ | mesh_synced.clear(); /* use for objects and motion sync */ | ||||
| if (scene->need_motion() == Scene::MOTION_PASS || scene->need_motion() == Scene::MOTION_NONE || | if (scene->need_motion() == Scene::MOTION_PASS || scene->need_motion() == Scene::MOTION_NONE || | ||||
| scene->camera->motion_position == Camera::MOTION_POSITION_CENTER) { | scene->camera->motion_position == Camera::MOTION_POSITION_CENTER) { | ||||
| ▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | void BlenderSync::sync_integrator() | ||||
| } | } | ||||
| if (integrator->modified(previntegrator)) | if (integrator->modified(previntegrator)) | ||||
| integrator->tag_update(scene); | integrator->tag_update(scene); | ||||
| } | } | ||||
| /* Film */ | /* Film */ | ||||
| void BlenderSync::sync_film() | void BlenderSync::sync_film(BL::SpaceView3D &b_v3d) | ||||
| { | { | ||||
| PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles"); | PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles"); | ||||
| Film *film = scene->film; | Film *film = scene->film; | ||||
| Film prevfilm = *film; | Film prevfilm = *film; | ||||
| if (b_v3d) { | |||||
| PassType display_pass; | |||||
| switch (b_v3d.shading().render_pass()) { | |||||
| default: | |||||
| case BL::View3DShading::render_pass_COMBINED: | |||||
brecht: Deduplicate this code with the one in `blender_camera.cpp`. | |||||
| display_pass = PASS_COMBINED; | |||||
| break; | |||||
Done Inline Actionsfree_memory() -> clear() brecht: `free_memory()` -> `clear()` | |||||
Done Inline ActionsAdd a comment saying we always need a combined pass for now, and that it would be a good optimization to support rendering without combined pass. brecht: Add a comment saying we always need a combined pass for now, and that it would be a good… | |||||
| case BL::View3DShading::render_pass_SHADOW: | |||||
| display_pass = PASS_SHADOW; | |||||
| break; | |||||
| case BL::View3DShading::render_pass_AO: | |||||
| display_pass = PASS_AO; | |||||
| break; | |||||
| case BL::View3DShading::render_pass_NORMAL: | |||||
| display_pass = PASS_NORMAL; | |||||
| break; | |||||
| case BL::View3DShading::render_pass_UV: | |||||
| display_pass = PASS_UV; | |||||
| break; | |||||
| case BL::View3DShading::render_pass_MIST: | |||||
| display_pass = PASS_MIST; | |||||
| break; | |||||
| case BL::View3DShading::render_pass_EMIT: | |||||
| display_pass = PASS_EMISSION; | |||||
| break; | |||||
| case BL::View3DShading::render_pass_ENVIRONMENT: | |||||
| display_pass = PASS_BACKGROUND; | |||||
| break; | |||||
| case BL::View3DShading::render_pass_DIFFUSE_DIRECT: | |||||
| display_pass = PASS_DIFFUSE_DIRECT; | |||||
| break; | |||||
| case BL::View3DShading::render_pass_DIFFUSE_INDIRECT: | |||||
| display_pass = PASS_DIFFUSE_INDIRECT; | |||||
| break; | |||||
| case BL::View3DShading::render_pass_DIFFUSE_COLOR: | |||||
| display_pass = PASS_DIFFUSE_COLOR; | |||||
| break; | |||||
| case BL::View3DShading::render_pass_GLOSSY_DIRECT: | |||||
| display_pass = PASS_GLOSSY_DIRECT; | |||||
| break; | |||||
| case BL::View3DShading::render_pass_GLOSSY_INDIRECT: | |||||
| display_pass = PASS_GLOSSY_INDIRECT; | |||||
| break; | |||||
| case BL::View3DShading::render_pass_GLOSSY_COLOR: | |||||
| display_pass = PASS_GLOSSY_COLOR; | |||||
| break; | |||||
| case BL::View3DShading::render_pass_TRANSMISSION_DIRECT: | |||||
| display_pass = PASS_TRANSMISSION_DIRECT; | |||||
| break; | |||||
| case BL::View3DShading::render_pass_TRANSMISSION_INDIRECT: | |||||
| display_pass = PASS_TRANSMISSION_INDIRECT; | |||||
| break; | |||||
| case BL::View3DShading::render_pass_TRANSMISSION_COLOR: | |||||
| display_pass = PASS_TRANSMISSION_COLOR; | |||||
| break; | |||||
| case BL::View3DShading::render_pass_SUBSURFACE_DIRECT: | |||||
| display_pass = PASS_SUBSURFACE_DIRECT; | |||||
| break; | |||||
| case BL::View3DShading::render_pass_SUBSURFACE_INDIRECT: | |||||
| display_pass = PASS_SUBSURFACE_INDIRECT; | |||||
| break; | |||||
| case BL::View3DShading::render_pass_SUBSURFACE_COLOR: | |||||
| display_pass = PASS_SUBSURFACE_COLOR; | |||||
| break; | |||||
| } | |||||
| film->passes.free_memory(); | |||||
| Pass::add(PASS_COMBINED, film->passes); | |||||
| if (display_pass != PASS_COMBINED) { | |||||
| Pass::add(display_pass, film->passes); | |||||
| } | |||||
| film->display_pass = display_pass; | |||||
| } | |||||
| film->exposure = get_float(cscene, "film_exposure"); | film->exposure = get_float(cscene, "film_exposure"); | ||||
| film->filter_type = (FilterType)get_enum( | film->filter_type = (FilterType)get_enum( | ||||
| cscene, "pixel_filter_type", FILTER_NUM_TYPES, FILTER_BLACKMAN_HARRIS); | cscene, "pixel_filter_type", FILTER_NUM_TYPES, FILTER_BLACKMAN_HARRIS); | ||||
| film->filter_width = (film->filter_type == FILTER_BOX) ? 1.0f : | film->filter_width = (film->filter_type == FILTER_BOX) ? 1.0f : | ||||
| get_float(cscene, "filter_width"); | get_float(cscene, "filter_width"); | ||||
| if (b_scene.world()) { | if (b_scene.world()) { | ||||
| BL::WorldMistSettings b_mist = b_scene.world().mist_settings(); | BL::WorldMistSettings b_mist = b_scene.world().mist_settings(); | ||||
| ▲ Show 20 Lines • Show All 513 Lines • Show Last 20 Lines | |||||
Deduplicate this code with the one in blender_camera.cpp.