Blender V4.3
render_shading.cc File Reference
#include <cstdlib>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "DNA_ID.h"
#include "DNA_curve_types.h"
#include "DNA_light_types.h"
#include "DNA_lightprobe_types.h"
#include "DNA_material_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
#include "DNA_world_types.h"
#include "BLI_listbase.h"
#include "BLI_math_vector.h"
#include "BLI_path_utils.hh"
#include "BLI_string.h"
#include "BLI_string_utils.hh"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "BKE_anim_data.hh"
#include "BKE_animsys.h"
#include "BKE_appdir.hh"
#include "BKE_blender_copybuffer.hh"
#include "BKE_blendfile.hh"
#include "BKE_brush.hh"
#include "BKE_context.hh"
#include "BKE_curve.hh"
#include "BKE_editmesh.hh"
#include "BKE_global.hh"
#include "BKE_image.hh"
#include "BKE_layer.hh"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.hh"
#include "BKE_lib_remap.hh"
#include "BKE_lightprobe.h"
#include "BKE_linestyle.h"
#include "BKE_main.hh"
#include "BKE_material.h"
#include "BKE_node.hh"
#include "BKE_node_runtime.hh"
#include "BKE_node_tree_update.hh"
#include "BKE_object.hh"
#include "BKE_report.hh"
#include "BKE_scene.hh"
#include "BKE_texture.h"
#include "BKE_vfont.hh"
#include "BKE_workspace.hh"
#include "BKE_world.h"
#include "NOD_composite.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_build.hh"
#include "DEG_depsgraph_query.hh"
#include "RNA_access.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "ED_curve.hh"
#include "ED_mesh.hh"
#include "ED_node.hh"
#include "ED_object.hh"
#include "ED_paint.hh"
#include "ED_render.hh"
#include "ED_scene.hh"
#include "ED_screen.hh"
#include "RNA_define.hh"
#include "RNA_prototypes.hh"
#include "UI_interface.hh"
#include "RE_engine.h"
#include "RE_pipeline.h"
#include "engines/eevee_next/eevee_lightcache.hh"
#include "render_intern.hh"

Go to the source code of this file.

Classes

struct  BakeOperatorData
 

Macros

#define SWAP_MEMBER(member)   std::swap(ma->member, ma_from->member)
 

Functions

Shared Operator Poll Functions
static bool object_materials_supported_poll_ex (bContext *C, const Object *ob)
 
static bool object_materials_supported_poll (bContext *C)
 
Local Utilities
static void material_copybuffer_filepath_get (char filepath[FILE_MAX], size_t filepath_maxncpy)
 
static bool object_array_for_shading_edit_mode_enabled_filter (const Object *ob, void *user_data)
 
static Vector< Object * > object_array_for_shading_edit_mode_enabled (bContext *C)
 
static bool object_array_for_shading_edit_mode_disabled_filter (const Object *ob, void *user_data)
 
static Vector< Object * > object_array_for_shading_edit_mode_disabled (bContext *C)
 
Material Slot Add Operator
static int material_slot_add_exec (bContext *C, wmOperator *)
 
void OBJECT_OT_material_slot_add (wmOperatorType *ot)
 
Material Slot Remove Operator
static int material_slot_remove_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_material_slot_remove (wmOperatorType *ot)
 
Material Slot Assign Operator
static int material_slot_assign_exec (bContext *C, wmOperator *)
 
void OBJECT_OT_material_slot_assign (wmOperatorType *ot)
 
Material Slot (De)Select Operator
static int material_slot_de_select (bContext *C, bool select)
 
static int material_slot_select_exec (bContext *C, wmOperator *)
 
void OBJECT_OT_material_slot_select (wmOperatorType *ot)
 
static int material_slot_deselect_exec (bContext *C, wmOperator *)
 
void OBJECT_OT_material_slot_deselect (wmOperatorType *ot)
 
Material Slot Copy Operator
static int material_slot_copy_exec (bContext *C, wmOperator *)
 
void OBJECT_OT_material_slot_copy (wmOperatorType *ot)
 
