Skip to content

Commit

Permalink
Sync up with the latest OpenUSD dev with conflicts and problems resol…
Browse files Browse the repository at this point in the history
…ved - PR PixarAnimationStudios#630

Merge pull request PixarAnimationStudios#630 from autodesk-forks/resolve/dev
  • Loading branch information
francis-wangfr authored and GitHub Enterprise committed Oct 16, 2023
2 parents 7082ac8 + 3fd9e45 commit 304384c
Show file tree
Hide file tree
Showing 116 changed files with 2,700 additions and 591 deletions.
6 changes: 3 additions & 3 deletions VERSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ Our test machines have the following software versions installed.
| ------------- | -------------------- | ---------------------------- | ------------------------------ |
| OS | CentOS Linux 7 | 10.15.7 | Windows 10 |
| C++ Compiler | gcc 9.3.1 | Apple clang 13.1.6 (Xcode 13.3) | Visual Studio 2017 15.9 |
| CMake | 3.17.5 | 3.19.5 | 3.16.5 |
| Python | 3.6.8 | 3.7.7 | 3.7.4, 3.8.10 |
| CMake | 3.17.5 | 3.19.5 | 3.25.3 |
| Python | 3.9.16 | 3.9.13 | 3.9.13 |
| Boost | 1.76.0 | 1.78.0 | 1.76.0 |
| Intel TBB | 2020 Update 3 | 2018 Update 1, 2020 Update 3 | 2020 Update 3 |
| OpenSubdiv | 3.5.1 | 3.5.1 | 3.5.1 |
| OpenImageIO | 2.3.21.0 | 2.3.21.0 | 2.3.21.0 |
| OpenColorIO | 2.1.3 | 2.1.3 | 2.1.3 |
| OSL | 1.10.9 | | |
| Ptex | 2.4.2 | 2.4.2 | 2.4.2 |
| Qt for Python | PySide2 5.14.1 | PySide6 6.3.1 | PySide2 5.14.1 |
| Qt for Python | PySide2 5.15.2.1 | PySide6 6.3.1 | PySide2 5.15.2.1 |
| PyOpenGL | 3.1.5 | 3.1.5 | 3.1.5 |
| Embree | 3.2.2 | 3.13.3 | 3.2.2 |
| RenderMan | 24.4, 25.0 | 24.4, 25.0 | 24.4, 25.0 |
Expand Down
8 changes: 7 additions & 1 deletion cmake/defaults/CXXDefaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ _add_define(BOOST_PYTHON_NO_PY_SIGNATURES)
# Parts of boost (in particular, boost::hash) rely on deprecated features
# of the STL that have been removed from some implementations under C++17.
# This define tells boost not to use those features.
_add_define(BOOST_NO_CXX98_FUNCTION_BASE)
#
# Under Visual Studio, boost automatically detects that this flag is
# needed so we don't need to define it ourselves. Otherwise, we'll get a
# C4005 macro redefinition warning.
if (NOT MSVC)
_add_define(BOOST_NO_CXX98_FUNCTION_BASE)
endif()

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
_add_define(BUILD_OPTLEVEL_DEV)
Expand Down
16 changes: 8 additions & 8 deletions cmake/macros/Private.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ function(_copy_headers LIBRARY_NAME)
get_filename_component(dir_to_create "${outfile}" PATH)
add_custom_command(
OUTPUT ${outfile}
COMMAND ${CMAKE_COMMAND} -E make_directory "${dir_to_create}"
COMMAND ${CMAKE_COMMAND} -Dinfile="${infile}" -Doutfile="${outfile}" -P "${PROJECT_SOURCE_DIR}/cmake/macros/copyHeaderForBuild.cmake"
MAIN_DEPENDENCY "${infile}"
COMMAND ${CMAKE_COMMAND} -E make_directory ${dir_to_create}
COMMAND ${CMAKE_COMMAND} -Dinfile=${infile} -Doutfile=${outfile} -P "${PROJECT_SOURCE_DIR}/cmake/macros/copyHeaderForBuild.cmake"
MAIN_DEPENDENCY ${infile}
COMMENT "Copying ${f} ..."
VERBATIM
)
Expand Down Expand Up @@ -756,19 +756,19 @@ function(_pxr_target_link_libraries NAME)

