79 return object->light_linking->receiver_collection;
81 return object->light_linking->blocker_collection;
117 return new_collection;
126 if (old_collection) {
131 if (new_collection) {
139 object->light_linking->receiver_collection = new_collection;
142 object->light_linking->blocker_collection = new_collection;
149 if (new_collection) {
171 if (collection_object->ob ==
object) {
172 return collection_object;
183 if (collection_child->collection == child) {
184 return collection_child;
204 if (!collection_object) {
205 BLI_assert_msg(0,
"Object was not found after added to the light linking collection");
225 if (!collection_child) {
226 BLI_assert_msg(0,
"Collection was not found after added to the light linking collection");
242 if (id_type ==
ID_OB) {
255 else if (id_type ==
ID_GR) {
257 bmain, collection,
reinterpret_cast<Collection *
>(receiver));
263 if (!collection_light_linking) {
267 collection_light_linking->
link_state = link_state;
280 if (!receiver_collection_child) {
281 BLI_assert_msg(0,
"Receiver child was not found after adding collection to light linking");
287 if (before_id_type !=
ID_GR) {
297 collection,
reinterpret_cast<const Collection *
>(before));
298 if (!before_collection_child) {
312 if (!receiver_collection_child) {
313 BLI_assert_msg(0,
"Receiver child was not found after adding collection to light linking");
319 if (after_id_type !=
ID_GR) {
329 collection,
reinterpret_cast<const Collection *
>(after));
330 if (!after_collection_child) {
344 if (!receiver_collection_object) {
346 0,
"Receiver collection object was not found after adding collection to light linking");
352 if (before_id_type !=
ID_OB) {
362 collection,
reinterpret_cast<const Object *
>(before));
363 if (!before_collection_object) {
375 if (!receiver_collection_object) {
377 0,
"Receiver collection object was not found after adding collection to light linking");
383 if (after_id_type !=
ID_OB) {
393 collection,
reinterpret_cast<const Object *
>(after));
394 if (!after_collection_object) {
419 if (id_type ==
ID_OB) {
422 else if (id_type ==
ID_GR) {
443 if (id_type ==
ID_OB) {
446 else if (id_type ==
ID_GR) {
458 if (id_type ==
ID_OB) {
461 else if (id_type ==
ID_GR) {
467 "Cannot unlink unsupported '%s' from light linking collection '%s'",
474 if (id_type ==
ID_OB) {
523 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_contains_geometry_recursive(const Collection *collection)
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)
@ LIB_ID_CREATE_NO_USER_REFCOUNT
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_UTF8(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)
void BKE_light_linking_copy(Object *object_dst, const Object *object_src, const int copy_flags)
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)
void BKE_light_linking_delete(Object *object, const int delete_flags)
static void order_object_receiver_before(Collection *collection, Object *receiver, const ID *before)
void BKE_light_linking_ensure(Object *object)
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)
void * MEM_dupallocN(const void *vmemh)
CollectionLightLinking light_linking
CollectionLightLinking light_linking
struct Collection * blocker_collection
struct Collection * receiver_collection
struct Collection * instance_collection
LightLinking * light_linking