Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/IECoreUSD/src/IECoreUSD/PrimitiveAlgo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ bool readPrimitiveVariables( const pxr::UsdSkelRoot &skelRoot, const pxr::UsdGeo
pxr::GfMatrix4d inverseBind = skinningQuery.GetGeomBindTransform( time ).GetInverse();
for( auto &p : points )
{
p = inverseBind.Transform( p );
p = pxr::GfVec3f( inverseBind.Transform( pxr::GfVec3d( p ) ) );
}

Canceller::check( canceller );
Expand Down
41 changes: 41 additions & 0 deletions contrib/IECoreUSD/src/IECoreUSD/bindings/IEUSDModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@

#include "IECore/IndexedIO.h"

#if PXR_VERSION >= 2505
#include "pxr/external/boost/python.hpp"
#endif

#include "boost/python.hpp"

using namespace boost::python;
Expand Down Expand Up @@ -86,10 +90,47 @@ static list fromInternalPath( list l )
return vectorToList( path );
}

#if PXR_VERSION >= 2505

// Registers `boost::python` converters for types
// wrapped using `pxr_boost::python`.
template<typename T>
struct PxrBoostConverter
{

static void registerConverters()
{
boost::python::to_python_converter<T, ToPxrBoost>();
/// \todo Add conversion from Python when we have
/// a use for it. See PyBindConverter for an example.
}

private :

struct ToPxrBoost
{
static PyObject *convert( const T &t )
{
pxr::pxr_boost::python::object o( t );
Py_INCREF( o.ptr() );
return o.ptr();
}
};

};

#endif // PXR_VERSION >= 2505

} // namespace

BOOST_PYTHON_MODULE( _IECoreUSD )
{
#if PXR_VERSION >= 2505
PxrBoostConverter<pxr::TfToken>::registerConverters();
PxrBoostConverter<pxr::VtValue>::registerConverters();
PxrBoostConverter<pxr::SdfValueTypeName>::registerConverters();
#endif

{
object dataAlgoModule( handle<>( borrowed( PyImport_AddModule( "IECoreUSD.DataAlgo" ) ) ) );
scope().attr( "DataAlgo" ) = dataAlgoModule;
Expand Down