Blender V4.3
BlenderSession Class Reference

#include <session.h>

Public Member Functions

 BlenderSession (BL::RenderEngine &b_engine, BL::Preferences &b_userpref, BL::BlendData &b_data, bool preview_osl)
 
 BlenderSession (BL::RenderEngine &b_engine, BL::Preferences &b_userpref, BL::BlendData &b_data, BL::SpaceView3D &b_v3d, BL::RegionView3D &b_rv3d, int width, int height)
 
 ~BlenderSession ()
 
void create_session ()
 
void free_session ()
 
void reset_session (BL::BlendData &b_data, BL::Depsgraph &b_depsgraph)
 
void render (BL::Depsgraph &b_depsgraph)
 
void render_frame_finish ()
 
void bake (BL::Depsgraph &b_depsgrah, BL::Object &b_object, const string &pass_type, const int custom_flag, const int bake_width, const int bake_height)
 
void full_buffer_written (string_view filename)
 
void synchronize (BL::Depsgraph &b_depsgraph)
 
void draw (BL::SpaceImageEditor &space_image)
 
void view_draw (int w, int h)
 
void tag_redraw ()
 
void tag_update ()
 
void get_status (string &status, string &substatus)
 
void get_progress (double &progress, double &total_time, double &render_time)
 
void test_cancel ()
 
void update_status_progress ()
 
void update_bake_progress ()
 

Public Attributes

bool background
 
Sessionsession
 
Scenescene
 
BlenderSyncsync
 
double last_redraw_time
 
BL::RenderEngine b_engine
 
BL::Preferences b_userpref
 
BL::BlendData b_data
 
BL::RenderSettings b_render
 
BL::Depsgraph b_depsgraph
 
BL::Scene b_scene
 
BL::SpaceView3D b_v3d
 
BL::RegionView3D b_rv3d
 
string b_rlay_name
 
string b_rview_name
 
string last_status
 
string last_error
 
double last_progress
 
double last_status_time
 
int width
 
int height
 
bool preview_osl
 
double start_resize_time
 
void * python_thread_state
 
bool use_developer_ui
 

Static Public Attributes

static DeviceTypeMask device_override = DEVICE_MASK_ALL
 
static bool headless = false
 
static bool print_render_stats = false
 

Protected Member Functions

void stamp_view_layer_metadata (Scene *scene, const string &view_layer_name)
 
bool check_and_report_session_error ()
 
void builtin_images_load ()
 
void free_blender_memory_if_possible ()
 
void ensure_display_driver_if_needed ()
 

Protected Attributes

struct { 
 
   thread_mutex   mutex 
 