Material Slot Move Operator
static int material_slot_move_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_material_slot_move (wmOperatorType *ot)
 
Material Slot Remove Unused Operator
static int material_slot_remove_unused_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_material_slot_remove_unused (wmOperatorType *ot)
 
New Material Operator
static int new_material_exec (bContext *C, wmOperator *)
 
void MATERIAL_OT_new (wmOperatorType *ot)
 
New Texture Operator
static int new_texture_exec (bContext *C, wmOperator *)
 
void TEXTURE_OT_new (wmOperatorType *ot)
 
new world operator
static int new_world_exec (bContext *C, wmOperator *)
 
void WORLD_OT_new (wmOperatorType *ot)
 
Render Layer Add Operator
static int view_layer_add_exec (bContext *C, wmOperator *op)
 
void SCENE_OT_view_layer_add (wmOperatorType *ot)
 
Render Layer Remove Operator
static bool view_layer_remove_poll (bContext *C)
 
static int view_layer_remove_exec (bContext *C, wmOperator *)
 
void SCENE_OT_view_layer_remove (wmOperatorType *ot)
 
View Layer Add AOV Operator
static int view_layer_add_aov_exec (bContext *C, wmOperator *)
 
void SCENE_OT_view_layer_add_aov (wmOperatorType *ot)
 
View Layer Remove AOV Operator
static int view_layer_remove_aov_exec (bContext *C, wmOperator *)
 
void SCENE_OT_view_layer_remove_aov (wmOperatorType *ot)
 
View Layer Add Lightgroup Operator
static int view_layer_add_lightgroup_exec (bContext *C, wmOperator *op)
 
void SCENE_OT_view_layer_add_lightgroup (wmOperatorType *ot)
 
View Layer Remove Lightgroup Operator
static int view_layer_remove_lightgroup_exec (bContext *C, wmOperator *)
 
void SCENE_OT_view_layer_remove_lightgroup (wmOperatorType *ot)
 
View Layer Add Used Lightgroups Operator
static GSetget_used_lightgroups (Scene *scene)
 
static int view_layer_add_used_lightgroups_exec (bContext *C, wmOperator *)
 
void SCENE_OT_view_layer_add_used_lightgroups (wmOperatorType *ot)
 
View Layer Remove Unused Lightgroups Operator
static int view_layer_remove_unused_lightgroups_exec (bContext *C, wmOperator *)
 
void SCENE_OT_view_layer_remove_unused_lightgroups (wmOperatorType *ot)
 
Light Cache Free Operator
static int lightprobe_cache_free_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_lightprobe_cache_free (wmOperatorType *ot)
 
Render View Remove Operator
static bool render_view_remove_poll (bContext *C)
 
static int render_view_add_exec (bContext *C, wmOperator *)
 
void SCENE_OT_render_view_add (wmOperatorType *ot)
 
Render View Add Operator
static int render_view_remove_exec (bContext *C, wmOperator *)
 
void SCENE_OT_render_view_remove (wmOperatorType *ot)
 
Texture Slot Move Operator
static int texture_slot_move_exec (bContext *C, wmOperator *op)
 
void TEXTURE_OT_slot_move (wmOperatorType *ot)
 
Material Copy Operator
static int copy_material_exec (bContext *C, wmOperator *op)
 
void MATERIAL_OT_copy (wmOperatorType *ot)
 
Material Paste Operator
static int paste_material_nodetree_ids_decref (LibraryIDLinkCallbackData *cb_data)
 
static int paste_material_nodetree_ids_relink_or_clear (LibraryIDLinkCallbackData *cb_data)
 
static int paste_material_exec (bContext *C, wmOperator *op)
 
void MATERIAL_OT_paste (wmOperatorType *ot)
 
Texture Slot Copy Operator
static int copy_mtex_exec (bContext *C, wmOperator *)
 
static bool copy_mtex_poll (bContext *C)
 
void TEXTURE_OT_slot_copy (wmOperatorType *ot)
 
Texture Slot Paste Operator
static int paste_mtex_exec (bContext *C, wmOperator *)
 
void TEXTURE_OT_slot_paste (wmOperatorType *ot)
 

