forked from AcademySoftwareFoundation/MaterialX
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPyOslShaderGenerator.cpp
More file actions
28 lines (22 loc) · 897 Bytes
/
PyOslShaderGenerator.cpp
File metadata and controls
28 lines (22 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//
// TM & (c) 2017 Lucasfilm Entertainment Company Ltd. and Lucasfilm Ltd.
// All rights reserved. See LICENSE.txt for license.
//
#include <PyMaterialX/PyMaterialX.h>
#include <MaterialXGenOsl/OslShaderGenerator.h>
#include <MaterialXGenShader/GenContext.h>
#include <MaterialXGenShader/Shader.h>
#include <string>
namespace py = pybind11;
namespace mx = MaterialX;
void bindPyOslShaderGenerator(py::module& mod)
{
mod.attr("OSL_UNIFORMS") = mx::OSL::UNIFORMS;
mod.attr("OSL_INPUTS") = mx::OSL::INPUTS;
mod.attr("OSL_OUTPUTS") = mx::OSL::OUTPUTS;
py::class_<mx::OslShaderGenerator, mx::ShaderGenerator, mx::OslShaderGeneratorPtr>(mod, "OslShaderGenerator")
.def_static("create", &mx::OslShaderGenerator::create)
.def(py::init<>())
.def("getTarget", &mx::OslShaderGenerator::getTarget)
.def("generate", &mx::OslShaderGenerator::generate);
}