December 13, 2019, 04:30 (GMT) |
Cleanup: USD: remove unused header files |
December 13, 2019, 04:30 (GMT) |
USD: Check location of USD JSON files in unit tests This commit adds a test to see whether the USD JSON files can be found and loaded. Simply the ability to create a USD Stage for a specific filename means that the extension has been recognised by the USD library, and that a USD plugin has been loaded to write such files. USD has been patched to not only look in `{exe_directory}/lib/usd`, but also in `{exe_directory}/../lib/usd`; the latter is required to resolve the path for test executables in `bin/tests/`. |
December 13, 2019, 04:30 (GMT) |
USD: fixed paths in usd.diff I made the previous diff with `git diff` in the USD source, which produced paths incompatible with the patch command we use to apply it. |
December 13, 2019, 04:30 (GMT) |
USD: Fixed include path for unit tests, now TBB headers can be found |
December 13, 2019, 04:30 (GMT) |
USD: Allow running unit tests without 'make install' step When the PXR_PLUGINPATH_NAME environment variable is defined, the USD library uses it to find its JSON files. This allows the unit tests to run without having to 'make install' Blender. |
December 13, 2019, 04:30 (GMT) |
USD: Support '.usd' as export extension (thanks @superfunc) and proper filtering in the file browser |
December 13, 2019, 04:30 (GMT) |
USD: Fixed export of animated meshes I missed a bit earlier, when creating the mesh attributes with an explicit default, causing meshes to be non-animated. Now I use the 'sparse value writer', as recommended on the USD forum [1], and animated meshes are properly written once again. [1] https://groups.google.com/d/msg/usd-interest/cVJv_eDYxZo/oREDDm11AgAJ |
December 13, 2019, 04:30 (GMT) |
USD: patch USD to allow Blender to construct a path to JSON files USD requires some JSON files, and it uses a static constructor to determine the possible filesystem paths to find those files. This made it impossible for Blender to pass a path to the USD library at runtime, as the constructor would run before Blender's main() function. We have patched USD (see usd.diff) to avoid that particular static constructor, and have an initialisation function instead. |
December 13, 2019, 04:30 (GMT) |
USD: remove `PXR_PLUGINPATH_NAME` when testing |
December 13, 2019, 04:30 (GMT) |
USD: install libusd_m.a from usd.cmake instead of from harvesting step |
December 13, 2019, 04:30 (GMT) |
USD: Avoid potential conflict with 2nd USD library We now build the USD library with `-DPXR_SET_INTERNAL_NAMESPACE=usdBlender`, which replaces the default namespace `pxrInternal_v_x_y` with `usdBlender`. This is a preventative measure that avoids possible conflicts when add-ons try to load another USD library into the same process space. |
December 13, 2019, 04:30 (GMT) |
USD: added note about upstream pull request for PXR_BUILD_USD_TOOLS |
December 13, 2019, 04:30 (GMT) |
USD: no more fatal message in FindUSD.cmake Instead of breaking the build, it properly sets `USD_FOUND` to `FALSE`. |
December 13, 2019, 04:29 (GMT) |
USD: Build improvements - Removed the `USD_PATH` variable, expose `USD_ROOT_DIR` from `FindUSD.cmake` instead. - Properly call `find_package_wrapper(USD)` from `platform_unix.cmake`. - Added USD files to `harvest.cmake`. - Removed `external_python` from USD dependencies, as we don't use USD's Python interface. - Removed Fink and DarwinPorts support. - Enable USD in `blender_full.cmake` |
December 13, 2019, 04:29 (GMT) |
USD: Added & corrected GPL license blocks |
December 13, 2019, 04:29 (GMT) |
USD: Also `include pxrTargets-release.cmake` when harvesting dependencies |
December 13, 2019, 04:29 (GMT) |
USD: Replaced `#include "../usd.h"` with `#include "usd.h"` |
December 13, 2019, 04:29 (GMT) |
USD: Introducing USD support This commit introduces an exporter to Pixar's Universal Scene Description (USD) format. - The USD libraries are expected to be in /opt/usd/, not yet built by install_deps.sh. I'll work on that while this patch is under review. - Only experimental support for instancing; by default all duplicated objects are made real in the USD file. This is fine for exporting a linked-in posed character, not so much for thousands of pebbles etc. - This patch contains LazyDodo's fixes for building on Windows in D5359. == Meshes == USD seems to support neither per-material nor per-face-group double-sidedness, so we just use the flag from the first non-empty material slot. If there is no material we default to double-sidedness. Each UV map is stored on the mesh in a separate primvar. Materials can refer to these UV maps, but this is not yet exported by Blender. The primvar name is the same as the UV Map name. This is to allow the standard name "st" for texture coordinates by naming the UV Map as such, without having to guess which UV Map is the "standard" one. Face-varying mesh normals are written to USD. When the mesh has custom loop normals those are written. Otherwise the poly flag `ME_SMOOTH` is inspected to determine the normals. The UV maps and mesh normals take up a significant amount of space, so exporting them is optional. They're still enabled by default, though. For comparison: a shot of Spring (03_035_A) is 1.2 GiB when exported with UVs and normals, and 262 MiB without. We probably have room for optimisation of written UVs and normals. The mesh subdivision scheme isn't using the default value 'Catmull Clark', but uses 'None', indicating we're exporting a polygonal mesh. This is necessary for USD to understand our normals; otherwise the mesh is always rendered smooth. In the future we may want to expose this choice of subdivision scheme to the user, or auto-detect it when we actually support exporting pre-subdivision meshes. A possible optimisation could be to inspect whether all polygons are smooth or flat, and mark the USD mesh as such. This can be added when needed. == Animation == Mesh and transform animation are now written when passing `animation=True` to the export operator. There is no inspection of whether an object is actually animated or not; USD can handle deduplication of static values for us. The administration of which timecode to use for the export is left to the file-format-specific concrete subclasses of `AbstractHierarchyIterator`; the abstract iterator itself doesn't know anything about the passage of time. This will allow subclasses for the frame-based USD format and time-based Alembic format. == support for simple preview materials == Very simple versions of the materials are now exported, using only the viewport diffuse RGB, metallic, and roughness. When there are multiple materials, the mesh faces are stored as geometry subset and each material is assigned to the appropriate subset. If there is only one material this is skipped. The first material if any) is always applied to the mesh itself (regardless of the existence of geometry subsets), because the Hydra viewport doesn't support materials on subsets. See https://github.com/PixarAnimationStudios/USD/issues/542 for more info. Note that the geometry subsets are not yet time-sampled, so it may break when an animated mesh changes topology. == Hair == Only the parent strands are exported, and only with a constant colour. No UV coordinates, no information about the normals. == Camera == Only perspective cameras are supported for now. == Particles == Particles are only written when they are alive, which means that they are always visible (there is currently no code that deals with marking them as invisible outside their lifespan). Particle-system-instanced objects are exported by suffixing the object name with the particle's persistent ID, giving each particle XForm a unique name. == Instancing/referencing == This exporter has experimental support for instancing/referencing. Dupli-object meshes are now written to USD as references to the original mesh. This is still very limited in correctness, as there are issues referencing to materials from a referenced mesh. I am still committing this, as it gives us a place to start when continuing the quest for proper instancing in USD. == Lights == USD does not directly support spot lights, so those aren't exported yet. It's possible to add this in the future via the UsdLuxShapingAPI. The units used for the light intensity are also still a bit of a mystery. == Fluid vertex velocities == Currently only fluid simulations (not meshes in general) have explicit vertex velocities. This is the most important case for exporting velocities, though, as the baked mesh changes topology all the time, and thus computing the velocities at import time in a post-processing step is hard. |
December 13, 2019, 04:29 (GMT) |
Automated test for USD's AbstractHierarchyIterator |
December 13, 2019, 04:29 (GMT) |
USD: build & install USD with 'make deps' |
|