Blender V4.3
FRS_freestyle.cpp File Reference
#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.hh"
#include "BKE_context.hh"
#include "BKE_freestyle.h"
#include "BKE_global.hh"
#include "BKE_lib_id.hh"
#include "BKE_linestyle.h"
#include "BKE_scene.hh"
#include "BKE_text.h"
#include "BLT_translation.hh"
#include "BLI_blenlib.h"
#include "BLI_math_color_blend.h"
#include "BLI_math_matrix.h"
#include "BLI_math_rotation.h"
#include "BPY_extern.hh"
#include "DEG_depsgraph_query.hh"
#include "IMB_imbuf.hh"
#include "pipeline.hh"
#include "FRS_freestyle.h"

Go to the source code of this file.

Classes

struct  edge_type_condition

Functions

static void load_post_callback (Main *, PointerRNA **, const int, void *)
void FRS_init ()
void FRS_set_context (bContext *C)
void FRS_exit ()
static void init_view (Render *re)
static char * escape_quotes (char *name)
static char * create_lineset_handler (char *layer_name, char *lineset_name)
static bool test_edge_type_conditions (edge_type_condition *conditions, int num_edge_types, bool logical_and, int target, bool distinct)
static void prepare (Render *re, ViewLayer *view_layer, Depsgraph *depsgraph)
void FRS_composite_result (Render *re, ViewLayer *view_layer, Render *freestyle_render)
static int displayed_layer_count (ViewLayer *view_layer)
int FRS_is_freestyle_enabled (ViewLayer *view_layer)
void FRS_init_stroke_renderer (Render *re)
void FRS_begin_stroke_rendering (Render *)
void FRS_do_stroke_rendering (Render *re, ViewLayer *view_layer)
void FRS_end_stroke_rendering (Render *)
void FRS_free_view_map_cache ()
void FRS_copy_active_lineset (FreestyleConfig *config)
void FRS_paste_active_lineset (FreestyleConfig *config)
void FRS_delete_active_lineset (FreestyleConfig *config)
bool FRS_move_active_lineset (FreestyleConfig *config, int direction)
MaterialFRS_create_stroke_material (Main *bmain, FreestyleLineStyle *linestyle)

Variables

FreestyleGlobals g_freestyle
static bool freestyle_is_initialized = false
static Config::Pathpathconfig = nullptr
static Controllercontroller = nullptr
static AppViewview = nullptr
static FreestyleLineSet lineset_buffer
static bool lineset_copied = false
static bCallbackFuncStore load_post_callback_funcstore

Function Documentation

◆ create_lineset_handler()

char * create_lineset_handler ( char * layer_name,
char * lineset_name )
static

Definition at line 182 of file FRS_freestyle.cpp.

References BLI_sprintfN(), escape_quotes(), and MEM_freeN().

Referenced by prepare().

◆ displayed_layer_count()

◆ escape_quotes()

char * escape_quotes ( char * name)
static

Definition at line 168 of file FRS_freestyle.cpp.

References MEM_mallocN.

Referenced by create_lineset_handler().

◆ FRS_begin_stroke_rendering()

void FRS_begin_stroke_rendering ( Render * re)

Definition at line 595 of file FRS_freestyle.cpp.

◆ FRS_composite_result()

◆ FRS_copy_active_lineset()

◆ FRS_create_stroke_material()

◆ FRS_delete_active_lineset()

void FRS_delete_active_lineset ( FreestyleConfig * config)

◆ FRS_do_stroke_rendering()

◆ FRS_end_stroke_rendering()

void FRS_end_stroke_rendering ( Render * re)

Definition at line 666 of file FRS_freestyle.cpp.

References controller.

◆ FRS_exit()

void FRS_exit ( void )

Definition at line 117 of file FRS_freestyle.cpp.

References controller, pathconfig, and view.

Referenced by RE_FreeAllRender().

◆ FRS_free_view_map_cache()

void FRS_free_view_map_cache ( void )

Definition at line 672 of file FRS_freestyle.cpp.

References controller, G, G_DEBUG_FREESTYLE, and printf.

◆ FRS_init()

◆ FRS_init_stroke_renderer()

void FRS_init_stroke_renderer ( Render * re)

Definition at line 581 of file FRS_freestyle.cpp.

