48 return object->light_linking->receiver_collection;
50 return object->light_linking->blocker_collection;
86 return new_collection;
108 object->light_linking->receiver_collection = new_collection;
111 object->light_linking->blocker_collection = new_collection;
118 if (new_collection) {
140 if (collection_object->ob ==
object) {
141 return collection_object;
152 if (collection_child->collection == child) {
153 return collection_child;
173 if (!collection_object) {
174 BLI_assert_msg(0,
"Object was not found after added to the light linking collection");
194 if (!collection_child) {
195 BLI_assert_msg(0,
"Collection was not found after added to the light linking collection");
211 if (id_type ==
ID_OB) {
218 else if (id_type ==
ID_GR) {
220 bmain, collection,
reinterpret_cast<Collection *
>(receiver));
226 if (!collection_light_linking) {
230 collection_light_linking->
link_state = link_state;
243 if (!receiver_collection_child) {
244 BLI_assert_msg(0,
"Receiver child was not found after adding collection to light linking");
250 if (before_id_type !=
ID_GR) {
260 collection,
reinterpret_cast<const Collection *
>(before));
261 if (!before_collection_child) {
275 if (!receiver_collection_child) {
276 BLI_assert_msg(0,
"Receiver child was not found after adding collection to light linking");
282 if (after_id_type !=
ID_GR) {
292 collection,
reinterpret_cast<const Collection *
>(after));
293 if (!after_collection_child) {
307 if (!receiver_collection_object) {
309 0,
"Receiver collection object was not found after adding collection to light linking");
315 if (before_id_type !=
ID_OB) {
325 collection,
reinterpret_cast<const Object *
>(before));
326 if (!before_collection_object) {
338 if (!receiver_collection_object) {
340 0,
"Receiver collection object was not found after adding collection to light linking");
346 if (after_id_type !=
ID_OB) {
356 collection,
reinterpret_cast<const Object *
>(after));
357 if (!after_collection_object) {
382 if (id_type ==
ID_OB) {
385 else if (id_type ==
ID_GR) {
406 if (id_type ==
ID_OB) {
409 else if (id_type ==
ID_GR) {
421 if (id_type ==
ID_OB) {
424 else if (id_type ==
ID_GR) {
430 "Cannot unlink unsupported '%s' from light linking collection '%s'",
437 if (id_type ==
ID_OB) {
481 if (base->object == emitter) {
bool BKE_collection_object_remove(Main *bmain, Collection *collection, Object *ob, bool free_us)
bool BKE_collection_child_remove(Main *bmain, Collection *parent, Collection *child)
Collection * BKE_collection_add(Main *bmain, Collection *collection_parent, const char *name_custom)
bool BKE_collection_child_add(Main *bmain, Collection *parent, Collection *child)
bool BKE_collection_object_add(Main *bmain, Collection *collection, Object *ob)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
ListBase * BKE_view_layer_object_bases_get(ViewLayer *view_layer)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_insertlinkafter(ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_insertlinkbefore(ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
#define SNPRINTF(dst, format,...)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
ID and Library types, which are fundamental for SDNA.
Object groups, one object can be in many groups at once.
eCollectionLightLinkingState
Object is a sort of wrapper for general info.
#define OB_TYPE_IS_GEOMETRY(_type)
#define BASE_SELECTED(v3d, base)
Read Guarded memory(de)allocation.
void BKE_light_linking_add_receiver_to_collection_before(Main *bmain, Collection *collection, ID *receiver, const ID *before, const eCollectionLightLinkingState link_state)
static CollectionObject * find_collection_object(const Collection *collection, const Object *object)
Collection * BKE_light_linking_collection_get(const Object *object, const LightLinkingType link_type)
static CollectionLightLinking * light_linking_collection_add_collection(Main *bmain, Collection *collection, Collection *child)
void BKE_light_linking_collection_assign_only(Object *object, Collection *new_collection, const LightLinkingType link_type)
void BKE_light_linking_free_if_empty(Object *object)
bool BKE_light_linking_unlink_id_from_collection(Main *bmain, Collection *collection, ID *id, ReportList *reports)
void BKE_light_linking_add_receiver_to_collection_after(Main *bmain, Collection *collection, ID *receiver, const ID *after, const eCollectionLightLinkingState link_state)
static void order_collection_receiver_before(Collection *collection, Collection *receiver, const ID *before)
static CollectionChild * find_collection_child(const Collection *collection, const Collection *child)
Collection * BKE_light_linking_collection_new(Main *bmain, Object *object, const LightLinkingType link_type)
static CollectionLightLinking * light_linking_collection_add_object(Main *bmain, Collection *collection, Object *object)
void BKE_light_linking_add_receiver_to_collection(Main *bmain, Collection *collection, ID *receiver, const eCollectionLightLinkingState link_state)
void BKE_light_linking_select_receivers_of_emitter(Scene *scene, ViewLayer *view_layer, Object *emitter, const LightLinkingType link_type)
static std::string get_default_collection_name(const Object *object, const LightLinkingType link_type)
static void order_object_receiver_before(Collection *collection, Object *receiver, const ID *before)
void BKE_light_linking_collection_assign(Main *bmain, Object *object, Collection *new_collection, const LightLinkingType link_type)
static void order_object_receiver_after(Collection *collection, Object *receiver, const ID *after)
static void order_collection_receiver_after(Collection *collection, Collection *receiver, const ID *after)
void BKE_light_linking_link_receiver_to_emitter(Main *bmain, Object *emitter, Object *receiver, const LightLinkingType link_type, const eCollectionLightLinkingState link_state)
void * MEM_callocN(size_t len, const char *str)
CollectionLightLinking light_linking
CollectionLightLinking light_linking
struct Collection * blocker_collection
struct Collection * receiver_collection
LightLinking * light_linking