   int   last_pass_index = -1 
 
draw_state_ 
 
BlenderDisplayDriverdisplay_driver_ = nullptr
 
vector< string > full_buffer_files_
 
int bake_id = 0
 

Detailed Description

Definition at line 28 of file blender/session.h.

Constructor & Destructor Documentation

◆ BlenderSession() [1/2]

BlenderSession::BlenderSession ( BL::RenderEngine & b_engine,
BL::Preferences & b_userpref,
BL::BlendData & b_data,
bool preview_osl )

Definition at line 45 of file blender/session.cpp.

References last_redraw_time, last_status_time, and start_resize_time.

◆ BlenderSession() [2/2]

BlenderSession::BlenderSession ( BL::RenderEngine & b_engine,
BL::Preferences & b_userpref,
BL::BlendData & b_data,
BL::SpaceView3D & b_v3d,
BL::RegionView3D & b_rv3d,
int width,
int height )

Definition at line 74 of file blender/session.cpp.

References last_redraw_time, last_status_time, and start_resize_time.

◆ ~BlenderSession()

BlenderSession::~BlenderSession ( )

Definition at line 106 of file blender/session.cpp.

References free_session().

Member Function Documentation

◆ bake()

◆ builtin_images_load()

void BlenderSession::builtin_images_load ( )
protected

◆ check_and_report_session_error()

bool BlenderSession::check_and_report_session_error ( )
protected

◆ create_session()

◆ draw()

void BlenderSession::draw ( BL::SpaceImageEditor & space_image)

◆ ensure_display_driver_if_needed()

void BlenderSession::ensure_display_driver_if_needed ( )
protected

Definition at line 1119 of file blender/session.cpp.

References b_engine, b_scene, display_driver_, headless, session, and Session::set_display_driver().

Referenced by render(), and synchronize().

◆ free_blender_memory_if_possible()

void BlenderSession::free_blender_memory_if_possible ( )
protected

Definition at line 1107 of file blender/session.cpp.

References b_engine.

Referenced by render().

◆ free_session()

void BlenderSession::free_session ( )

Definition at line 254 of file blender/session.cpp.

References Session::cancel(), display_driver_, session, and sync.

Referenced by reset_session(), synchronize(), and ~BlenderSession().

◆ full_buffer_written()

void BlenderSession::full_buffer_written ( string_view filename)

Definition at line 269 of file blender/session.cpp.

References full_buffer_files_.

Referenced by bake(), and render().

◆ get_progress()

void BlenderSession::get_progress ( double & progress,
double & total_time,
double & render_time )

◆ get_status()

void BlenderSession::get_status ( string & status,
string & substatus )

Definition at line 971 of file blender/session.cpp.

References Progress::get_status(), Session::progress, and session.

Referenced by update_status_progress().

◆ render()

◆ render_frame_finish()

◆ reset_session()

◆ stamp_view_layer_metadata()

void BlenderSession::stamp_view_layer_metadata ( Scene * scene,
const string & view_layer_name )
protected

◆ synchronize()

◆ tag_redraw()

void BlenderSession::tag_redraw ( )

Definition at line 1078 of file blender/session.cpp.

References b_engine, last_redraw_time, time_dt(), and update_status_progress().

Referenced by create_session(), and view_draw().

◆ tag_update()

void BlenderSession::tag_update ( )

Definition at line 1072 of file blender/session.cpp.

References b_engine.

Referenced by synchronize(), and view_draw().

◆ test_cancel()

void BlenderSession::test_cancel ( )

Definition at line 1097 of file blender/session.cpp.

References b_engine, Session::progress, session, and Progress::set_cancel().

Referenced by create_session().

◆ update_bake_progress()

void BlenderSession::update_bake_progress ( )

Definition at line 982 of file blender/session.cpp.

References b_engine, Progress::get_progress(), last_progress, Session::progress, and session.

Referenced by bake().

◆ update_status_progress()

◆ view_draw()

Member Data Documentation

◆ b_data

BL::BlendData BlenderSession::b_data

Definition at line 86 of file blender/session.h.

Referenced by create_session(), and reset_session().

◆ b_depsgraph

BL::Depsgraph BlenderSession::b_depsgraph

Definition at line 88 of file blender/session.h.

Referenced by bake(), render(), reset_session(), and synchronize().

◆ b_engine

◆ b_render

BL::RenderSettings BlenderSession::b_render

◆ b_rlay_name

string BlenderSession::b_rlay_name

Definition at line 94 of file blender/session.h.

Referenced by draw(), render(), render_frame_finish(), and update_status_progress().

◆ b_rv3d

BL::RegionView3D BlenderSession::b_rv3d

Definition at line 93 of file blender/session.h.

Referenced by create_session(), render(), synchronize(), and view_draw().

◆ b_rview_name

string BlenderSession::b_rview_name

Definition at line 95 of file blender/session.h.

Referenced by render(), render_frame_finish(), and update_status_progress().

◆ b_scene

BL::Scene BlenderSession::b_scene

◆ b_userpref

BL::Preferences BlenderSession::b_userpref

Definition at line 85 of file blender/session.h.

Referenced by bake(), create_session(), render(), reset_session(), synchronize(), and view_draw().

◆ b_v3d

BL::SpaceView3D BlenderSession::b_v3d

Definition at line 92 of file blender/session.h.

Referenced by bake(), create_session(), render(), reset_session(), synchronize(), and view_draw().

◆ background

bool BlenderSession::background

Definition at line 78 of file blender/session.h.

◆ bake_id

int BlenderSession::bake_id = 0
protected

Definition at line 151 of file blender/session.h.

Referenced by bake().

◆ device_override

CCL_NAMESPACE_BEGIN DeviceTypeMask BlenderSession::device_override = DEVICE_MASK_ALL
static

Definition at line 113 of file blender/session.h.

Referenced by blender_device_info(), and set_device_override_func().

◆ display_driver_

BlenderDisplayDriver* BlenderSession::display_driver_ = nullptr
protected

◆ [struct]

struct { ... } BlenderSession::draw_state_

Referenced by draw(), render(), and reset_session().

◆ full_buffer_files_

vector<string> BlenderSession::full_buffer_files_
protected

Definition at line 149 of file blender/session.h.

Referenced by full_buffer_written(), and render_frame_finish().

◆ headless

◆ height

int BlenderSession::height

Definition at line 102 of file blender/session.h.

Referenced by bake(), create_session(), render(), reset_session(), synchronize(), and view_draw().

◆ last_error

string BlenderSession::last_error

Definition at line 98 of file blender/session.h.

Referenced by check_and_report_session_error(), and create_session().

◆ last_pass_index

int BlenderSession::last_pass_index = -1

Definition at line 143 of file blender/session.h.

◆ last_progress

double BlenderSession::last_progress

Definition at line 99 of file blender/session.h.

Referenced by create_session(), update_bake_progress(), and update_status_progress().

◆ last_redraw_time

double BlenderSession::last_redraw_time

Definition at line 82 of file blender/session.h.

Referenced by BlenderSession(), BlenderSession(), and tag_redraw().

◆ last_status

string BlenderSession::last_status

Definition at line 97 of file blender/session.h.

Referenced by create_session(), and update_status_progress().

◆ last_status_time

double BlenderSession::last_status_time

Definition at line 100 of file blender/session.h.

Referenced by BlenderSession(), BlenderSession(), and update_status_progress().

◆ mutex

thread_mutex BlenderSession::mutex

Definition at line 142 of file blender/session.h.

◆ preview_osl

bool BlenderSession::preview_osl

Definition at line 103 of file blender/session.h.

Referenced by reset_session().

◆ print_render_stats

bool BlenderSession::print_render_stats = false
static

◆ python_thread_state

void* BlenderSession::python_thread_state

◆ scene

Scene* BlenderSession::scene

Definition at line 80 of file blender/session.h.

◆ session

◆ start_resize_time

double BlenderSession::start_resize_time

◆ sync

◆ use_developer_ui

bool BlenderSession::use_developer_ui

Definition at line 108 of file blender/session.h.

Referenced by create_session(), reset_session(), and synchronize().

◆ width

int BlenderSession::width

The documentation for this class was generated from the following files: