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) { | |||||
| /* Retrieve pass from `View3DShading.cycles.render_pass` */ | |||||
| BL::View3DShading b_view3dshading = b_v3d.shading(); | |||||
| PointerRNA cshading = RNA_pointer_get(&b_view3dshading.ptr, "cycles"); | |||||
| PassType display_pass = (PassType)get_enum(cshading, "render_pass", -1, -1); | |||||
brecht: Deduplicate this code with the one in `blender_camera.cpp`. | |||||
| film->passes.free_memory(); | |||||
Done Inline Actionsfree_memory() -> clear() brecht: `free_memory()` -> `clear()` | |||||
| Pass::add(PASS_COMBINED, film->passes); | |||||
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… | |||||
| 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.