python improvements
parent
1b47d02583
commit
bdf44fc85b
|
@ -34,6 +34,8 @@ build('src/librender/SConscript')
|
|||
build('src/libhw/SConscript')
|
||||
# Bidirectional support library
|
||||
build('src/libbidir/SConscript')
|
||||
# Python binding library
|
||||
build('src/libpython/SConscript')
|
||||
|
||||
# ===== Build the applications =====
|
||||
env = env.Clone()
|
||||
|
@ -49,9 +51,6 @@ build('src/mtsgui/SConscript', ['mainEnv', 'converter_objects'], duplicate=True)
|
|||
|
||||
env['SHLIBPREFIX']=''
|
||||
|
||||
# Python binding library
|
||||
build('src/mtspy/SConscript')
|
||||
|
||||
# ===== Build the plugins =====
|
||||
|
||||
Export('env')
|
||||
|
|
|
@ -43,7 +43,7 @@ if sys.platform == 'linux2':
|
|||
install(distDir, ['libcore/libmitsuba-core.so', 'libhw/libmitsuba-hw.so',
|
||||
'librender/libmitsuba-render.so', 'libbidir/libmitsuba-bidir.so'])
|
||||
if hasPython:
|
||||
install(distDir, ['mtspy/mtspy.so'])
|
||||
install(os.path.join(distDir, 'mitsuba.so'), ['libpython/mitsuba.so'])
|
||||
install(distDir, ['mitsuba/mitsuba', 'mitsuba/mtssrv', 'mitsuba/mtsutil', 'mtsgui/mtsgui'])
|
||||
if hasCollada:
|
||||
install(distDir, ['converter/mtsimport'])
|
||||
|
@ -70,7 +70,7 @@ if sys.platform == 'win32':
|
|||
install(distDir, ['libcore/libmitsuba-core.dll', 'libhw/libmitsuba-hw.dll',
|
||||
'librender/libmitsuba-render.dll', 'libbidir/libmitsuba-bidir.dll'])
|
||||
if hasPython:
|
||||
installAs(os.path.join(distDir, 'mtspy.pyd'), 'mtspy/mtspy.dylib')
|
||||
installAs(os.path.join(distDir, 'python/mitsuba.pyd'), 'libpython/mitsuba.dll')
|
||||
install(distDir, ['Iex.dll', 'Half.dll','IlmThread.dll', 'Imath.dll','IlmImf.dll','zlib1.dll',
|
||||
'libpng13.dll', 'jpeg62.dll', 'pthreadVCE2.dll', 'xerces-c_3_0.dll', 'glew32mx.dll'],
|
||||
prefix=dllprefix)
|
||||
|
@ -115,7 +115,7 @@ elif sys.platform == 'darwin':
|
|||
install(frameworkDir, ['libcore/libmitsuba-core.dylib', 'libhw/libmitsuba-hw.dylib',
|
||||
'librender/libmitsuba-render.dylib', 'libbidir/libmitsuba-bidir.dylib'])
|
||||
if hasPython:
|
||||
installAs(os.path.join(frameworkDir, 'mtspy.so'), 'mtspy/mtspy.dylib')
|
||||
installAs(os.path.join(distDir, 'python/mitsuba.so'), 'libpython/mitsuba.dylib')
|
||||
install(frameworkDir, [
|
||||
'GLEW.framework/Resources/libs/libGLEW.dylib', 'OpenEXR.framework/Resources/lib/libHalf.6.dylib',
|
||||
'OpenEXR.framework/Resources/lib/libIex.6.dylib', 'OpenEXR.framework/Resources/lib/libImath.6.dylib',
|
||||
|
|
|
@ -187,6 +187,14 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
/// Matrix-scalar addition
|
||||
inline const Matrix &operator-=(T value) {
|
||||
for (int i=0; i<M; ++i)
|
||||
for (int j=0; j<N; ++j)
|
||||
m[i][j] -= value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// Component-wise negation
|
||||
inline Matrix operator-() const {
|
||||
Matrix result;
|
||||
|
|
|
@ -11,8 +11,4 @@ if pythonEnv.has_key('PYTHONLIB'):
|
|||
pythonEnv.Prepend(LIBS=pythonEnv['PYTHONLIB'])
|
||||
|
||||
if hasPython:
|
||||
mtspy_plugin = pythonEnv.SharedLibrary('mtspy', ['base.cpp']);
|
||||
#mtspy_app = pythonEnv.SharedLibrary('mtspy', ['base.cpp']);
|
||||
|
||||
if sys.platform == "darwin":
|
||||
pythonEnv.AddPostAction(mtspy_plugin, 'install_name_tool -id @loader_path/mtspy.dylib $TARGET')
|
||||
libpython = pythonEnv.SharedLibrary('mitsuba', ['base.cpp']);
|
|
@ -90,9 +90,7 @@ void export_core() {
|
|||
.def("getRefCount", &Object::getRefCount)
|
||||
.def("__str__", &Object::toString);
|
||||
|
||||
bp::class_<Stream, ref<Object>, bp::bases<Object>, boost::noncopyable>("Stream", bp::no_init)
|
||||
.def("getRefCount", &Object::getRefCount)
|
||||
.def("__str__", &Object::toString);
|
||||
bp::class_<Stream, ref<Stream>, bp::bases<Object>, boost::noncopyable>("Stream", bp::no_init);
|
||||
|
||||
bp::enum_<Stream::EByteOrder>("EByteOrder")
|
||||
.value("EBigEndian", Stream::EBigEndian)
|
||||
|
@ -341,7 +339,6 @@ void export_core() {
|
|||
.def("__setitem__", &Matrix4x4_setItem)
|
||||
.def("__getitem__", &Matrix4x4_getItem)
|
||||
.def("setIdentity", &Matrix4x4::setIdentity)
|
||||
.def("setZero", &Matrix4x4::setZero)
|
||||
.def("isZero", &Matrix4x4::isZero)
|
||||
.def("trace", &Matrix4x4::trace)
|
||||
.def("det", &Matrix4x4::det)
|
Loading…
Reference in New Issue