Commit Graph

15 Commits

Author SHA1 Message Date
Bastien Montagne b684864561 Fix USD I/O crashing on reports by using new wmJob report system.
Calling `WM_report` & co API from wmJob worker thread is utterly unsafe,
and should never have been done. It 'worked' so far presumably because
worker threads were barely (if ever) reporting anything that way, but
now USD IO code is spamming reports in some cases, leading to fairly
common crashes.

Pull Request: https://projects.blender.org/blender/blender/pulls/113883
2023-10-20 11:08:27 +02:00
Denis Kovacs 7a9284107d USD: Improve camera import/export and round-tripping
Fix various issues in import and export of cameras.

* Wrong units and flipped shift values on import
* Wrong clip start lower range on import
* Wrong units for aperture and focal length properties on export
* Issue with auto sensor fit and height > width on export

Pull Request: https://projects.blender.org/blender/blender/pulls/112905
2023-10-05 19:47:11 +02:00
Campbell Barton bf35eb9cbc Cleanup: format 2023-08-18 08:38:02 +10:00
Michael Kowalski 6f4cb9bc56 USD: Skeleton and blend shape import
Added support for UsdSkel animation import.

This addresses #110076.

Added USDSkeletonReader class which imports UsdSkelSkeleton primitives
as armatures.

Extended USDMeshReader to import UsdSkelBlendShape as shape keys.

Extended USDMeshReader to import USD skinning data as as deform groups
and an armature modifier on the mesh object.

Added USDMeshReader::get_local_usd_xform() to override the transform
computation to account for the binding transformation for skinned meshes.

Pull Request: https://projects.blender.org/blender/blender/pulls/110912
2023-08-17 20:11:51 +02:00
Campbell Barton e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Campbell Barton 65f99397ec License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
Michael B Johnson 73509d1bc1 Fix #105327: USD import fails to recognize UV map varname
Follow connections when reading the varname attribute of a primvar
reader, and support both string and TfToken types for the varname.

A unit test is also provided.

Authored by Apple: Matt McLin

Pull Request: https://projects.blender.org/blender/blender/pulls/105508
2023-03-18 00:05:39 +01:00
Jacques Lucke bbc18673f3 Cleanup: make format 2023-02-02 13:16:39 +01:00
Michael Kowalski f359a39d11 Fix T100028: Convert USD camera properties to mm from USD units.
Authored by Sonny Campbell.

Currently when importing a USD file, some of the camera properties are
ignored, or the units are not converted correctly from USD world units.
On import we currently set the focal length, but not the camera sensor
size (horizontal and vertical aperture), so the camera field of view
is wrong. The sensor size information is in the USD file, but is ignored
for perspective cameras.

USD uses "tenth of a world unit" scale for some physical camera properties
like focal length and aperture.
https://graphics.pixar.com/usd/release/api/class_usd_geom_camera.html#UsdGeom_CameraUnits

I have added the UsdStage's metersPerUnit parameter to the ImportSettings
so the camera can do the required conversion on import. This will convert from
the USD file's world units to millimeters for Blender's camera settings.

Reviewed by: Sybren and makowalski.

Differential Revision: https://developer.blender.org/D16019
2023-01-30 17:22:26 -05:00
Bastien Montagne 3649c05f57 Cleanup: Run `make format` on codebase. 2023-01-30 09:40:17 +01:00
Michael Kowalski fa57c691f6 USD IO CI Tests
Various new CI tests for USD Import / Export functionalty:

Import:
 - Added mesh import tests for topology types and multiple UV sets. (Python)

Export:
 - Added a verification tests for mesh topology. (C++)
 - Added a test to make sure UsdPreviewSurface export conversion of materials
is correct. (C++)

Reviewed by: Sybren and Hans.

Differential Revision: https://developer.blender.org/D16274
2023-01-25 14:51:39 -05:00
Campbell Barton 3ca76ae0e8 Cleanup: remove "<pep8 compliant>" from headers
It can be assumed that all scripts comply with basic pep8 formatting
regarding white-space, indentation etc.

Also remove note in best practices page & update `tests/python/pep8.py`.

If we want to exclude some scripts from make format,
this can be done by adding them to `ignore_files` in:
source/tools/utils_maintenance/autopep8_format_paths.py

Or using `# nopep8` for to ignore for individual lines.

Ref T98554
2022-06-02 20:16:20 +10:00
Campbell Barton 3035235def Cleanup: run autopep8 on tests/ 2022-04-19 15:25:55 +10:00
Campbell Barton c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00
Michael Kowalski 0baa876b83 New test for USD import.
Added a basic test for importing a primitive hierarchy from a USDA
file into Blender.  This was reviewed by Sybren in patch D12479.
2021-10-20 12:07:28 -04:00