Blender V4.5
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

◆ displayed_layer_count()

◆ escape_quotes()

char * escape_quotes ( char * name)
static

Definition at line 162 of file FRS_freestyle.cpp.

References escape_quotes(), and MEM_malloc_arrayN().

Referenced by create_lineset_handler(), and escape_quotes().

◆ FRS_begin_stroke_rendering()

void FRS_begin_stroke_rendering ( Render * re)

Definition at line 589 of file FRS_freestyle.cpp.

References FRS_begin_stroke_rendering().

Referenced by FRS_begin_stroke_rendering().

◆ 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)

◆ FRS_exit()

void FRS_exit ( void )

Definition at line 111 of file FRS_freestyle.cpp.

References controller, FRS_exit(), pathconfig, and view.

Referenced by FRS_exit(), and RE_FreeAllRender().

◆ FRS_free_view_map_cache()

void FRS_free_view_map_cache ( void )

◆ FRS_init()

◆ FRS_init_stroke_renderer()

void FRS_init_stroke_renderer ( Render * re)

◆ 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(), FRS_move_active_lineset(), and FreestyleConfig::linesets.

Referenced by FRS_move_active_lineset().

◆ FRS_paste_active_lineset()

◆ FRS_set_context()

void FRS_set_context ( bContext * C)

◆ 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, and load_post_callback().

Referenced by load_post_callback().

◆ prepare()

void prepare ( Render * re,
ViewLayer * view_layer,
Depsgraph * depsgraph )
static

Definition at line 273 of file FRS_freestyle.cpp.

References ARRAY_SIZE, Freestyle::Controller::ComputeViewMap(), controller, FreestyleConfig::crease_angle, create_lineset_handler(), FreestyleConfig::dkr_epsilon, edge_type_condition::edge_type, FreestyleConfig::flags, 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(), i, Render::i, id_name(), RenderStats::infostr, Freestyle::Controller::InsertStyleModule(), FreestyleConfig::linesets, LISTBASE_FOREACH, Freestyle::Controller::LoadMesh(), MEM_freeN(), FreestyleConfig::mode, FreestyleConfig::modules, ViewLayer::name, RenderLayer::passes, prepare(), RAD2DEGF, RE_GetRenderLayer(), RE_PASSNAME_DIFFUSE_COLOR, RE_PASSNAME_Z, BaseRender::result, RPT_, 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::test_break(), test_edge_type_conditions(), Freestyle::Controller::toggleLayer(), edge_type_condition::value, and z().

Referenced by FRS_do_stroke_rendering(), and 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, test_edge_type_conditions(), and edge_type_condition::value.

Referenced by prepare(), and test_edge_type_conditions().

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 FRS_exit(), FRS_init(), and init_view().