Commit Graph

4 Commits

Author SHA1 Message Date
Campbell Barton
3933f45f52 Cleanup: move doc-strings to declarations
Move into headers or to the top of the function body for internal
implementation details, in some cases remove duplicate doc-strings.
2025-04-18 22:58:36 +10:00
Jesse Yurkovich
eac1ade956 Fix #132077: Prevent stack-use-after-return inside USD_create_handle
Commit 0df5d8220b made a change to have the `USDStageReader` only keep
a reference to the ImportSettings struct. This isn't safe to do because
there's scenarios where the ImportSettings might be defined as a stack
variable but the reader outlives the lifetime of that variable. This
happens inside `USD_create_handle` where the reader is returned to the
caller for instance.

Fix this, and the original issue which lead to the change causing the
regression, by having `USDStageReader` own ImportSettings directly so
it's more obvious that it is A) tied to the lifetime of the reader and
B) can no longer become out of sync with a caller's own ImportSettings
data (since that no longer exists).

Pull Request: https://projects.blender.org/blender/blender/pulls/132095
2024-12-22 21:35:12 +01:00
Jesse Yurkovich
5bc71c8704 Cleanup: style changes for newly added USD DomeLight support code
A variety of non-functional style changes for the recently added
DomeLight code:

- Remove unused includes and forward decls
- Changed NULL -> nullptr
- Use `motionSampleTime` name consistently
- Moved the `r_value` out parameter to the last position per our coding
  guidelines

Pull Request: https://projects.blender.org/blender/blender/pulls/122641
2024-06-03 04:41:39 +02:00
Charles Wardlaw
e1a6749b3d USD: dome light IO
This commit adds logic to convert between USD dome lights and Blender
world materials.

The USD dome light rotation is represented in a mapping node input to the
environment texture.  If the dome light has a color specified in addition to
the texture map, the color will be converted to a vector multiply on the
the environment texture output.

I the imported USD has multiple dome lights, only the first dome light will
be converted to a world material.

Co-authored-by: kiki <charles@skeletalstudios.com>
Co-authored-by: Michael Kowalski <makowalski@nvidia.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/121800
2024-05-30 20:48:43 +02:00