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) { | |||||
| film->display_pass = update_viewport_display_passes(b_v3d, film->passes, true); | |||||
| } | |||||
| film->exposure = get_float(cscene, "film_exposure"); | film->exposure = get_float(cscene, "film_exposure"); | ||||
brecht: Deduplicate this code with the one in `blender_camera.cpp`. | |||||
| 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); | ||||
Done Inline Actionsfree_memory() -> clear() brecht: `free_memory()` -> `clear()` | |||||
| film->filter_width = (film->filter_type == FILTER_BOX) ? 1.0f : | film->filter_width = (film->filter_type == FILTER_BOX) ? 1.0f : | ||||
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… | |||||
| 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(); | ||||
| film->mist_start = b_mist.start(); | film->mist_start = b_mist.start(); | ||||
| film->mist_depth = b_mist.depth(); | film->mist_depth = b_mist.depth(); | ||||
| switch (b_mist.falloff()) { | switch (b_mist.falloff()) { | ||||
| case BL::WorldMistSettings::falloff_QUADRATIC: | case BL::WorldMistSettings::falloff_QUADRATIC: | ||||
| film->mist_falloff = 2.0f; | film->mist_falloff = 2.0f; | ||||
| break; | break; | ||||
| case BL::WorldMistSettings::falloff_LINEAR: | case BL::WorldMistSettings::falloff_LINEAR: | ||||
| film->mist_falloff = 1.0f; | film->mist_falloff = 1.0f; | ||||
| break; | break; | ||||
| case BL::WorldMistSettings::falloff_INVERSE_QUADRATIC: | case BL::WorldMistSettings::falloff_INVERSE_QUADRATIC: | ||||
| film->mist_falloff = 0.5f; | film->mist_falloff = 0.5f; | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| if (film->modified(prevfilm)) | if (film->modified(prevfilm)) { | ||||
| film->tag_update(scene); | film->tag_update(scene); | ||||
| film->tag_passes_update(scene, prevfilm.passes, false); | |||||
| } | |||||
| } | } | ||||
| /* Render Layer */ | /* Render Layer */ | ||||
| void BlenderSync::sync_view_layer(BL::SpaceView3D & /*b_v3d*/, BL::ViewLayer &b_view_layer) | void BlenderSync::sync_view_layer(BL::SpaceView3D & /*b_v3d*/, BL::ViewLayer &b_view_layer) | ||||
| { | { | ||||
| /* render layer */ | /* render layer */ | ||||
| view_layer.name = b_view_layer.name(); | view_layer.name = b_view_layer.name(); | ||||
| ▲ Show 20 Lines • Show All 486 Lines • Show Last 20 Lines | |||||
Deduplicate this code with the one in blender_camera.cpp.