Skip to content

Commit

Permalink
python: define trade.AbstractSceneConverter before trade.SceneContents.
Browse files Browse the repository at this point in the history
SceneContents.FOR() uses it as an argument. Wasn't caught by the doc
generator, and looks like it didn't break testing either, probably
because this is an overloaded function and when an overload gets picked,
the types are already defined. Or something. Not sure.
  • Loading branch information
mosra committed Jun 11, 2024
1 parent 335bbfc commit b0df197
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/python/magnum/trade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3275,6 +3275,10 @@ void trade(py::module_& m) {
.value("NONE", Trade::SceneConverterFlag{});
corrade::enumOperators(sceneConverterFlags);

/* Has to be created before SceneContents as SceneContents.FOR() depends on
it */
py::class_<Trade::AbstractSceneConverter, PluginManager::PyPluginHolder<Trade::AbstractSceneConverter>, PluginManager::AbstractPlugin> abstractSceneConverter{m, "AbstractSceneConverter", "Interface for scene converter plugins"};

py::enum_<Trade::SceneContent> sceneContents{m, "SceneContents", "Scene contents"};
sceneContents
.value("SCENES", Trade::SceneContent::Scenes)
Expand Down Expand Up @@ -3305,7 +3309,6 @@ void trade(py::module_& m) {
});
corrade::enumOperators(sceneContents);

py::class_<Trade::AbstractSceneConverter, PluginManager::PyPluginHolder<Trade::AbstractSceneConverter>, PluginManager::AbstractPlugin> abstractSceneConverter{m, "AbstractSceneConverter", "Interface for scene converter plugins"};
abstractSceneConverter
.def_property_readonly("features", [](Trade::AbstractSceneConverter& self) {
return Trade::SceneConverterFeature(Containers::enumCastUnderlyingType(self.features()));
Expand Down

0 comments on commit b0df197

Please sign in to comment.