Skip to content

Commit b4f6d25

Browse files
Merge pull request #1462 from johnhaddon/usd2505
USD 25.05 compatibility
2 parents d968a39 + bf3cb23 commit b4f6d25

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

contrib/IECoreUSD/src/IECoreUSD/PrimitiveAlgo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ bool readPrimitiveVariables( const pxr::UsdSkelRoot &skelRoot, const pxr::UsdGeo
426426
pxr::GfMatrix4d inverseBind = skinningQuery.GetGeomBindTransform( time ).GetInverse();
427427
for( auto &p : points )
428428
{
429-
p = inverseBind.Transform( p );
429+
p = pxr::GfVec3f( inverseBind.Transform( pxr::GfVec3d( p ) ) );
430430
}
431431

432432
Canceller::check( canceller );

contrib/IECoreUSD/src/IECoreUSD/bindings/IEUSDModule.cpp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939

4040
#include "IECore/IndexedIO.h"
4141

42+
#if PXR_VERSION >= 2505
43+
#include "pxr/external/boost/python.hpp"
44+
#endif
45+
4246
#include "boost/python.hpp"
4347

4448
using namespace boost::python;
@@ -86,10 +90,47 @@ static list fromInternalPath( list l )
8690
return vectorToList( path );
8791
}
8892

93+
#if PXR_VERSION >= 2505
94+
95+
// Registers `boost::python` converters for types
96+
// wrapped using `pxr_boost::python`.
97+
template<typename T>
98+
struct PxrBoostConverter
99+
{
100+
101+
static void registerConverters()
102+
{
103+
boost::python::to_python_converter<T, ToPxrBoost>();
104+
/// \todo Add conversion from Python when we have
105+
/// a use for it. See PyBindConverter for an example.
106+
}
107+
108+
private :
109+
110+
struct ToPxrBoost
111+
{
112+
static PyObject *convert( const T &t )
113+
{
114+
pxr::pxr_boost::python::object o( t );
115+
Py_INCREF( o.ptr() );
116+
return o.ptr();
117+
}
118+
};
119+
120+
};
121+
122+
#endif // PXR_VERSION >= 2505
123+
89124
} // namespace
90125

91126
BOOST_PYTHON_MODULE( _IECoreUSD )
92127
{
128+
#if PXR_VERSION >= 2505
129+
PxrBoostConverter<pxr::TfToken>::registerConverters();
130+
PxrBoostConverter<pxr::VtValue>::registerConverters();
131+
PxrBoostConverter<pxr::SdfValueTypeName>::registerConverters();
132+
#endif
133+
93134
{
94135
object dataAlgoModule( handle<>( borrowed( PyImport_AddModule( "IECoreUSD.DataAlgo" ) ) ) );
95136
scope().attr( "DataAlgo" ) = dataAlgoModule;

0 commit comments

Comments
 (0)