Blender V5.0
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_library.hh"
#include "BKE_lightprobe.h"
#include "BKE_linestyle.h"
#include "BKE_main.hh"
#include "BKE_main_invariants.hh"
#include "BKE_material.hh"
#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 "ED_undo.hh"
#include "RNA_define.hh"
#include "RNA_prototypes.hh"
#include "UI_interface.hh"
#include "RE_engine.h"
#include "RE_pipeline.h"
#include "engines/eevee/eevee_lightcache.hh"
#include "render_intern.hh"

Go to the source code of this file.

Classes

struct  BakeOperatorData

Macros

#define SWAP_MEMBER(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)
static bool material_slot_populated_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 wmOperatorStatus material_slot_add_exec (bContext *C, wmOperator *)
void OBJECT_OT_material_slot_add (wmOperatorType *ot)
Material Slot Remove Operator
static bool material_slot_remove_poll (bContext *C)
static wmOperatorStatus material_slot_remove_exec (bContext *C, wmOperator *)
void OBJECT_OT_material_slot_remove (wmOperatorType *ot)
Material Slot Assign Operator
static wmOperatorStatus material_slot_assign_exec (bContext *C, wmOperator *)
void OBJECT_OT_material_slot_assign (wmOperatorType *ot)
Material Slot (De)Select Operator
static wmOperatorStatus material_slot_de_select (bContext *C, bool select)
static wmOperatorStatus material_slot_select_exec (bContext *C, wmOperator *)
void OBJECT_OT_material_slot_select (wmOperatorType *ot)
static wmOperatorStatus material_slot_deselect_exec (bContext *C, wmOperator *)
void OBJECT_OT_material_slot_deselect (wmOperatorType *ot)
Material Slot Copy Operator
static wmOperatorStatus material_slot_copy_exec (bContext *C, wmOperator *)
void OBJECT_OT_material_slot_copy (wmOperatorType *ot)
Material Slot Move Operator
static wmOperatorStatus material_slot_move_exec (bContext *C, wmOperator *op)
void OBJECT_OT_material_slot_move (wmOperatorType *ot)
Material Slot Remove Unused Operator
static wmOperatorStatus material_slot_remove_unused_exec (bContext *C, wmOperator *op)
void OBJECT_OT_material_slot_remove_unused (wmOperatorType *ot)
static wmOperatorStatus material_slot_remove_all_exec (bContext *C, wmOperator *op)
void OBJECT_OT_material_slot_remove_all (wmOperatorType *ot)
New Material Operator
static wmOperatorStatus new_material_exec (bContext *C, wmOperator *)
void MATERIAL_OT_new (wmOperatorType *ot)
New Texture Operator
static wmOperatorStatus new_texture_exec (bContext *C, wmOperator *op)
void TEXTURE_OT_new (wmOperatorType *ot)
new world operator
static wmOperatorStatus new_world_exec (bContext *C, wmOperator *)
void WORLD_OT_new (wmOperatorType *ot)
Render Layer Add Operator
static wmOperatorStatus 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 wmOperatorStatus view_layer_remove_exec (bContext *C, wmOperator *)
void SCENE_OT_view_layer_remove (wmOperatorType *ot)
View Layer Add AOV Operator
static wmOperatorStatus view_layer_add_aov_exec (bContext *C, wmOperator *)
void SCENE_OT_view_layer_add_aov (wmOperatorType *ot)
View Layer Remove AOV Operator
static wmOperatorStatus view_layer_remove_aov_exec (bContext *C, wmOperator *)
void SCENE_OT_view_layer_remove_aov (wmOperatorType *ot)
View Layer Add Lightgroup Operator
static wmOperatorStatus view_layer_add_lightgroup_exec (bContext *C, wmOperator *op)
void SCENE_OT_view_layer_add_lightgroup (wmOperatorType *ot)
View Layer Remove Lightgroup Operator
static wmOperatorStatus view_layer_remove_lightgroup_exec (bContext *C, wmOperator *)
void SCENE_OT_view_layer_remove_lightgroup (wmOperatorType *ot)
View Layer Add Used Lightgroups Operator
static blender::Set< blender::StringRefNullget_used_lightgroups (Scene *scene)
static wmOperatorStatus 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 wmOperatorStatus view_layer_remove_unused_lightgroups_exec (bContext *C, wmOperator *)
void SCENE_OT_view_layer_remove_unused_lightgroups (wmOperatorType *ot)
Light Cache Free Operator
static wmOperatorStatus 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 wmOperatorStatus render_view_add_exec (bContext *C, wmOperator *)
void SCENE_OT_render_view_add (wmOperatorType *ot)
Render View Add Operator
static wmOperatorStatus render_view_remove_exec (bContext *C, wmOperator *)
void SCENE_OT_render_view_remove (wmOperatorType *ot)
Texture Slot Move Operator
static wmOperatorStatus texture_slot_move_exec (bContext *C, wmOperator *op)
void TEXTURE_OT_slot_move (wmOperatorType *ot)
Material Copy Operator
static wmOperatorStatus 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 wmOperatorStatus paste_material_exec (bContext *C, wmOperator *op)
void MATERIAL_OT_paste (wmOperatorType *ot)
Texture Slot Copy Operator
static wmOperatorStatus 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 wmOperatorStatus 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 wmOperatorStatus lightprobe_cache_bake_invoke (bContext *C, wmOperator *op, const wmEvent *)
static wmOperatorStatus lightprobe_cache_bake_modal (bContext *C, wmOperator *op, const wmEvent *event)
static void lightprobe_cache_bake_cancel (bContext *C, wmOperator *op)
static wmOperatorStatus 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)
Value:
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 1443 of file render_shading.cc.

