27#include "RNA_prototypes.hh"
35template<LightLinkingType link_type>
49 ot->
name =
"New Light Linking Collection";
50 ot->
description =
"Create new light linking collection used by the active emitter";
51 ot->
idname =
"OBJECT_OT_light_linking_receiver_collection_new";
64 ot->
name =
"New Light Linking Collection";
65 ot->
description =
"Create new light linking collection used by the active emitter";
66 ot->
idname =
"OBJECT_OT_light_linking_blocker_collection_new";
82template<LightLinkingType link_type>
100 ot->
name =
"Select Light Linking Receivers";
101 ot->
description =
"Select all objects which receive light from this emitter";
102 ot->
idname =
"OBJECT_OT_light_linking_receivers_select";
115 ot->
name =
"Select Light Linking Blockers";
116 ot->
description =
"Select all objects which block light from this emitter";
117 ot->
idname =
"OBJECT_OT_light_linking_blockers_select";
133template<LightLinkingType link_type>
145 collection_scene !=
nullptr)
149 "Cannot link to light linking collection '%s' that is used by scene '%s'",
151 collection_scene->id.name + 2);
156 if (receiver == emitter) {
179 "Include selected receivers to receive light from the active emitter"},
184 "Exclude selected receivers from receiving light from the active emitter"},
185 {0,
nullptr, 0,
nullptr,
nullptr},
189 ot->
name =
"Link Receiver Objects to Emitter";
190 ot->
description =
"Light link selected objects to the active emitter object";
191 ot->
idname =
"OBJECT_OT_light_linking_receivers_link";
205 "State of the light linking");
215 "Include selected blockers to cast shadows from the active emitter"},
220 "Exclude selected blockers from casting shadows from the active emitter"},
221 {0,
nullptr, 0,
nullptr,
nullptr},
225 ot->
name =
"Link Blockers to Emitter";
226 ot->
description =
"Light link selected blockers to the active emitter object";
227 ot->
idname =
"OBJECT_OT_light_linking_blockers_link";
241 "State of the shadow linking");
258 if (!
id || !collection) {
265 "Cannot unlink from light linking collection '%s' that is used by scene '%s'",
286 ot->
name =
"Remove From Light Linking Collection";
287 ot->
description =
"Remove this object or collection from the light linking collection";
288 ot->
idname =
"OBJECT_OT_light_linking_unlink_from_collection";
#define CTX_DATA_BEGIN(C, Type, instance, member)
Object groups, one object can be in many groups at once.
#define ND_SPACE_OUTLINER
void OBJECT_OT_light_linking_receiver_collection_new(wmOperatorType *ot)
static wmOperatorStatus light_linking_collection_new_exec(bContext *C, wmOperator *)
static wmOperatorStatus light_linking_link_exec(bContext *C, wmOperator *op)
static wmOperatorStatus light_linking_select_exec(bContext *C, wmOperator *)
void OBJECT_OT_light_linking_blocker_collection_new(wmOperatorType *ot)
static wmOperatorStatus light_linking_unlink_from_collection_exec(bContext *C, wmOperator *op)
void OBJECT_OT_light_linking_unlink_from_collection(wmOperatorType *ot)
Object * context_active_object(const bContext *C)
void OBJECT_OT_light_linking_receivers_link(wmOperatorType *ot)
void OBJECT_OT_light_linking_blockers_select(wmOperatorType *ot)
void OBJECT_OT_light_linking_receivers_select(wmOperatorType *ot)
void OBJECT_OT_light_linking_blockers_link(wmOperatorType *ot)
struct Collection * BKE_light_linking_collection_new(struct Main *bmain, struct Object *object, LightLinkingType link_type)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
ViewLayer * CTX_data_view_layer(const bContext *C)
eCollectionLightLinkingState
@ COLLECTION_LIGHT_LINKING_STATE_INCLUDE
@ COLLECTION_LIGHT_LINKING_STATE_EXCLUDE
struct Collection * BKE_light_linking_collection_get(const struct Object *object, LightLinkingType link_type)
void BKE_light_linking_select_receivers_of_emitter(const Main &bmain, struct Scene *scene, struct ViewLayer *view_layer, struct Object *emitter, LightLinkingType link_type)
bool ED_operator_object_active(bContext *C)
bool ED_operator_object_active_editable(bContext *C)
Scene * BKE_scene_find_from_collection(const Main *bmain, const Collection *collection)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
bool BKE_light_linking_unlink_id_from_collection(struct Main *bmain, struct Collection *collection, struct ID *id, struct ReportList *reports)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Main * CTX_data_main(const bContext *C)
void BKE_light_linking_link_receiver_to_emitter(struct Main *bmain, struct Object *emitter, struct Object *receiver, LightLinkingType link_type, eCollectionLightLinkingState link_state)
Scene * CTX_data_scene(const bContext *C)
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports