48 bpy_inline_shader_nodes_from_material_doc,
49 ".. staticmethod:: from_material(material)\n"
51 " Create an inlined shader node tree from a material.\n"
53 " :arg material: The material to inline the node tree of.\n"
54 " :type material: bpy.types.Material\n");
59 static const char *kwlist[] = {
"material",
nullptr};
60 PyObject *py_material;
61 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"O",
const_cast<char **
>(kwlist), &py_material)) {
64 ID *material_id =
nullptr;
67 PyExc_TypeError,
"Expected a Material, not %.200s", Py_TYPE(py_material)->tp_name);
71 PyErr_Format(PyExc_TypeError,
72 "Expected a Material, not %.200s",
76 Material *material = blender::id_cast<Material *>(material_id);
78 PyErr_Format(PyExc_TypeError,
"Material '%s' has no node tree",
BKE_id_name(*material_id));
86 bpy_inline_shader_nodes_from_light_doc,
87 ".. staticmethod:: from_light(light)\n"
89 " Create an inlined shader node tree from a light.\n"
91 " :arg light: The light to online the node tree of.\n"
92 " :type light: bpy.types.Light\n");
97 static const char *kwlist[] = {
"light",
nullptr};
99 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"O",
const_cast<char **
>(kwlist), &py_light)) {
102 ID *light_id =
nullptr;
104 PyErr_Format(PyExc_TypeError,
"Expected a Light, not %.200s", Py_TYPE(py_light)->tp_name);
108 PyErr_Format(PyExc_TypeError,
109 "Expected a Light, not %.200s",
113 Light *light = blender::id_cast<Light *>(light_id);
115 PyErr_Format(PyExc_TypeError,
"Light '%s' has no node tree",
BKE_id_name(*light_id));
123 bpy_inline_shader_nodes_from_world_doc,
124 ".. staticmethod:: from_world(world)\n"
126 " Create an inlined shader node tree from a world.\n"
128 " :arg world: The world to inline the node tree of.\n"
129 " :type world: bpy.types.World\n");
134 static const char *kwlist[] = {
"world",
nullptr};
136 if (!PyArg_ParseTupleAndKeywords(args, kwds,
"O",
const_cast<char **
>(kwlist), &py_world)) {
139 ID *world_id =
nullptr;
141 PyErr_Format(PyExc_TypeError,
"Expected a World, not %.200s", Py_TYPE(py_world)->tp_name);
145 PyErr_Format(PyExc_TypeError,
146 "Expected a World, not %.200s",
150 World *world = blender::id_cast<World *>(world_id);
152 PyErr_Format(PyExc_TypeError,
"World '%s' has no node tree",
BKE_id_name(*world_id));
161 Py_TYPE(
self)->tp_free(
reinterpret_cast<PyObject *
>(
self));
166 bpy_inline_shader_nodes_node_tree_doc,
167 "The inlined node tree.\n"
169 ":type: :class:`bpy.types.NodeTree`\n");
180 bpy_inline_shader_nodes_node_tree_doc,
187# pragma clang diagnostic push
188# pragma clang diagnostic ignored "-Wcast-function-type"
190# pragma GCC diagnostic push
191# pragma GCC diagnostic ignored "-Wcast-function-type"
198 METH_VARARGS | METH_KEYWORDS | METH_STATIC,
199 bpy_inline_shader_nodes_from_material_doc},
202 METH_VARARGS | METH_KEYWORDS | METH_STATIC,
203 bpy_inline_shader_nodes_from_light_doc},
206 METH_VARARGS | METH_KEYWORDS | METH_STATIC,
207 bpy_inline_shader_nodes_from_world_doc},
213# pragma clang diagnostic pop
215# pragma GCC diagnostic pop
221 bpy_inline_shader_nodes_doc,
222 "An inlined shader node tree.\n");
224 PyVarObject_HEAD_INIT(
nullptr, 0)
243 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
244 bpy_inline_shader_nodes_doc,
const char * BKE_idtype_idcode_to_name(short idcode)
void BKE_id_free(Main *bmain, void *idv)
const char * BKE_id_name(const ID &id)
static PyMethodDef BPy_InlineShaderNodes_methods[]
static PyGetSetDef BPy_InlineShaderNodes_getseters[]
static BPy_InlineShaderNodes * BPy_InlineShaderNodes_static_from_world(PyObject *, PyObject *args, PyObject *kwds)
PyDoc_STRVAR(bpy_inline_shader_nodes_from_material_doc, ".. staticmethod:: from_material(material)\n" "\n" " Create an inlined shader node tree from a material.\n" "\n" " :arg material: The material to inline the node tree of.\n" " :type material: bpy.types.Material\n")
static BPy_InlineShaderNodes * create_from_shader_node_tree(const bNodeTree &tree)
static void BPy_InlineShaderNodes_dealloc(BPy_InlineShaderNodes *self)
static PyObject * BPy_InlineShaderNodes_get_node_tree(BPy_InlineShaderNodes *self, void *)
static BPy_InlineShaderNodes * BPy_InlineShaderNodes_static_from_material(PyObject *, PyObject *args, PyObject *kwds)
PyTypeObject bpy_inline_shader_nodes_Type
static BPy_InlineShaderNodes * BPy_InlineShaderNodes_static_from_light(PyObject *, PyObject *args, PyObject *kwds)
PyObject * BPyInit_inline_shader_nodes_type()
PyObject * pyrna_id_CreatePyObject(ID *id)
bool pyrna_id_FromPyObject(PyObject *obj, ID **id)
bNodeTree * node_tree_add_tree(Main *bmain, StringRef name, StringRef idname)
bool inline_shader_node_tree(const bNodeTree &src_tree, bNodeTree &dst_tree, InlineShaderNodeTreeParams ¶ms)
PyObject_HEAD bNodeTree * inline_node_tree
struct bNodeTree * nodetree
struct bNodeTree * nodetree
struct bNodeTree * nodetree