Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_point_instance.cc
| Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | static void get_instanced_data__collection( | ||||
| bke::PersistentCollectionHandle collection_handle = | bke::PersistentCollectionHandle collection_handle = | ||||
| params.get_input<bke::PersistentCollectionHandle>("Collection"); | params.get_input<bke::PersistentCollectionHandle>("Collection"); | ||||
| Collection *collection = params.handle_map().lookup(collection_handle); | Collection *collection = params.handle_map().lookup(collection_handle); | ||||
| if (collection == nullptr) { | if (collection == nullptr) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (BLI_listbase_is_empty(&collection->children) && | |||||
| BLI_listbase_is_empty(&collection->gobject)) { | |||||
| params.error_message_add(NODE_WARNING_INFO, "Collection is empty"); | |||||
| return; | |||||
| } | |||||
| const bool use_whole_collection = (node_storage->flag & | const bool use_whole_collection = (node_storage->flag & | ||||
| GEO_NODE_POINT_INSTANCE_WHOLE_COLLECTION) != 0; | GEO_NODE_POINT_INSTANCE_WHOLE_COLLECTION) != 0; | ||||
| if (use_whole_collection) { | if (use_whole_collection) { | ||||
| InstancedData instance; | InstancedData instance; | ||||
| instance.type = INSTANCE_DATA_TYPE_COLLECTION; | instance.type = INSTANCE_DATA_TYPE_COLLECTION; | ||||
| instance.data.collection = collection; | instance.data.collection = collection; | ||||
| r_instances_data.fill(instance); | r_instances_data.fill(instance); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines | |||||