Function Documentation

◆ copy_material_exec()

◆ copy_mtex_copybuf()

void copy_mtex_copybuf ( ID * id)
static

Definition at line 2986 of file render_shading.cc.

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

Referenced by copy_mtex_exec().

◆ copy_mtex_exec()

◆ copy_mtex_poll()

bool copy_mtex_poll ( bContext * C)
static

Definition at line 3080 of file render_shading.cc.

References C, 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 2981 of file render_shading.cc.

References mtexcopied.

Referenced by copy_mtex_exec(), and WM_init().

◆ get_used_lightgroups()

◆ lightprobe_cache_bake_cancel()

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

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

Definition at line 114 of file render_shading.cc.

References BKE_tempdir_base(), BLI_path_join, and FILE_MAX.

Referenced by copy_material_exec(), and paste_material_exec().

◆ MATERIAL_OT_copy()

void MATERIAL_OT_copy ( wmOperatorType * ot)

◆ MATERIAL_OT_new()

void MATERIAL_OT_new ( wmOperatorType * ot)

◆ MATERIAL_OT_paste()

void MATERIAL_OT_paste ( wmOperatorType * ot)

◆ material_slot_add_exec()

◆ material_slot_assign_exec()

◆ material_slot_copy_exec()

◆ material_slot_de_select()

◆ material_slot_deselect_exec()

wmOperatorStatus material_slot_deselect_exec ( bContext * C,
wmOperator *  )
static

Definition at line 521 of file render_shading.cc.

References C, and material_slot_de_select().

Referenced by OBJECT_OT_material_slot_deselect().

◆ material_slot_move_exec()

◆ material_slot_populated_poll()

bool material_slot_populated_poll ( bContext * C)
static

◆ material_slot_remove_all_exec()

◆ material_slot_remove_exec()

◆ material_slot_remove_poll()

◆ material_slot_remove_unused_exec()

◆ material_slot_select_exec()

wmOperatorStatus material_slot_select_exec ( bContext * C,
wmOperator *  )
static

Definition at line 502 of file render_shading.cc.

References C, and 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()

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

◆ object_array_for_shading_edit_mode_disabled_filter()

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

◆ object_array_for_shading_edit_mode_enabled()

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

◆ object_array_for_shading_edit_mode_enabled_filter()

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

void OBJECT_OT_material_slot_add ( wmOperatorType * ot)

◆ OBJECT_OT_material_slot_assign()

void OBJECT_OT_material_slot_assign ( wmOperatorType * ot)

◆ OBJECT_OT_material_slot_copy()

void OBJECT_OT_material_slot_copy ( wmOperatorType * ot)

◆ OBJECT_OT_material_slot_deselect()

void OBJECT_OT_material_slot_deselect ( wmOperatorType * ot)

◆ OBJECT_OT_material_slot_move()

