index-of-nearest-104619 #2

Merged
Iliya Katushenock merged 62 commits from HooglyBoogly/blender:index-of-nearest-104619 into index_of_nearest 2023-04-20 21:19:53 +02:00
3 changed files with 4 additions and 9 deletions
Showing only changes of commit 2ab500c234 - Show all commits

View File

@ -70,8 +70,7 @@ void *BKE_pointcloud_add(struct Main *bmain, const char *name);
void *BKE_pointcloud_add_default(struct Main *bmain, const char *name); void *BKE_pointcloud_add_default(struct Main *bmain, const char *name);
struct PointCloud *BKE_pointcloud_new_nomain(int totpoint); struct PointCloud *BKE_pointcloud_new_nomain(int totpoint);
void BKE_pointcloud_nomain_to_pointcloud(struct PointCloud *pointcloud_src, void BKE_pointcloud_nomain_to_pointcloud(struct PointCloud *pointcloud_src,
struct PointCloud *pointcloud_dst, struct PointCloud *pointcloud_dst);
bool take_ownership);
struct BoundBox *BKE_pointcloud_boundbox_get(struct Object *ob); struct BoundBox *BKE_pointcloud_boundbox_get(struct Object *ob);

View File

@ -249,9 +249,7 @@ PointCloud *BKE_pointcloud_new_nomain(const int totpoint)
return pointcloud; return pointcloud;
} }
void BKE_pointcloud_nomain_to_pointcloud(PointCloud *pointcloud_src, void BKE_pointcloud_nomain_to_pointcloud(PointCloud *pointcloud_src, PointCloud *pointcloud_dst)
PointCloud *pointcloud_dst,
bool take_ownership)
{ {
BLI_assert(pointcloud_src->id.tag & LIB_TAG_NO_MAIN); BLI_assert(pointcloud_src->id.tag & LIB_TAG_NO_MAIN);
@ -260,9 +258,7 @@ void BKE_pointcloud_nomain_to_pointcloud(PointCloud *pointcloud_src,
const int totpoint = pointcloud_dst->totpoint = pointcloud_src->totpoint; const int totpoint = pointcloud_dst->totpoint = pointcloud_src->totpoint;
CustomData_copy(&pointcloud_src->pdata, &pointcloud_dst->pdata, CD_MASK_ALL, totpoint); CustomData_copy(&pointcloud_src->pdata, &pointcloud_dst->pdata, CD_MASK_ALL, totpoint);
if (take_ownership) {
BKE_id_free(nullptr, pointcloud_src); BKE_id_free(nullptr, pointcloud_src);
}
} }
bool PointCloud::bounds_min_max(blender::float3 &min, blender::float3 &max) const bool PointCloud::bounds_min_max(blender::float3 &min, blender::float3 &max) const

View File

@ -1107,7 +1107,7 @@ static bool modifier_apply_obdata(
/* Copy the relevant information to the original. */ /* Copy the relevant information to the original. */
Main *bmain = DEG_get_bmain(depsgraph); Main *bmain = DEG_get_bmain(depsgraph);
BKE_object_material_from_eval_data(bmain, ob, &pointcloud_eval->id); BKE_object_material_from_eval_data(bmain, ob, &pointcloud_eval->id);
BKE_pointcloud_nomain_to_pointcloud(pointcloud_eval, &points, true); BKE_pointcloud_nomain_to_pointcloud(pointcloud_eval, &points);
} }
else { else {
/* TODO: implement for volumes. */ /* TODO: implement for volumes. */