50 bpy_inline_shader_nodes_from_material_doc,
51 ".. staticmethod:: from_material(material)\n"
53 " Create an inlined shader node tree from a material.\n"
55 " :param material: The material to inline the node tree of.\n"
56 " :type material: bpy.types.Material\n");
61 static const char *kwlist[] = {
"material",
nullptr};
62 PyObject *py_material;
63 if (!PyArg_ParseTupleAndKeywords(args,
67 const_cast<char **
>(kwlist),
72 ID *material_id =
nullptr;
75 PyExc_TypeError,
"Expected a Material, not %.200s", Py_TYPE(py_material)->tp_name);
79 PyErr_Format(PyExc_TypeError,
80 "Expected a Material, not %.200s",
84 Material *material = id_cast<Material *>(material_id);
85 if (!material->nodetree) {
86 PyErr_Format(PyExc_TypeError,
"Material '%s' has no node tree",
BKE_id_name(*material_id));
94 bpy_inline_shader_nodes_from_light_doc,
95 ".. staticmethod:: from_light(light)\n"
97 " Create an inlined shader node tree from a light.\n"
99 " :param light: The light to online the node tree of.\n"
100 " :type light: bpy.types.Light\n");
105 static const char *kwlist[] = {
"light",
nullptr};
107 if (!PyArg_ParseTupleAndKeywords(args,
111 const_cast<char **
>(kwlist),
116 ID *light_id =
nullptr;
118 PyErr_Format(PyExc_TypeError,
"Expected a Light, not %.200s", Py_TYPE(py_light)->tp_name);
122 PyErr_Format(PyExc_TypeError,
123 "Expected a Light, not %.200s",
127 Light *light = id_cast<Light *>(light_id);
128 if (!light->nodetree) {
129 PyErr_Format(PyExc_TypeError,
"Light '%s' has no node tree",
BKE_id_name(*light_id));
137 bpy_inline_shader_nodes_from_world_doc,
138 ".. staticmethod:: from_world(world)\n"
140 " Create an inlined shader node tree from a world.\n"
142 " :param world: The world to inline the node tree of.\n"
143 " :type world: bpy.types.World\n");
148 static const char *kwlist[] = {
"world",
nullptr};
150 if (!PyArg_ParseTupleAndKeywords(args,
154 const_cast<char **
>(kwlist),
159 ID *world_id =
nullptr;
161 PyErr_Format(PyExc_TypeError,
"Expected a World, not %.200s", Py_TYPE(py_world)->tp_name);
165 PyErr_Format(PyExc_TypeError,
166 "Expected a World, not %.200s",
170 World *world = id_cast<World *>(world_id);
171 if (!world->nodetree) {
172 PyErr_Format(PyExc_TypeError,
"World '%s' has no node tree",
BKE_id_name(*world_id));
181 Py_TYPE(self)->tp_free(
reinterpret_cast<PyObject *
>(self));
186 bpy_inline_shader_nodes_node_tree_doc,
187 "The inlined node tree.\n"
189 ":type: :class:`bpy.types.NodeTree`\n");
200 bpy_inline_shader_nodes_node_tree_doc,
207# pragma clang diagnostic push
208# pragma clang diagnostic ignored "-Wcast-function-type"
210# pragma GCC diagnostic push
211# pragma GCC diagnostic ignored "-Wcast-function-type"
218 METH_VARARGS | METH_KEYWORDS | METH_STATIC,
219 bpy_inline_shader_nodes_from_material_doc},
222 METH_VARARGS | METH_KEYWORDS | METH_STATIC,
223 bpy_inline_shader_nodes_from_light_doc},
226 METH_VARARGS | METH_KEYWORDS | METH_STATIC,
227 bpy_inline_shader_nodes_from_world_doc},
233# pragma clang diagnostic pop
235# pragma GCC diagnostic pop
241 bpy_inline_shader_nodes_doc,
242 "An inlined shader node tree.\n");
244 PyVarObject_HEAD_INIT(
nullptr, 0)
263 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
264 bpy_inline_shader_nodes_doc,
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)
const char * BKE_idtype_idcode_to_name(short idcode)
PyObject * pyrna_id_CreatePyObject(ID *id)
PyDoc_STRVAR(bpy_bm_new_doc, ".. function:: new(*, use_operators=True)\n" "\n" " :param use_operators: Support calling operators in :mod:`bmesh.ops` (uses some " "extra memory per vert/edge/face).\n" " :type use_operators: bool\n" " :return: Return a new, empty BMesh.\n" " :rtype: :class:`bmesh.types.BMesh`\n")
static PyMethodDef BPy_InlineShaderNodes_methods[]
const char * BKE_id_name(const ID &id)
static BPy_InlineShaderNodes * BPy_InlineShaderNodes_static_from_world(PyObject *, PyObject *args, PyObject *kwds)
static BPy_InlineShaderNodes * BPy_InlineShaderNodes_static_from_material(PyObject *, PyObject *args, PyObject *kwds)
PyObject * BPyInit_inline_shader_nodes_type()
bool pyrna_id_FromPyObject(PyObject *obj, ID **id)
void BKE_id_free(Main *bmain, void *idv)
static PyObject * BPy_InlineShaderNodes_get_node_tree(BPy_InlineShaderNodes *self, void *)
static PyGetSetDef BPy_InlineShaderNodes_getseters[]
ID_Type GS(const char *name)
static BPy_InlineShaderNodes * BPy_InlineShaderNodes_static_from_light(PyObject *, PyObject *args, PyObject *kwds)
static void BPy_InlineShaderNodes_dealloc(BPy_InlineShaderNodes *self)
PyTypeObject bpy_inline_shader_nodes_Type
static BPy_InlineShaderNodes * create_from_shader_node_tree(const bNodeTree &tree)
PyObject_HEAD bNodeTree * inline_node_tree