References controller, G, G_DEBUG_FREESTYLE, and init_view().

◆ FRS_is_freestyle_enabled()

int FRS_is_freestyle_enabled ( ViewLayer * view_layer)

◆ FRS_move_active_lineset()

bool FRS_move_active_lineset ( struct FreestyleConfig * config,
int direction )

Reinsert the active lineset at an offset direction from current position.

Returns
if position of active lineset has changed.

Definition at line 752 of file FRS_freestyle.cpp.

References BKE_freestyle_lineset_get_active(), BLI_listbase_link_move(), and FreestyleConfig::linesets.

◆ FRS_paste_active_lineset()

◆ FRS_set_context()

void FRS_set_context ( bContext * C)

Definition at line 109 of file FRS_freestyle.cpp.

References C, controller, CTX_data_scene(), G, and G_DEBUG_FREESTYLE.

Referenced by main().

◆ init_view()

◆ load_post_callback()

void load_post_callback ( Main * ,
PointerRNA ** ,
const int ,
void *  )
static

Definition at line 71 of file FRS_freestyle.cpp.

References lineset_copied.

◆ prepare()

◆ test_edge_type_conditions()

bool test_edge_type_conditions ( edge_type_condition * conditions,
int num_edge_types,
bool logical_and,
int target,
bool distinct )
static

Definition at line 198 of file FRS_freestyle.cpp.

References edge_type_condition::value.

Referenced by prepare().

Variable Documentation

◆ controller

◆ freestyle_is_initialized

bool freestyle_is_initialized = false
static

Definition at line 62 of file FRS_freestyle.cpp.

Referenced by FRS_init().

◆ g_freestyle

◆ lineset_buffer

FreestyleLineSet lineset_buffer
static

Definition at line 68 of file FRS_freestyle.cpp.

Referenced by FRS_copy_active_lineset(), and FRS_paste_active_lineset().

◆ lineset_copied

bool lineset_copied = false
static

◆ load_post_callback_funcstore

bCallbackFuncStore load_post_callback_funcstore
static
Initial value:
= {
nullptr,
nullptr,
nullptr,
0}
static void load_post_callback(Main *, PointerRNA **, const int, void *)

Definition at line 79 of file FRS_freestyle.cpp.

Referenced by FRS_init().

◆ pathconfig

Config::Path* pathconfig = nullptr
static

Definition at line 63 of file FRS_freestyle.cpp.

Referenced by FRS_exit(), and FRS_init().

◆ view

AppView* view = nullptr
static

Definition at line 65 of file FRS_freestyle.cpp.