Light Cache Bake Operator

enum  { LIGHTCACHE_SUBSET_ALL = 0 , LIGHTCACHE_SUBSET_SELECTED , LIGHTCACHE_SUBSET_ACTIVE }
 
static blender::Vector< Object * > lightprobe_cache_irradiance_volume_subset_get (bContext *C, wmOperator *op)
 
static int lightprobe_cache_bake_invoke (bContext *C, wmOperator *op, const wmEvent *)
 
static int lightprobe_cache_bake_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static void lightprobe_cache_bake_cancel (bContext *C, wmOperator *op)
 
static int lightprobe_cache_bake_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_lightprobe_cache_bake (wmOperatorType *ot)
 

#MTex Copy/Paste Utilities

static short mtexcopied = 0
 
static MTex mtexcopybuf
 
void ED_render_clear_mtex_copybuf ()
 
static void copy_mtex_copybuf (ID *id)
 
static void paste_mtex_copybuf (ID *id)
 

Macro Definition Documentation

◆ SWAP_MEMBER

#define SWAP_MEMBER ( member)    std::swap(ma->member, ma_from->member)

Referenced by paste_material_exec().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LIGHTCACHE_SUBSET_ALL 
LIGHTCACHE_SUBSET_SELECTED 
LIGHTCACHE_SUBSET_ACTIVE 

Definition at line 1351 of file render_shading.cc.

Function Documentation

◆ copy_material_exec()

◆ copy_mtex_copybuf()

static void copy_mtex_copybuf ( ID * id)
static

Definition at line 2877 of file render_shading.cc.

References GS, ID_LS, ID_PA, int, mtexcopied, and mtexcopybuf.

Referenced by copy_mtex_exec().

◆ copy_mtex_exec()

◆ copy_mtex_poll()

static bool copy_mtex_poll ( bContext * C)
static

Definition at line 2971 of file render_shading.cc.

References CTX_data_pointer_get_type(), and PointerRNA::owner_id.

Referenced by TEXTURE_OT_slot_copy().

◆ ED_render_clear_mtex_copybuf()

void ED_render_clear_mtex_copybuf ( )

Definition at line 2872 of file render_shading.cc.

References mtexcopied.

Referenced by copy_mtex_exec(), and WM_init().

◆ get_used_lightgroups()

◆ lightprobe_cache_bake_cancel()

static void lightprobe_cache_bake_cancel ( bContext * C,
wmOperator * op )
static

◆ lightprobe_cache_bake_exec()

◆ lightprobe_cache_bake_invoke()

◆ lightprobe_cache_bake_modal()

◆ lightprobe_cache_free_exec()

◆ lightprobe_cache_irradiance_volume_subset_get()

◆ material_copybuffer_filepath_get()

static void material_copybuffer_filepath_get ( char filepath[FILE_MAX],
size_t filepath_maxncpy )
static

Definition at line 111 of file render_shading.cc.

References BKE_tempdir_base(), and BLI_path_join.

Referenced by copy_material_exec(), and paste_material_exec().

◆ MATERIAL_OT_copy()

◆ MATERIAL_OT_new()

◆ MATERIAL_OT_paste()

◆ material_slot_add_exec()

◆ material_slot_assign_exec()

◆ material_slot_copy_exec()

◆ material_slot_de_select()

◆ material_slot_deselect_exec()

static int material_slot_deselect_exec ( bContext * C,
wmOperator *  )
static

Definition at line 495 of file render_shading.cc.

References material_slot_de_select().

Referenced by OBJECT_OT_material_slot_deselect().

◆ material_slot_move_exec()

◆ material_slot_remove_exec()

◆ material_slot_remove_unused_exec()

◆ material_slot_select_exec()

static int material_slot_select_exec ( bContext * C,
wmOperator *  )
static

Definition at line 476 of file render_shading.cc.

References material_slot_de_select().

Referenced by OBJECT_OT_material_slot_select().

◆ new_material_exec()

◆ new_texture_exec()

◆ new_world_exec()

◆ object_array_for_shading_edit_mode_disabled()

