-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
USD VolumeAlgo : Fix crash loading empty field
If an attribute has no value, `DataAlgo::fromUSD()` returns `nullptr`, and we were dereferencing it. We could probably still use a `static_cast` here as long as we checked for null, since we don't expect anything but StringData when non-null. But since I failed to predict this outcome, I've gone belt-and-braces and used a `runTimeCast()`.
- Loading branch information
1 parent
ac82753
commit 97c19f0
Showing
4 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
contrib/IECoreUSD/test/IECoreUSD/data/volumeWithEmptyField.usda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#usda 1.0 | ||
|
||
def Volume "volume" | ||
{ | ||
custom rel field:density = </volume/density> | ||
|
||
def OpenVDBAsset "density" | ||
{ | ||
} | ||
} | ||
|