|
Blender
V2.93
|
#include <iostream>#include <map>#include <set>#include "../application/AppCanvas.h"#include "../application/AppConfig.h"#include "../application/AppView.h"#include "../application/Controller.h"#include "BlenderStrokeRenderer.h"#include "MEM_guardedalloc.h"#include "DNA_camera_types.h"#include "DNA_collection_types.h"#include "DNA_freestyle_types.h"#include "DNA_material_types.h"#include "DNA_text_types.h"#include "BKE_callbacks.h"#include "BKE_context.h"#include "BKE_freestyle.h"#include "BKE_global.h"#include "BKE_lib_id.h"#include "BKE_linestyle.h"#include "BKE_scene.h"#include "BKE_text.h"#include "BLT_translation.h"#include "BLI_blenlib.h"#include "BLI_math.h"#include "BLI_math_color_blend.h"#include "BPY_extern.h"#include "DEG_depsgraph_query.h"#include "pipeline.h"#include "FRS_freestyle.h"Go to the source code of this file.
Classes | |
| struct | edge_type_condition |
Macros | |
| #define | DEFAULT_SPHERE_RADIUS 1.0f |
| #define | DEFAULT_DKR_EPSILON 0.0f |
Variables | |
| struct FreestyleGlobals | g_freestyle |
| static bool | freestyle_is_initialized = false |
| static Config::Path * | pathconfig = nullptr |
| static Controller * | controller = nullptr |
| static AppView * | view = nullptr |
| static FreestyleLineSet | lineset_buffer |
| static bool | lineset_copied = false |
| static bCallbackFuncStore | load_post_callback_funcstore |
| #define DEFAULT_DKR_EPSILON 0.0f |
Definition at line 69 of file FRS_freestyle.cpp.
| #define DEFAULT_SPHERE_RADIUS 1.0f |
Definition at line 68 of file FRS_freestyle.cpp.
|
static |
Definition at line 195 of file FRS_freestyle.cpp.
References BLI_sprintfN(), escape_quotes(), and MEM_freeN.
Referenced by prepare().
|
static |
Definition at line 573 of file FRS_freestyle.cpp.
References count, ListBase::first, ViewLayer::freestyle_config, FREESTYLE_CONTROL_EDITOR_MODE, FREESTYLE_CONTROL_SCRIPT_MODE, FREESTYLE_LINESET_ENABLED, FreestyleConfig::linesets, FreestyleConfig::mode, module, and FreestyleConfig::modules.
Referenced by FRS_is_freestyle_enabled().
|
static |
Definition at line 181 of file FRS_freestyle.cpp.
References MEM_mallocN.
Referenced by create_lineset_handler().
| void FRS_begin_stroke_rendering | ( | Render * | UNUSEDre | ) |
Definition at line 622 of file FRS_freestyle.cpp.
Definition at line 496 of file FRS_freestyle.cpp.
References blend_color_mix_float(), FreestyleConfig::flags, FREESTYLE_AS_RENDER_PASS, ViewLayer::freestyle_config, G, G_DEBUG_FREESTYLE, ViewLayer::name, RE_create_render_pass(), RE_GetRenderLayer(), RE_PASSNAME_COMBINED, RE_PASSNAME_FREESTYLE, RE_RenderLayerGetPass(), Render::rectx, RenderLayer::rectx, Render::recty, RenderLayer::recty, render_get_active_layer(), Render::result, Render::viewname, x, and y.
Referenced by FRS_do_stroke_rendering().
| void FRS_copy_active_lineset | ( | FreestyleConfig * | config | ) |
Definition at line 716 of file FRS_freestyle.cpp.
References BKE_freestyle_lineset_get_active(), FreestyleLineSet::edge_types, FreestyleLineSet::exclude_edge_types, FreestyleLineSet::flags, FreestyleLineSet::group, lineset_buffer, lineset_copied, FreestyleLineSet::linestyle, FreestyleLineSet::name, FreestyleLineSet::qi, FreestyleLineSet::qi_end, FreestyleLineSet::qi_start, and FreestyleLineSet::selection.
| Material* FRS_create_stroke_material | ( | Main * | bmain, |
| struct FreestyleLineStyle * | linestyle | ||
| ) |
Definition at line 793 of file FRS_freestyle.cpp.
References Material::id, linestyle, FreestyleLineStyle::nodetree, ID::us, and FreestyleLineStyle::use_nodes.
| void FRS_delete_active_lineset | ( | FreestyleConfig * | config | ) |
Definition at line 772 of file FRS_freestyle.cpp.
References BKE_freestyle_lineset_delete(), and BKE_freestyle_lineset_get_active().
Definition at line 626 of file FRS_freestyle.cpp.
References Freestyle::Controller::_ViewMap, BKE_scene_graph_update_for_newframe(), BLI_findstring(), Freestyle::Controller::CloseFile(), controller, DAG_EVAL_RENDER, DEG_get_evaluated_object(), DEG_get_evaluated_scene(), DEG_graph_free(), DEG_graph_new(), depsgraph, Freestyle::Controller::DrawStrokes(), FreestyleConfig::flags, ViewLayer::freestyle_config, FREESTYLE_VIEW_MAP_CACHE, FRS_composite_result(), G, G_DEBUG_FREESTYLE, g_freestyle, Render::i, Scene::id, RenderStats::infostr, Render::main, FreestyleGlobals::mv, ViewLayer::name, ID::name, prepare(), FreestyleGlobals::proj, RE_FreeRender(), RE_GetCamera(), RE_GetCameraWindow(), Freestyle::Controller::RenderStrokes(), FreestyleGlobals::scene, Render::scene, Render::sdh, Freestyle::Controller::setRenderMonitor(), Freestyle::Controller::setViewMapCache(), Render::stats_draw, Render::tbh, Render::test_break, TIP_, unit_m4(), Scene::view_layers, FreestyleGlobals::viewpoint, and zero_v3().
| void FRS_end_stroke_rendering | ( | Render * | re | ) |
Definition at line 695 of file FRS_freestyle.cpp.
References Freestyle::Controller::Clear(), and controller.
| void FRS_exit | ( | void | ) |
Definition at line 130 of file FRS_freestyle.cpp.
References controller, pathconfig, and view.
Referenced by RE_FreeAllRender().
| void FRS_free_view_map_cache | ( | void | ) |
Definition at line 701 of file FRS_freestyle.cpp.
References controller, Freestyle::Controller::DeleteViewMap(), G, and G_DEBUG_FREESTYLE.
| void FRS_init | ( | void | ) |
Definition at line 103 of file FRS_freestyle.cpp.
References BKE_callback_add(), BKE_CB_EVT_LOAD_POST, Freestyle::Controller::Clear(), controller, freestyle_is_initialized, g_freestyle, lineset_copied, load_post_callback_funcstore, pathconfig, FreestyleGlobals::scene, Freestyle::Controller::setView(), and view.
Referenced by main().
| void FRS_init_stroke_renderer | ( | Render * | re | ) |
Definition at line 608 of file FRS_freestyle.cpp.
References controller, G, G_DEBUG_FREESTYLE, init_view(), and Freestyle::Controller::ResetRenderCount().
| int FRS_is_freestyle_enabled | ( | ViewLayer * | view_layer | ) |
Definition at line 602 of file FRS_freestyle.cpp.
References displayed_layer_count(), ViewLayer::flag, VIEW_LAYER_FREESTYLE, and VIEW_LAYER_RENDER.
| bool FRS_move_active_lineset | ( | FreestyleConfig * | config, |
| int | direction | ||
| ) |
Reinsert the active lineset at an offset direction from current position.
Definition at line 785 of file FRS_freestyle.cpp.
References BKE_freestyle_lineset_get_active(), BLI_listbase_link_move(), and FreestyleConfig::linesets.
| void FRS_paste_active_lineset | ( | FreestyleConfig * | config | ) |
Definition at line 735 of file FRS_freestyle.cpp.
References BKE_freestyle_lineset_get_active(), BKE_freestyle_lineset_unique_name(), FreestyleLineSet::edge_types, FreestyleLineSet::exclude_edge_types, FreestyleLineSet::flags, FREESTYLE_LINESET_CURRENT, FreestyleLineSet::group, Collection::id, FreestyleLineStyle::id, id_us_min(), id_us_plus(), lineset_buffer, lineset_copied, FreestyleLineSet::linestyle, FreestyleLineSet::name, FreestyleLineSet::qi, FreestyleLineSet::qi_end, FreestyleLineSet::qi_start, and FreestyleLineSet::selection.
| void FRS_set_context | ( | bContext * | C | ) |
Definition at line 122 of file FRS_freestyle.cpp.
References C, controller, CTX_data_scene(), G, G_DEBUG_FREESTYLE, and Freestyle::Controller::setContext().
Referenced by main().
|
static |
Definition at line 141 of file FRS_freestyle.cpp.
References Render::disprect, G, G_DEBUG_FREESTYLE, g_freestyle, height, RenderData::line_thickness_mode, RenderData::mode, Render::r, R_BORDER, R_LINE_THICKNESS_ABSOLUTE, R_LINE_THICKNESS_RELATIVE, Freestyle::AppView::setBorder(), Freestyle::AppView::setHeight(), Freestyle::AppView::setThickness(), Freestyle::AppView::setWidth(), RenderData::size, RenderData::unit_line_thickness, view, FreestyleGlobals::viewport, width, Render::winx, Render::winy, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by FRS_init_stroke_renderer().
|
static |
Definition at line 83 of file FRS_freestyle.cpp.
References lineset_copied.
Definition at line 292 of file FRS_freestyle.cpp.
References ARRAY_SIZE, buffer, Freestyle::Controller::ComputeViewMap(), controller, FreestyleConfig::crease_angle, create_lineset_handler(), DEFAULT_DKR_EPSILON, DEFAULT_SPHERE_RADIUS, depsgraph, FreestyleConfig::dkr_epsilon, edge_type_condition::edge_type, ListBase::first, FreestyleConfig::flags, FREESTYLE_ADVANCED_OPTIONS_FLAG, FREESTYLE_ALGO_ADAPTIVE_CUMULATIVE, FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE, ViewLayer::freestyle_config, FREESTYLE_CONTROL_EDITOR_MODE, FREESTYLE_CONTROL_SCRIPT_MODE, FREESTYLE_CULLING, FREESTYLE_FACE_SMOOTHNESS_FLAG, FREESTYLE_FE_BORDER, FREESTYLE_FE_CONTOUR, FREESTYLE_FE_CREASE, FREESTYLE_FE_EDGE_MARK, FREESTYLE_FE_EXTERNAL_CONTOUR, FREESTYLE_FE_MATERIAL_BOUNDARY, FREESTYLE_FE_RIDGE_VALLEY, FREESTYLE_FE_SILHOUETTE, FREESTYLE_FE_SUGGESTIVE_CONTOUR, FREESTYLE_LINESET_ENABLED, FREESTYLE_LINESET_FE_AND, FREESTYLE_LINESET_FE_NOT, FREESTYLE_MATERIAL_BOUNDARIES_FLAG, FREESTYLE_RIDGES_AND_VALLEYS_FLAG, FREESTYLE_SEL_EDGE_TYPES, FREESTYLE_SUGGESTIVE_CONTOURS_FLAG, G, G_DEBUG_FREESTYLE, Freestyle::Controller::getComputeMaterialBoundariesFlag(), Freestyle::Controller::getComputeRidgesAndValleysFlag(), Freestyle::Controller::getComputeSuggestiveContoursFlag(), Freestyle::Controller::getCreaseAngle(), Freestyle::Controller::getFaceSmoothness(), Freestyle::Controller::getSphereRadius(), Freestyle::Controller::getSuggestiveContourKrDerivativeEpsilon(), Freestyle::Controller::hitViewMapCache(), Render::i, id_name(), RenderStats::infostr, Freestyle::Controller::InsertStyleModule(), FreestyleConfig::linesets, Freestyle::Controller::LoadMesh(), MEM_freeN, FreestyleConfig::mode, FreestyleConfig::modules, ViewLayer::name, RenderLayer::passes, RAD2DEGF, RE_GetRenderLayer(), RE_PASSNAME_DIFFUSE_COLOR, RE_PASSNAME_Z, Render::result, Render::sdh, Freestyle::Controller::setComputeMaterialBoundariesFlag(), Freestyle::Controller::setComputeRidgesAndValleysFlag(), Freestyle::Controller::setComputeSuggestiveContoursFlag(), Freestyle::Controller::setCreaseAngle(), Freestyle::Controller::setFaceSmoothness(), Freestyle::Controller::setPassDiffuse(), Freestyle::Controller::setPassZ(), Freestyle::Controller::setSphereRadius(), Freestyle::Controller::setSuggestiveContourKrDerivativeEpsilon(), Freestyle::Controller::setVisibilityAlgo(), FreestyleConfig::sphere_radius, Render::stats_draw, STREQ, Render::tbh, Render::test_break, test_edge_type_conditions(), TIP_, Freestyle::Controller::toggleLayer(), edge_type_condition::value, and z.
Referenced by FRS_do_stroke_rendering(), and register_closure().
|
static |
Definition at line 211 of file FRS_freestyle.cpp.
References edge_type_condition::value.
Referenced by prepare().
|
static |
Definition at line 76 of file FRS_freestyle.cpp.
Referenced by FRS_do_stroke_rendering(), FRS_end_stroke_rendering(), FRS_exit(), FRS_free_view_map_cache(), FRS_init(), FRS_init_stroke_renderer(), FRS_set_context(), prepare(), ArmatureImporter::write_controller(), DocumentImporter::write_node(), and DocumentImporter::writeController().
|
static |
Definition at line 74 of file FRS_freestyle.cpp.
Referenced by FRS_init().
| struct FreestyleGlobals g_freestyle |
Definition at line 1 of file FRS_freestyle.cpp.
Referenced by Freestyle::Controller::ComputeViewMap(), Freestyle::AppView::distanceToSceneCenter(), Freestyle_getCurrentScene(), FRS_do_stroke_rendering(), FRS_init(), Freestyle::GridHelpers::getDefaultViewProscenium(), init_view(), Freestyle::Controller::LoadMesh(), Freestyle::AppView::zfar(), and Freestyle::AppView::znear().
|
static |
Definition at line 80 of file FRS_freestyle.cpp.
Referenced by FRS_copy_active_lineset(), and FRS_paste_active_lineset().
|
static |
Definition at line 81 of file FRS_freestyle.cpp.
Referenced by FRS_copy_active_lineset(), FRS_init(), FRS_paste_active_lineset(), and load_post_callback().
|
static |
Definition at line 91 of file FRS_freestyle.cpp.
Referenced by FRS_init().
|
static |
Definition at line 75 of file FRS_freestyle.cpp.
Referenced by FRS_exit(), and FRS_init().
|
static |
Definition at line 77 of file FRS_freestyle.cpp.
Referenced by axis_set_view(), BKE_image_is_multiview(), BKE_scene_disable_color_management(), blender_camera_view_subset(), BPy_IDArray_getbuffer(), BPy_IDArray_releasebuffer(), colormanage_check_view_settings(), colormanage_load_config(), colormanage_view_add(), colormanage_view_get_named(), colormanage_view_get_named_for_display(), colormanage_view_settings_to_cache(), colormanagement_view_item_add(), blender::compositor::ImageNode::convertToOperations(), draw_call_is_culled(), draw_compute_culling(), DRW_culling_box_test(), DRW_culling_frustum_corners_get(), DRW_culling_frustum_planes_get(), DRW_culling_min_max_test(), DRW_culling_plane_test(), DRW_culling_sphere_test(), DRW_notify_view_update(), DRW_view_camtexco_set(), DRW_view_clip_planes_set(), DRW_view_create(), DRW_view_create_sub(), DRW_view_default_set(), DRW_view_far_distance_get(), DRW_view_frustum_corners_get(), DRW_view_frustum_planes_get(), DRW_view_is_persp_get(), DRW_view_near_distance_get(), DRW_view_persmat_get(), DRW_view_set_active(), DRW_view_update(), DRW_view_update_sub(), DRW_view_viewmat_get(), DRW_view_winmat_get(), ED_view3d_axis_view_opposite(), ED_view3d_quat_from_axis_view(), ED_view3d_quat_to_axis_view(), eevee_ensure_cascade_views(), eevee_ensure_cube_views(), eevee_lightbake_cache_create(), EEVEE_render_view_sync(), EEVEE_shadows_draw(), EEVEE_shadows_draw_cascades(), exr_print_filecontents(), FRS_exit(), FRS_init(), getGPUDisplayShader(), blender::compositor::MultilayerBaseOperation::getImBuf(), GHOST_WindowCocoa::getValid(), GHOST_WindowCocoa::GHOST_WindowCocoa(), ghost_xr_draw_view_info_from_view(), GPENCIL_render_init(), GPU_matrix_project(), GPU_matrix_unproject(), GPU_matrix_unproject_precalc(), GPU_viewport_active_view_set(), GPU_viewport_bind(), GPU_viewport_color_texture(), GPU_viewport_draw_to_screen(), GPU_viewport_draw_to_screen_ex(), gpu_viewport_framebuffer_view_set(), image_render_pass_get(), image_save_single(), imapaint_pick_uv(), imapaint_tri_weights(), IMB_colormanagement_get_display_colorspace_name(), IMB_colormanagement_setup_glsl_draw_from_space(), IMB_colormanagement_validate_settings(), IMB_colormanagement_view_get_default_name(), IMB_colormanagement_view_get_indexed_name(), IMB_colormanagement_view_get_named_index(), IMB_colormanagement_view_items_add(), imb_exr_begin_read_mem(), imb_exr_get_views(), IMB_exrtile_write_channels(), init_view(), GHOST_WindowCocoa::invalidate(), lineart_main_load_geometries(), ml_addpass_cb(), blender::compositor::MultilayerBaseOperation::MultilayerBaseOperation(), OCIO_configGetDisplayColorSpaceName(), OCIO_createDisplayProcessor(), OCIO_gpuDisplayShaderBind(), parse_channel_name(), point_is_visible(), project_brush_radius(), RE_create_render_pass(), RE_WriteRenderResult(), region_quadview_init_rv3d(), render_result_new(), sequencer_ibuf_get(), set_pass_full_name(), GHOST_WindowCocoa::setNativePixelSize(), blender::tests::TEST(), wm_draw_region_bind(), wm_draw_region_blend(), wm_draw_region_blit(), wm_draw_region_texture(), wm_draw_window(), wm_draw_window_offscreen(), wm_draw_window_onscreen(), wm_stereo3d_draw_sidebyside(), wm_stereo3d_draw_topbottom(), and workbench_render_matrices_init().