void OBJECT_OT_material_slot_move ( wmOperatorType * ot)

◆ OBJECT_OT_material_slot_remove()

void OBJECT_OT_material_slot_remove ( wmOperatorType * ot)

◆ OBJECT_OT_material_slot_remove_all()

void OBJECT_OT_material_slot_remove_all ( wmOperatorType * ot)

◆ OBJECT_OT_material_slot_remove_unused()

void OBJECT_OT_material_slot_remove_unused ( wmOperatorType * ot)

◆ OBJECT_OT_material_slot_select()

void OBJECT_OT_material_slot_select ( wmOperatorType * ot)

◆ paste_material_exec()

◆ paste_material_nodetree_ids_decref()

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 2771 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()

◆ paste_mtex_copybuf()

void paste_mtex_copybuf ( ID * id)
static

◆ paste_mtex_exec()

◆ render_view_add_exec()

◆ render_view_remove_exec()

◆ render_view_remove_poll()

bool render_view_remove_poll ( bContext * C)
static

Definition at line 1732 of file render_shading.cc.

References RenderData::actview, C, CTX_data_scene(), and Scene::r.

Referenced by SCENE_OT_render_view_remove().

◆ SCENE_OT_render_view_add()

void SCENE_OT_render_view_add ( wmOperatorType * ot)

Definition at line 1756 of file render_shading.cc.

References OPTYPE_REGISTER, OPTYPE_UNDO, ot, and render_view_add_exec().

Referenced by ED_operatortypes_render().

◆ SCENE_OT_render_view_remove()

void SCENE_OT_render_view_remove ( wmOperatorType * ot)

◆ SCENE_OT_view_layer_add()

◆ SCENE_OT_view_layer_add_aov()

void SCENE_OT_view_layer_add_aov ( wmOperatorType * ot)

◆ SCENE_OT_view_layer_add_lightgroup()

void SCENE_OT_view_layer_add_lightgroup ( wmOperatorType * ot)

◆ SCENE_OT_view_layer_add_used_lightgroups()

void SCENE_OT_view_layer_add_used_lightgroups ( wmOperatorType * ot)

◆ SCENE_OT_view_layer_remove()

void SCENE_OT_view_layer_remove ( wmOperatorType * ot)

◆ SCENE_OT_view_layer_remove_aov()

void SCENE_OT_view_layer_remove_aov ( wmOperatorType * ot)

◆ SCENE_OT_view_layer_remove_lightgroup()

void SCENE_OT_view_layer_remove_lightgroup ( wmOperatorType * ot)

◆ SCENE_OT_view_layer_remove_unused_lightgroups()

void SCENE_OT_view_layer_remove_unused_lightgroups ( wmOperatorType * ot)

◆ TEXTURE_OT_new()

void TEXTURE_OT_new ( wmOperatorType * ot)

Definition at line 950 of file render_shading.cc.

References new_texture_exec(), OPTYPE_INTERNAL, OPTYPE_REGISTER, and ot.

Referenced by ED_operatortypes_render().

◆ TEXTURE_OT_slot_copy()

void TEXTURE_OT_slot_copy ( wmOperatorType * ot)

◆ TEXTURE_OT_slot_move()

void TEXTURE_OT_slot_move ( wmOperatorType * ot)

◆ TEXTURE_OT_slot_paste()

void TEXTURE_OT_slot_paste ( wmOperatorType * ot)

Definition at line 3151 of file render_shading.cc.

References OPTYPE_INTERNAL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and paste_mtex_exec().

Referenced by ED_operatortypes_render().

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

bool view_layer_remove_poll ( bContext * C)
static

◆ view_layer_remove_unused_lightgroups_exec()

◆ WORLD_OT_new()

void WORLD_OT_new ( wmOperatorType * ot)

Definition at line 1010 of file render_shading.cc.

References new_world_exec(), OPTYPE_INTERNAL, OPTYPE_REGISTER, OPTYPE_UNDO, and ot.

Referenced by ED_operatortypes_render().

Variable Documentation

◆ mtexcopied

short mtexcopied = 0
static

◆ mtexcopybuf

MTex mtexcopybuf
static

Definition at line 2979 of file render_shading.cc.

Referenced by copy_mtex_copybuf(), and paste_mtex_copybuf().