File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
src/py-opentimelineio/opentimelineio-bindings Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ static void define_imath_2d(py::module m) {
2828 // Imath classes are binded with Pybind11 more than once.
2929 // Using module_local will avoid conflicts in such cases.
3030 py::class_<IMATH_NAMESPACE::V2d>(m, " V2d" , py::module_local ())
31- .def (py::init<>())
31+ .def (py::init<>([]() { return IMATH_NAMESPACE::V2d ( 0.0 , 0.0 ); } ))
3232 .def (py::init<double >())
3333 .def (py::init<double , double >())
3434 .def_readwrite (" x" , &IMATH_NAMESPACE::V2d::x)
@@ -101,7 +101,7 @@ static void define_imath_2d(py::module m) {
101101 });
102102
103103 py::class_<IMATH_NAMESPACE::Box2d>(m, " Box2d" , py::module_local ())
104- .def (py::init<>())
104+ .def (py::init<>([]() { return IMATH_NAMESPACE::Box2d ( IMATH_NAMESPACE::V2d ( 0.0 , 0.0 )); } ))
105105 .def (py::init<IMATH_NAMESPACE::V2d>())
106106 .def (py::init<IMATH_NAMESPACE::V2d, IMATH_NAMESPACE::V2d>())
107107 .def_readwrite (" min" , &IMATH_NAMESPACE::Box2d::min)
Original file line number Diff line number Diff line change 99
1010class Box2dTests (unittest .TestCase , otio_test_utils .OTIOAssertions ):
1111 def test_cons (self ):
12+ box = otio .schema .Box2d ()
13+
14+ self .assertEqual (box .min , otio .schema .V2d (0.0 , 0.0 ))
15+ self .assertEqual (box .max , otio .schema .V2d (0.0 , 0.0 ))
16+
1217 v1 = otio .schema .V2d (1.0 , 2.0 )
1318 v2 = otio .schema .V2d (3.0 , 4.0 )
1419 box = otio .schema .Box2d (v1 , v2 )
Original file line number Diff line number Diff line change 1212
1313class V2dTests (unittest .TestCase , otio_test_utils .OTIOAssertions ):
1414 def test_cons (self ):
15+ v = otio .schema .V2d ()
16+
17+ self .assertEqual (v .x , 0.0 )
18+ self .assertEqual (v .y , 0.0 )
19+
1520 v = otio .schema .V2d (1.0 , 2.0 )
1621
1722 self .assertEqual (v .x , 1.0 )
You can’t perform that action at this time.
0 commit comments