Age | Commit message (Collapse) | Author |
|
The UsdPrimReader class doesn't need a stage pointer as a
member because the stage can implicitly be accessed
through the prim itself, as long as the prim is valid.
I removed the UsdPrimReader::stage_ member and updated the
relevant constructors and function calls. Also, updated
the various readers to construct schemas directly from
the contained prim, e.g., pxr::UsdLuxRectLight rect_light(prim_)
|
|
Removed empty add_cache_modifier() function and made
create_object() abstract.
|
|
To be consistent with the convention used in the USD exporter,
updated class member variables to consistently use snake case
and trailing underscores instead of the m_ prefix.
|
|
As part of code cleanup, now using snake case consistently
for class member function names, to match the convention
used in the USD exporter code.
|
|
Added blender::io::usd namespace where it was missing, to
conform to the convention used in the USD exporter code.
|
|
|
|
Replaced include guards with pragma once directives,
to conform to the conventions used in the existing USD
export code.
|
|
|
|
|
|
Added support for reading the display color primvars. This
option is off by default in the mesh read flags.
|
|
Checking for null pointer to avoid crash when custom data
allocation fails.
|
|
|
|
Fixed a crash where polys were not being read for new meshes when
the MOD_MESHSEQ_READ_POLY flag isn't set. Crash occurs because
downstream code expects polys to exist. Modified the logic to
always read verts and polys for new meshes, regardless of the
value of the read flag.
|
|
The Import Subdiv Option can sometimes behave unexpectedly,
losing all sharp edges. Turning this option off by default
until the behavior can be fine tuned.
|
|
|
|
Added new float import option to scale intensity of imported
lights.
|
|
|
|
Updated the USDXformReader matrix computation function to use the
standard UsdGeomXformable API for querying the prim's local
transform and to determine whether the matrix is time-varying,
rather than explicitly iterating over the UsdGeomXformOps.
|
|
|
|
Added a Convert to Z Up import option and logic to rotate
imported root objects 90 degrees about the X-axis if this
option is checked and the USD stage up-axis is Y.
|
|
Updated the code to apply the global scale option, which
was previously ignored. Fixed application of global scale
in the xform reader matrix calculation to only apply the
scale to root objects. Also fixed bug in setting the
is_constant flag and simplified some of the code.
|
|
|
|
|
|
Added experimental Import USD Preview option to convert
UsdPreviewSurface shaders to Principled BSD shader networks,
for an approximate preview. Added new USDMaterialReader
class, which implements this feature. Also added a
Set Material Blend option to automatically set the material
blend method based on the UsdPreviewSurface shader's opacity
and opacityThreshold inputs. Finally, updated the logic so that
no materials will be imported if the Materials option is
not checked.
|
|
Fixed bug where several USDPrimReader class member variables
were not being intialized in the constructor. One of the
previously uninitialized variables stores the reference count,
which was causing memory leaks in some cases.
|
|
Made the following updates to fix UV import errors:
Added logic to read UVs with Vertex interpolation and
indexed UVs. Fixed incorrect UV winding order for
left-handed orientation.
|
|
Small edit to the Instancing import option parameter
description. Now allowing setting null instance collection
on USDInstanceReader objects.
|
|
|
|
Added an experimental Instancing option to support
importing USD scenegraph instances as Blender
instanced collections.
|
|
Fixed occasional random crash due to simultaneous update
to the dependency graph from multiple threads. A typical
collision might happen when the USD import job thread
is creating a material while the window manager in the
main thread is processing event notifiers. The current
fix is to remove the ND_FRAME flag from the call to
WM_jobs_timer(), which prevents ED_update_for_newframe()
from being called from wm_event_do_notifiers().
|
|
Added logic to import USD normals with uniform interpolation
(i.e., per-face normals) as Blender loop normals.
|
|
Currently, the importer converts every node in the USD
to a Blender Empty object by default, including nodes
that aren't of UsdGeomImageable type, such as materials
and shaders. This can unnecessarily bloat the Blender
scene with nodes that are not immediately useful. I've
added logic to restrict conversion to nodes that are
UsdGeomImageables, and this can have a dramatic effect
in some cases. For exmaple, the number of nodes imported
in the Attic scene is reduced from 1,025 to 238 with
this change.
|
|
USD_get_transform() was not taking the object's parent
transform into account. Now following the same logic
as in the corresponding Alembic implementation,
ABC_get_transform(), to fix this.
|
|
Added new option to prune primitives by visibility.
If this option is enabled, invisible prims will
be excluded from the traversal. This only applies
to prims with a non-animating visibility attribute.
Prims with animating visibility will always be imported.
|
|
Also added check to ensure normal and loop counts match.
|
|
Uninitialized USDMeshReader::m_isLeftHanded flag was
causing the vertex winding orientation to randomly flip,
causing incorrect shading and other issues.
|
|
Per Pixar UsdGeomPointBased documentation: If 'normals' and
'primvars:normals' are both specified, the latter has precedence.
|
|
If point normals are empty, now invoking BKE_mesh_calc_normals()
to avoid black renders. Since BKE_mesh_calc_normals() requires
edges to be defined, moving point normal calculation to follow
reading polys.
|
|
Setting point normals by invoking normal_float_to_short_v3(),
instead of directly assigning components as floats.
|
|
Removed call to BKE_mesh_calc_edges() after setting
UVs, as this function is already called after setting
polys. Moreover, the second, redundant call was causing
incorrect viewport shading of previously set custom
normals. Now also setting the ME_AUTOSMOOTH mesh flag
to enable shading with custom normals.
|
|
Added new stage traversal options to filter prim import
based on purpose (guide, proxy and render) and whether
to traverse instances with instance proxies. Also modified
the stage traversal logic to avoid a small memory leak due to
creating a reader for the pseudo root which is never used or
deleted.
|
|
|
|
Cherry-picked commit of Tangent Animation's
USD importer from branch ta-usd-import in
https://github.com/tangent-opensource/blender.git.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|