From ef228d92f2e77ffab3b764a307415e951c90b608 Mon Sep 17 00:00:00 2001 From: Michael Kowalski Date: Thu, 24 Mar 2022 11:53:45 -0400 Subject: Fix: Volume grid duplication on USD import. Fix provided by Piotr Makal in patch D14204. This patch fixes volume grid duplication which was occurring during importing USD files. This was caused by calling BKE_volume_grid_add twice per grid (excluding 'density' grid) for the same Volume object: (1) in USDVolumeReader::read_object_data and (2) later in BKE_volume_load. Differential Revision: https://developer.blender.org/D14204 --- source/blender/io/usd/intern/usd_reader_volume.cc | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/source/blender/io/usd/intern/usd_reader_volume.cc b/source/blender/io/usd/intern/usd_reader_volume.cc index aec30539ee6..13044de5002 100644 --- a/source/blender/io/usd/intern/usd_reader_volume.cc +++ b/source/blender/io/usd/intern/usd_reader_volume.cc @@ -54,18 +54,6 @@ void USDVolumeReader::read_object_data(Main *bmain, const double motionSampleTim pxr::UsdVolOpenVDBAsset fieldBase(fieldPrim); - pxr::UsdAttribute fieldNameAttr = fieldBase.GetFieldNameAttr(); - - if (fieldNameAttr.IsAuthored()) { - pxr::TfToken fieldName; - fieldNameAttr.Get(&fieldName, motionSampleTime); - - /* A Blender volume creates density by default. */ - if (fieldName != usdtokens::density) { - BKE_volume_grid_add(volume, fieldName.GetString().c_str(), VOLUME_GRID_FLOAT); - } - } - pxr::UsdAttribute filepathAttr = fieldBase.GetFilePathAttr(); if (filepathAttr.IsAuthored()) { -- cgit v1.2.3