Referenced by blender::ui::AbstractViewItemDragController::AbstractViewItemDragController(), blender::eevee::Film::accumulate(), blender::ui::AbstractViewItem::add_rename_button(), blender::ed::asset::shelf::AssetDragController::AssetDragController(), axis_set_view(), blender::ui::AbstractViewItem::begin_renaming(), blender::draw::overlay::Cameras::begin_sync(), blender::draw::overlay::Curves::begin_sync(), blender::draw::overlay::Empties::begin_sync(), blender::draw::overlay::GreasePencil::begin_sync(), blender::draw::overlay::Grid::begin_sync(), blender::draw::overlay::Instance::begin_sync(), blender::draw::overlay::Meshes::begin_sync(), BKE_image_is_multiview(), BKE_image_memorypack(), BKE_image_packfiles(), BKE_image_render_write_exr(), BKE_scene_disable_color_management(), blender_camera_view_subset(), BlenderSession::BlenderSession(), BlenderSession::BlenderSession(), blo_do_versions_280(), blo_do_versions_300(), BPy_IDArray_getbuffer(), BPy_IDArray_releasebuffer(), blender::eevee::BackgroundPipeline::clear(), 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(), IOCIOImpl::configGetDisplayColorSpaceName(), IOCIOImpl::createDisplayProcessor(), ArmatureBoneDrawStrategy::culling_test(), ArmatureBoneDrawStrategyBBone::culling_test(), ArmatureBoneDrawStrategyCustomShape::culling_test(), ArmatureBoneDrawStrategyEnvelope::culling_test(), ArmatureBoneDrawStrategyLine::culling_test(), ArmatureBoneDrawStrategyOcta::culling_test(), ArmatureBoneDrawStrategyWire::culling_test(), blender::eevee::DeferredPipeline::debug_draw(), blender::eevee::HiZBuffer::debug_draw(), blender::eevee::LightModule::debug_draw(), blender::eevee::ShadowModule::debug_draw(), blender::draw::overlay::Armatures::draw(), blender::draw::overlay::AttributeViewer::draw(), blender::draw::overlay::Bounds::draw(), blender::draw::overlay::Cameras::draw(), blender::draw::overlay::Curves::draw(), blender::draw::overlay::EditText::draw(), blender::draw::overlay::Empties::draw(), blender::draw::overlay::Facing::draw(), blender::draw::overlay::Fade::draw(), blender::draw::overlay::Fluids::draw(), blender::draw::overlay::ForceFields::draw(), blender::draw::overlay::GreasePencil::draw(), blender::draw::overlay::Grid::draw(), blender::draw::overlay::Instance::draw(), blender::draw::overlay::Lattices::draw(), blender::draw::overlay::LightProbes::draw(), blender::draw::overlay::Lights::draw(), blender::draw::overlay::Meshes::draw(), blender::draw::overlay::MeshUVs::draw(), blender::draw::overlay::Metaballs::draw(), blender::draw::overlay::ModeTransfer::draw(), blender::draw::overlay::Origins::draw(), blender::draw::overlay::Outline::draw(), blender::draw::overlay::Paints::draw(), blender::draw::overlay::Particles::draw(), blender::draw::overlay::Prepass::draw(), blender::draw::overlay::Relations::draw(), blender::draw::overlay::Sculpts::draw(), blender::draw::overlay::Speakers::draw(), blender::draw::overlay::Wireframe::draw(), blender::eevee::LookdevModule::draw(), blender::workbench::AntiAliasingPass::draw(), blender::workbench::DofPass::draw(), blender::workbench::OpaquePass::draw(), blender::workbench::ShadowPass::draw(), blender::workbench::TransparentDepthPass::draw(), blender::workbench::TransparentPass::draw(), blender::workbench::VolumePass::draw(), blender::draw::overlay::Armatures::draw_armature_pose(), blender::draw::overlay::Cameras::draw_background_images(), blender::draw::overlay::Empties::draw_background_images(), draw_call_is_culled(), blender::draw::overlay::Curves::draw_color_only(), blender::draw::overlay::GreasePencil::draw_color_only(), blender::draw::overlay::LightProbes::draw_color_only(), blender::draw::overlay::Meshes::draw_color_only(), blender::draw::overlay::MotionPath::draw_color_only(), draw_compute_culling(), blender::draw::overlay::GreasePencil::draw_grease_pencil(), blender::draw::overlay::Empties::draw_images(), blender::draw::overlay::Cameras::draw_in_front(), blender::draw::overlay::Empties::draw_in_front_images(), blender::draw::overlay::Particles::draw_no_line(), blender::draw::overlay::MeshUVs::draw_on_render(), blender::draw::overlay::Sculpts::draw_on_render(), blender::eevee::VolumeModule::draw_resolve(), blender::draw::overlay::Cameras::draw_scene_background_images(), draw_view_matrix_state_update(), 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_manager_init(), DRW_notify_view_update(), drw_notify_view_update_offscreen(), 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(), blender::ui::AbstractViewItem::end_renaming(), blender::draw::Texture::ensure_layer_views(), blender::draw::Texture::ensure_mip_views(), blender::nodes::node_composite_file_output_cc::FileOutputOperation::execute_multi_layer(), exr_print_filecontents(), external_image_space_matrix_set(), blender::ui::find_filtered_item_index(), blender::ui::find_first_view_item_but(), blender::ui::find_item_from_rename_button(), blender::draw::Texture::free(), blender::math::detail::from_rotation(), FRS_exit(), FRS_init(), get_display_colorspace_name(), blender::nodes::node_composite_file_output_cc::FileOutputOperation::get_multi_layer_exr_image_path(), get_multilayer_view_index(), blender::realtime_compositor::get_view_index(), blender::draw::compositor::Context::get_view_name(), getGPUDisplayShader(), GHOST_WindowCocoa::getValid(), GHOST_WindowCocoa::GHOST_WindowCocoa(), ghost_xr_draw_view_info_from_view(), GPENCIL_render_init(), GPU_matrix_project_2fv(), GPU_matrix_project_3fv(), GPU_matrix_unproject_3fv(), GPU_matrix_unproject_precalc(), GPU_texture_create_view(), GPU_viewport_bind(), GPU_viewport_color_texture(), gpu_viewport_draw_colormanaged(), GPU_viewport_draw_to_screen(), GPU_viewport_draw_to_screen_ex(), GPU_viewport_overlay_texture(), GPU_viewport_unbind_from_offscreen(), blender::ui::GridViewItemDropTarget::GridViewItemDropTarget(), image_memorypack_imbuf(), image_render_pass_get(), image_save_single(), 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_get_raw_or_default_name(), IMB_colormanagement_view_items_add(), imb_exr_get_views(), IMB_exr_multilayer_convert(), IMB_exr_multilayer_convert(), imb_exr_multilayer_parse_channels_from_file(), IMB_exrtile_write_channels(), init_view(), GHOST_WindowCocoa::invalidate(), lineart_main_load_geometries(), lineart_main_try_generate_shadow_v3(), ml_addpass_cb(), MOD_lineart_chain_offset_towards_camera(), NODE_DEFINE(), blender::workbench::ShadowPass::object_sync(), OCIO_configGetDisplayColorSpaceName(), OCIO_createDisplayProcessor(), OCIO_gpuDisplayShaderBind(), parse_channel_name(), parse_channel_name(), pchan_culling_test_simple(), pchan_culling_test_with_radius_scale(), point_is_visible(), blender::ed::sculpt_paint::project_brush_radius(), pygpu_buffer__bf_getbuffer(), pygpu_buffer__bf_releasebuffer(), RE_create_render_pass(), region_quadview_init_rv3d(), blender::ui::region_views_find_drop_target_at(), blender::ui::AbstractViewItem::rename_apply(), blender::eevee::AmbientOcclusion::render(), blender::eevee::BackgroundPipeline::render(), blender::eevee::CapturePipeline::render(), blender::eevee::DeferredProbePipeline::render(), blender::eevee::DepthOfField::render(), blender::eevee::ForwardPipeline::render(), blender::eevee::MotionBlurModule::render(), blender::eevee::PlanarProbePipeline::render(), blender::eevee::ShadowPipeline::render(), blender::eevee::SubsurfaceModule::render(), blender::eevee::VolumeLayer::render(), blender::eevee::VolumePipeline::render(), blender::eevee::WorldPipeline::render(), blender::eevee::WorldVolumePipeline::render(), blender::eevee::AmbientOcclusion::render_pass(), blender::eevee::CaptureView::render_probes(), render_result_new(), blender::eevee::CaptureView::render_world(), sequencer_ibuf_get(), blender::eevee::ShadowModule::set_lights_data(), blender::eevee::LightModule::set_view(), blender::eevee::PlanarProbe::set_view(), blender::eevee::ShadowModule::set_view(), GHOST_WindowCocoa::setNativePixelSize(), blender::workbench::AntiAliasingPass::setup_view(), blender::StringRef::StringRef(), blender::draw::Manager::submit(), blender::draw::Manager::submit(), blender::draw::Manager::submit(), blender::draw::Manager::submit_debug(), blender::draw::Manager::submit_debug(), blender::eevee::IrradianceBake::surfel_raster_views_sync(), blender::draw::View::sync(), blender::eevee::Camera::sync(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::draw::test_draw_resource_id_gen(), blender::draw::test_draw_visibility(), blender::draw::test_eevee_surfel_list(), blender::math::transform_direction(), blender::math::transform_point(), blender::math::transform_point(), ui_block_add_view_impl(), ui_block_view_find_idname(), ui_view_focused_poll(), UI_view_item_can_rename(), ui_view_scroll_invoke(), ui_view_scroll_poll(), blender::workbench::ShadowPass::update(), blender::draw::View::View(), blender::eevee::PlanarProbeModule::viewport_draw(), blender::eevee::SphereProbeModule::viewport_draw(), blender::eevee::VolumeProbeModule::viewport_draw(), 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_keymap_guess_from_context(), wm_stereo3d_draw_sidebyside(), wm_stereo3d_draw_topbottom(), and workbench_render_to_image().