diff --git a/src/python/magnum/shaders.cpp b/src/python/magnum/shaders.cpp index d478bb4..d664b6d 100644 --- a/src/python/magnum/shaders.cpp +++ b/src/python/magnum/shaders.cpp @@ -54,11 +54,7 @@ template void vertexColor(NonDestructibleBase&) { - return MatrixTypeFor{}; - }, &Shaders::VertexColor::setTransformationProjectionMatrix, + .def_property("transformation_projection_matrix", nullptr, &Shaders::VertexColor::setTransformationProjectionMatrix, "Transformation and projection matrix"); } @@ -127,33 +123,27 @@ void shaders(py::module& m) { }, "Flags") .def_property_readonly("light_count", &Shaders::Phong::lightCount, "Light count") - // TODO: make write-only once https://github.com/pybind/pybind11/pull/1144 - // is released - .def_property("ambient_color", [](Shaders::Phong&) { return Color4{}; }, + .def_property("ambient_color", nullptr, &Shaders::Phong::setAmbientColor, "Ambient color") - .def_property("diffuse_color", [](Shaders::Phong&) { return Color4{}; }, + .def_property("diffuse_color", nullptr, &Shaders::Phong::setDiffuseColor, "Diffuse color") - .def_property("specular_color", [](Shaders::Phong&) { return Color4{}; }, + .def_property("specular_color", nullptr, &Shaders::Phong::setSpecularColor, "Specular color") // TODO: textures, once exposed - .def_property("shininess", [](Shaders::Phong&) { return Float{}; }, + .def_property("shininess", nullptr, &Shaders::Phong::setShininess, "Shininess") - .def_property("alpha_mask", [](Shaders::Phong&) { return Float{}; }, + .def_property("alpha_mask", nullptr, &Shaders::Phong::setAlphaMask, "Alpha mask") - .def_property("transformation_matrix", [](Shaders::Phong&) { return Matrix4{}; }, + .def_property("transformation_matrix", nullptr, &Shaders::Phong::setTransformationMatrix, "Set transformation matrix") - .def_property("normal_matrix", [](Shaders::Phong&) { return Matrix3x3{}; }, + .def_property("normal_matrix", nullptr, &Shaders::Phong::setNormalMatrix, "Set normal matrix") - .def_property("projection_matrix", [](Shaders::Phong&) { return Matrix4{}; }, + .def_property("projection_matrix", nullptr, &Shaders::Phong::setProjectionMatrix, "Set projection matrix") - .def_property("light_positions", [](Shaders::Phong&) { - return std::vector{}; - }, [](Shaders::Phong& self, const std::vector& positions) { + .def_property("light_positions", nullptr, [](Shaders::Phong& self, const std::vector& positions) { self.setLightPositions(positions); }, "Light positions") - .def_property("light_colors", [](Shaders::Phong&) { - return std::vector{}; - }, [](Shaders::Phong& self, const std::vector& colors) { + .def_property("light_colors", nullptr, [](Shaders::Phong& self, const std::vector& colors) { self.setLightColors(colors); }, "Light colors"); }