get_property(defs TARGET ${lib} PROPERTY INTERFACE_COMPILE_DEFINITIONS)
foreach(def ${defs})
if(NOT ";${finalDefs};" MATCHES ";${def};")
if(NOT def IN_LIST finalDefs)
list(APPEND finalDefs "${def}")
endif()
endforeach()
get_property(incs TARGET ${lib} PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
foreach(inc ${incs})
if(NOT ";${finalIncs};" MATCHES ";${inc};")
if(NOT inc IN_LIST finalIncs)
list(APPEND finalIncs "${inc}")
endif()
endforeach()
get_property(incs TARGET ${lib} PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES)
foreach(inc ${incs})
if(NOT ";${finalSystemIncs};" MATCHES ";${inc};")
if(NOT inc IN_LIST finalSystemIncs)
list(APPEND finalSystemIncs "${inc}")
endif()
endforeach()
Expand All @@ -794,7 +794,7 @@ function(_pxr_target_link_libraries NAME)
else()
set(entry "${lib}")
endif()
if(entry AND NOT ";${finalLibs};" MATCHES ";${entry};")
if(entry AND NOT entry IN_LIST finalLibs)
list(APPEND finalLibs "${entry}")
endif()
endif()
Expand Down Expand Up @@ -845,7 +845,7 @@ function(_pxr_target_link_libraries NAME)
_pxr_transitive_internal_libraries("${internal}" internal)
set(final "")
foreach(lib ${internal})
if(";${PXR_STATIC_LIBS};" MATCHES ";${lib};")
if(lib IN_LIST PXR_STATIC_LIBS)
# The library is explicitly static.
list(APPEND final ${lib})
elseif(MSVC)
Expand Down
26 changes: 16 additions & 10 deletions cmake/macros/Public.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function(pxr_build_documentation)
# Execute doxygen during the install step. All of the files we want
# doxygen to process should already have been copied to the docs
# directory during the build step
install(CODE "execute_process(COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxyfile)")
install(CODE "execute_process(COMMAND ${DOXYGEN_EXECUTABLE} \"${PROJECT_BINARY_DIR}/Doxyfile\")")

set(INST_DOCS_ROOT "${CMAKE_INSTALL_PREFIX}/docs")

Expand Down Expand Up @@ -1348,12 +1348,18 @@ function(pxr_build_python_documentation)
string(REPLACE ";" "," pxrPythonModulesStr "${pxrPythonModules}")
# Run convertDoxygen on the module list, setting PYTHONPATH
# to the install path for the USD Python modules
install(CODE "execute_process(\
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/cmake \
COMMAND ${PYTHON_EXECUTABLE} ${CONVERT_DOXYGEN_TO_PYTHON_DOCS_SCRIPT} \
--package pxr --module ${pxrPythonModulesStr} \
--inputIndex ${BUILT_XML_DOCS}/index.xml \
--pythonPath ${CMAKE_INSTALL_PREFIX}/lib/python \
--output ${INSTALL_PYTHON_PXR_ROOT})")

endfunction() # pxr_build_python_documentation
install(CODE "\
execute_process(\
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/cmake \
RESULT_VARIABLE convert_doxygen_return_code
COMMAND ${PYTHON_EXECUTABLE} ${CONVERT_DOXYGEN_TO_PYTHON_DOCS_SCRIPT} \
--package pxr --module ${pxrPythonModulesStr} \
--inputIndex ${BUILT_XML_DOCS}/index.xml \
--pythonPath ${CMAKE_INSTALL_PREFIX}/lib/python \
--output ${INSTALL_PYTHON_PXR_ROOT})
if (NOT \${convert_doxygen_return_code} EQUAL \"0\")
message( FATAL_ERROR \"Error generating python docstrings - ${CONVERT_DOXYGEN_TO_PYTHON_DOCS_SCRIPT} return code: \${convert_doxygen_return_code} \")
endif()
")

endfunction() # pxr_build_python_documentation
9 changes: 3 additions & 6 deletions cmake/macros/copyHeaderForBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
file(TO_NATIVE_PATH ${infile} INFILE)
file(TO_NATIVE_PATH ${outfile} OUTFILE)

file(READ "${INFILE}" _tmp_file_content)
file(WRITE "${OUTFILE}" "\#line 1 ${infile}\n")
file(APPEND "${OUTFILE}" "${_tmp_file_content}")
file(READ ${infile} _tmp_file_content)
file(WRITE ${outfile} "\#line 1 \"${infile}\"\n")
file(APPEND ${outfile} "${_tmp_file_content}")
9 changes: 6 additions & 3 deletions docs/python/doxygenlib/cdUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,21 @@
import os
import sys
import inspect
import re
import traceback

__debugMode = True

ATTR_NOT_IN_PYTHON = 'notinpython'
ATTR_STATIC_METHOD = 'staticmethod'

LABEL_STATIC = '**static** '
LABEL_STATIC = '**classmethod** '

def Error(msg):
"""Output a fatal error message and exit the program."""
print("Error: %s" % msg)
print("Error: %s" % msg, flush=True)
if __debugMode:
traceback.print_stack()
sys.stderr.flush()
sys.exit(1)

def Warn(msg):
Expand Down
16 changes: 14 additions & 2 deletions docs/python/doxygenlib/cdWriterDocstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@

from .cdUtils import *


API_RE_FIND = re.compile(r"""\b[A-Z]+_API(?:\s+|$)""")
API_RE_REPLACE = ""


class Writer:
"""
Manage the formatting of Python docstrings and output file generation.
Expand Down Expand Up @@ -205,11 +210,17 @@ def __wordWrapDocString(self, lines):
# following lines of a list item are indented at the same
# level. We word wrap the text, but don't break long words
# as we don't want to word wrap code sections.
# Take extra care with doxygen lifted CODE block lines.
textWrapper = textwrap.TextWrapper(width=70, break_long_words=False)
newlines = list(map(textWrapper.fill, newlines))
wrapped_lines = []
for line in newlines:
if line.startswith("CODE_START"): # skip line wrapping on codeblock - manually unwrapped below
wrapped_lines.append(line)
else:
wrapped_lines.append(textWrapper.fill(line))
lines = []
inlistitem = False
for curline in newlines:
for curline in wrapped_lines:
# the textwrap.fill call adds \n's at line breaks
for line in curline.split('\n'):
if line.startswith(" - "):
Expand Down Expand Up @@ -463,6 +474,7 @@ def __convertTypeName(self, cppName):
ret = ret.replace('boost::', '')
ret = ret.replace('vector', 'sequence')
ret = ret.replace('::', '.')
ret = API_RE_FIND.sub(API_RE_REPLACE, ret)
ret = ret.strip()
if ret.startswith(self.prefix):
ret = ret[len(self.prefix):]
Expand Down
8 changes: 5 additions & 3 deletions docs/spec_usdz.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ following file types:
+=============+================================+
| USD | **usda**, **usdc**, **usd** |
+-------------+--------------------------------+
| Image | **png**, **jpeg** |
| Image | **png**, **jpeg**, **exr** |
+-------------+--------------------------------+
| Audio | **M4A**, **MP3**, **WAV** |
+-------------+--------------------------------+
Expand Down Expand Up @@ -210,8 +210,10 @@ currently. Allowable file types are currently:
only a single usdc file, but this restriction will be lifted in future
OS updates)

* **png** and **jpeg** files (any of the multiple common extensions for
jpeg) for images/textures
* **png**, **jpeg** (any of the multiple common extensions for
jpeg), and **OpenEXR** files for images/textures. See
:ref:`Working With Image File Formats<image_file_formats>` for more
details on supported image file formats.

* **M4A, MP3, WAV** files for embedded audio (given in order of preferred
format)
Expand Down
6 changes: 2 additions & 4 deletions pxr/base/tf/refPtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -1252,15 +1252,13 @@ TfConst_cast(const TfRefPtr<const typename T::DataType>& ptr)
template <>
class TfRefPtr<TfRefBase> {
private:
TfRefPtr<TfRefBase>() {
}
TfRefPtr() = delete;
};

template <>
class TfRefPtr<const TfRefBase> {
private:
TfRefPtr<const TfRefBase>() {
}
TfRefPtr() = delete;
};

template <class T>
Expand Down
2 changes: 0 additions & 2 deletions pxr/base/trace/eventTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@

#include "pxr/base/js/json.h"

#include <boost/optional.hpp>

PXR_NAMESPACE_OPEN_SCOPE

TraceEventTreeRefPtr
Expand Down
13 changes: 13 additions & 0 deletions pxr/imaging/hd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,13 @@ pxr_build_test(testHdTypes
testenv/testHdTypes.cpp
)

pxr_build_test(testHdInstancerDeprecatedPrimvars
LIBRARIES
hd

CPPFILES
testenv/testHdInstancerDeprecatedPrimvars.cpp
)

pxr_install_test_dir(
SRC testenv/testHdSortedIds
Expand Down Expand Up @@ -443,3 +450,9 @@ pxr_register_test(testHdTimeSampleArray
pxr_register_test(testHdTypes
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testHdTypes"
)

pxr_register_test(testHdInstancerDeprecatedPrimvars
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testHdInstancerDeprecatedPrimvars"
ENV
HD_USE_DEPRECATED_INSTANCER_PRIMVAR_NAMES=true
)
60 changes: 25 additions & 35 deletions pxr/imaging/hd/dataSourceLegacyPrim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,26 @@ HdLegacyPrimTypeIsVolumeField(TfToken const &primType)

namespace {

template<typename TimeSampleArray>
static
void _FillSampleTimes(
const TimeSampleArray &timeSamples,
const HdSampledDataSource::Time startTime,
const HdSampledDataSource::Time endTime,
std::vector<HdSampledDataSource::Time> * const outSampleTimes)
{
if (!outSampleTimes) {
return;
}
for (size_t i = 0; i < timeSamples.count; ++i) {
const float t = timeSamples.times[i];
if (startTime <= t && t <= endTime) {
outSampleTimes->push_back(t);
}
}
}


class Hd_DataSourceLegacyPrimvarValue : public HdSampledDataSource
{
public:
Expand Down Expand Up @@ -164,13 +184,7 @@ class Hd_DataSourceLegacyPrimvarValue : public HdSampledDataSource
// XXX: Start and end times come from the sene delegate, so we can't
// get samples outside of those provided. However, we can clamp
// returned samples to be in the right range.
if (outSampleTimes != nullptr) {
for (const float &t : _timeSamples.times) {
if (t >= startTime && t <= endTime) {
outSampleTimes->push_back(t);
}
}
}
_FillSampleTimes(_timeSamples, startTime, endTime, outSampleTimes);

return true;
}
Expand Down Expand Up @@ -232,13 +246,7 @@ class Hd_DataSourceLegacyIndexedPrimvarValue : public HdSampledDataSource
// XXX: Start and end times come from the sene delegate, so we can't
// get samples outside of those provided. However, we can clamp
// returned samples to be in the right range.
if (outSampleTimes != nullptr) {
for (const float &t : _timeSamples.times) {
if (t >= startTime && t <= endTime) {
outSampleTimes->push_back(t);
}
}
}
_FillSampleTimes(_timeSamples, startTime, endTime, outSampleTimes);

return true;
}
Expand Down Expand Up @@ -307,13 +315,7 @@ class Hd_DataSourceLegacyPrimvarIndices :
// XXX: Start and end times come from the sene delegate, so we can't
// get samples outside of those provided. However, we can clamp
// returned samples to be in the right range.
if (outSampleTimes != nullptr) {
for (const float &t : _timeSamples.times) {
if (t >= startTime && t <= endTime) {
outSampleTimes->push_back(t);
}
}
}
_FillSampleTimes(_timeSamples, startTime, endTime, outSampleTimes);

return true;
}
Expand Down Expand Up @@ -461,13 +463,7 @@ class Hd_DataSourceLegacyMatrixValue : public HdMatrixDataSource
// XXX: Start and end times come from the scene delegate, so we can't
// get samples outside of those provided. However, we can clamp
// returned samples to be in the right range.
if (outSampleTimes != nullptr) {
for (const float &t : _timeSamples.times) {
if (t >= startTime && t <= endTime) {
outSampleTimes->push_back(t);
}
}
}
_FillSampleTimes(_timeSamples, startTime, endTime, outSampleTimes);

return true;
}
Expand Down Expand Up @@ -2308,13 +2304,7 @@ class Hd_DataSourceLegacyExtComputationInput : public HdSampledDataSource
// XXX: Start and end times come from the sene delegate, so we can't
// get samples outside of those provided. However, we can clamp
// returned samples to be in the right range.
if (outSampleTimes != nullptr) {
for (const float &t : _timeSamples.times) {
if (t >= startTime && t <= endTime) {
outSampleTimes->push_back(t);
}
}
}
_FillSampleTimes(_timeSamples, startTime, endTime, outSampleTimes);

return true;
}
Expand Down
Loading

0 comments on commit 304384c

Please sign in to comment.