Blender  V3.3
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
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
 
voidpython_thread_state
 
bool use_developer_ui
 
thread_mutex mutex
 
int last_pass_index = -1
 

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 27 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 44 of file blender/session.cpp.

References background, 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 72 of file blender/session.cpp.

References background, last_redraw_time, last_status_time, and start_resize_time.

◆ ~BlenderSession()

BlenderSession::~BlenderSession ( )

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

References free_session().

Member Function Documentation

◆ bake()

void BlenderSession::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 
)

◆ builtin_images_load()

void BlenderSession::builtin_images_load ( )
protected

◆ check_and_report_session_error()

bool BlenderSession::check_and_report_session_error ( )
protected

◆ create_session()

void BlenderSession::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 1045 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 1033 of file blender/session.cpp.

References b_engine, and background.

Referenced by render().

◆ free_session()

void BlenderSession::free_session ( )

Definition at line 249 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 264 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 904 of file blender/session.cpp.

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

Referenced by update_status_progress().

◆ render()

void BlenderSession::render ( BL::Depsgraph b_depsgraph)

◆ render_frame_finish()

void BlenderSession::render_frame_finish ( )

◆ reset_session()

void BlenderSession::reset_session ( BL::BlendData &  b_data,
BL::Depsgraph b_depsgraph 
)

◆ stamp_view_layer_metadata()

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

◆ synchronize()

void BlenderSession::synchronize ( BL::Depsgraph b_depsgraph)

◆ tag_redraw()

void BlenderSession::tag_redraw ( )

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

References b_engine, background, 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 1000 of file blender/session.cpp.

References b_engine.

Referenced by synchronize(), and view_draw().

◆ test_cancel()

void BlenderSession::test_cancel ( )

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

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

Referenced by create_session().

◆ update_bake_progress()

void BlenderSession::update_bake_progress ( )

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

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

Referenced by bake().

◆ update_status_progress()

void BlenderSession::update_status_progress ( )

◆ view_draw()

void BlenderSession::view_draw ( int  w,
int  h 
)

Member Data Documentation

◆ b_data

BL::BlendData BlenderSession::b_data

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

Referenced by create_session(), and reset_session().

◆ b_depsgraph

BL::Depsgraph BlenderSession::b_depsgraph

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

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

◆ b_engine

BL::RenderEngine BlenderSession::b_engine

◆ b_render

BL::RenderSettings BlenderSession::b_render

◆ b_rlay_name

string BlenderSession::b_rlay_name

Definition at line 93 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 92 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 94 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 84 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 91 of file blender/session.h.

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

◆ background

bool BlenderSession::background

◆ bake_id

int BlenderSession::bake_id = 0
protected

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

Referenced by bake().

◆ device_override

CCL_NAMESPACE_BEGIN DeviceTypeMask BlenderSession::device_override = DEVICE_MASK_ALL
static

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

Referenced by blender_device_info(), and set_device_override_func().

◆ display_driver_

BlenderDisplayDriver* BlenderSession::display_driver_ = nullptr
protected

◆ 

struct { ... } BlenderSession::draw_state_

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

◆ full_buffer_files_

vector<string> BlenderSession::full_buffer_files_
protected

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

Referenced by full_buffer_written(), and render_frame_finish().

◆ headless

bool BlenderSession::headless = false
static

◆ height

int BlenderSession::height

Definition at line 101 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 97 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 142 of file blender/session.h.

◆ last_progress

double BlenderSession::last_progress

Definition at line 98 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 81 of file blender/session.h.

Referenced by BlenderSession(), and tag_redraw().

◆ last_status

string BlenderSession::last_status

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

Referenced by create_session(), and update_status_progress().

◆ last_status_time

double BlenderSession::last_status_time

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

Referenced by BlenderSession(), and update_status_progress().

◆ mutex

thread_mutex BlenderSession::mutex

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

◆ preview_osl

bool BlenderSession::preview_osl

Definition at line 102 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

◆ session

Session* BlenderSession::session

◆ start_resize_time

double BlenderSession::start_resize_time

◆ sync

BlenderSync* BlenderSession::sync

◆ use_developer_ui

bool BlenderSession::use_developer_ui

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

Referenced by create_session(), and reset_session().

◆ width

int BlenderSession::width

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

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


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