Blender V5.0
FRS_freestyle.cpp File Reference
#include <iostream>
#include "../application/AppConfig.h"
#include "../application/AppView.h"
#include "../application/Controller.h"
#include "BlenderStrokeRenderer.h"
#include "MEM_guardedalloc.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_listbase.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 176 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 162 of file FRS_freestyle.cpp.

References MEM_malloc_arrayN(), and name.

Referenced by create_lineset_handler().

◆ FRS_begin_stroke_rendering()

void FRS_begin_stroke_rendering ( Render * re)

Definition at line 589 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 660 of file FRS_freestyle.cpp.

References controller.

◆ FRS_exit()

void FRS_exit ( void )

Definition at line 111 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 666 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 575 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 746 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 103 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 65 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 192 of file FRS_freestyle.cpp.

References i, and edge_type_condition::value.

Referenced by prepare().

Variable Documentation

◆ controller

◆ freestyle_is_initialized

bool freestyle_is_initialized = false
static

Definition at line 56 of file FRS_freestyle.cpp.

Referenced by FRS_init().

◆ g_freestyle

◆ lineset_buffer

FreestyleLineSet lineset_buffer
static

Definition at line 62 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 73 of file FRS_freestyle.cpp.

Referenced by FRS_init().

◆ pathconfig

Config::Path* pathconfig = nullptr
static

Definition at line 57 of file FRS_freestyle.cpp.

Referenced by FRS_exit(), and FRS_init().

◆ view

AppView* view = nullptr
static

Definition at line 59 of file FRS_freestyle.cpp.

Referenced by _BaseMathObject_RaiseBufferViewExc(), blender::ui::AbstractViewItemDragController::AbstractViewItemDragController(), blender::eevee::Film::accumulate(), DRWContext::acquire_data(), blender::ui::AbstractViewItem::add_rename_button(), blender::ed::asset::shelf::AssetDragController::AssetDragController(), axis_set_view(), blender::ui::AbstractViewItem::begin_renaming(), blender::draw::overlay::Instance::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(), BLO_update_defaults_workspace(), BPy_IDArray_getbuffer(), BPy_IDArray_releasebuffer(), blender::eevee::BackgroundPipeline::clear(), Color_getbuffer(), blender::draw::DebugDraw::color_pack(), Color_releasebuffer(), colormanage_check_view_settings(), colormanage_find_matching_view_name(), colormanage_load_config(), colormanage_view_settings_to_cache(), blender::draw::overlay::GreasePencil::compute_depth_planes(), blender::nodes::node_composite_file_output_cc::compute_image_path(), blender::draw::Manager::compute_visibility(), blender::eevee::DeferredPipeline::debug_draw(), blender::eevee::HiZBuffer::debug_draw(), blender::eevee::LightModule::debug_draw(), blender::eevee::ShadowModule::debug_draw(), blender::draw::DebugDraw::display_to_view(), blender::draw::edit_select::Instance::draw(), blender::draw::gpencil::Instance::draw(), blender::draw::overlay::Facing::draw(), blender::draw::overlay::Fade::draw(), blender::draw::overlay::Instance::draw(), blender::draw::overlay::MeshUVs::draw(), blender::draw::overlay::ModeTransfer::draw(), blender::draw::overlay::Paints::draw(), blender::draw::overlay::Particles::draw(), blender::draw::overlay::Text::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::Cameras::draw_background_images(), blender::draw::overlay::Empties::draw_background_images(), blender::draw::overlay::Curves::draw_color_only(), blender::draw::overlay::GreasePencil::draw_color_only(), blender::draw::overlay::Grid::draw_color_only(), blender::draw::overlay::LightProbes::draw_color_only(), blender::draw::overlay::Meshes::draw_color_only(), blender::draw::overlay::MotionPath::draw_color_only(), blender::draw::overlay::Origins::draw_color_only(), blender::draw::overlay::Empties::draw_images(), blender::draw::overlay::Cameras::draw_in_front(), blender::draw::overlay::Empties::draw_in_front_images(), blender::draw::overlay::Armatures::draw_line(), blender::draw::overlay::AttributeViewer::draw_line(), blender::draw::overlay::Axes::draw_line(), blender::draw::overlay::Bounds::draw_line(), blender::draw::overlay::Cameras::draw_line(), blender::draw::overlay::Curves::draw_line(), blender::draw::overlay::Empties::draw_line(), blender::draw::overlay::Fluids::draw_line(), blender::draw::overlay::ForceFields::draw_line(), blender::draw::overlay::GreasePencil::draw_line(), blender::draw::overlay::Lattices::draw_line(), blender::draw::overlay::LightProbes::draw_line(), blender::draw::overlay::Lights::draw_line(), blender::draw::overlay::Meshes::draw_line(), blender::draw::overlay::Metaballs::draw_line(), blender::draw::overlay::Particles::draw_line(), blender::draw::overlay::PointClouds::draw_line(), blender::draw::overlay::Prepass::draw_line(), blender::draw::overlay::Relations::draw_line(), blender::draw::overlay::Sculpts::draw_line(), blender::draw::overlay::Speakers::draw_line(), blender::draw::overlay::Wireframe::draw_line(), blender::draw::overlay::Outline::draw_line_only_ex(), blender::draw::overlay::ImagePrepass::draw_on_render(), blender::draw::overlay::MeshUVs::draw_on_render(), blender::draw::overlay::Sculpts::draw_on_render(), blender::draw::overlay::Background::draw_output(), blender::eevee::VolumeModule::draw_resolve(), blender::draw::overlay::Cameras::draw_scene_background_images(), blender::draw::overlay::Background::draw_vignette(), 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::draw::Manager::ensure_visibility(), Euler_getbuffer(), Euler_releasebuffer(), blender::nodes::node_composite_file_output_cc::FileOutputOperation::execute_multi_layer(), exr_print_filecontents(), blender::ui::find_filtered_item_index(), blender::ui::find_first_view_item_but(), blender::ui::find_item_from_rename_button(), blender::draw::overlay::Outline::flat_objects_pass_sync(), blender::draw::Texture::free_texture_views(), blender::math::detail::from_rotation(), FRS_exit(), FRS_init(), blender::draw::Manager::generate_commands(), blender::draw::Manager::generate_commands(), blender::ocio::Config::get_display_view_color_space(), blender::ocio::FallbackConfig::get_display_view_color_space(), blender::nodes::node_composite_file_output_cc::FileOutputOperation::get_image_path(), get_multilayer_view_index(), blender::compositor::get_view_index(), blender::draw::compositor_engine::Context::get_view_name(), GHOST_WindowCocoa::getValid(), GHOST_WindowCocoa::GHOST_WindowCocoa(), ghost_xr_draw_view_info_from_view(), 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(), blender::draw::overlay::FlatObjectRef::if_flat_axis_orthogonal_to_view(), image_memorypack_imbuf(), image_render_pass_get(), image_save_single(), IMB_colormanagement_display_is_hdr(), IMB_colormanagement_display_is_wide_gamut(), IMB_colormanagement_display_support_emulation(), IMB_colormanagement_validate_settings(), IMB_colormanagement_view_get_default_name(), IMB_colormanagement_view_get_raw_or_default_name(), IMB_colormanagement_view_items_add(), IMB_colormangement_display_get_color_space(), imb_exr_get_views(), IMB_exr_multilayer_convert(), IMB_exr_multilayer_convert(), imb_exr_multilayer_parse_channels_from_file(), init_view(), GHOST_WindowCocoa::invalidate(), lineart_main_load_geometries(), lineart_main_try_generate_shadow_v3(), Matrix_getbuffer(), Matrix_releasebuffer(), ml_addpass_cb(), MOD_lineart_chain_offset_towards_camera(), NODE_DEFINE(), blender::workbench::ShadowPass::object_sync(), blender::nodes::node_composite_file_output_cc::output_path_layout(), blender::nodes::node_composite_file_output_cc::output_paths_layout(), parse_channel_name(), parse_channel_name(), point_is_visible(), blender::draw::overlay::AttributeViewer::pre_draw(), blender::draw::overlay::Cameras::pre_draw(), blender::draw::overlay::Empties::pre_draw(), blender::draw::overlay::Facing::pre_draw(), blender::draw::overlay::Fade::pre_draw(), blender::draw::overlay::Lattices::pre_draw(), blender::draw::overlay::LightProbes::pre_draw(), blender::draw::overlay::Outline::pre_draw(), blender::draw::overlay::Particles::pre_draw(), blender::draw::overlay::PointClouds::pre_draw(), blender::draw::overlay::Prepass::pre_draw(), blender::draw::overlay::Wireframe::pre_draw(), blender::ed::sculpt_paint::project_brush_radius(), pygpu_buffer__bf_getbuffer(), pygpu_buffer__bf_releasebuffer(), Quaternion_getbuffer(), Quaternion_releasebuffer(), RE_create_render_pass(), RE_ResultIsMultiView(), region_quadview_init_rv3d(), blender::ui::region_views_find_drop_target_at(), blender::draw::gpencil::remap_depth(), 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::draw::gpencil::render_init_buffers(), blender::eevee::AmbientOcclusion::render_pass(), blender::eevee::CaptureView::render_probes(), render_result_new(), blender::eevee::CaptureView::render_world(), select_operator_view_and_item_find_xy(), blender::ed::vse::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::ed::object::shapekey::ShapeKeyDragController::ShapeKeyDragController(), blender::ocio::split_view_specific_look(), blender::StringRef::StringRef(), blender::draw::external::Prepass::submit(), blender::draw::Manager::submit(), blender::draw::Manager::submit(), blender::draw::Manager::submit(), blender::draw::Manager::submit_debug(), blender::draw::Manager::submit_debug(), blender::draw::Manager::submit_only(), blender::eevee::IrradianceBake::surfel_raster_views_sync(), blender::eevee::Camera::sync(), blender::ocio::TEST(), 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_submit_only(), blender::draw::test_draw_visibility(), blender::draw::test_eevee_shadow_tag_update(), blender::draw::test_eevee_shadow_tilemap_amend(), blender::draw::test_eevee_surfel_list(), blender::math::transform_direction(), blender::math::transform_point(), blender::math::transform_point(), blender::math::transform_point(), ui_block_add_view_impl(), ui_block_view_find_idname(), ui_block_view_persistent_state_restore(), ui_view_focused_poll(), UI_view_item_can_rename(), ui_view_item_delete_invoke(), ui_view_item_select_exec(), ui_view_scroll_invoke(), ui_view_scroll_poll(), blender::workbench::ShadowPass::update(), Vector_getbuffer(), Vector_releasebuffer(), view_item_click_select(), blender::eevee::PlanarProbeModule::viewport_draw(), blender::eevee::SphereProbeModule::viewport_draw(), blender::eevee::VolumeProbeModule::viewport_draw(), wm_draw_area_offscreen(), wm_draw_region_bind(), wm_draw_region_blend(), wm_draw_region_blit(), wm_draw_region_texture(), wm_draw_window(), wm_draw_window_onscreen(), WM_keymap_guess_from_context(), wm_stereo3d_draw_sidebyside(), and wm_stereo3d_draw_topbottom().