static Vector< Object * > object_array_for_shading_edit_mode_disabled ( bContext * C)
static

◆ object_array_for_shading_edit_mode_disabled_filter()

static bool object_array_for_shading_edit_mode_disabled_filter ( const Object * ob,
void * user_data )
static

◆ object_array_for_shading_edit_mode_enabled()

static Vector< Object * > object_array_for_shading_edit_mode_enabled ( bContext * C)
static

◆ object_array_for_shading_edit_mode_enabled_filter()

static bool object_array_for_shading_edit_mode_enabled_filter ( const Object * ob,
void * user_data )
static

◆ object_materials_supported_poll()

◆ object_materials_supported_poll_ex()

◆ OBJECT_OT_lightprobe_cache_bake()

◆ OBJECT_OT_lightprobe_cache_free()

◆ OBJECT_OT_material_slot_add()

◆ OBJECT_OT_material_slot_assign()

◆ OBJECT_OT_material_slot_copy()

◆ OBJECT_OT_material_slot_deselect()

◆ OBJECT_OT_material_slot_move()

◆ OBJECT_OT_material_slot_remove()

◆ OBJECT_OT_material_slot_remove_unused()

◆ OBJECT_OT_material_slot_select()

◆ paste_material_exec()

◆ paste_material_nodetree_ids_decref()

static int paste_material_nodetree_ids_decref ( LibraryIDLinkCallbackData * cb_data)
static

Clear ID's as freeing the data-block doesn't handle reference counting.

Definition at line 2661 of file render_shading.cc.

References LibraryIDLinkCallbackData::cb_flag, LibraryIDLinkCallbackData::id_pointer, id_us_min(), IDWALK_CB_USER, and IDWALK_RET_NOP.

Referenced by paste_material_exec().

◆ paste_material_nodetree_ids_relink_or_clear()

static int paste_material_nodetree_ids_relink_or_clear ( LibraryIDLinkCallbackData * cb_data)
static

◆ paste_mtex_copybuf()

static void paste_mtex_copybuf ( ID * id)
static

◆ paste_mtex_exec()

◆ render_view_add_exec()

◆ render_view_remove_exec()

◆ render_view_remove_poll()

static bool render_view_remove_poll ( bContext * C)
static

Definition at line 1628 of file render_shading.cc.

References CTX_data_scene().

Referenced by SCENE_OT_render_view_remove().

◆ SCENE_OT_render_view_add()

◆ SCENE_OT_render_view_remove()

◆ SCENE_OT_view_layer_add()

◆ SCENE_OT_view_layer_add_aov()

◆ SCENE_OT_view_layer_add_lightgroup()

◆ SCENE_OT_view_layer_add_used_lightgroups()

◆ SCENE_OT_view_layer_remove()

◆ SCENE_OT_view_layer_remove_aov()

◆ SCENE_OT_view_layer_remove_lightgroup()

◆ SCENE_OT_view_layer_remove_unused_lightgroups()

◆ TEXTURE_OT_new()

◆ TEXTURE_OT_slot_copy()

◆ TEXTURE_OT_slot_move()

◆ TEXTURE_OT_slot_paste()

◆ texture_slot_move_exec()

◆ view_layer_add_aov_exec()

◆ view_layer_add_exec()

◆ view_layer_add_lightgroup_exec()

◆ view_layer_add_used_lightgroups_exec()

◆ view_layer_remove_aov_exec()

◆ view_layer_remove_exec()

◆ view_layer_remove_lightgroup_exec()

◆ view_layer_remove_poll()

static bool view_layer_remove_poll ( bContext * C)
static

Definition at line 998 of file render_shading.cc.

References CTX_data_scene().

Referenced by SCENE_OT_view_layer_remove().

◆ view_layer_remove_unused_lightgroups_exec()

◆ WORLD_OT_new()

Variable Documentation

◆ mtexcopied

short mtexcopied = 0
static

◆ mtexcopybuf

MTex mtexcopybuf
static

Definition at line 2870 of file render_shading.cc.

Referenced by copy_mtex_copybuf(), and paste_mtex_copybuf().