Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/render/render_shading.c
| Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_font.h" | #include "BKE_font.h" | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_image.h" | #include "BKE_image.h" | ||||
| #include "BKE_layer.h" | #include "BKE_layer.h" | ||||
| #include "BKE_lib_id.h" | #include "BKE_lib_id.h" | ||||
| #include "BKE_linestyle.h" | #include "BKE_linestyle.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_material.h" | #include "BKE_material.h" | ||||
| #include "BKE_object.h" | |||||
| #include "BKE_paint.h" | #include "BKE_paint.h" | ||||
| #include "BKE_report.h" | #include "BKE_report.h" | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| #include "BKE_texture.h" | #include "BKE_texture.h" | ||||
| #include "BKE_workspace.h" | #include "BKE_workspace.h" | ||||
| #include "BKE_world.h" | #include "BKE_world.h" | ||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| ▲ Show 20 Lines • Show All 2,094 Lines • ▼ Show 20 Lines | void TEXTURE_OT_slot_paste(wmOperatorType *ot) | ||||
| ot->description = "Copy the texture settings and nodes"; | ot->description = "Copy the texture settings and nodes"; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->exec = paste_mtex_exec; | ot->exec = paste_mtex_exec; | ||||
| /* flags */ | /* flags */ | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL; | ||||
| } | } | ||||
| /********************** bake pass operators *********************/ | |||||
| static int bake_pass_add_exec(bContext *C, wmOperator *UNUSED(op)) | |||||
| { | |||||
| Object *ob = CTX_data_active_object(C); | |||||
| BKE_object_add_bake_pass(ob, NULL); | |||||
| ob->active_bake_pass = BLI_listbase_count(&ob->bake_passes) - 1; | |||||
| DEG_id_tag_update(&ob->id, 0); | |||||
| return OPERATOR_FINISHED; | |||||
| } | |||||
| void OBJECT_OT_bake_pass_add(wmOperatorType *ot) | |||||
| { | |||||
| /* identifiers */ | |||||
| ot->name = "Add Bake Pass"; | |||||
| ot->idname = "OBJECT_OT_bake_pass_add"; | |||||
| ot->description = "Add a bake pass"; | |||||
| /* api callbacks */ | |||||
| ot->exec = bake_pass_add_exec; | |||||
| /* flags */ | |||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL; | |||||
| } | |||||
| static int bake_pass_remove_exec(bContext *C, wmOperator *UNUSED(op)) | |||||
| { | |||||
| Object *ob = CTX_data_active_object(C); | |||||
| BakePass *bp = BLI_findlink(&ob->bake_passes, ob->active_bake_pass); | |||||
| if (!BKE_object_remove_bake_pass(ob, bp)) | |||||
| return OPERATOR_CANCELLED; | |||||
| DEG_id_tag_update(&ob->id, 0); | |||||
| return OPERATOR_FINISHED; | |||||
| } | |||||
| void OBJECT_OT_bake_pass_remove(wmOperatorType *ot) | |||||
| { | |||||
| /* identifiers */ | |||||
| ot->name = "Remove Bake Pass"; | |||||
| ot->idname = "OBJECT_OT_bake_pass_remove"; | |||||
| ot->description = "Remove the selected bake pass"; | |||||
| /* api callbacks */ | |||||
| ot->exec = bake_pass_remove_exec; | |||||
| /* flags */ | |||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL; | |||||
| } | |||||