Blender V5.3
gpu_py_select.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
16
17#include <Python.h>
18
20
21#include "GPU_select.hh"
22
23#include "gpu_py.hh"
24#include "gpu_py_select.hh" /* Own include. */
25
26namespace blender {
27
28/* -------------------------------------------------------------------- */
31
33 /* Wrap. */
34 pygpu_select_load_id_doc,
35 ".. function:: load_id(id)\n"
36 "\n"
37 " Set the selection ID.\n"
38 "\n"
39 " :param id: Number (32-bit uint).\n"
40 " :type id: int\n");
41static PyObject *pygpu_select_load_id(PyObject * /*self*/, PyObject *value)
42{
44
45 uint id;
46 if ((id = PyC_Long_AsU32(value)) == uint(-1)) {
47 return nullptr;
48 }
50 Py_RETURN_NONE;
51}
52
54
55/* -------------------------------------------------------------------- */
58
59static PyMethodDef pygpu_select__tp_methods[] = {
60 /* Manage Stack */
61 {"load_id", static_cast<PyCFunction>(pygpu_select_load_id), METH_O, pygpu_select_load_id_doc},
62 {nullptr, nullptr, 0, nullptr},
63};
64
66 /* Wrap. */
67 pygpu_select__tp_doc,
68 "This module provides access to selection.");
69static PyModuleDef pygpu_select_module_def = {
70 /*m_base*/ PyModuleDef_HEAD_INIT,
71 /*m_name*/ "gpu.select",
72 /*m_doc*/ pygpu_select__tp_doc,
73 /*m_size*/ 0,
74 /*m_methods*/ pygpu_select__tp_methods,
75 /*m_slots*/ nullptr,
76 /*m_traverse*/ nullptr,
77 /*m_clear*/ nullptr,
78 /*m_free*/ nullptr,
79};
80
82{
83 PyObject *submodule;
84
85 submodule = PyModule_Create(&pygpu_select_module_def);
86
87 return submodule;
88}
89
91
92} // namespace blender
#define BPYGPU_IS_INIT_OR_ERROR_OBJ
Definition gpu_py.hh:45
BMesh Iterators.
unsigned int uint
Definition BKE_text.h:55
bool GPU_select_load_id(unsigned int 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 PyModuleDef pygpu_select_module_def
static PyMethodDef pygpu_select__tp_methods[]
uint32_t PyC_Long_AsU32(PyObject *value)
PyObject * bpygpu_select_init()
static PyObject * pygpu_select_load_id(PyObject *, PyObject *value)