diff --git a/plugins/script/interfaces/ShaderSystemInterface.cpp b/plugins/script/interfaces/ShaderSystemInterface.cpp index a86066f704..b975a40d90 100644 --- a/plugins/script/interfaces/ShaderSystemInterface.cpp +++ b/plugins/script/interfaces/ShaderSystemInterface.cpp @@ -78,8 +78,9 @@ void ShaderSystemInterface::saveMaterial(const std::string& name) // IScriptInterface implementation void ShaderSystemInterface::registerInterface(py::module& scope, py::dict& globals) { - // Add the declaration for a Material object + // Add the declaration for a Material and Stage object py::class_ material(scope, "Material"); + py::class_ stage(scope, "MaterialStage"); // Add the old name as alias scope.add_object("Shader", material); @@ -208,7 +209,7 @@ void ShaderSystemInterface::registerInterface(py::module& scope, py::dict& globa .value("TRANSLUCENT", Material::MC_TRANSLUCENT) .export_values(); - py::enum_(material, "MapType") + py::enum_(stage, "MapType") .value("Map", IShaderLayer::MapType::Map) .value("CubeMap", IShaderLayer::MapType::CubeMap) .value("CameraCubeMap", IShaderLayer::MapType::CameraCubeMap) diff --git a/plugins/script/interfaces/ShaderSystemInterface.h b/plugins/script/interfaces/ShaderSystemInterface.h index 056f01e568..f3d55277ef 100644 --- a/plugins/script/interfaces/ShaderSystemInterface.h +++ b/plugins/script/interfaces/ShaderSystemInterface.h @@ -9,6 +9,19 @@ namespace script { +class ScriptMaterialStage +{ +private: + IShaderLayer::Ptr _layer; + +public: + ScriptMaterialStage(const IShaderLayer::Ptr& layer) : + _layer(layer) + {} + + +}; + /** * This class represents a single Material as seen by the Python script. */ @@ -21,10 +34,6 @@ class ScriptMaterial _material(material) {} - operator const MaterialPtr&() const { - return _material; - } - std::string getName() { return _material ? _material->getName() : ""; }