PyDoc: use Python's type annotation syntax for doc-strings
Replace plain-text type information with the type syntax used for Python's type annotations as it's more concise, especially for callbacks which often didn't include useful type information. Note that this change only applies to inline doc-strings, generated doc-strings from RNA need to be updated separately. Details: - Many minor corrections were made when "list" was incorrectly used instead of "sequence". - Some type information wasn't defined in the doc-strings and has been added. - Verbose type info would benefit from support for type aliases.
This commit is contained in:
@@ -106,9 +106,9 @@ PyDoc_STRVAR(
|
||||
" :arg mesh: The editmode mesh.\n"
|
||||
" :type mesh: :class:`bpy.types.Mesh`\n"
|
||||
" :arg loop_triangles: Option to recalculate n-gon tessellation.\n"
|
||||
" :type loop_triangles: boolean\n"
|
||||
" :type loop_triangles: bool\n"
|
||||
" :arg destructive: Use when geometry has been added or removed.\n"
|
||||
" :type destructive: boolean\n");
|
||||
" :type destructive: bool\n");
|
||||
static PyObject *bpy_bm_update_edit_mesh(PyObject * /*self*/, PyObject *args, PyObject *kw)
|
||||
{
|
||||
static const char *kwlist[] = {"mesh", "loop_triangles", "destructive", nullptr};
|
||||
|
||||
@@ -94,31 +94,31 @@ PyDoc_STRVAR(
|
||||
bpy_bm_elem_select_doc,
|
||||
"Selected state of this element.\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
PyDoc_STRVAR(
|
||||
/* Wrap. */
|
||||
bpy_bm_elem_hide_doc,
|
||||
"Hidden state of this element.\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
PyDoc_STRVAR(
|
||||
/* Wrap. */
|
||||
bpy_bm_elem_tag_doc,
|
||||
"Generic attribute scripts can use for own logic\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
PyDoc_STRVAR(
|
||||
/* Wrap. */
|
||||
bpy_bm_elem_smooth_doc,
|
||||
"Smooth state of this element.\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
PyDoc_STRVAR(
|
||||
/* Wrap. */
|
||||
bpy_bm_elem_seam_doc,
|
||||
"Seam for UV unwrapping.\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
|
||||
static PyObject *bpy_bm_elem_hflag_get(BPy_BMElem *self, void *flag)
|
||||
{
|
||||
@@ -314,7 +314,7 @@ PyDoc_STRVAR(
|
||||
bpy_bm_is_valid_doc,
|
||||
"True when this element is valid (hasn't been removed).\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
static PyObject *bpy_bm_is_valid_get(BPy_BMGeneric *self, void * /*closure*/)
|
||||
{
|
||||
return PyBool_FromLong(BPY_BM_IS_VALID(self));
|
||||
@@ -323,7 +323,7 @@ static PyObject *bpy_bm_is_valid_get(BPy_BMGeneric *self, void * /*closure*/)
|
||||
PyDoc_STRVAR(bpy_bmesh_is_wrapped_doc,
|
||||
"True when this mesh is owned by blender (typically the editmode BMesh).\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
static PyObject *bpy_bmesh_is_wrapped_get(BPy_BMesh *self, void * /*closure*/)
|
||||
{
|
||||
BPY_BM_CHECK_OBJ(self);
|
||||
@@ -437,7 +437,7 @@ PyDoc_STRVAR(
|
||||
bpy_bmvert_is_manifold_doc,
|
||||
"True when this vertex is manifold (read-only).\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
static PyObject *bpy_bmvert_is_manifold_get(BPy_BMVert *self, void * /*closure*/)
|
||||
{
|
||||
BPY_BM_CHECK_OBJ(self);
|
||||
@@ -449,7 +449,7 @@ PyDoc_STRVAR(
|
||||
bpy_bmvert_is_wire_doc,
|
||||
"True when this vertex is not connected to any faces (read-only).\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
static PyObject *bpy_bmvert_is_wire_get(BPy_BMVert *self, void * /*closure*/)
|
||||
{
|
||||
BPY_BM_CHECK_OBJ(self);
|
||||
@@ -459,7 +459,7 @@ static PyObject *bpy_bmvert_is_wire_get(BPy_BMVert *self, void * /*closure*/)
|
||||
PyDoc_STRVAR(bpy_bmvert_is_boundary_doc,
|
||||
"True when this vertex is connected to boundary edges (read-only).\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
static PyObject *bpy_bmvert_is_boundary_get(BPy_BMVert *self, void * /*closure*/)
|
||||
{
|
||||
BPY_BM_CHECK_OBJ(self);
|
||||
@@ -474,7 +474,7 @@ PyDoc_STRVAR(
|
||||
bpy_bmedge_is_manifold_doc,
|
||||
"True when this edge is manifold (read-only).\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
static PyObject *bpy_bmedge_is_manifold_get(BPy_BMEdge *self, void * /*closure*/)
|
||||
{
|
||||
BPY_BM_CHECK_OBJ(self);
|
||||
@@ -487,7 +487,7 @@ PyDoc_STRVAR(
|
||||
"True when this edge is manifold, between two faces with the same winding "
|
||||
"(read-only).\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
static PyObject *bpy_bmedge_is_contiguous_get(BPy_BMEdge *self, void * /*closure*/)
|
||||
{
|
||||
BPY_BM_CHECK_OBJ(self);
|
||||
@@ -499,7 +499,7 @@ PyDoc_STRVAR(
|
||||
bpy_bmedge_is_convex_doc,
|
||||
"True when this edge joins two convex faces, depends on a valid face normal (read-only).\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
static PyObject *bpy_bmedge_is_convex_get(BPy_BMEdge *self, void * /*closure*/)
|
||||
{
|
||||
BPY_BM_CHECK_OBJ(self);
|
||||
@@ -511,7 +511,7 @@ PyDoc_STRVAR(
|
||||
bpy_bmedge_is_wire_doc,
|
||||
"True when this edge is not connected to any faces (read-only).\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
static PyObject *bpy_bmedge_is_wire_get(BPy_BMEdge *self, void * /*closure*/)
|
||||
{
|
||||
BPY_BM_CHECK_OBJ(self);
|
||||
@@ -523,7 +523,7 @@ PyDoc_STRVAR(
|
||||
bpy_bmedge_is_boundary_doc,
|
||||
"True when this edge is at the boundary of a face (read-only).\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
static PyObject *bpy_bmedge_is_boundary_get(BPy_BMEdge *self, void * /*closure*/)
|
||||
{
|
||||
BPY_BM_CHECK_OBJ(self);
|
||||
@@ -678,7 +678,7 @@ PyDoc_STRVAR(
|
||||
"True when this loop is at the convex corner of a face, depends on a valid face "
|
||||
"normal (read-only).\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
static PyObject *bpy_bmloop_is_convex_get(BPy_BMLoop *self, void * /*closure*/)
|
||||
{
|
||||
BPY_BM_CHECK_OBJ(self);
|
||||
@@ -1253,11 +1253,11 @@ PyDoc_STRVAR(
|
||||
" :type object: :class:`Object`\n"
|
||||
" :type depsgraph: :class:`Depsgraph`\n"
|
||||
" :arg cage: Get the mesh as a deformed cage.\n"
|
||||
" :type cage: boolean\n"
|
||||
" :type cage: bool\n"
|
||||
" :arg face_normals: Calculate face normals.\n"
|
||||
" :type face_normals: boolean\n"
|
||||
" :type face_normals: bool\n"
|
||||
" :arg vertex_normals: Calculate vertex normals.\n"
|
||||
" :type vertex_normals: boolean\n");
|
||||
" :type vertex_normals: bool\n");
|
||||
static PyObject *bpy_bmesh_from_object(BPy_BMesh *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
static const char *kwlist[] = {
|
||||
@@ -1357,10 +1357,10 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" :arg mesh: The mesh data to load.\n"
|
||||
" :type mesh: :class:`Mesh`\n"
|
||||
" :type face_normals: boolean\n"
|
||||
" :type vertex_normals: boolean\n"
|
||||
" :type face_normals: bool\n"
|
||||
" :type vertex_normals: bool\n"
|
||||
" :arg use_shape_key: Use the locations from a shape key.\n"
|
||||
" :type use_shape_key: boolean\n"
|
||||
" :type use_shape_key: bool\n"
|
||||
" :arg shape_key_index: The shape key index to use.\n"
|
||||
" :type shape_key_index: int\n"
|
||||
"\n"
|
||||
@@ -1437,7 +1437,7 @@ PyDoc_STRVAR(
|
||||
" Flush selection, independent of the current selection mode.\n"
|
||||
"\n"
|
||||
" :arg select: flush selection or de-selected elements.\n"
|
||||
" :type select: boolean\n");
|
||||
" :type select: bool\n");
|
||||
static PyObject *bpy_bmesh_select_flush(BPy_BMesh *self, PyObject *value)
|
||||
{
|
||||
int param;
|
||||
@@ -1485,11 +1485,11 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" Transform the mesh (optionally filtering flagged data only).\n"
|
||||
"\n"
|
||||
" :arg matrix: transform matrix.\n"
|
||||
" :type matrix: 4x4 :class:`mathutils.Matrix`\n"
|
||||
" :arg matrix: 4x4x transform matrix.\n"
|
||||
" :type matrix: :class:`mathutils.Matrix`\n"
|
||||
" :arg filter: set of values in " BPY_BM_HFLAG_ALL_STR
|
||||
".\n"
|
||||
" :type filter: set\n");
|
||||
" :type filter: set[str]\n");
|
||||
static PyObject *bpy_bmesh_transform(BPy_BMElem *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
static const char *kwlist[] = {"matrix", "filter", nullptr};
|
||||
@@ -1578,7 +1578,7 @@ PyDoc_STRVAR(
|
||||
" Calculate triangle tessellation from quads/ngons.\n"
|
||||
"\n"
|
||||
" :return: The triangulated faces.\n"
|
||||
" :rtype: list of :class:`BMLoop` tuples\n");
|
||||
" :rtype: list[tuple[:class:`BMLoop`, :class:`BMLoop`, :class:`BMLoop`]]\n");
|
||||
static PyObject *bpy_bmesh_calc_loop_triangles(BPy_BMElem *self)
|
||||
{
|
||||
BMesh *bm;
|
||||
@@ -1617,7 +1617,7 @@ PyDoc_STRVAR(
|
||||
"state of associated geometry.\n"
|
||||
"\n"
|
||||
" :arg select: Select or de-select.\n"
|
||||
" :type select: boolean\n"
|
||||
" :type select: bool\n"
|
||||
"\n"
|
||||
" .. note::\n"
|
||||
"\n"
|
||||
@@ -1650,7 +1650,7 @@ PyDoc_STRVAR(
|
||||
"hide state of associated geometry.\n"
|
||||
"\n"
|
||||
" :arg hide: Hidden or visible.\n"
|
||||
" :type hide: boolean\n");
|
||||
" :type hide: bool\n");
|
||||
static PyObject *bpy_bm_elem_hide_set(BPy_BMElem *self, PyObject *value)
|
||||
{
|
||||
int param;
|
||||
@@ -1739,7 +1739,7 @@ PyDoc_STRVAR(
|
||||
" Interpolate the customdata from a vert between 2 other verts.\n"
|
||||
"\n"
|
||||
" :arg vert_pair: The verts between which to interpolate data from.\n"
|
||||
" :type vert_pair: pair of :class:`BMVert`\n"
|
||||
" :type vert_pair: Sequence[:class:`BMVert`]\n"
|
||||
" :type fac: float\n");
|
||||
static PyObject *bpy_bmvert_copy_from_vert_interp(BPy_BMVert *self, PyObject *args)
|
||||
{
|
||||
@@ -1815,7 +1815,7 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" :arg fallback: return this when the vert doesn't have 2 edges\n"
|
||||
" (instead of raising a :exc:`ValueError`).\n"
|
||||
" :type fallback: any\n"
|
||||
" :type fallback: Any\n"
|
||||
" :return: Angle between edges in radians.\n"
|
||||
" :rtype: float\n");
|
||||
static PyObject *bpy_bmvert_calc_edge_angle(BPy_BMVert *self, PyObject *args)
|
||||
@@ -1908,7 +1908,7 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" :arg fallback: return this when the edge doesn't have 2 faces\n"
|
||||
" (instead of raising a :exc:`ValueError`).\n"
|
||||
" :type fallback: any\n"
|
||||
" :type fallback: Any\n"
|
||||
" :return: The angle between 2 connected faces in radians.\n"
|
||||
" :rtype: float\n");
|
||||
static PyObject *bpy_bmedge_calc_face_angle(BPy_BMEdge *self, PyObject *args)
|
||||
@@ -1948,7 +1948,7 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" :arg fallback: return this when the edge doesn't have 2 faces\n"
|
||||
" (instead of raising a :exc:`ValueError`).\n"
|
||||
" :type fallback: any\n"
|
||||
" :type fallback: Any\n"
|
||||
" :return: The angle between 2 connected faces in radians (negative for concave join).\n"
|
||||
" :rtype: float\n");
|
||||
static PyObject *bpy_bmedge_calc_face_angle_signed(BPy_BMEdge *self, PyObject *args)
|
||||
@@ -2019,7 +2019,7 @@ PyDoc_STRVAR(
|
||||
" :arg vert: a vert in this edge.\n"
|
||||
" :type vert: :class:`BMVert`\n"
|
||||
" :return: The edges other vert.\n"
|
||||
" :rtype: :class:`BMVert` or None\n");
|
||||
" :rtype: :class:`BMVert` | None\n");
|
||||
static PyObject *bpy_bmedge_other_vert(BPy_BMEdge *self, BPy_BMVert *value)
|
||||
{
|
||||
BMVert *other;
|
||||
@@ -2076,7 +2076,7 @@ PyDoc_STRVAR(
|
||||
" :arg face: The face to interpolate data from.\n"
|
||||
" :type face: :class:`BMFace`\n"
|
||||
" :arg vert: When True, also copy vertex data.\n"
|
||||
" :type vert: boolean\n");
|
||||
" :type vert: bool\n");
|
||||
static PyObject *bpy_bmface_copy_from_face_interp(BPy_BMFace *self, PyObject *args)
|
||||
{
|
||||
BPy_BMFace *py_face = nullptr;
|
||||
@@ -2111,9 +2111,9 @@ PyDoc_STRVAR(
|
||||
" Make a copy of this face.\n"
|
||||
"\n"
|
||||
" :arg verts: When set, the faces verts will be duplicated too.\n"
|
||||
" :type verts: boolean\n"
|
||||
" :type verts: bool\n"
|
||||
" :arg edges: When set, the faces edges will be duplicated too.\n"
|
||||
" :type edges: boolean\n"
|
||||
" :type edges: bool\n"
|
||||
" :return: The newly created face.\n"
|
||||
" :rtype: :class:`BMFace`\n");
|
||||
static PyObject *bpy_bmface_copy(BPy_BMFace *self, PyObject *args, PyObject *kw)
|
||||
@@ -2354,9 +2354,9 @@ PyDoc_STRVAR(
|
||||
" :arg face: The face to interpolate data from.\n"
|
||||
" :type face: :class:`BMFace`\n"
|
||||
" :arg vert: When enabled, interpolate the loops vertex data (optional).\n"
|
||||
" :type vert: boolean\n"
|
||||
" :type vert: bool\n"
|
||||
" :arg multires: When enabled, interpolate the loops multires data (optional).\n"
|
||||
" :type multires: boolean\n");
|
||||
" :type multires: bool\n");
|
||||
static PyObject *bpy_bmloop_copy_from_face_interp(BPy_BMLoop *self, PyObject *args)
|
||||
{
|
||||
BPy_BMFace *py_face = nullptr;
|
||||
@@ -2508,7 +2508,7 @@ PyDoc_STRVAR(
|
||||
" Create a new edge from a given pair of verts.\n"
|
||||
"\n"
|
||||
" :arg verts: Vertex pair.\n"
|
||||
" :type verts: pair of :class:`BMVert`\n"
|
||||
" :type verts: Sequence[:class:`BMVert`]\n"
|
||||
" :arg example: Existing edge to initialize settings (optional argument).\n"
|
||||
" :type example: :class:`BMEdge`\n"
|
||||
" :return: The newly created edge.\n"
|
||||
@@ -2584,7 +2584,7 @@ PyDoc_STRVAR(
|
||||
" Create a new face from a given set of verts.\n"
|
||||
"\n"
|
||||
" :arg verts: Sequence of 3 or more verts.\n"
|
||||
" :type verts: sequence of :class:`BMVert`\n"
|
||||
" :type verts: Sequence[:class:`BMVert`]\n"
|
||||
" :arg example: Existing face to initialize settings (optional argument).\n"
|
||||
" :type example: :class:`BMFace`\n"
|
||||
" :return: The newly created face.\n"
|
||||
@@ -2741,7 +2741,7 @@ PyDoc_STRVAR(
|
||||
" Return an edge which uses the **verts** passed.\n"
|
||||
"\n"
|
||||
" :arg verts: Sequence of verts.\n"
|
||||
" :type verts: sequence of :class:`BMVert`\n"
|
||||
" :type verts: Sequence[:class:`BMVert`]\n"
|
||||
" :arg fallback: Return this value if nothing is found.\n"
|
||||
" :return: The edge found or None\n"
|
||||
" :rtype: :class:`BMEdge`\n");
|
||||
@@ -2789,7 +2789,7 @@ PyDoc_STRVAR(
|
||||
" Return a face which uses the **verts** passed.\n"
|
||||
"\n"
|
||||
" :arg verts: Sequence of verts.\n"
|
||||
" :type verts: sequence of :class:`BMVert`\n"
|
||||
" :type verts: Sequence[:class:`BMVert`]\n"
|
||||
" :arg fallback: Return this value if nothing is found.\n"
|
||||
" :return: The face found or None\n"
|
||||
" :rtype: :class:`BMFace`\n");
|
||||
@@ -2916,7 +2916,7 @@ PyDoc_STRVAR(
|
||||
"that.\n"
|
||||
"\n"
|
||||
" :arg key: The key that sets the ordering of the elements.\n"
|
||||
" :type key: :function: returning a number\n"
|
||||
" :type key: Callable[[:class:`BMVert` | :class:`BMEdge` | :class:`BMFace`], int] | None\n"
|
||||
" :arg reverse: Reverse the order of the elements\n"
|
||||
" :type reverse: bool\n"
|
||||
"\n"
|
||||
|
||||
@@ -182,7 +182,7 @@ static PyObject *bpy_bmlayercollection_active_get(BPy_BMLayerItem *self, void *
|
||||
PyDoc_STRVAR(bpy_bmlayercollection_is_singleton_doc,
|
||||
"True if there can exists only one layer of this type (read-only).\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
static PyObject *bpy_bmlayercollection_is_singleton_get(BPy_BMLayerItem *self, void * /*flag*/)
|
||||
{
|
||||
BPY_BM_CHECK_OBJ(self);
|
||||
@@ -195,7 +195,7 @@ PyDoc_STRVAR(
|
||||
bpy_bmlayercollection_name_doc,
|
||||
"The layers unique name (read-only).\n"
|
||||
"\n"
|
||||
":type: string");
|
||||
":type: str");
|
||||
static PyObject *bpy_bmlayeritem_name_get(BPy_BMLayerItem *self, void * /*flag*/)
|
||||
{
|
||||
CustomDataLayer *layer;
|
||||
@@ -506,7 +506,7 @@ PyDoc_STRVAR(
|
||||
" Create a new layer\n"
|
||||
"\n"
|
||||
" :arg name: Optional name argument (will be made unique).\n"
|
||||
" :type name: string\n"
|
||||
" :type name: str\n"
|
||||
" :return: The newly created layer.\n"
|
||||
" :rtype: :class:`BMLayerItem`\n");
|
||||
static PyObject *bpy_bmlayercollection_new(BPy_BMLayerCollection *self, PyObject *args)
|
||||
@@ -593,7 +593,7 @@ PyDoc_STRVAR(
|
||||
" (matching Python's dict.keys() functionality).\n"
|
||||
"\n"
|
||||
" :return: the identifiers for each member of this collection.\n"
|
||||
" :rtype: list of strings\n");
|
||||
" :rtype: list[str]\n");
|
||||
static PyObject *bpy_bmlayercollection_keys(BPy_BMLayerCollection *self)
|
||||
{
|
||||
PyObject *ret;
|
||||
@@ -630,7 +630,7 @@ PyDoc_STRVAR(
|
||||
" (matching Python's dict.items() functionality).\n"
|
||||
"\n"
|
||||
" :return: (key, value) pairs for each member of this collection.\n"
|
||||
" :rtype: list of tuples\n");
|
||||
" :rtype: list[tuple[str, :class:`BMLayerItem`]]\n");
|
||||
static PyObject *bpy_bmlayercollection_items(BPy_BMLayerCollection *self)
|
||||
{
|
||||
PyObject *ret;
|
||||
@@ -667,7 +667,7 @@ PyDoc_STRVAR(
|
||||
" (matching Python's dict.values() functionality).\n"
|
||||
"\n"
|
||||
" :return: the members of this collection.\n"
|
||||
" :rtype: list\n");
|
||||
" :rtype: list[:class:`BMLayerItem`]\n");
|
||||
static PyObject *bpy_bmlayercollection_values(BPy_BMLayerCollection *self)
|
||||
{
|
||||
PyObject *ret;
|
||||
@@ -701,10 +701,10 @@ PyDoc_STRVAR(
|
||||
" when not found (matches Python's dictionary function of the same name).\n"
|
||||
"\n"
|
||||
" :arg key: The key associated with the layer.\n"
|
||||
" :type key: string\n"
|
||||
" :type key: str\n"
|
||||
" :arg default: Optional argument for the value to return if\n"
|
||||
" *key* is not found.\n"
|
||||
" :type default: Undefined\n");
|
||||
" :type default: Any\n");
|
||||
static PyObject *bpy_bmlayercollection_get(BPy_BMLayerCollection *self, PyObject *args)
|
||||
{
|
||||
const char *key;
|
||||
|
||||
@@ -85,19 +85,19 @@ PyDoc_STRVAR(
|
||||
bpy_bmloopuv_pin_uv_doc,
|
||||
"UV pin state.\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
PyDoc_STRVAR(
|
||||
/* Wrap. */
|
||||
bpy_bmloopuv_select_doc,
|
||||
"UV select state.\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
PyDoc_STRVAR(
|
||||
/* Wrap. */
|
||||
bpy_bmloopuv_select_edge_doc,
|
||||
"UV edge select state.\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
|
||||
static PyObject *bpy_bmloopuv_pin_uv_get(BPy_BMLoopUV *self, void * /*closure*/)
|
||||
{
|
||||
@@ -284,13 +284,13 @@ PyDoc_STRVAR(
|
||||
bpy_bmvertskin_flag__use_root_doc,
|
||||
"Use as root vertex. Setting this flag does not clear other roots in the same mesh island.\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
PyDoc_STRVAR(
|
||||
/* Wrap. */
|
||||
bpy_bmvertskin_flag__use_loose_doc,
|
||||
"Use loose vertex.\n"
|
||||
"\n"
|
||||
":type: boolean");
|
||||
":type: bool");
|
||||
|
||||
static PyObject *bpy_bmvertskin_flag_get(BPy_BMVertSkin *self, void *flag_p)
|
||||
{
|
||||
@@ -637,7 +637,7 @@ PyDoc_STRVAR(
|
||||
" (matching Python's dict.keys() functionality).\n"
|
||||
"\n"
|
||||
" :return: the deform group this vertex uses\n"
|
||||
" :rtype: list of ints\n");
|
||||
" :rtype: list[int]\n");
|
||||
static PyObject *bpy_bmdeformvert_keys(BPy_BMDeformVert *self)
|
||||
{
|
||||
PyObject *ret;
|
||||
@@ -661,7 +661,7 @@ PyDoc_STRVAR(
|
||||
" (matching Python's dict.values() functionality).\n"
|
||||
"\n"
|
||||
" :return: The weights that influence this vertex\n"
|
||||
" :rtype: list of floats\n");
|
||||
" :rtype: list[float]\n");
|
||||
static PyObject *bpy_bmdeformvert_values(BPy_BMDeformVert *self)
|
||||
{
|
||||
PyObject *ret;
|
||||
@@ -685,7 +685,7 @@ PyDoc_STRVAR(
|
||||
" (matching Python's dict.items() functionality).\n"
|
||||
"\n"
|
||||
" :return: (key, value) pairs for each deform weight of this vertex.\n"
|
||||
" :rtype: list of tuples\n");
|
||||
" :rtype: list[tuple[int, float]]\n");
|
||||
static PyObject *bpy_bmdeformvert_items(BPy_BMDeformVert *self)
|
||||
{
|
||||
PyObject *ret;
|
||||
@@ -715,7 +715,7 @@ PyDoc_STRVAR(
|
||||
" :type key: int\n"
|
||||
" :arg default: Optional argument for the value to return if\n"
|
||||
" *key* is not found.\n"
|
||||
" :type default: Undefined\n");
|
||||
" :type default: Any\n");
|
||||
static PyObject *bpy_bmdeformvert_get(BPy_BMDeformVert *self, PyObject *args)
|
||||
{
|
||||
int key;
|
||||
|
||||
@@ -163,7 +163,7 @@ PyDoc_STRVAR(
|
||||
" :arg vert: The vert to be dissolved.\n"
|
||||
" :type vert: :class:`bmesh.types.BMVert`\n"
|
||||
" :return: True when the vertex dissolve is successful.\n"
|
||||
" :rtype: boolean\n");
|
||||
" :rtype: bool\n");
|
||||
static PyObject *bpy_bm_utils_vert_dissolve(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
BPy_BMVert *py_vert;
|
||||
@@ -250,7 +250,7 @@ PyDoc_STRVAR(
|
||||
" :arg edges: The edges to separated.\n"
|
||||
" :type edges: :class:`bmesh.types.BMEdge`\n"
|
||||
" :return: The newly separated verts (including the vertex passed).\n"
|
||||
" :rtype: tuple of :class:`bmesh.types.BMVert`\n");
|
||||
" :rtype: tuple[:class:`bmesh.types.BMVert`, ...]\n");
|
||||
static PyObject *bpy_bm_utils_vert_separate(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
BPy_BMVert *py_vert;
|
||||
@@ -312,7 +312,7 @@ PyDoc_STRVAR(
|
||||
" :arg fac: The point on the edge where the new vert will be created [0 - 1].\n"
|
||||
" :type fac: float\n"
|
||||
" :return: The newly created (edge, vert) pair.\n"
|
||||
" :rtype: tuple\n");
|
||||
" :rtype: tuple[:class:`bmesh.types.BMEdge`, :class:`bmesh.types.BMVert`]\n");
|
||||
static PyObject *bpy_bm_utils_edge_split(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
BPy_BMEdge *py_edge;
|
||||
@@ -366,7 +366,7 @@ PyDoc_STRVAR(
|
||||
" :arg edge: The edge to rotate.\n"
|
||||
" :type edge: :class:`bmesh.types.BMEdge`\n"
|
||||
" :arg ccw: When True the edge will be rotated counter clockwise.\n"
|
||||
" :type ccw: boolean\n"
|
||||
" :type ccw: bool\n"
|
||||
" :return: The newly rotated edge.\n"
|
||||
" :rtype: :class:`bmesh.types.BMEdge`\n");
|
||||
static PyObject *bpy_bm_utils_edge_rotate(PyObject * /*self*/, PyObject *args)
|
||||
@@ -409,15 +409,15 @@ PyDoc_STRVAR(
|
||||
" :type vert_a: :class:`bmesh.types.BMVert`\n"
|
||||
" :arg vert_b: Second vertex to cut in the face (face must contain the vert).\n"
|
||||
" :type vert_b: :class:`bmesh.types.BMVert`\n"
|
||||
" :arg coords: Optional argument to define points in between *vert_a* and *vert_b*.\n"
|
||||
" :type coords: sequence of float triplets\n"
|
||||
" :arg coords: Optional sequence of 3D points in between *vert_a* and *vert_b*.\n"
|
||||
" :type coords: Sequence[Sequence[float]]\n"
|
||||
" :arg use_exist: .Use an existing edge if it exists (Only used when *coords* argument is "
|
||||
"empty or omitted)\n"
|
||||
" :type use_exist: boolean\n"
|
||||
" :type use_exist: bool\n"
|
||||
" :arg example: Newly created edge will copy settings from this one.\n"
|
||||
" :type example: :class:`bmesh.types.BMEdge`\n"
|
||||
" :return: The newly created face or None on failure.\n"
|
||||
" :rtype: (:class:`bmesh.types.BMFace`, :class:`bmesh.types.BMLoop`) pair\n");
|
||||
" :rtype: tuple[:class:`bmesh.types.BMFace`, :class:`bmesh.types.BMLoop`]\n");
|
||||
static PyObject *bpy_bm_utils_face_split(PyObject * /*self*/, PyObject *args, PyObject *kw)
|
||||
{
|
||||
static const char *kwlist[] = {
|
||||
@@ -544,9 +544,9 @@ PyDoc_STRVAR(
|
||||
" :arg face: The face to split.\n"
|
||||
" :type face: :class:`bmesh.types.BMFace`\n"
|
||||
" :arg edgenet: Sequence of edges.\n"
|
||||
" :type edgenet: :class:`bmesh.types.BMEdge`\n"
|
||||
" :type edgenet: Sequence[:class:`bmesh.types.BMEdge`]\n"
|
||||
" :return: The newly created faces.\n"
|
||||
" :rtype: tuple of :class:`bmesh.types.BMFace`\n"
|
||||
" :rtype: tuple[:class:`bmesh.types.BMFace`, ...]\n"
|
||||
"\n"
|
||||
" .. note::\n"
|
||||
"\n"
|
||||
@@ -621,7 +621,7 @@ PyDoc_STRVAR(
|
||||
" :arg faces: Sequence of faces.\n"
|
||||
" :type faces: :class:`bmesh.types.BMFace`\n"
|
||||
" :arg remove: Remove the edges and vertices between the faces.\n"
|
||||
" :type remove: boolean\n"
|
||||
" :type remove: bool\n"
|
||||
" :return: The newly created face or None on failure.\n"
|
||||
" :rtype: :class:`bmesh.types.BMFace`\n");
|
||||
static PyObject *bpy_bm_utils_face_join(PyObject * /*self*/, PyObject *args)
|
||||
|
||||
@@ -150,7 +150,7 @@ PyDoc_STRVAR(
|
||||
"font use 0.\n"
|
||||
" :type fontid: int\n"
|
||||
" :arg text: the text to draw.\n"
|
||||
" :type text: string\n");
|
||||
" :type text: str\n");
|
||||
static PyObject *py_blf_draw(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
const char *text;
|
||||
@@ -177,9 +177,9 @@ PyDoc_STRVAR(
|
||||
"font use 0.\n"
|
||||
" :type fontid: int\n"
|
||||
" :arg text: the text to draw.\n"
|
||||
" :type text: string\n"
|
||||
" :type text: str\n"
|
||||
" :return: the width and height of the text.\n"
|
||||
" :rtype: tuple of 2 floats\n");
|
||||
" :rtype: tuple[float, float]\n");
|
||||
static PyObject *py_blf_dimensions(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
const char *text;
|
||||
@@ -408,9 +408,9 @@ PyDoc_STRVAR(
|
||||
" Load a new font.\n"
|
||||
"\n"
|
||||
" :arg filepath: the filepath of the font.\n"
|
||||
" :type filepath: string or bytes\n"
|
||||
" :type filepath: str | bytes\n"
|
||||
" :return: the new font's fontid or -1 if there was an error.\n"
|
||||
" :rtype: integer\n");
|
||||
" :rtype: int\n");
|
||||
static PyObject *py_blf_load(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
PyC_UnicodeAsBytesAndSize_Data filepath_data = {nullptr};
|
||||
@@ -436,7 +436,7 @@ PyDoc_STRVAR(
|
||||
" Unload an existing font.\n"
|
||||
"\n"
|
||||
" :arg filepath: the filepath of the font.\n"
|
||||
" :type filepath: string or bytes\n");
|
||||
" :type filepath: str | bytes\n");
|
||||
static PyObject *py_blf_unload(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
PyC_UnicodeAsBytesAndSize_Data filepath_data = {nullptr};
|
||||
|
||||
@@ -1682,9 +1682,9 @@ PyDoc_STRVAR(
|
||||
" :raises KeyError: When the item doesn't exist.\n"
|
||||
"\n"
|
||||
" :arg key: Name of item to remove.\n"
|
||||
" :type key: string\n"
|
||||
" :type key: str\n"
|
||||
" :arg default: Value to return when key isn't found, otherwise raise an exception.\n"
|
||||
" :type default: Undefined\n");
|
||||
" :type default: Any\n");
|
||||
static PyObject *BPy_IDGroup_pop(BPy_IDProperty *self, PyObject *args)
|
||||
{
|
||||
IDProperty *idprop;
|
||||
@@ -1884,7 +1884,8 @@ PyDoc_STRVAR(
|
||||
" Update key, values.\n"
|
||||
"\n"
|
||||
" :arg other: Updates the values in the group with this.\n"
|
||||
" :type other: :class:`IDPropertyGroup` or dict\n");
|
||||
/* TODO: replace `Any` with an alias for all types an ID property can use. */
|
||||
" :type other: :class:`IDPropertyGroup` | dict[str, Any]\n");
|
||||
static PyObject *BPy_IDGroup_update(BPy_IDProperty *self, PyObject *value)
|
||||
{
|
||||
PyObject *pkey, *pval;
|
||||
|
||||
@@ -79,7 +79,7 @@ PyDoc_STRVAR(
|
||||
" Resize the image.\n"
|
||||
"\n"
|
||||
" :arg size: New size.\n"
|
||||
" :type size: pair of ints\n"
|
||||
" :type size: tuple[int, int]\n"
|
||||
" :arg method: Method of resizing ('FAST', 'BILINEAR')\n"
|
||||
" :type method: str\n");
|
||||
static PyObject *py_imbuf_resize(Py_ImBuf *self, PyObject *args, PyObject *kw)
|
||||
@@ -136,9 +136,9 @@ PyDoc_STRVAR(
|
||||
" Crop the image.\n"
|
||||
"\n"
|
||||
" :arg min: X, Y minimum.\n"
|
||||
" :type min: pair of ints\n"
|
||||
" :type min: tuple[int, int]\n"
|
||||
" :arg max: X, Y maximum.\n"
|
||||
" :type max: pair of ints\n");
|
||||
" :type max: tuple[int, int]\n");
|
||||
static PyObject *py_imbuf_crop(Py_ImBuf *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
PY_IMBUF_CHECK_OBJ(self);
|
||||
@@ -296,7 +296,7 @@ PyDoc_STRVAR(
|
||||
py_imbuf_filepath_doc,
|
||||
"filepath associated with this image.\n"
|
||||
"\n"
|
||||
":type: string");
|
||||
":type: str");
|
||||
static PyObject *py_imbuf_filepath_get(Py_ImBuf *self, void * /*closure*/)
|
||||
{
|
||||
PY_IMBUF_CHECK_OBJ(self);
|
||||
@@ -472,7 +472,7 @@ PyDoc_STRVAR(
|
||||
" Load a new image.\n"
|
||||
"\n"
|
||||
" :arg size: The size of the image in pixels.\n"
|
||||
" :type size: pair of ints\n"
|
||||
" :type size: tuple[int, int]\n"
|
||||
" :return: the newly loaded image.\n"
|
||||
" :rtype: :class:`ImBuf`\n");
|
||||
static PyObject *M_imbuf_new(PyObject * /*self*/, PyObject *args, PyObject *kw)
|
||||
@@ -537,7 +537,7 @@ PyDoc_STRVAR(
|
||||
" Load an image from a file.\n"
|
||||
"\n"
|
||||
" :arg filepath: the filepath of the image.\n"
|
||||
" :type filepath: string or bytes\n"
|
||||
" :type filepath: str | bytes\n"
|
||||
" :return: the newly loaded image.\n"
|
||||
" :rtype: :class:`ImBuf`\n");
|
||||
static PyObject *M_imbuf_load(PyObject * /*self*/, PyObject *args, PyObject *kw)
|
||||
@@ -584,7 +584,7 @@ PyDoc_STRVAR(
|
||||
" :arg image: the image to write.\n"
|
||||
" :type image: :class:`ImBuf`\n"
|
||||
" :arg filepath: Optional filepath of the image (fallback to the images file path).\n"
|
||||
" :type filepath: string, bytes or NoneType\n");
|
||||
" :type filepath: str | bytes | None\n");
|
||||
static PyObject *M_imbuf_write(PyObject * /*self*/, PyObject *args, PyObject *kw)
|
||||
{
|
||||
Py_ImBuf *py_imb;
|
||||
|
||||
@@ -684,7 +684,7 @@ PyDoc_STRVAR(
|
||||
" :arg dimensions: Array describing the dimensions.\n"
|
||||
" :type dimensions: int\n"
|
||||
" :arg data: Optional data array.\n"
|
||||
" :type data: sequence\n");
|
||||
" :type data: Buffer | Sequence[float] | Sequence[int]\n");
|
||||
PyTypeObject BPyGPU_BufferType = {
|
||||
/*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
|
||||
/*tp_name*/ "Buffer",
|
||||
|
||||
@@ -247,7 +247,7 @@ PyDoc_STRVAR(
|
||||
" Get supported extensions in the current context.\n"
|
||||
"\n"
|
||||
" :return: Extensions.\n"
|
||||
" :rtype: tuple of string\n");
|
||||
" :rtype: tuple[str]\n");
|
||||
static PyObject *pygpu_extensions_get(PyObject * /*self*/)
|
||||
{
|
||||
BPYGPU_IS_INIT_OR_ERROR_OBJ;
|
||||
|
||||
@@ -189,7 +189,7 @@ PyDoc_STRVAR(
|
||||
" :arg seq: Indices this index buffer will contain.\n"
|
||||
" Whether a 1D or 2D sequence is required depends on the type.\n"
|
||||
" Optionally the sequence can support the buffer protocol.\n"
|
||||
" :type seq: 1D or 2D sequence\n");
|
||||
" :type seq: Buffer | Sequence[int] | Sequence[Sequence[int]]\n");
|
||||
PyTypeObject BPyGPUIndexBuf_Type = {
|
||||
/*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
|
||||
/*tp_name*/ "GPUIndexBuf",
|
||||
|
||||
@@ -413,8 +413,8 @@ PyDoc_STRVAR(
|
||||
" Fill color, depth and stencil textures with specific value.\n"
|
||||
" Common values: color=(0.0, 0.0, 0.0, 1.0), depth=1.0, stencil=0.\n"
|
||||
"\n"
|
||||
" :arg color: float sequence each representing ``(r, g, b, a)``.\n"
|
||||
" :type color: sequence of 3 or 4 floats\n"
|
||||
" :arg color: Sequence of 3 or 4 floats representing ``(r, g, b, a)``.\n"
|
||||
" :type color: Sequence[float]\n"
|
||||
" :arg depth: depth value.\n"
|
||||
" :type depth: float\n"
|
||||
" :arg stencil: stencil value.\n"
|
||||
@@ -774,6 +774,8 @@ static PyMethodDef pygpu_framebuffer__tp_methods[] = {
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
/* Ideally type aliases would de-duplicate: `GPUTexture | dict[str, int | GPUTexture]`
|
||||
* in this doc-string. */
|
||||
PyDoc_STRVAR(
|
||||
/* Wrap. */
|
||||
pygpu_framebuffer__tp_doc,
|
||||
@@ -786,10 +788,13 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" :arg depth_slot: GPUTexture to attach or a `dict` containing keywords: "
|
||||
"'texture', 'layer' and 'mip'.\n"
|
||||
" :type depth_slot: :class:`gpu.types.GPUTexture`, dict or Nonetype\n"
|
||||
" :type depth_slot: :class:`gpu.types.GPUTexture` | dict[] | None\n"
|
||||
" :arg color_slots: Tuple where each item can be a GPUTexture or a `dict` "
|
||||
"containing keywords: 'texture', 'layer' and 'mip'.\n"
|
||||
" :type color_slots: tuple or Nonetype\n");
|
||||
" :type color_slots: :class:`gpu.types.GPUTexture` | "
|
||||
"dict[str, int | :class:`gpu.types.GPUTexture`] | "
|
||||
"Sequence[:class:`gpu.types.GPUTexture` | dict[str, int | :class:`gpu.types.GPUTexture`]] | "
|
||||
"None\n");
|
||||
PyTypeObject BPyGPUFrameBuffer_Type = {
|
||||
/*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
|
||||
/*tp_name*/ "GPUFrameBuffer",
|
||||
|
||||
@@ -370,8 +370,8 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" Scale the current stack matrix.\n"
|
||||
"\n"
|
||||
" :arg scale: Scale the current stack matrix.\n"
|
||||
" :type scale: sequence of 2 or 3 floats\n");
|
||||
" :arg scale: Scale the current stack matrix with 2 or 3 floats.\n"
|
||||
" :type scale: Sequence[float]\n");
|
||||
static PyObject *pygpu_matrix_scale(PyObject * /*self*/, PyObject *value)
|
||||
{
|
||||
BPYGPU_IS_INIT_OR_ERROR_OBJ;
|
||||
@@ -419,8 +419,8 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" Scale the current stack matrix.\n"
|
||||
"\n"
|
||||
" :arg offset: Translate the current stack matrix.\n"
|
||||
" :type offset: sequence of 2 or 3 floats\n");
|
||||
" :arg offset: Translate the current stack matrix with 2 or 3 floats.\n"
|
||||
" :type offset: Sequence[float]\n");
|
||||
static PyObject *pygpu_matrix_translate(PyObject * /*self*/, PyObject *value)
|
||||
{
|
||||
float offset[3];
|
||||
|
||||
@@ -322,7 +322,7 @@ PyDoc_STRVAR(
|
||||
pygpu_offscreen_width_doc,
|
||||
"Width of the texture.\n"
|
||||
"\n"
|
||||
":type: `int`");
|
||||
":type: int");
|
||||
static PyObject *pygpu_offscreen_width_get(BPyGPUOffScreen *self, void * /*type*/)
|
||||
{
|
||||
BPY_GPU_OFFSCREEN_CHECK_OBJ(self);
|
||||
@@ -334,7 +334,7 @@ PyDoc_STRVAR(
|
||||
pygpu_offscreen_height_doc,
|
||||
"Height of the texture.\n"
|
||||
"\n"
|
||||
":type: `int`");
|
||||
":type: int");
|
||||
static PyObject *pygpu_offscreen_height_get(BPyGPUOffScreen *self, void * /*type*/)
|
||||
{
|
||||
BPY_GPU_OFFSCREEN_CHECK_OBJ(self);
|
||||
@@ -346,7 +346,7 @@ PyDoc_STRVAR(
|
||||
pygpu_offscreen_color_texture_doc,
|
||||
"OpenGL bindcode for the color texture.\n"
|
||||
"\n"
|
||||
":type: `int`");
|
||||
":type: int");
|
||||
static PyObject *pygpu_offscreen_color_texture_get(BPyGPUOffScreen *self, void * /*type*/)
|
||||
{
|
||||
BPY_GPU_OFFSCREEN_CHECK_OBJ(self);
|
||||
|
||||
@@ -261,7 +261,7 @@ PyDoc_STRVAR(
|
||||
" :arg location: Location of the uniform variable to be modified.\n"
|
||||
" :type location: int\n"
|
||||
" :arg buffer: The data that should be set. Can support the buffer protocol.\n"
|
||||
" :type buffer: sequence of floats\n"
|
||||
" :type buffer: Sequence[float]\n"
|
||||
" :arg length: Size of the uniform data type:\n"
|
||||
"\n"
|
||||
" - 1: float\n"
|
||||
@@ -331,7 +331,7 @@ PyDoc_STRVAR(
|
||||
" :arg name: Name of the uniform variable whose value is to be changed.\n"
|
||||
" :type name: str\n"
|
||||
" :arg value: Value that will be used to update the specified uniform variable.\n"
|
||||
" :type value: bool or sequence of bools\n");
|
||||
" :type value: bool | Sequence[bool]\n");
|
||||
static PyObject *pygpu_shader_uniform_bool(BPyGPUShader *self, PyObject *args)
|
||||
{
|
||||
const char *error_prefix = "GPUShader.uniform_bool";
|
||||
@@ -406,7 +406,7 @@ PyDoc_STRVAR(
|
||||
" :arg name: Name of the uniform variable whose value is to be changed.\n"
|
||||
" :type name: str\n"
|
||||
" :arg value: Value that will be used to update the specified uniform variable.\n"
|
||||
" :type value: single number or sequence of floats\n");
|
||||
" :type value: float | Sequence[float]\n");
|
||||
static PyObject *pygpu_shader_uniform_float(BPyGPUShader *self, PyObject *args)
|
||||
{
|
||||
const char *error_prefix = "GPUShader.uniform_float";
|
||||
@@ -478,7 +478,7 @@ PyDoc_STRVAR(
|
||||
" :arg name: name of the uniform variable whose value is to be changed.\n"
|
||||
" :type name: str\n"
|
||||
" :arg seq: Value that will be used to update the specified uniform variable.\n"
|
||||
" :type seq: sequence of ints\n");
|
||||
" :type seq: Sequence[int]\n");
|
||||
static PyObject *pygpu_shader_uniform_int(BPyGPUShader *self, PyObject *args)
|
||||
{
|
||||
const char *error_prefix = "GPUShader.uniform_int";
|
||||
@@ -689,7 +689,7 @@ PyDoc_STRVAR(
|
||||
" Information about the attributes used in the Shader.\n"
|
||||
"\n"
|
||||
" :return: tuples containing information about the attributes in order (name, type)\n"
|
||||
" :rtype: tuple\n");
|
||||
" :rtype: tuple[tuple[str, str | None], ...]\n");
|
||||
static PyObject *pygpu_shader_attrs_info_get(BPyGPUShader *self, PyObject * /*arg*/)
|
||||
{
|
||||
uint attr_len = GPU_shader_get_attribute_len(self->shader);
|
||||
|
||||
@@ -692,7 +692,7 @@ PyDoc_STRVAR(
|
||||
"read or written. Possible values are:\n"
|
||||
"" PYDOC_QUALIFIERS
|
||||
""
|
||||
" :type qualifiers: set\n");
|
||||
" :type qualifiers: set[str]\n");
|
||||
static PyObject *pygpu_shader_info_image(BPyGPUShaderCreateInfo *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
@@ -891,9 +891,8 @@ PyDoc_STRVAR(
|
||||
" :type type: str\n"
|
||||
" :arg name: Name of the constant.\n"
|
||||
" :type name: str\n"
|
||||
" :arg size: If not zero, indicates that the constant is an array with the "
|
||||
"specified size.\n"
|
||||
" :type size: uint\n");
|
||||
" :arg size: If not zero, indicates that the constant is an array with the specified size.\n"
|
||||
" :type size: int\n");
|
||||
static PyObject *pygpu_shader_info_push_constant(BPyGPUShaderCreateInfo *self,
|
||||
PyObject *args,
|
||||
PyObject *kwds)
|
||||
|
||||
@@ -301,7 +301,7 @@ PyDoc_STRVAR(
|
||||
" (x, y, xsize, ysize).\n"
|
||||
" x, y: lower left corner of the scissor rectangle, in pixels.\n"
|
||||
" xsize, ysize: width and height of the scissor rectangle.\n"
|
||||
" :rtype: tuple(int, int, int, int)\n");
|
||||
" :rtype: tuple[int, int, int, int]\n");
|
||||
static PyObject *pygpu_state_scissor_get(PyObject * /*self*/, PyObject * /*args*/)
|
||||
{
|
||||
BPYGPU_IS_INIT_OR_ERROR_OBJ;
|
||||
|
||||
@@ -295,7 +295,7 @@ PyDoc_STRVAR(
|
||||
pygpu_texture_width_doc,
|
||||
"Width of the texture.\n"
|
||||
"\n"
|
||||
":type: `int`");
|
||||
":type: int");
|
||||
static PyObject *pygpu_texture_width_get(BPyGPUTexture *self, void * /*type*/)
|
||||
{
|
||||
BPYGPU_TEXTURE_CHECK_OBJ(self);
|
||||
@@ -307,7 +307,7 @@ PyDoc_STRVAR(
|
||||
pygpu_texture_height_doc,
|
||||
"Height of the texture.\n"
|
||||
"\n"
|
||||
":type: `int`");
|
||||
":type: int");
|
||||
static PyObject *pygpu_texture_height_get(BPyGPUTexture *self, void * /*type*/)
|
||||
{
|
||||
BPYGPU_TEXTURE_CHECK_OBJ(self);
|
||||
@@ -319,7 +319,7 @@ PyDoc_STRVAR(
|
||||
pygpu_texture_format_doc,
|
||||
"Format of the texture.\n"
|
||||
"\n"
|
||||
":type: `str`");
|
||||
":type: str");
|
||||
static PyObject *pygpu_texture_format_get(BPyGPUTexture *self, void * /*type*/)
|
||||
{
|
||||
BPYGPU_TEXTURE_CHECK_OBJ(self);
|
||||
@@ -337,8 +337,8 @@ PyDoc_STRVAR(
|
||||
" :arg format: The format that describes the content of a single item.\n"
|
||||
" Possible values are `FLOAT`, `INT`, `UINT`, `UBYTE`, `UINT_24_8` and `10_11_11_REV`.\n"
|
||||
" :type format: str\n"
|
||||
" :arg value: sequence each representing the value to fill.\n"
|
||||
" :type value: sequence of 1, 2, 3 or 4 values\n");
|
||||
" :arg value: Sequence each representing the value to fill. Sizes 1..4 are supported.\n"
|
||||
" :type value: Sequence[float]\n");
|
||||
static PyObject *pygpu_texture_clear(BPyGPUTexture *self, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
BPYGPU_TEXTURE_CHECK_OBJ(self);
|
||||
@@ -540,7 +540,7 @@ PyDoc_STRVAR(
|
||||
" This object gives access to off GPU textures.\n"
|
||||
"\n"
|
||||
" :arg size: Dimensions of the texture 1D, 2D, 3D or cubemap.\n"
|
||||
" :type size: tuple or int\n"
|
||||
" :type size: int | Sequence[int]\n"
|
||||
" :arg layers: Number of layers in texture array or number of cubemaps in cubemap array\n"
|
||||
" :type layers: int\n"
|
||||
" :arg is_cubemap: Indicates the creation of a cubemap texture.\n"
|
||||
|
||||
@@ -270,9 +270,10 @@ PyDoc_STRVAR(
|
||||
" Insert data into the buffer for a single attribute.\n"
|
||||
"\n"
|
||||
" :arg id: Either the name or the id of the attribute.\n"
|
||||
" :type id: int or str\n"
|
||||
" :arg data: Sequence of data that should be stored in the buffer\n"
|
||||
" :type data: sequence of floats, ints, vectors or matrices\n");
|
||||
" :type id: int | str\n"
|
||||
" :arg data: Buffer or sequence of data that should be stored in the buffer\n"
|
||||
" :type data: Buffer | "
|
||||
"Sequence[float] | Sequence[int] | Sequence[Sequence[float]] | Sequence[Sequence[int]]\n");
|
||||
static PyObject *pygpu_vertbuf_attr_fill(BPyGPUVertBuf *self, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
PyObject *data;
|
||||
|
||||
@@ -69,7 +69,7 @@ PyDoc_STRVAR(
|
||||
" Return 2 paths to blender scripts directories.\n"
|
||||
"\n"
|
||||
" :return: (system, user) strings will be empty when not found.\n"
|
||||
" :rtype: tuple of strings\n");
|
||||
" :rtype: tuple[str, str]\n");
|
||||
static PyObject *bpy_script_paths(PyObject * /*self*/)
|
||||
{
|
||||
PyObject *ret = PyTuple_New(2);
|
||||
@@ -105,13 +105,13 @@ PyDoc_STRVAR(
|
||||
" Returns a list of paths to external files referenced by the loaded .blend file.\n"
|
||||
"\n"
|
||||
" :arg absolute: When true the paths returned are made absolute.\n"
|
||||
" :type absolute: boolean\n"
|
||||
" :type absolute: bool\n"
|
||||
" :arg packed: When true skip file paths for packed data.\n"
|
||||
" :type packed: boolean\n"
|
||||
" :type packed: bool\n"
|
||||
" :arg local: When true skip linked library paths.\n"
|
||||
" :type local: boolean\n"
|
||||
" :type local: bool\n"
|
||||
" :return: path list.\n"
|
||||
" :rtype: list of strings\n");
|
||||
" :rtype: list[str]\n");
|
||||
static PyObject *bpy_blend_paths(PyObject * /*self*/, PyObject *args, PyObject *kw)
|
||||
{
|
||||
eBPathForeachFlag flag = eBPathForeachFlag(0);
|
||||
@@ -176,11 +176,11 @@ PyDoc_STRVAR(
|
||||
" mirroring bone names.\n"
|
||||
"\n"
|
||||
" :arg name: Bone name to flip.\n"
|
||||
" :type name: string\n"
|
||||
" :type name: str\n"
|
||||
" :arg strip_digits: Whether to remove ``.###`` suffix.\n"
|
||||
" :type strip_digits: bool\n"
|
||||
" :return: The flipped name.\n"
|
||||
" :rtype: string\n");
|
||||
" :rtype: str\n");
|
||||
static PyObject *bpy_flip_name(PyObject * /*self*/, PyObject *args, PyObject *kw)
|
||||
{
|
||||
const char *name_src = nullptr;
|
||||
@@ -267,9 +267,9 @@ PyDoc_STRVAR(
|
||||
" Return a system resource path.\n"
|
||||
"\n"
|
||||
" :arg type: string in ['DATAFILES', 'SCRIPTS', 'EXTENSIONS', 'PYTHON'].\n"
|
||||
" :type type: string\n"
|
||||
" :type type: str\n"
|
||||
" :arg path: Optional subdirectory.\n"
|
||||
" :type path: string or bytes\n");
|
||||
" :type path: str | bytes\n");
|
||||
static PyObject *bpy_system_resource(PyObject * /*self*/, PyObject *args, PyObject *kw)
|
||||
{
|
||||
const PyC_StringEnumItems type_items[] = {
|
||||
@@ -318,13 +318,13 @@ PyDoc_STRVAR(
|
||||
" Return the base path for storing system files.\n"
|
||||
"\n"
|
||||
" :arg type: string in ['USER', 'LOCAL', 'SYSTEM'].\n"
|
||||
" :type type: string\n"
|
||||
" :type type: str\n"
|
||||
" :arg major: major version, defaults to current.\n"
|
||||
" :type major: int\n"
|
||||
" :arg minor: minor version, defaults to current.\n"
|
||||
" :type minor: string\n"
|
||||
" :type minor: str\n"
|
||||
" :return: the resource path (not necessarily existing).\n"
|
||||
" :rtype: string\n");
|
||||
" :rtype: str\n");
|
||||
static PyObject *bpy_resource_path(PyObject * /*self*/, PyObject *args, PyObject *kw)
|
||||
{
|
||||
const PyC_StringEnumItems type_items[] = {
|
||||
@@ -371,7 +371,7 @@ PyDoc_STRVAR(
|
||||
" :arg code: The code to test.\n"
|
||||
" :type code: code\n"
|
||||
" :arg namespace: The namespace of values which are allowed.\n"
|
||||
" :type namespace: dict\n"
|
||||
" :type namespace: dict[str, Any]\n"
|
||||
" :arg verbose: Print the reason for considering insecure to the ``stderr``.\n"
|
||||
" :type verbose: bool\n"
|
||||
" :return: True when the script is considered trusted.\n"
|
||||
@@ -415,9 +415,9 @@ PyDoc_STRVAR(
|
||||
" Simple string escaping function used for animation paths.\n"
|
||||
"\n"
|
||||
" :arg string: text\n"
|
||||
" :type string: string\n"
|
||||
" :type string: str\n"
|
||||
" :return: The escaped string.\n"
|
||||
" :rtype: string\n");
|
||||
" :rtype: str\n");
|
||||
static PyObject *bpy_escape_identifier(PyObject * /*self*/, PyObject *value)
|
||||
{
|
||||
Py_ssize_t value_str_len;
|
||||
@@ -455,9 +455,9 @@ PyDoc_STRVAR(
|
||||
" This performs the reverse of `escape_identifier`.\n"
|
||||
"\n"
|
||||
" :arg string: text\n"
|
||||
" :type string: string\n"
|
||||
" :type string: str\n"
|
||||
" :return: The un-escaped string.\n"
|
||||
" :rtype: string\n");
|
||||
" :rtype: str\n");
|
||||
static PyObject *bpy_unescape_identifier(PyObject * /*self*/, PyObject *value)
|
||||
{
|
||||
Py_ssize_t value_str_len;
|
||||
@@ -505,7 +505,7 @@ PyDoc_STRVAR(
|
||||
".. function:: context_members()\n"
|
||||
"\n"
|
||||
" :return: A dict where the key is the context and the value is a tuple of it's members.\n"
|
||||
" :rtype: dict\n");
|
||||
" :rtype: dict[str, tuple[str]]\n");
|
||||
static PyObject *bpy_context_members(PyObject * /*self*/)
|
||||
{
|
||||
|
||||
@@ -552,9 +552,8 @@ PyDoc_STRVAR(
|
||||
bpy_rna_enum_items_static_doc,
|
||||
".. function:: rna_enum_items_static()\n"
|
||||
"\n"
|
||||
" :return: A dict where the key the name of the enum, the value is a tuple of "
|
||||
":class:`bpy.types.EnumPropertyItem`.\n"
|
||||
" :rtype: dict of \n");
|
||||
" :return: A dict where the key the name of the enum, the value is a tuple of enum items.\n"
|
||||
" :rtype: dict[str, tuple[:class:`bpy.types.EnumPropertyItem`]]\n");
|
||||
static PyObject *bpy_rna_enum_items_static(PyObject * /*self*/)
|
||||
{
|
||||
#define DEF_ENUM(id) {STRINGIFY(id), id},
|
||||
@@ -588,7 +587,7 @@ PyDoc_STRVAR(
|
||||
".. function:: _ghost_backend()\n"
|
||||
"\n"
|
||||
" :return: An identifier for the GHOST back-end.\n"
|
||||
" :rtype: string\n");
|
||||
" :rtype: str\n");
|
||||
static PyObject *bpy_ghost_backend(PyObject * /*self*/)
|
||||
{
|
||||
return PyUnicode_FromString(WM_ghost_backend());
|
||||
@@ -607,7 +606,7 @@ PyDoc_STRVAR(
|
||||
".. function:: _wm_capabilities()\n"
|
||||
"\n"
|
||||
" :return: A dictionary of capabilities (string keys, boolean values).\n"
|
||||
" :rtype: dict\n");
|
||||
" :rtype: dict[str, bool]\n");
|
||||
static PyObject *bpy_wm_capabilities(PyObject *self)
|
||||
{
|
||||
static _Py_Identifier PyId_capabilities = {"_wm_capabilities_", -1};
|
||||
|
||||
@@ -30,11 +30,11 @@ PyDoc_STRVAR(
|
||||
" Create a new icon from triangle geometry.\n"
|
||||
"\n"
|
||||
" :arg range: Pair of ints.\n"
|
||||
" :type range: tuple.\n"
|
||||
" :type range: tuple[int, int]\n"
|
||||
" :arg coords: Sequence of bytes (6 floats for one triangle) for (X, Y) coordinates.\n"
|
||||
" :type coords: byte sequence.\n"
|
||||
" :arg colors: Sequence of ints (12 for one triangles) for RGBA.\n"
|
||||
" :type colors: byte sequence.\n"
|
||||
" :type coords: bytes\n"
|
||||
" :arg colors: Sequence of bytes (12 for one triangles) for RGBA.\n"
|
||||
" :type colors: bytes\n"
|
||||
" :return: Unique icon value (pass to interface ``icon_value`` argument).\n"
|
||||
" :rtype: int\n");
|
||||
static PyObject *bpy_app_icons_new_triangles(PyObject * /*self*/, PyObject *args, PyObject *kw)
|
||||
@@ -97,7 +97,7 @@ PyDoc_STRVAR(
|
||||
" Create a new icon from triangle geometry.\n"
|
||||
"\n"
|
||||
" :arg filepath: File path.\n"
|
||||
" :type filepath: string or bytes.\n"
|
||||
" :type filepath: str | bytes.\n"
|
||||
" :return: Unique icon value (pass to interface ``icon_value`` argument).\n"
|
||||
" :rtype: int\n");
|
||||
static PyObject *bpy_app_icons_new_triangles_from_file(PyObject * /*self*/,
|
||||
|
||||
@@ -81,7 +81,7 @@ PyDoc_STRVAR(
|
||||
" ``functools.partial`` can be used to assign some parameters.\n"
|
||||
"\n"
|
||||
" :arg function: The function that should called.\n"
|
||||
" :type function: Callable[[], Union[float, None]]\n"
|
||||
" :type function: Callable[[], float | None]\n"
|
||||
" :arg first_interval: Seconds until the callback should be called the first time.\n"
|
||||
" :type first_interval: float\n"
|
||||
" :arg persistent: Don't remove timer when a new file is loaded.\n"
|
||||
@@ -128,7 +128,7 @@ PyDoc_STRVAR(
|
||||
" Unregister timer.\n"
|
||||
"\n"
|
||||
" :arg function: Function to unregister.\n"
|
||||
" :type function: Callable[[], Union[float, None]]\n");
|
||||
" :type function: Callable[[], float | None]\n");
|
||||
static PyObject *bpy_app_timers_unregister(PyObject * /*self*/, PyObject *function)
|
||||
{
|
||||
if (!BLI_timer_unregister(intptr_t(function))) {
|
||||
@@ -146,7 +146,7 @@ PyDoc_STRVAR(
|
||||
" Check if this function is registered as a timer.\n"
|
||||
"\n"
|
||||
" :arg function: Function to check.\n"
|
||||
" :type function: Callable[[], Union[float, None]]\n"
|
||||
" :type function: Callable[[], float | None]\n"
|
||||
" :return: True when this function is registered, otherwise False.\n"
|
||||
" :rtype: bool\n");
|
||||
static PyObject *bpy_app_timers_is_registered(PyObject * /*self*/, PyObject *function)
|
||||
|
||||
@@ -308,10 +308,10 @@ PyDoc_STRVAR(
|
||||
" Does nothing when Blender is built without internationalization support.\n"
|
||||
"\n"
|
||||
" :arg module_name: The name identifying the addon.\n"
|
||||
" :type module_name: string\n"
|
||||
" :type module_name: str\n"
|
||||
" :arg translations_dict: A dictionary built like that:\n"
|
||||
" ``{locale: {msg_key: msg_translation, ...}, ...}``\n"
|
||||
" :type translations_dict: dict\n"
|
||||
" :type translations_dict: dict[str, dict[str, str]]\n"
|
||||
"\n");
|
||||
static PyObject *app_translations_py_messages_register(BlenderAppTranslations *self,
|
||||
PyObject *args,
|
||||
@@ -367,7 +367,7 @@ PyDoc_STRVAR(
|
||||
" Does nothing when Blender is built without internationalization support.\n"
|
||||
"\n"
|
||||
" :arg module_name: The name identifying the addon.\n"
|
||||
" :type module_name: string\n"
|
||||
" :type module_name: str\n"
|
||||
"\n");
|
||||
static PyObject *app_translations_py_messages_unregister(BlenderAppTranslations *self,
|
||||
PyObject *args,
|
||||
@@ -602,9 +602,9 @@ PyDoc_STRVAR(
|
||||
"returns ``msgid``).\n"
|
||||
"\n"
|
||||
" :arg msgid: The string to translate.\n"
|
||||
" :type msgid: string\n"
|
||||
" :type msgid: str\n"
|
||||
" :arg msgctxt: The translation context (defaults to BLT_I18NCONTEXT_DEFAULT).\n"
|
||||
" :type msgctxt: string or None\n"
|
||||
" :type msgctxt: str | None\n"
|
||||
" :return: The translated string (or msgid if no translation was found).\n"
|
||||
"\n");
|
||||
static PyObject *app_translations_pgettext(BlenderAppTranslations * /*self*/,
|
||||
@@ -624,9 +624,9 @@ PyDoc_STRVAR(app_translations_pgettext_n_doc,
|
||||
" See :func:`pgettext` notes.\n"
|
||||
"\n"
|
||||
" :arg msgid: The string to extract.\n"
|
||||
" :type msgid: string\n"
|
||||
" :type msgid: str\n"
|
||||
" :arg msgctxt: The translation context (defaults to BLT_I18NCONTEXT_DEFAULT).\n"
|
||||
" :type msgctxt: string or None\n"
|
||||
" :type msgctxt: str | None\n"
|
||||
" :return: The original string.\n"
|
||||
"\n");
|
||||
static PyObject *app_translations_pgettext_n(BlenderAppTranslations * /*self*/,
|
||||
@@ -658,9 +658,9 @@ PyDoc_STRVAR(
|
||||
" See :func:`pgettext` notes.\n"
|
||||
"\n"
|
||||
" :arg msgid: The string to translate.\n"
|
||||
" :type msgid: string\n"
|
||||
" :type msgid: str\n"
|
||||
" :arg msgctxt: The translation context (defaults to BLT_I18NCONTEXT_DEFAULT).\n"
|
||||
" :type msgctxt: string or None\n"
|
||||
" :type msgctxt: str | None\n"
|
||||
" :return: The translated string (or msgid if no translation was found).\n"
|
||||
"\n");
|
||||
static PyObject *app_translations_pgettext_iface(BlenderAppTranslations * /*self*/,
|
||||
@@ -682,9 +682,9 @@ PyDoc_STRVAR(
|
||||
" See :func:`pgettext` notes.\n"
|
||||
"\n"
|
||||
" :arg msgid: The string to translate.\n"
|
||||
" :type msgid: string\n"
|
||||
" :type msgid: str\n"
|
||||
" :arg msgctxt: The translation context (defaults to BLT_I18NCONTEXT_DEFAULT).\n"
|
||||
" :type msgctxt: string or None\n"
|
||||
" :type msgctxt: str | None\n"
|
||||
" :return: The translated string (or msgid if no translation was found).\n"
|
||||
"\n");
|
||||
static PyObject *app_translations_pgettext_tip(BlenderAppTranslations * /*self*/,
|
||||
@@ -706,9 +706,9 @@ PyDoc_STRVAR(
|
||||
" See :func:`pgettext` notes.\n"
|
||||
"\n"
|
||||
" :arg msgid: The string to translate.\n"
|
||||
" :type msgid: string\n"
|
||||
" :type msgid: str\n"
|
||||
" :arg msgctxt: The translation context (defaults to BLT_I18NCONTEXT_DEFAULT).\n"
|
||||
" :type msgctxt: string or None\n"
|
||||
" :type msgctxt: str | None\n"
|
||||
" :return: The translated string (or msgid if no translation was found).\n"
|
||||
"\n");
|
||||
static PyObject *app_translations_pgettext_rpt(BlenderAppTranslations * /*self*/,
|
||||
@@ -730,9 +730,9 @@ PyDoc_STRVAR(
|
||||
" See :func:`pgettext` notes.\n"
|
||||
"\n"
|
||||
" :arg msgid: The string to translate.\n"
|
||||
" :type msgid: string\n"
|
||||
" :type msgid: str\n"
|
||||
" :arg msgctxt: The translation context (defaults to BLT_I18NCONTEXT_DEFAULT).\n"
|
||||
" :type msgctxt: string or None\n"
|
||||
" :type msgctxt: str | None\n"
|
||||
" :return: The translated string (or ``msgid`` if no translation was found).\n"
|
||||
"\n");
|
||||
static PyObject *app_translations_pgettext_data(BlenderAppTranslations * /*self*/,
|
||||
@@ -755,7 +755,7 @@ PyDoc_STRVAR(
|
||||
" For non-complete locales, missing elements will be None.\n"
|
||||
"\n"
|
||||
" :arg locale: The ISO locale string to explode.\n"
|
||||
" :type msgid: string\n"
|
||||
" :type msgid: str\n"
|
||||
" :return: A tuple ``(language, country, variant, language_country, language@variant)``.\n"
|
||||
"\n");
|
||||
static PyObject *app_translations_locale_explode(BlenderAppTranslations * /*self*/,
|
||||
|
||||
@@ -166,7 +166,7 @@ PyDoc_STRVAR(
|
||||
" Each object has attributes matching bpy.data which are lists of strings to be linked.\n"
|
||||
"\n"
|
||||
" :arg filepath: The path to a blend file.\n"
|
||||
" :type filepath: string or bytes\n"
|
||||
" :type filepath: str | bytes\n"
|
||||
" :arg link: When False reference to the original file is lost.\n"
|
||||
" :type link: bool\n"
|
||||
" :arg relative: When True the path is stored relative to the open blend file.\n"
|
||||
|
||||
@@ -49,9 +49,9 @@ PyDoc_STRVAR(
|
||||
" Indirectly referenced data-blocks will be expanded and written too.\n"
|
||||
"\n"
|
||||
" :arg filepath: The path to write the blend-file.\n"
|
||||
" :type filepath: string or bytes\n"
|
||||
" :arg datablocks: set of data-blocks (:class:`bpy.types.ID` instances).\n"
|
||||
" :type datablocks: set\n"
|
||||
" :type filepath: str | bytes\n"
|
||||
" :arg datablocks: set of data-blocks.\n"
|
||||
" :type datablocks: set[:class:`bpy.types.ID`]\n"
|
||||
" :arg path_remap: Optionally remap paths when writing the file:\n"
|
||||
"\n"
|
||||
" - ``NONE`` No path manipulation (default).\n"
|
||||
@@ -59,7 +59,7 @@ PyDoc_STRVAR(
|
||||
" - ``RELATIVE_ALL`` Remap all paths to be relative to the new location.\n"
|
||||
" - ``ABSOLUTE`` Make all paths absolute on writing.\n"
|
||||
"\n"
|
||||
" :type path_remap: string\n"
|
||||
" :type path_remap: str\n"
|
||||
" :arg fake_user: When True, data-blocks will be written with fake-user flag enabled.\n"
|
||||
" :type fake_user: bool\n"
|
||||
" :arg compress: When True, write a compressed blend file.\n"
|
||||
|
||||
@@ -37,10 +37,12 @@
|
||||
" :arg key: Represents the type of data being subscribed to\n" \
|
||||
"\n" \
|
||||
" Arguments include\n" \
|
||||
" - :class:`bpy.types.Property` instance.\n" \
|
||||
" - :class:`bpy.types.Struct` type.\n" \
|
||||
" - (:class:`bpy.types.Struct`, str) type and property name.\n" \
|
||||
" :type key: Multiple\n"
|
||||
" - A property instance.\n" \
|
||||
" - A struct type.\n" \
|
||||
" - A tuple representing a (struct, property name) pair.\n" \
|
||||
" :type key: :class:`bpy.types.Property` | " \
|
||||
":class:`bpy.types.Struct` | " \
|
||||
"tuple[:class:`bpy.types.Struct`, str]\n"
|
||||
|
||||
/**
|
||||
* There are multiple ways we can get RNA from Python,
|
||||
@@ -198,12 +200,12 @@ PyDoc_STRVAR(
|
||||
" loaded, or can be cleared explicitly via :func:`bpy.msgbus.clear_by_owner`.\n"
|
||||
"\n" BPY_MSGBUS_RNA_MSGKEY_DOC
|
||||
" :arg owner: Handle for this subscription (compared by identity).\n"
|
||||
" :type owner: Any type.\n"
|
||||
" :type owner: Any\n"
|
||||
" :arg options: Change the behavior of the subscriber.\n"
|
||||
"\n"
|
||||
" - ``PERSISTENT`` when set, the subscriber will be kept when remapping ID data.\n"
|
||||
"\n"
|
||||
" :type options: set of str.\n"
|
||||
" :type options: set[str]\n"
|
||||
"\n"
|
||||
".. note::\n"
|
||||
"\n"
|
||||
|
||||
@@ -53,31 +53,31 @@ using blender::Array;
|
||||
|
||||
#define BPY_PROPDEF_OPTIONS_DOC \
|
||||
" :arg options: Enumerator in :ref:`rna_enum_property_flag_items`.\n" \
|
||||
" :type options: set\n"
|
||||
" :type options: set[str]\n"
|
||||
|
||||
#define BPY_PROPDEF_OPTIONS_ENUM_DOC \
|
||||
" :arg options: Enumerator in :ref:`rna_enum_property_flag_enum_items`.\n" \
|
||||
" :type options: set\n"
|
||||
" :type options: set[str]\n"
|
||||
|
||||
#define BPY_PROPDEF_OPTIONS_OVERRIDE_DOC \
|
||||
" :arg override: Enumerator in :ref:`rna_enum_property_override_flag_items`.\n" \
|
||||
" :type override: set\n"
|
||||
" :type override: set[str]\n"
|
||||
|
||||
#define BPY_PROPDEF_OPTIONS_OVERRIDE_COLLECTION_DOC \
|
||||
" :arg override: Enumerator in :ref:`rna_enum_property_override_flag_collection_items`.\n" \
|
||||
" :type override: set\n"
|
||||
" :type override: set[str]\n"
|
||||
|
||||
#define BPY_PROPDEF_SUBTYPE_STRING_DOC \
|
||||
" :arg subtype: Enumerator in :ref:`rna_enum_property_subtype_string_items`.\n" \
|
||||
" :type subtype: string\n"
|
||||
" :type subtype: str\n"
|
||||
|
||||
#define BPY_PROPDEF_SUBTYPE_NUMBER_DOC \
|
||||
" :arg subtype: Enumerator in :ref:`rna_enum_property_subtype_number_items`.\n" \
|
||||
" :type subtype: string\n"
|
||||
" :type subtype: str\n"
|
||||
|
||||
#define BPY_PROPDEF_SUBTYPE_NUMBER_ARRAY_DOC \
|
||||
" :arg subtype: Enumerator in :ref:`rna_enum_property_subtype_number_array_items`.\n" \
|
||||
" :type subtype: string\n"
|
||||
" :type subtype: str\n"
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -2648,40 +2648,49 @@ static int bpy_prop_arg_parse_tag_defines(PyObject *o, void *p)
|
||||
|
||||
#define BPY_PROPDEF_NAME_DOC \
|
||||
" :arg name: Name used in the user interface.\n" \
|
||||
" :type name: string\n"
|
||||
" :type name: str\n"
|
||||
|
||||
#define BPY_PROPDEF_DESC_DOC \
|
||||
" :arg description: Text used for the tooltip and api documentation.\n" \
|
||||
" :type description: string\n"
|
||||
" :type description: str\n"
|
||||
|
||||
#define BPY_PROPDEF_CTXT_DOC \
|
||||
" :arg translation_context: Text used as context to disambiguate translations.\n" \
|
||||
" :type translation_context: string\n"
|
||||
" :type translation_context: str\n"
|
||||
|
||||
#define BPY_PROPDEF_UNIT_DOC \
|
||||
" :arg unit: Enumerator in :ref:`rna_enum_property_unit_items`.\n" \
|
||||
" :type unit: string\n"
|
||||
" :type unit: str\n"
|
||||
|
||||
#define BPY_PROPDEF_NUM_MIN_DOC \
|
||||
#define BPY_PROPDEF_NUM_MIN_DOC_(ty) \
|
||||
" :arg min: Hard minimum, trying to assign a value below will silently assign this minimum " \
|
||||
"instead.\n"
|
||||
"instead.\n" \
|
||||
" :type min: " ty "\n"
|
||||
|
||||
#define BPY_PROPDEF_NUM_MAX_DOC \
|
||||
#define BPY_PROPDEF_NUM_MAX_DOC_(ty) \
|
||||
" :arg max: Hard maximum, trying to assign a value above will silently assign this maximum " \
|
||||
"instead.\n"
|
||||
"instead.\n" \
|
||||
" :type max: " ty "\n"
|
||||
|
||||
#define BPY_PROPDEF_NUM_SOFTMIN_DOC \
|
||||
" :arg soft_min: Soft minimum (>= *min*), user won't be able to drag the widget below this " \
|
||||
"value in the UI.\n"
|
||||
#define BPY_PROPDEF_NUM_MINMAX_DOC(ty) BPY_PROPDEF_NUM_MIN_DOC_(ty) BPY_PROPDEF_NUM_MAX_DOC_(ty)
|
||||
|
||||
#define BPY_PROPDEF_NUM_SOFTMAX_DOC \
|
||||
" :arg soft_max: Soft maximum (<= *max*), user won't be able to drag the widget above this " \
|
||||
"value in the UI.\n"
|
||||
#define BPY_PROPDEF_NUM_SOFT_MIN_DOC_(ty) \
|
||||
" :arg soft_min: Soft minimum (>= *min*), " \
|
||||
"user won't be able to drag the widget below this value in the UI.\n" \
|
||||
" :type soft_min: " ty "\n"
|
||||
|
||||
#define BPY_PROPDEF_NUM_SOFT_MAX_DOC_(ty) \
|
||||
" :arg soft_max: Soft maximum (<= *max*), " \
|
||||
"user won't be able to drag the widget above this value in the UI.\n" \
|
||||
" :type soft_max: " ty "\n"
|
||||
|
||||
#define BPY_PROPDEF_NUM_SOFT_MINMAX_DOC(ty) \
|
||||
BPY_PROPDEF_NUM_SOFT_MIN_DOC_(ty) BPY_PROPDEF_NUM_SOFT_MAX_DOC_(ty)
|
||||
|
||||
#define BPY_PROPDEF_VECSIZE_DOC \
|
||||
" :arg size: Vector dimensions in [1, " STRINGIFY(PYRNA_STACK_ARRAY) "]. " \
|
||||
"An int sequence can be used to define multi-dimension arrays.\n" \
|
||||
" :type size: int or int sequence\n"
|
||||
" :type size: int | Sequence[int]\n"
|
||||
|
||||
#define BPY_PROPDEF_INT_STEP_DOC \
|
||||
" :arg step: Step of increment/decrement in UI, in [1, 100], defaults to 1 (WARNING: unused " \
|
||||
@@ -2703,23 +2712,25 @@ static int bpy_prop_arg_parse_tag_defines(PyObject *o, void *p)
|
||||
" :arg update: Function to be called when this value is modified,\n" \
|
||||
" This function must take 2 values (self, context) and return None.\n" \
|
||||
" *Warning* there are no safety checks to avoid infinite recursion.\n" \
|
||||
" :type update: function\n"
|
||||
" :type update: Callable[[:class:`bpy.types.bpy_struct`, :class:`bpy.types.Context`], " \
|
||||
"None]\n"
|
||||
|
||||
#define BPY_PROPDEF_POLL_DOC \
|
||||
" :arg poll: function to be called to determine whether an item is valid for this " \
|
||||
"property.\n" \
|
||||
" The function must take 2 values (self, object) and return Bool.\n" \
|
||||
" :type poll: function\n"
|
||||
" :type poll: Callable[[:class:`bpy.types.bpy_struct`, :class:`bpy.types.bpy_struct`], " \
|
||||
"bool]\n"
|
||||
|
||||
#define BPY_PROPDEF_GET_DOC \
|
||||
#define BPY_PROPDEF_GET_DOC(ty) \
|
||||
" :arg get: Function to be called when this value is 'read',\n" \
|
||||
" This function must take 1 value (self) and return the value of the property.\n" \
|
||||
" :type get: function\n"
|
||||
" :type get: Callable[[:class:`bpy.types.bpy_struct`], " ty "]\n"
|
||||
|
||||
#define BPY_PROPDEF_SET_DOC \
|
||||
#define BPY_PROPDEF_SET_DOC(ty) \
|
||||
" :arg set: Function to be called when this value is 'written',\n" \
|
||||
" This function must take 2 values (self, value) and return None.\n" \
|
||||
" :type set: function\n"
|
||||
" :type set: Callable[[:class:`bpy.types.bpy_struct`, " ty "], None]\n"
|
||||
|
||||
#define BPY_PROPDEF_SEARCH_DOC \
|
||||
" :arg search: Function to be called to show candidates for this string (shown in the UI).\n" \
|
||||
@@ -2729,7 +2740,9 @@ static int bpy_prop_arg_parse_tag_defines(PyObject *o, void *p)
|
||||
" - A single string (representing a candidate to display).\n" \
|
||||
" - A tuple-pair of strings, where the first is a candidate and the second\n" \
|
||||
" is additional information about the candidate.\n" \
|
||||
" :type search: function\n" \
|
||||
" :type search: Callable[[:class:`bpy.types.bpy_struct`, :class:`bpy.types.Context`, str], " \
|
||||
"Iterable[str | tuple[str, str]]" \
|
||||
"]\n" \
|
||||
" :arg search_options: Set of strings in:\n" \
|
||||
"\n" \
|
||||
" - 'SORT' sorts the resulting items.\n" \
|
||||
@@ -2737,19 +2750,19 @@ static int bpy_prop_arg_parse_tag_defines(PyObject *o, void *p)
|
||||
" **WARNING** disabling this flag causes the search callback to run on redraw,\n" \
|
||||
" so only disable this flag if it's not likely to cause performance issues.\n" \
|
||||
"\n" \
|
||||
" :type search_options: set\n"
|
||||
" :type search_options: set[str]\n"
|
||||
|
||||
#define BPY_PROPDEF_POINTER_TYPE_DOC \
|
||||
" :arg type: A subclass of :class:`bpy.types.PropertyGroup` or :class:`bpy.types.ID`.\n" \
|
||||
" :type type: class\n"
|
||||
" :arg type: A subclass of a property group or ID types.\n" \
|
||||
" :type type: :class:`bpy.types.PropertyGroup` | :class:`bpy.types.ID`\n"
|
||||
|
||||
#define BPY_PROPDEF_COLLECTION_TYPE_DOC \
|
||||
" :arg type: A subclass of :class:`bpy.types.PropertyGroup`.\n" \
|
||||
" :type type: class\n"
|
||||
" :arg type: A subclass of a property group.\n" \
|
||||
" :type type: :class:`bpy.types.PropertyGroup`\n"
|
||||
|
||||
#define BPY_PROPDEF_TAGS_DOC \
|
||||
" :arg tags: Enumerator of tags that are defined by parent class.\n" \
|
||||
" :type tags: set\n"
|
||||
" :type tags: set[str]\n"
|
||||
|
||||
#if 0
|
||||
static int bpy_struct_id_used(StructRNA *srna, char *identifier)
|
||||
@@ -2790,7 +2803,7 @@ PyDoc_STRVAR(
|
||||
" Returns a new boolean property definition.\n"
|
||||
"\n" BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC BPY_PROPDEF_CTXT_DOC BPY_PROPDEF_OPTIONS_DOC
|
||||
BPY_PROPDEF_OPTIONS_OVERRIDE_DOC BPY_PROPDEF_TAGS_DOC BPY_PROPDEF_SUBTYPE_NUMBER_DOC
|
||||
BPY_PROPDEF_UPDATE_DOC BPY_PROPDEF_GET_DOC BPY_PROPDEF_SET_DOC);
|
||||
BPY_PROPDEF_UPDATE_DOC BPY_PROPDEF_GET_DOC("bool") BPY_PROPDEF_SET_DOC("bool"));
|
||||
static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -2943,9 +2956,10 @@ PyDoc_STRVAR(
|
||||
" Returns a new vector boolean property definition.\n"
|
||||
"\n" BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC BPY_PROPDEF_CTXT_DOC
|
||||
" :arg default: sequence of booleans the length of *size*.\n"
|
||||
" :type default: sequence\n" BPY_PROPDEF_OPTIONS_DOC BPY_PROPDEF_OPTIONS_OVERRIDE_DOC
|
||||
" :type default: Sequence[bool]\n" BPY_PROPDEF_OPTIONS_DOC BPY_PROPDEF_OPTIONS_OVERRIDE_DOC
|
||||
BPY_PROPDEF_TAGS_DOC BPY_PROPDEF_SUBTYPE_NUMBER_ARRAY_DOC BPY_PROPDEF_VECSIZE_DOC
|
||||
BPY_PROPDEF_UPDATE_DOC BPY_PROPDEF_GET_DOC BPY_PROPDEF_SET_DOC);
|
||||
BPY_PROPDEF_UPDATE_DOC BPY_PROPDEF_GET_DOC("Sequence[bool]")
|
||||
BPY_PROPDEF_SET_DOC("tuple[bool]"));
|
||||
static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -3131,12 +3145,11 @@ PyDoc_STRVAR(
|
||||
"set=None)\n"
|
||||
"\n"
|
||||
" Returns a new int property definition.\n"
|
||||
"\n" BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC BPY_PROPDEF_CTXT_DOC BPY_PROPDEF_NUM_MIN_DOC
|
||||
" :type min: int\n" BPY_PROPDEF_NUM_MAX_DOC " :type max: int\n" BPY_PROPDEF_NUM_SOFTMAX_DOC
|
||||
" :type soft_min: int\n" BPY_PROPDEF_NUM_SOFTMIN_DOC
|
||||
" :type soft_max: int\n" BPY_PROPDEF_INT_STEP_DOC BPY_PROPDEF_OPTIONS_DOC
|
||||
BPY_PROPDEF_OPTIONS_OVERRIDE_DOC BPY_PROPDEF_TAGS_DOC BPY_PROPDEF_SUBTYPE_NUMBER_DOC
|
||||
BPY_PROPDEF_UPDATE_DOC BPY_PROPDEF_GET_DOC BPY_PROPDEF_SET_DOC);
|
||||
"\n" BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC BPY_PROPDEF_CTXT_DOC
|
||||
BPY_PROPDEF_NUM_MINMAX_DOC("int") BPY_PROPDEF_NUM_SOFT_MINMAX_DOC("int")
|
||||
BPY_PROPDEF_INT_STEP_DOC BPY_PROPDEF_OPTIONS_DOC BPY_PROPDEF_OPTIONS_OVERRIDE_DOC
|
||||
BPY_PROPDEF_TAGS_DOC BPY_PROPDEF_SUBTYPE_NUMBER_DOC BPY_PROPDEF_UPDATE_DOC
|
||||
BPY_PROPDEF_GET_DOC("int") BPY_PROPDEF_SET_DOC("int"));
|
||||
static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -3311,13 +3324,12 @@ PyDoc_STRVAR(
|
||||
" Returns a new vector int property definition.\n"
|
||||
"\n" BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC BPY_PROPDEF_CTXT_DOC
|
||||
" :arg default: sequence of ints the length of *size*.\n"
|
||||
" :type default: sequence\n" BPY_PROPDEF_NUM_MIN_DOC
|
||||
" :type min: int\n" BPY_PROPDEF_NUM_MAX_DOC " :type max: int\n" BPY_PROPDEF_NUM_SOFTMIN_DOC
|
||||
" :type soft_min: int\n" BPY_PROPDEF_NUM_SOFTMAX_DOC
|
||||
" :type soft_max: int\n" BPY_PROPDEF_INT_STEP_DOC BPY_PROPDEF_OPTIONS_DOC
|
||||
BPY_PROPDEF_OPTIONS_OVERRIDE_DOC BPY_PROPDEF_TAGS_DOC BPY_PROPDEF_SUBTYPE_NUMBER_ARRAY_DOC
|
||||
BPY_PROPDEF_VECSIZE_DOC BPY_PROPDEF_UPDATE_DOC BPY_PROPDEF_GET_DOC
|
||||
BPY_PROPDEF_SET_DOC);
|
||||
" :type default: Sequence[int]\n" BPY_PROPDEF_NUM_MINMAX_DOC("int")
|
||||
BPY_PROPDEF_NUM_SOFT_MINMAX_DOC("int")
|
||||
BPY_PROPDEF_INT_STEP_DOC BPY_PROPDEF_OPTIONS_DOC BPY_PROPDEF_OPTIONS_OVERRIDE_DOC
|
||||
BPY_PROPDEF_TAGS_DOC BPY_PROPDEF_SUBTYPE_NUMBER_ARRAY_DOC BPY_PROPDEF_VECSIZE_DOC
|
||||
BPY_PROPDEF_UPDATE_DOC BPY_PROPDEF_GET_DOC("Sequence[int]")
|
||||
BPY_PROPDEF_SET_DOC("tuple[int]"));
|
||||
static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -3510,14 +3522,12 @@ PyDoc_STRVAR(
|
||||
"set=None)\n"
|
||||
"\n"
|
||||
" Returns a new float (single precision) property definition.\n"
|
||||
"\n" BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC BPY_PROPDEF_CTXT_DOC BPY_PROPDEF_NUM_MIN_DOC
|
||||
" :type min: float\n" BPY_PROPDEF_NUM_MAX_DOC
|
||||
" :type max: float\n" BPY_PROPDEF_NUM_SOFTMIN_DOC
|
||||
" :type soft_min: float\n" BPY_PROPDEF_NUM_SOFTMAX_DOC
|
||||
" :type soft_max: float\n" BPY_PROPDEF_FLOAT_STEP_DOC BPY_PROPDEF_FLOAT_PREC_DOC
|
||||
BPY_PROPDEF_OPTIONS_DOC BPY_PROPDEF_OPTIONS_OVERRIDE_DOC BPY_PROPDEF_TAGS_DOC
|
||||
BPY_PROPDEF_SUBTYPE_NUMBER_DOC BPY_PROPDEF_UNIT_DOC BPY_PROPDEF_UPDATE_DOC
|
||||
BPY_PROPDEF_GET_DOC BPY_PROPDEF_SET_DOC);
|
||||
"\n" BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC BPY_PROPDEF_CTXT_DOC BPY_PROPDEF_NUM_MINMAX_DOC(
|
||||
"float") BPY_PROPDEF_NUM_SOFT_MINMAX_DOC("float")
|
||||
BPY_PROPDEF_FLOAT_STEP_DOC BPY_PROPDEF_FLOAT_PREC_DOC BPY_PROPDEF_OPTIONS_DOC
|
||||
BPY_PROPDEF_OPTIONS_OVERRIDE_DOC BPY_PROPDEF_TAGS_DOC BPY_PROPDEF_SUBTYPE_NUMBER_DOC
|
||||
BPY_PROPDEF_UNIT_DOC BPY_PROPDEF_UPDATE_DOC BPY_PROPDEF_GET_DOC("float")
|
||||
BPY_PROPDEF_SET_DOC("float"));
|
||||
static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -3691,15 +3701,14 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" Returns a new vector float property definition.\n"
|
||||
"\n" BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC BPY_PROPDEF_CTXT_DOC
|
||||
" :arg default: sequence of floats the length of *size*.\n"
|
||||
" :type default: sequence\n" BPY_PROPDEF_NUM_MIN_DOC
|
||||
" :type min: float\n" BPY_PROPDEF_NUM_MAX_DOC
|
||||
" :type max: float\n" BPY_PROPDEF_NUM_SOFTMIN_DOC
|
||||
" :type soft_min: float\n" BPY_PROPDEF_NUM_SOFTMAX_DOC
|
||||
" :type soft_max: float\n" BPY_PROPDEF_OPTIONS_DOC BPY_PROPDEF_OPTIONS_OVERRIDE_DOC
|
||||
BPY_PROPDEF_TAGS_DOC BPY_PROPDEF_FLOAT_STEP_DOC BPY_PROPDEF_FLOAT_PREC_DOC
|
||||
BPY_PROPDEF_SUBTYPE_NUMBER_ARRAY_DOC BPY_PROPDEF_UNIT_DOC BPY_PROPDEF_VECSIZE_DOC
|
||||
BPY_PROPDEF_UPDATE_DOC BPY_PROPDEF_GET_DOC BPY_PROPDEF_SET_DOC);
|
||||
" :arg default: Sequence of floats the length of *size*.\n"
|
||||
" :type default: Sequence[float]\n" BPY_PROPDEF_NUM_MINMAX_DOC(
|
||||
"float") BPY_PROPDEF_NUM_SOFT_MINMAX_DOC("float")
|
||||
BPY_PROPDEF_OPTIONS_DOC BPY_PROPDEF_OPTIONS_OVERRIDE_DOC BPY_PROPDEF_TAGS_DOC
|
||||
BPY_PROPDEF_FLOAT_STEP_DOC BPY_PROPDEF_FLOAT_PREC_DOC
|
||||
BPY_PROPDEF_SUBTYPE_NUMBER_ARRAY_DOC BPY_PROPDEF_UNIT_DOC BPY_PROPDEF_VECSIZE_DOC
|
||||
BPY_PROPDEF_UPDATE_DOC BPY_PROPDEF_GET_DOC("Sequence[float]")
|
||||
BPY_PROPDEF_SET_DOC("tuple[float]"));
|
||||
static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -3907,11 +3916,11 @@ PyDoc_STRVAR(
|
||||
" Returns a new string property definition.\n"
|
||||
"\n" BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC BPY_PROPDEF_CTXT_DOC
|
||||
" :arg default: initializer string.\n"
|
||||
" :type default: string\n"
|
||||
" :type default: str\n"
|
||||
" :arg maxlen: maximum length of the string.\n"
|
||||
" :type maxlen: int\n" BPY_PROPDEF_OPTIONS_DOC BPY_PROPDEF_OPTIONS_OVERRIDE_DOC
|
||||
BPY_PROPDEF_TAGS_DOC BPY_PROPDEF_SUBTYPE_STRING_DOC BPY_PROPDEF_UPDATE_DOC
|
||||
BPY_PROPDEF_GET_DOC BPY_PROPDEF_SET_DOC BPY_PROPDEF_SEARCH_DOC);
|
||||
BPY_PROPDEF_GET_DOC("str") BPY_PROPDEF_SET_DOC("str") BPY_PROPDEF_SEARCH_DOC);
|
||||
static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -4115,17 +4124,28 @@ PyDoc_STRVAR(
|
||||
" Python must keep a reference to the strings returned by the callback or Blender\n"
|
||||
" will misbehave or even crash."
|
||||
"\n"
|
||||
" :type items: sequence of string tuples or a function\n" BPY_PROPDEF_NAME_DOC
|
||||
BPY_PROPDEF_DESC_DOC BPY_PROPDEF_CTXT_DOC
|
||||
" :type items: Sequence["
|
||||
"tuple[str, str, str] | "
|
||||
"tuple[str, str, str, int] | "
|
||||
"tuple[str, str, str, int, int] | "
|
||||
"None] | "
|
||||
"Callable[[:class:`bpy.types.bpy_struct`, :class:`bpy.types.Context` | None], "
|
||||
/* NOTE(@ideasman42): a type alias would be useful here (same as above). */
|
||||
"Sequence["
|
||||
"tuple[str, str, str] | "
|
||||
"tuple[str, str, str, int] | "
|
||||
"tuple[str, str, str, int, int] | "
|
||||
"None]"
|
||||
"]\n" BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC BPY_PROPDEF_CTXT_DOC
|
||||
" :arg default: The default value for this enum, a string from the identifiers used in "
|
||||
"*items*, or integer matching an item number.\n"
|
||||
" If the *ENUM_FLAG* option is used this must be a set of such string identifiers "
|
||||
"instead.\n"
|
||||
" WARNING: Strings cannot be specified for dynamic enums\n"
|
||||
" (i.e. if a callback function is given as *items* parameter).\n"
|
||||
" :type default: string, integer or set\n" BPY_PROPDEF_OPTIONS_ENUM_DOC
|
||||
" :type default: str | int | set[str]\n" BPY_PROPDEF_OPTIONS_ENUM_DOC
|
||||
BPY_PROPDEF_OPTIONS_OVERRIDE_DOC BPY_PROPDEF_TAGS_DOC BPY_PROPDEF_UPDATE_DOC
|
||||
BPY_PROPDEF_GET_DOC BPY_PROPDEF_SET_DOC);
|
||||
BPY_PROPDEF_GET_DOC("int") BPY_PROPDEF_SET_DOC("int"));
|
||||
static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -4640,7 +4660,7 @@ PyDoc_STRVAR(
|
||||
" :arg cls: The class containing the property (must be a positional argument).\n"
|
||||
" :type cls: type\n"
|
||||
" :arg attr: Property name (must be passed as a keyword).\n"
|
||||
" :type attr: string\n"
|
||||
" :type attr: str\n"
|
||||
"\n"
|
||||
".. note:: Typically this function doesn't need to be accessed directly.\n"
|
||||
" Instead use ``del cls.attr``\n");
|
||||
|
||||
@@ -3645,9 +3645,9 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" In rare cases you may want to set this option to false.\n"
|
||||
"\n"
|
||||
" :type ghost: boolean\n"
|
||||
" :type ghost: bool\n"
|
||||
" :return: True when the property has been set.\n"
|
||||
" :rtype: boolean\n");
|
||||
" :rtype: bool\n");
|
||||
static PyObject *pyrna_struct_is_property_set(BPy_StructRNA *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
@@ -3719,7 +3719,7 @@ PyDoc_STRVAR(
|
||||
" Check if a property is hidden.\n"
|
||||
"\n"
|
||||
" :return: True when the property is hidden.\n"
|
||||
" :rtype: boolean\n");
|
||||
" :rtype: bool\n");
|
||||
static PyObject *pyrna_struct_is_property_hidden(BPy_StructRNA *self, PyObject *args)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
@@ -3750,7 +3750,7 @@ PyDoc_STRVAR(
|
||||
" Check if a property is readonly.\n"
|
||||
"\n"
|
||||
" :return: True when the property is readonly (not writable).\n"
|
||||
" :rtype: boolean\n");
|
||||
" :rtype: bool\n");
|
||||
static PyObject *pyrna_struct_is_property_readonly(BPy_StructRNA *self, PyObject *args)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
@@ -3781,7 +3781,7 @@ PyDoc_STRVAR(
|
||||
" Check if a property is overridable.\n"
|
||||
"\n"
|
||||
" :return: True when the property is overridable.\n"
|
||||
" :rtype: boolean\n");
|
||||
" :rtype: bool\n");
|
||||
static PyObject *pyrna_struct_is_property_overridable_library(BPy_StructRNA *self, PyObject *args)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
@@ -3812,7 +3812,7 @@ PyDoc_STRVAR(
|
||||
" Define a property as overridable or not (only for custom properties!).\n"
|
||||
"\n"
|
||||
" :return: True when the overridable status of the property was successfully set.\n"
|
||||
" :rtype: boolean\n");
|
||||
" :rtype: bool\n");
|
||||
static PyObject *pyrna_struct_property_overridable_library_set(BPy_StructRNA *self, PyObject *args)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
@@ -3845,10 +3845,10 @@ PyDoc_STRVAR(
|
||||
" Returns the property from the path, raise an exception when not found.\n"
|
||||
"\n"
|
||||
" :arg path: path which this property resolves.\n"
|
||||
" :type path: string\n"
|
||||
" :type path: str\n"
|
||||
" :arg coerce: optional argument, when True, the property will be converted\n"
|
||||
" into its Python representation.\n"
|
||||
" :type coerce: boolean\n");
|
||||
" :type coerce: bool\n");
|
||||
static PyObject *pyrna_struct_path_resolve(BPy_StructRNA *self, PyObject *args)
|
||||
{
|
||||
const char *path;
|
||||
@@ -3903,7 +3903,7 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" :arg property: Optional property name which can be used if the path is\n"
|
||||
" to a property of this object.\n"
|
||||
" :type property: string\n"
|
||||
" :type property: str\n"
|
||||
" :return: The path from :class:`bpy.types.bpy_struct.id_data`\n"
|
||||
" to this struct and property (when given).\n"
|
||||
" :rtype: str\n");
|
||||
@@ -4046,7 +4046,7 @@ PyDoc_STRVAR(
|
||||
" such as textures can be changed at runtime.\n"
|
||||
"\n"
|
||||
" :return: a new instance of this object with the type initialized again.\n"
|
||||
" :rtype: subclass of :class:`bpy.types.bpy_struct`\n");
|
||||
" :rtype: :class:`bpy.types.bpy_struct`\n");
|
||||
static PyObject *pyrna_struct_type_recast(BPy_StructRNA *self)
|
||||
{
|
||||
|
||||
@@ -4099,7 +4099,7 @@ PyDoc_STRVAR(
|
||||
".. classmethod:: bl_rna_get_subclass_py(id, default=None)\n"
|
||||
"\n"
|
||||
" :arg id: The RNA type identifier.\n"
|
||||
" :type id: string\n"
|
||||
" :type id: str\n"
|
||||
" :return: The class or default when not found.\n"
|
||||
" :rtype: type\n");
|
||||
static PyObject *pyrna_struct_bl_rna_get_subclass_py(PyObject *cls, PyObject *args)
|
||||
@@ -4123,7 +4123,7 @@ PyDoc_STRVAR(
|
||||
".. classmethod:: bl_rna_get_subclass(id, default=None)\n"
|
||||
"\n"
|
||||
" :arg id: The RNA type identifier.\n"
|
||||
" :type id: string\n"
|
||||
" :type id: str\n"
|
||||
" :return: The RNA type or default when not found.\n"
|
||||
" :rtype: :class:`bpy.types.Struct` subclass\n");
|
||||
static PyObject *pyrna_struct_bl_rna_get_subclass(PyObject *cls, PyObject *args)
|
||||
@@ -5043,7 +5043,7 @@ PyDoc_STRVAR(
|
||||
" (matching Python's dict.keys() functionality).\n"
|
||||
"\n"
|
||||
" :return: the identifiers for each member of this collection.\n"
|
||||
" :rtype: list of strings\n");
|
||||
" :rtype: list[str]\n");
|
||||
static PyObject *pyrna_prop_collection_keys(BPy_PropertyRNA *self)
|
||||
{
|
||||
PyObject *ret = PyList_New(0);
|
||||
@@ -5075,7 +5075,7 @@ PyDoc_STRVAR(
|
||||
" (matching Python's dict.items() functionality).\n"
|
||||
"\n"
|
||||
" :return: (key, value) pairs for each member of this collection.\n"
|
||||
" :rtype: list of tuples\n");
|
||||
" :rtype: list[tuple[str, :class:`bpy.types.bpy_struct`]]\n");
|
||||
static PyObject *pyrna_prop_collection_items(BPy_PropertyRNA *self)
|
||||
{
|
||||
PyObject *ret = PyList_New(0);
|
||||
@@ -5119,8 +5119,8 @@ PyDoc_STRVAR(
|
||||
" Return the values of collection\n"
|
||||
" (matching Python's dict.values() functionality).\n"
|
||||
"\n"
|
||||
" :return: the members of this collection.\n"
|
||||
" :rtype: list\n");
|
||||
" :return: The members of this collection.\n"
|
||||
" :rtype: list[:class:`bpy.types.bpy_struct`]\n");
|
||||
static PyObject *pyrna_prop_collection_values(BPy_PropertyRNA *self)
|
||||
{
|
||||
/* Re-use slice. */
|
||||
@@ -5136,10 +5136,10 @@ PyDoc_STRVAR(
|
||||
" when not found (matches Python's dictionary function of the same name).\n"
|
||||
"\n"
|
||||
" :arg key: The key associated with the custom property.\n"
|
||||
" :type key: string\n"
|
||||
" :type key: str\n"
|
||||
" :arg default: Optional argument for the value to return if\n"
|
||||
" *key* is not found.\n"
|
||||
" :type default: Undefined\n"
|
||||
" :type default: Any\n"
|
||||
"\n" BPY_DOC_ID_PROP_TYPE_NOTE);
|
||||
static PyObject *pyrna_struct_get(BPy_StructRNA *self, PyObject *args)
|
||||
{
|
||||
@@ -5181,10 +5181,10 @@ PyDoc_STRVAR(
|
||||
" when not found (matches Python's dictionary function of the same name).\n"
|
||||
"\n"
|
||||
" :arg key: The key associated with the custom property.\n"
|
||||
" :type key: string\n"
|
||||
" :type key: str\n"
|
||||
" :arg default: Optional argument for the value to return if\n"
|
||||
" *key* is not found.\n"
|
||||
" :type default: Undefined\n"
|
||||
" :type default: Any\n"
|
||||
"\n" BPY_DOC_ID_PROP_TYPE_NOTE);
|
||||
static PyObject *pyrna_struct_pop(BPy_StructRNA *self, PyObject *args)
|
||||
{
|
||||
@@ -5254,10 +5254,10 @@ PyDoc_STRVAR(
|
||||
" (matches Python's dictionary function of the same name).\n"
|
||||
"\n"
|
||||
" :arg key: The identifier for the collection member.\n"
|
||||
" :type key: string\n"
|
||||
" :type key: str\n"
|
||||
" :arg default: Optional argument for the value to return if\n"
|
||||
" *key* is not found.\n"
|
||||
" :type default: Undefined\n");
|
||||
" :type default: Any\n");
|
||||
static PyObject *pyrna_prop_collection_get(BPy_PropertyRNA *self, PyObject *args)
|
||||
{
|
||||
PointerRNA newptr;
|
||||
@@ -5308,7 +5308,7 @@ PyDoc_STRVAR(
|
||||
" (matches Python's string find function of the same name).\n"
|
||||
"\n"
|
||||
" :arg key: The identifier for the collection member.\n"
|
||||
" :type key: string\n"
|
||||
" :type key: str\n"
|
||||
" :return: index of the key.\n"
|
||||
" :rtype: int\n");
|
||||
static PyObject *pyrna_prop_collection_find(BPy_PropertyRNA *self, PyObject *key_ob)
|
||||
@@ -9142,7 +9142,7 @@ PyDoc_STRVAR(
|
||||
" :class:`bpy.types.Operator`, :class:`bpy.types.KeyingSetInfo`,\n"
|
||||
" :class:`bpy.types.RenderEngine`, :class:`bpy.types.AssetShelf`,\n"
|
||||
" :class:`bpy.types.FileHandler`\n"
|
||||
" :type cls: class\n"
|
||||
" :type cls: type\n"
|
||||
" :raises ValueError:\n"
|
||||
" if the class is not a subclass of a registerable blender class.\n"
|
||||
"\n"
|
||||
@@ -9327,7 +9327,7 @@ PyDoc_STRVAR(
|
||||
" :arg cls: Blender type class, \n"
|
||||
" see :mod:`bpy.utils.register_class` for classes which can \n"
|
||||
" be registered.\n"
|
||||
" :type cls: class\n"
|
||||
" :type cls: type\n"
|
||||
"\n"
|
||||
" .. note::\n"
|
||||
"\n"
|
||||
|
||||
@@ -296,7 +296,7 @@ char pyrna_struct_keyframe_insert_doc[] =
|
||||
"necessary.\n"
|
||||
"\n"
|
||||
" :arg data_path: path to the property to key, analogous to the fcurve's data path.\n"
|
||||
" :type data_path: string\n"
|
||||
" :type data_path: str\n"
|
||||
" :arg index: array index of the property to key.\n"
|
||||
" Defaults to -1 which will key all indices or a single channel if the property is not "
|
||||
"an array.\n"
|
||||
@@ -319,12 +319,12 @@ char pyrna_struct_keyframe_insert_doc[] =
|
||||
" - ``INSERTKEY_AVAILABLE`` Only insert into already existing F-Curves.\n"
|
||||
" - ``INSERTKEY_CYCLE_AWARE`` Take cyclic extrapolation into account "
|
||||
"(Cycle-Aware Keying option).\n"
|
||||
" :type options: set\n"
|
||||
" :type options: set[str]\n"
|
||||
" :arg keytype: Type of the key: 'KEYFRAME', 'BREAKDOWN', 'MOVING_HOLD', 'EXTREME', "
|
||||
"'JITTER', or 'GENERATED'\n"
|
||||
" :type keytype: string\n"
|
||||
" :type keytype: str\n"
|
||||
" :return: Success of keyframe insertion.\n"
|
||||
" :rtype: boolean\n";
|
||||
" :rtype: bool\n";
|
||||
PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
using namespace blender::animrig;
|
||||
@@ -455,7 +455,7 @@ char pyrna_struct_keyframe_delete_doc[] =
|
||||
"\n"
|
||||
" :arg data_path: path to the property to remove a key, analogous to the fcurve's data "
|
||||
"path.\n"
|
||||
" :type data_path: string\n"
|
||||
" :type data_path: str\n"
|
||||
" :arg index: array index of the property to remove a key. Defaults to -1 removing all "
|
||||
"indices or a single channel if the property is not an array.\n"
|
||||
" :type index: int\n"
|
||||
@@ -465,7 +465,7 @@ char pyrna_struct_keyframe_delete_doc[] =
|
||||
"yet.\n"
|
||||
" :type group: str\n"
|
||||
" :return: Success of keyframe deletion.\n"
|
||||
" :rtype: boolean\n";
|
||||
" :rtype: bool\n";
|
||||
PyObject *pyrna_struct_keyframe_delete(BPy_StructRNA *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
/* args, pyrna_struct_keyframe_parse handles these */
|
||||
@@ -575,12 +575,12 @@ char pyrna_struct_driver_add_doc[] =
|
||||
" Adds driver(s) to the given property\n"
|
||||
"\n"
|
||||
" :arg path: path to the property to drive, analogous to the fcurve's data path.\n"
|
||||
" :type path: string\n"
|
||||
" :type path: str\n"
|
||||
" :arg index: array index of the property drive. Defaults to -1 for all indices or a single "
|
||||
"channel if the property is not an array.\n"
|
||||
" :type index: int\n"
|
||||
" :return: The driver(s) added.\n"
|
||||
" :rtype: :class:`bpy.types.FCurve` or list if index is -1 with an array property.\n";
|
||||
" :return: The driver added or a list of drivers when index is -1.\n"
|
||||
" :rtype: :class:`bpy.types.FCurve` | list[:class:`bpy.types.FCurve`]\n";
|
||||
PyObject *pyrna_struct_driver_add(BPy_StructRNA *self, PyObject *args)
|
||||
{
|
||||
const char *path, *path_full;
|
||||
@@ -659,12 +659,12 @@ char pyrna_struct_driver_remove_doc[] =
|
||||
" Remove driver(s) from the given property\n"
|
||||
"\n"
|
||||
" :arg path: path to the property to drive, analogous to the fcurve's data path.\n"
|
||||
" :type path: string\n"
|
||||
" :type path: str\n"
|
||||
" :arg index: array index of the property drive. Defaults to -1 for all indices or a single "
|
||||
"channel if the property is not an array.\n"
|
||||
" :type index: int\n"
|
||||
" :return: Success of driver removal.\n"
|
||||
" :rtype: boolean\n";
|
||||
" :rtype: bool\n";
|
||||
PyObject *pyrna_struct_driver_remove(BPy_StructRNA *self, PyObject *args)
|
||||
{
|
||||
const char *path, *path_full;
|
||||
|
||||
@@ -567,6 +567,8 @@ static PyObject *bpy_context_temp_override_extract_known_args(const char *const
|
||||
return kwds_parse;
|
||||
}
|
||||
|
||||
/* NOTE(@ideasman42): `ContextTempOverride` isn't accessible from (without creating an instance),
|
||||
* it should be exposed although it doesn't seem especially important either. */
|
||||
PyDoc_STRVAR(
|
||||
/* Wrap. */
|
||||
bpy_context_temp_override_doc,
|
||||
@@ -593,7 +595,7 @@ PyDoc_STRVAR(
|
||||
" :type region: :class:`bpy.types.Region`\n"
|
||||
" :arg keywords: Additional keywords override context members.\n"
|
||||
" :return: The context manager .\n"
|
||||
" :rtype: context manager\n");
|
||||
" :rtype: ContextTempOverride\n");
|
||||
static PyObject *bpy_context_temp_override(PyObject *self, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
const PointerRNA *context_ptr = pyrna_struct_as_ptr(self, &RNA_Context);
|
||||
|
||||
@@ -135,7 +135,7 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" :arg filepath: The file path for the newly temporary data. "
|
||||
"When None, the path of the currently open file is used.\n"
|
||||
" :type filepath: str, bytes or NoneType\n"
|
||||
" :type filepath: str | bytes | None\n"
|
||||
"\n"
|
||||
" :return: Blend file data which is freed once the context exists.\n"
|
||||
" :rtype: :class:`bpy.types.BlendData`\n");
|
||||
|
||||
@@ -322,12 +322,13 @@ PyDoc_STRVAR(
|
||||
" Assigns callbacks to a gizmos property.\n"
|
||||
"\n"
|
||||
" :arg target: Target property name.\n"
|
||||
" :type target: string\n"
|
||||
" :type target: str\n"
|
||||
" :arg get: Function that returns the value for this property (single value or sequence).\n"
|
||||
" :type get: callable\n"
|
||||
" :type get: Callable[[], float | Sequence[float]]\n"
|
||||
" :arg set: Function that takes a single value argument and applies it.\n"
|
||||
" :type set: callable\n"
|
||||
" :arg range: Function that returns a (min, max) tuple for gizmos that use a range.\n"
|
||||
" :type set: Callable[[tuple[float, ...]], Any]\n"
|
||||
" :arg range: Function that returns a (min, max) tuple for gizmos that use a range. "
|
||||
"The returned value is not used.\n"
|
||||
" :type range: callable\n");
|
||||
static PyObject *bpy_gizmo_target_set_handler(PyObject * /*self*/, PyObject *args, PyObject *kw)
|
||||
{
|
||||
@@ -439,9 +440,9 @@ PyDoc_STRVAR(
|
||||
" Get the value of this target property.\n"
|
||||
"\n"
|
||||
" :arg target: Target property name.\n"
|
||||
" :type target: string\n"
|
||||
" :return: The value of the target property.\n"
|
||||
" :rtype: Single value or array based on the target type\n");
|
||||
" :type target: str\n"
|
||||
" :return: The value of the target property as a value or array based on the target type.\n"
|
||||
" :rtype: float | tuple[float, ...]\n");
|
||||
static PyObject *bpy_gizmo_target_get_value(PyObject * /*self*/, PyObject *args, PyObject *kw)
|
||||
{
|
||||
struct {
|
||||
@@ -510,7 +511,7 @@ PyDoc_STRVAR(
|
||||
" Set the value of this target property.\n"
|
||||
"\n"
|
||||
" :arg target: Target property name.\n"
|
||||
" :type target: string\n");
|
||||
" :type target: str\n");
|
||||
static PyObject *bpy_gizmo_target_set_value(PyObject * /*self*/, PyObject *args, PyObject *kw)
|
||||
{
|
||||
struct {
|
||||
@@ -598,7 +599,7 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" :arg target: Target property name.\n"
|
||||
" :return: The range of this property (min, max).\n"
|
||||
" :rtype: tuple pair.\n");
|
||||
" :rtype: tuple[float, float]\n");
|
||||
static PyObject *bpy_gizmo_target_get_range(PyObject * /*self*/, PyObject *args, PyObject *kw)
|
||||
{
|
||||
struct {
|
||||
|
||||
@@ -119,21 +119,20 @@ PyDoc_STRVAR(
|
||||
".. method:: user_map(subset, key_types, value_types)\n"
|
||||
"\n"
|
||||
" Returns a mapping of all ID data-blocks in current ``bpy.data`` to a set of all "
|
||||
"datablocks using them.\n"
|
||||
"data-blocks using them.\n"
|
||||
"\n"
|
||||
" For list of valid set members for key_types & value_types, see: "
|
||||
":class:`bpy.types.KeyingSetPath.id_type`.\n"
|
||||
"\n"
|
||||
" :arg subset: When passed, only these data-blocks and their users will be "
|
||||
"included as keys/values in the map.\n"
|
||||
" :type subset: sequence\n"
|
||||
" :type subset: Sequence[:class:`bpy.types.ID`]\n"
|
||||
" :arg key_types: Filter the keys mapped by ID types.\n"
|
||||
" :type key_types: set of strings\n"
|
||||
" :type key_types: set[str]\n"
|
||||
" :arg value_types: Filter the values in the set by ID types.\n"
|
||||
" :type value_types: set of strings\n"
|
||||
" :return: dictionary of :class:`bpy.types.ID` instances, with sets of ID's as "
|
||||
"their values.\n"
|
||||
" :rtype: dict\n");
|
||||
" :type value_types: set[str]\n"
|
||||
" :return: dictionary that maps data-blocks ID's to their users.\n"
|
||||
" :rtype: dict[:class:`bpy.types.ID`, set[:class:`bpy.types.ID`]]\n");
|
||||
static PyObject *bpy_user_map(PyObject * /*self*/, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
#if 0 /* If someone knows how to get a proper 'self' in that case... */
|
||||
@@ -287,8 +286,8 @@ PyDoc_STRVAR(
|
||||
" ID collections), but less safe/versatile (it can break Blender, e.g. by removing "
|
||||
"all scenes...).\n"
|
||||
"\n"
|
||||
" :arg ids: Iterables of IDs (types can be mixed).\n"
|
||||
" :type subset: sequence\n");
|
||||
" :arg ids: Sequence of IDs (types can be mixed).\n"
|
||||
" :type ids: Sequence[:class:`bpy.types.ID`]\n");
|
||||
static PyObject *bpy_batch_remove(PyObject * /*self*/, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
#if 0 /* If someone knows how to get a proper 'self' in that case... */
|
||||
|
||||
@@ -95,7 +95,7 @@ PyDoc_STRVAR(
|
||||
"additional user defined positional arguments are passed to the message function.\n"
|
||||
"\n"
|
||||
" :arg message: The message or a function that returns the message.\n"
|
||||
" :type message: string or a callable that returns a string or None.\n");
|
||||
" :type message: str | Callable[[Any, ...], str | None]\n");
|
||||
|
||||
static PyObject *BPY_rna_operator_poll_message_set(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
|
||||
@@ -54,7 +54,7 @@ PyDoc_STRVAR(
|
||||
"((start_line, start_column), (end_line, end_column))\n"
|
||||
" The values match Python's slicing logic "
|
||||
"(negative values count backwards from the end, the end value is not inclusive).\n"
|
||||
" :type range: Two pairs of ints\n"
|
||||
" :type range: tuple[tuple[int, int], tuple[int, int]]\n"
|
||||
" :return: The specified region as a string.\n"
|
||||
" :rtype: str.\n");
|
||||
/* Receive a Python Tuple as parameter to represent the region range. */
|
||||
@@ -124,7 +124,7 @@ PyDoc_STRVAR(
|
||||
"((start_line, start_column), (end_line, end_column))\n"
|
||||
" The values match Python's slicing logic "
|
||||
"(negative values count backwards from the end, the end value is not inclusive).\n"
|
||||
" :type range: Two pairs of ints\n");
|
||||
" :type range: tuple[tuple[int, int], tuple[int, int]]\n");
|
||||
static PyObject *bpy_rna_region_from_string(PyObject *self, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
BPy_StructRNA *pyrna = (BPy_StructRNA *)self;
|
||||
|
||||
@@ -113,7 +113,7 @@ PyDoc_STRVAR(
|
||||
pyrna_WindowManager_clipboard_doc,
|
||||
"Clipboard text storage.\n"
|
||||
"\n"
|
||||
":type: string");
|
||||
":type: str");
|
||||
static PyObject *pyrna_WindowManager_clipboard_get(PyObject * /*self*/, void * /*flag*/)
|
||||
{
|
||||
int text_len = 0;
|
||||
@@ -158,9 +158,9 @@ PyDoc_STRVAR(
|
||||
" A function that will be called when the cursor is drawn.\n"
|
||||
" It gets the specified arguments as input with the mouse position (tuple) as last "
|
||||
"argument.\n"
|
||||
" :type callback: function\n"
|
||||
" :type callback: Callable[[Any, ..., tuple[int, int]], Any]\n"
|
||||
" :arg args: Arguments that will be passed to the callback.\n"
|
||||
" :type args: tuple\n"
|
||||
" :type args: tuple[Any, ...]\n"
|
||||
" :arg space_type: The space type the callback draws in; for example ``VIEW_3D``. "
|
||||
"(:class:`bpy.types.Space.type`)\n"
|
||||
" :type space_type: str\n"
|
||||
@@ -229,10 +229,10 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" :arg callback:\n"
|
||||
" A function that will be called when the region is drawn.\n"
|
||||
" It gets the specified arguments as input.\n"
|
||||
" :type callback: function\n"
|
||||
" It gets the specified arguments as input, it's return value is ignored.\n"
|
||||
" :type callback: Callable[[Any, ...], Any]\n"
|
||||
" :arg args: Arguments that will be passed to the callback.\n"
|
||||
" :type args: tuple\n"
|
||||
" :type args: tuple[Any, ...]\n"
|
||||
" :arg region_type: The region type the callback draws in; usually ``WINDOW``. "
|
||||
"(:class:`bpy.types.Region.type`)\n"
|
||||
" :type region_type: str\n"
|
||||
|
||||
@@ -40,7 +40,7 @@ PyDoc_STRVAR(
|
||||
" Generate a new empty preview.\n"
|
||||
"\n"
|
||||
" :arg name: The name (unique id) identifying the preview.\n"
|
||||
" :type name: string\n"
|
||||
" :type name: str\n"
|
||||
" :return: The Preview matching given name, or a new empty one.\n"
|
||||
" :rtype: :class:`bpy.types.ImagePreview`\n"
|
||||
/* This is only true when accessed via 'bpy.utils.previews.ImagePreviewCollection.load',
|
||||
@@ -69,12 +69,12 @@ PyDoc_STRVAR(
|
||||
" Generate a new preview from given file path.\n"
|
||||
"\n"
|
||||
" :arg name: The name (unique id) identifying the preview.\n"
|
||||
" :type name: string\n"
|
||||
" :type name: str\n"
|
||||
" :arg filepath: The file path to generate the preview from.\n"
|
||||
" :type filepath: string or bytes\n"
|
||||
" :type filepath: str | bytes\n"
|
||||
" :arg filetype: The type of file, needed to generate the preview in [" STR_SOURCE_TYPES
|
||||
"].\n"
|
||||
" :type filetype: string\n"
|
||||
" :type filetype: str\n"
|
||||
" :arg force_reload: If True, force running thumbnail manager even if preview already "
|
||||
"exists in cache.\n"
|
||||
" :type force_reload: bool\n"
|
||||
@@ -137,7 +137,7 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
"\n"
|
||||
" :arg name: The name (unique id) identifying the preview.\n"
|
||||
" :type name: string\n");
|
||||
" :type name: str\n");
|
||||
static PyObject *bpy_utils_previews_release(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
char *name;
|
||||
|
||||
@@ -151,16 +151,16 @@ PyDoc_STRVAR(
|
||||
" Convert a given input string into a float value.\n"
|
||||
"\n"
|
||||
" :arg unit_system: The unit system, from :attr:`bpy.utils.units.systems`.\n"
|
||||
" :type unit_system: string\n"
|
||||
" :type unit_system: str\n"
|
||||
" :arg unit_category: The category of data we are converting (length, area, rotation, "
|
||||
"etc.),\n"
|
||||
" from :attr:`bpy.utils.units.categories`.\n"
|
||||
" :type unit_category: string\n"
|
||||
" :type unit_category: str\n"
|
||||
" :arg str_input: The string to convert to a float value.\n"
|
||||
" :type str_input: string\n"
|
||||
" :type str_input: str\n"
|
||||
" :arg str_ref_unit: A reference string from which to extract a default unit, if none is "
|
||||
"found in ``str_input``.\n"
|
||||
" :type str_ref_unit: string or None\n"
|
||||
" :type str_ref_unit: str | None\n"
|
||||
" :return: The converted/interpreted value.\n"
|
||||
" :rtype: float\n"
|
||||
" :raises ValueError: if conversion fails to generate a valid Python float value.\n");
|
||||
@@ -236,11 +236,11 @@ PyDoc_STRVAR(
|
||||
" Convert a given input float value into a string with units.\n"
|
||||
"\n"
|
||||
" :arg unit_system: The unit system, from :attr:`bpy.utils.units.systems`.\n"
|
||||
" :type unit_system: string\n"
|
||||
" :type unit_system: str\n"
|
||||
" :arg unit_category: The category of data we are converting (length, area, "
|
||||
"rotation, etc.),\n"
|
||||
" from :attr:`bpy.utils.units.categories`.\n"
|
||||
" :type unit_category: string\n"
|
||||
" :type unit_category: str\n"
|
||||
" :arg value: The value to convert to a string.\n"
|
||||
" :type value: float\n"
|
||||
" :arg precision: Number of digits after the comma.\n"
|
||||
|
||||
@@ -623,21 +623,20 @@ PyObject *BaseMathObject_owner_get(BaseMathObject *self, void * /*closure*/)
|
||||
}
|
||||
|
||||
char BaseMathObject_is_wrapped_doc[] =
|
||||
"True when this object wraps external data (read-only).\n\n:type: boolean";
|
||||
"True when this object wraps external data (read-only).\n\n:type: bool";
|
||||
PyObject *BaseMathObject_is_wrapped_get(BaseMathObject *self, void * /*closure*/)
|
||||
{
|
||||
return PyBool_FromLong((self->flag & BASE_MATH_FLAG_IS_WRAP) != 0);
|
||||
}
|
||||
|
||||
char BaseMathObject_is_frozen_doc[] =
|
||||
"True when this object has been frozen (read-only).\n\n:type: boolean";
|
||||
"True when this object has been frozen (read-only).\n\n:type: bool";
|
||||
PyObject *BaseMathObject_is_frozen_get(BaseMathObject *self, void * /*closure*/)
|
||||
{
|
||||
return PyBool_FromLong((self->flag & BASE_MATH_FLAG_IS_FROZEN) != 0);
|
||||
}
|
||||
|
||||
char BaseMathObject_is_valid_doc[] =
|
||||
"True when the owner of this data is valid.\n\n:type: boolean";
|
||||
char BaseMathObject_is_valid_doc[] = "True when the owner of this data is valid.\n\n:type: bool";
|
||||
PyObject *BaseMathObject_is_valid_get(BaseMathObject *self, void * /*closure*/)
|
||||
{
|
||||
return PyBool_FromLong(BaseMath_CheckCallback(self) == 0);
|
||||
|
||||
@@ -1200,8 +1200,8 @@ PyDoc_STRVAR(
|
||||
" the OpenColorIO configuration. The notable exception is user interface theming colors, "
|
||||
" which are in sRGB color space.\n"
|
||||
"\n"
|
||||
" :arg rgb: (r, g, b) color values\n"
|
||||
" :type rgb: 3d vector\n");
|
||||
" :arg rgb: (red, green, blue) color values where (0, 0, 0) is black & (1, 1, 1) is white.\n"
|
||||
" :type rgb: Sequence[float]\n");
|
||||
PyTypeObject color_Type = {
|
||||
/*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
|
||||
/*tp_name*/ "Color",
|
||||
|
||||
@@ -214,7 +214,7 @@ PyDoc_STRVAR(
|
||||
" (no 720 degree pitches).\n"
|
||||
"\n"
|
||||
" :arg axis: single character in ['X, 'Y', 'Z'].\n"
|
||||
" :type axis: string\n"
|
||||
" :type axis: str\n"
|
||||
" :arg angle: angle in radians.\n"
|
||||
" :type angle: float\n");
|
||||
static PyObject *Euler_rotate_axis(EulerObject *self, PyObject *args)
|
||||
@@ -255,7 +255,7 @@ PyDoc_STRVAR(
|
||||
" Rotates the euler by another mathutils value.\n"
|
||||
"\n"
|
||||
" :arg other: rotation component of mathutils value\n"
|
||||
" :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n");
|
||||
" :type other: :class:`Euler` | :class:`Quaternion` | :class:`Matrix`\n");
|
||||
static PyObject *Euler_rotate(EulerObject *self, PyObject *value)
|
||||
{
|
||||
float self_rmat[3][3], other_rmat[3][3], rmat[3][3];
|
||||
@@ -707,7 +707,7 @@ PyDoc_STRVAR(
|
||||
Euler_order_doc,
|
||||
"Euler rotation order.\n"
|
||||
"\n"
|
||||
":type: string in ['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX']");
|
||||
":type: str in ['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX']");
|
||||
static PyObject *Euler_order_get(EulerObject *self, void * /*closure*/)
|
||||
{
|
||||
if (BaseMath_ReadCallback(self) == -1) {
|
||||
@@ -823,8 +823,8 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" .. seealso:: `Euler angles <https://en.wikipedia.org/wiki/Euler_angles>`__ on Wikipedia.\n"
|
||||
"\n"
|
||||
" :arg angles: Three angles, in radians.\n"
|
||||
" :type angles: 3d vector\n"
|
||||
" :arg angles: (X, Y, Z) angles in radians.\n"
|
||||
" :type angles: Sequence[float]\n"
|
||||
" :arg order: Optional order of the angles, a permutation of ``XYZ``.\n"
|
||||
" :type order: str\n");
|
||||
PyTypeObject euler_Type = {
|
||||
|
||||
@@ -692,7 +692,7 @@ PyDoc_STRVAR(
|
||||
" :type size: int\n"
|
||||
" :arg axis: a string in ['X', 'Y', 'Z'] or a 3D Vector Object\n"
|
||||
" (optional when size is 2).\n"
|
||||
" :type axis: string or :class:`Vector`\n"
|
||||
" :type axis: str | :class:`Vector`\n"
|
||||
" :return: A new rotation matrix.\n"
|
||||
" :rtype: :class:`Matrix`\n");
|
||||
static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args)
|
||||
@@ -928,7 +928,7 @@ PyDoc_STRVAR(
|
||||
" :arg axis: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ'],\n"
|
||||
" where a single axis is for a 2D matrix.\n"
|
||||
" Or a vector for an arbitrary axis\n"
|
||||
" :type axis: string or :class:`Vector`\n"
|
||||
" :type axis: str | :class:`Vector`\n"
|
||||
" :arg size: The size of the projection matrix to construct [2, 4].\n"
|
||||
" :type size: int\n"
|
||||
" :return: A new projection matrix.\n"
|
||||
@@ -1049,12 +1049,13 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" :arg plane: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ'],\n"
|
||||
" where a single axis is for a 2D matrix only.\n"
|
||||
" :type plane: string\n"
|
||||
" :type plane: str\n"
|
||||
" :arg size: The size of the shear matrix to construct [2, 4].\n"
|
||||
" :type size: int\n"
|
||||
" :arg factor: The factor of shear to apply. For a 3 or 4 *size* matrix\n"
|
||||
" pass a pair of floats corresponding with the *plane* axis.\n"
|
||||
" :type factor: float or float pair\n"
|
||||
" :arg factor: The factor of shear to apply. "
|
||||
"For a 2 *size* matrix use a single float. "
|
||||
"For a 3 or 4 *size* matrix pass a pair of floats corresponding with the *plane* axis.\n"
|
||||
" :type factor: float | Sequence[float]\n"
|
||||
" :return: A new shear matrix.\n"
|
||||
" :rtype: :class:`Matrix`\n");
|
||||
static PyObject *C_Matrix_Shear(PyObject *cls, PyObject *args)
|
||||
@@ -1152,13 +1153,14 @@ PyDoc_STRVAR(
|
||||
" Any of the inputs may be replaced with None if not needed.\n"
|
||||
"\n"
|
||||
" :arg location: The translation component.\n"
|
||||
" :type location: :class:`Vector` or None\n"
|
||||
" :arg rotation: The rotation component.\n"
|
||||
" :type rotation: 3x3 :class:`Matrix`, :class:`Quaternion`, :class:`Euler` or None\n"
|
||||
" :type location: :class:`Vector` | None\n"
|
||||
" :arg rotation: The rotation component as a "
|
||||
"3x3 matrix, quaternion, euler or None for no rotation.\n"
|
||||
" :type rotation: :class:`Matrix` | :class:`Quaternion` | :class:`Euler` | None\n"
|
||||
" :arg scale: The scale component.\n"
|
||||
" :type scale: :class:`Vector` or None\n"
|
||||
" :return: Combined transformation matrix. \n"
|
||||
" :rtype: 4x4 :class:`Matrix`\n");
|
||||
" :type scale: :class:`Vector` | None\n"
|
||||
" :return: Combined transformation as a 4x4 matrix. \n"
|
||||
" :rtype: :class:`Matrix`\n");
|
||||
static PyObject *C_Matrix_LocRotScale(PyObject *cls, PyObject *args)
|
||||
{
|
||||
PyObject *loc_obj, *rot_obj, *scale_obj;
|
||||
@@ -1297,7 +1299,7 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" :arg order: Optional rotation order argument in\n"
|
||||
" ['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX'].\n"
|
||||
" :type order: string\n"
|
||||
" :type order: str\n"
|
||||
" :arg euler_compat: Optional euler argument the new euler will be made\n"
|
||||
" compatible with (no axis flipping between them).\n"
|
||||
" Useful for converting a series of matrices to animation curves.\n"
|
||||
@@ -1695,9 +1697,9 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" :arg fallback: return this when the inverse can't be calculated\n"
|
||||
" (instead of raising a :exc:`ValueError`).\n"
|
||||
" :type fallback: any\n"
|
||||
" :return: the inverted matrix or fallback when given.\n"
|
||||
" :rtype: :class:`Matrix`\n");
|
||||
" :type fallback: Any\n"
|
||||
" :return: The inverted matrix or fallback when given.\n"
|
||||
" :rtype: :class:`Matrix` | Any\n");
|
||||
static PyObject *Matrix_inverted(MatrixObject *self, PyObject *args)
|
||||
{
|
||||
float mat[MATRIX_MAX_DIM * MATRIX_MAX_DIM];
|
||||
@@ -1877,7 +1879,7 @@ PyDoc_STRVAR(
|
||||
" Rotates the matrix by another mathutils value.\n"
|
||||
"\n"
|
||||
" :arg other: rotation component of mathutils value\n"
|
||||
" :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n"
|
||||
" :type other: :class:`Euler` | :class:`Quaternion` | :class:`Matrix`\n"
|
||||
"\n"
|
||||
" .. note:: If any of the columns are not unit length this may not have desired results.\n");
|
||||
static PyObject *Matrix_rotate(MatrixObject *self, PyObject *value)
|
||||
@@ -1921,8 +1923,8 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" Return the translation, rotation, and scale components of this matrix.\n"
|
||||
"\n"
|
||||
" :return: tuple of translation, rotation, and scale\n"
|
||||
" :rtype: (:class:`Vector`, :class:`Quaternion`, :class:`Vector`)");
|
||||
" :return: Tuple of translation, rotation, and scale.\n"
|
||||
" :rtype: tuple[:class:`Vector`, :class:`Quaternion`, :class:`Vector`]");
|
||||
static PyObject *Matrix_decompose(MatrixObject *self)
|
||||
{
|
||||
PyObject *ret;
|
||||
@@ -3107,7 +3109,7 @@ PyDoc_STRVAR(
|
||||
Matrix_translation_doc,
|
||||
"The translation component of the matrix.\n"
|
||||
"\n"
|
||||
":type: Vector");
|
||||
":type: :class:`Vector`");
|
||||
static PyObject *Matrix_translation_get(MatrixObject *self, void * /*closure*/)
|
||||
{
|
||||
PyObject *ret;
|
||||
@@ -3457,7 +3459,7 @@ PyDoc_STRVAR(
|
||||
" matrices from 2x2 up to 4x4.\n"
|
||||
"\n"
|
||||
" :arg rows: Sequence of rows. When omitted, a 4x4 identity matrix is constructed.\n"
|
||||
" :type rows: 2d number sequence\n");
|
||||
" :type rows: Sequence[Sequence[float]]\n");
|
||||
PyTypeObject matrix_Type = {
|
||||
/*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
|
||||
/*tp_name*/ "Matrix",
|
||||
|
||||
@@ -173,7 +173,7 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" :arg order: Optional rotation order argument in\n"
|
||||
" ['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX'].\n"
|
||||
" :type order: string\n"
|
||||
" :type order: str\n"
|
||||
" :arg euler_compat: Optional euler argument the new euler will be made\n"
|
||||
" compatible with (no axis flipping between them).\n"
|
||||
" Useful for converting a series of matrices to animation curves.\n"
|
||||
@@ -270,8 +270,8 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" Return the axis, angle representation of the quaternion.\n"
|
||||
"\n"
|
||||
" :return: axis, angle.\n"
|
||||
" :rtype: (:class:`Vector`, float) pair\n");
|
||||
" :return: Axis, angle.\n"
|
||||
" :rtype: tuple[:class:`Vector`, float]\n");
|
||||
static PyObject *Quaternion_to_axis_angle(QuaternionObject *self)
|
||||
{
|
||||
PyObject *ret;
|
||||
@@ -309,9 +309,10 @@ PyDoc_STRVAR(
|
||||
" Split the rotation into a swing quaternion with the specified\n"
|
||||
" axis fixed at zero, and the remaining twist rotation angle.\n"
|
||||
"\n"
|
||||
" :arg axis: twist axis as a string in ['X', 'Y', 'Z']\n"
|
||||
" :return: swing, twist angle.\n"
|
||||
" :rtype: (:class:`Quaternion`, float) pair\n");
|
||||
" :arg axis: Twist axis as a string in ['X', 'Y', 'Z'].\n"
|
||||
" :type axis: str\n"
|
||||
" :return: Swing, twist angle.\n"
|
||||
" :rtype: tuple[:class:`Quaternion`, float]\n");
|
||||
static PyObject *Quaternion_to_swing_twist(QuaternionObject *self, PyObject *axis_arg)
|
||||
{
|
||||
PyObject *ret;
|
||||
@@ -556,7 +557,7 @@ PyDoc_STRVAR(
|
||||
" Rotates the quaternion by another mathutils value.\n"
|
||||
"\n"
|
||||
" :arg other: rotation component of mathutils value\n"
|
||||
" :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n");
|
||||
" :type other: :class:`Euler` | :class:`Quaternion` | :class:`Matrix`\n");
|
||||
static PyObject *Quaternion_rotate(QuaternionObject *self, PyObject *value)
|
||||
{
|
||||
float self_rmat[3][3], other_rmat[3][3], rmat[3][3];
|
||||
|
||||
@@ -764,7 +764,7 @@ PyDoc_STRVAR(
|
||||
" :arg precision: The number to round the value to in [-1, 21].\n"
|
||||
" :type precision: int\n"
|
||||
" :return: the values of the vector rounded by *precision*\n"
|
||||
" :rtype: tuple\n");
|
||||
" :rtype: tuple[float]\n");
|
||||
static PyObject *Vector_to_tuple(VectorObject *self, PyObject *args)
|
||||
{
|
||||
int ndigits = 0;
|
||||
@@ -805,9 +805,9 @@ PyDoc_STRVAR(
|
||||
" Return a quaternion rotation from the vector and the track and up axis.\n"
|
||||
"\n"
|
||||
" :arg track: Track axis in ['X', 'Y', 'Z', '-X', '-Y', '-Z'].\n"
|
||||
" :type track: string\n"
|
||||
" :type track: str\n"
|
||||
" :arg up: Up axis in ['X', 'Y', 'Z'].\n"
|
||||
" :type up: string\n"
|
||||
" :type up: str\n"
|
||||
" :return: rotation from the vector and the track and up axis.\n"
|
||||
" :rtype: :class:`Quaternion`\n");
|
||||
static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
|
||||
@@ -1031,8 +1031,8 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" :arg other: The other vector to perform the cross product with.\n"
|
||||
" :type other: :class:`Vector`\n"
|
||||
" :return: The cross product.\n"
|
||||
" :rtype: :class:`Vector` or float when 2D vectors are used\n"
|
||||
" :return: The cross product as a vector or a float when 2D vectors are used.\n"
|
||||
" :rtype: :class:`Vector` | float\n"
|
||||
"\n"
|
||||
" .. note:: both vectors must be 2D or 3D\n");
|
||||
static PyObject *Vector_cross(VectorObject *self, PyObject *value)
|
||||
@@ -1121,9 +1121,9 @@ PyDoc_STRVAR(
|
||||
" :type other: :class:`Vector`\n"
|
||||
" :arg fallback: return this when the angle can't be calculated (zero length vector),\n"
|
||||
" (instead of raising a :exc:`ValueError`).\n"
|
||||
" :type fallback: any\n"
|
||||
" :type fallback: Any\n"
|
||||
" :return: angle in radians or fallback when given\n"
|
||||
" :rtype: float\n");
|
||||
" :rtype: float | Any\n");
|
||||
static PyObject *Vector_angle(VectorObject *self, PyObject *args)
|
||||
{
|
||||
const int vec_num = std::min(self->vec_num, 3); /* 4D angle makes no sense */
|
||||
@@ -1194,9 +1194,9 @@ PyDoc_STRVAR(
|
||||
" :type other: :class:`Vector`\n"
|
||||
" :arg fallback: return this when the angle can't be calculated (zero length vector),\n"
|
||||
" (instead of raising a :exc:`ValueError`).\n"
|
||||
" :type fallback: any\n"
|
||||
" :type fallback: Any\n"
|
||||
" :return: angle in radians or fallback when given\n"
|
||||
" :rtype: float\n");
|
||||
" :rtype: float | Any\n");
|
||||
static PyObject *Vector_angle_signed(VectorObject *self, PyObject *args)
|
||||
{
|
||||
float tvec[2];
|
||||
@@ -1400,7 +1400,7 @@ PyDoc_STRVAR(
|
||||
" :arg fallback: return this when the vector can't be calculated (zero length "
|
||||
"vector or direct opposites),\n"
|
||||
" (instead of raising a :exc:`ValueError`).\n"
|
||||
" :type fallback: any\n"
|
||||
" :type fallback: Any\n"
|
||||
" :return: The interpolated vector.\n"
|
||||
" :rtype: :class:`Vector`\n");
|
||||
static PyObject *Vector_slerp(VectorObject *self, PyObject *args)
|
||||
@@ -1491,7 +1491,7 @@ PyDoc_STRVAR(
|
||||
" .. note:: 2D vectors are a special case that can only be rotated by a 2x2 matrix.\n"
|
||||
"\n"
|
||||
" :arg other: rotation component of mathutils value\n"
|
||||
" :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n");
|
||||
" :type other: :class:`Euler` | :class:`Quaternion` | :class:`Matrix`\n");
|
||||
static PyObject *Vector_rotate(VectorObject *self, PyObject *value)
|
||||
{
|
||||
if (BaseMath_ReadCallback_ForWrite(self) == -1) {
|
||||
@@ -3405,8 +3405,8 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" This object gives access to Vectors in Blender.\n"
|
||||
"\n"
|
||||
" :arg seq: Components of the vector, must be a sequence of at least two\n"
|
||||
" :type seq: sequence of floats\n");
|
||||
" :arg seq: Components of the vector, must be a sequence of at least two.\n"
|
||||
" :type seq: Sequence[float]\n");
|
||||
PyTypeObject vector_Type = {
|
||||
/*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
|
||||
/*tp_name*/ "Vector",
|
||||
|
||||
@@ -58,15 +58,13 @@
|
||||
" :type distance: float\n"
|
||||
|
||||
#define PYBVH_FIND_GENERIC_RETURN_DOC \
|
||||
" :return: Returns a tuple\n" \
|
||||
" (:class:`Vector` location, :class:`Vector` normal, int index, float distance),\n" \
|
||||
" :return: Returns a tuple: (position, normal, index, distance),\n" \
|
||||
" Values will all be None if no hit is found.\n" \
|
||||
" :rtype: :class:`tuple`\n"
|
||||
" :rtype: tuple[:class:`Vector` | None, :class:`Vector` | None, int | None, float | None]\n"
|
||||
|
||||
#define PYBVH_FIND_GENERIC_RETURN_LIST_DOC \
|
||||
" :return: Returns a list of tuples\n" \
|
||||
" (:class:`Vector` location, :class:`Vector` normal, int index, float distance),\n" \
|
||||
" :rtype: :class:`list`\n"
|
||||
" :return: Returns a list of tuples (position, normal, index, distance)\n" \
|
||||
" :rtype: list[tuple[:class:`Vector`, :class:`Vector`, int, float]]\n"
|
||||
|
||||
#define PYBVH_FROM_GENERIC_EPSILON_DOC \
|
||||
" :arg epsilon: Increase the threshold for detecting overlap and raycast hits.\n" \
|
||||
@@ -559,7 +557,7 @@ PyDoc_STRVAR(
|
||||
" :type other_tree: :class:`BVHTree`\n"
|
||||
" :return: Returns a list of unique index pairs,"
|
||||
" the first index referencing this tree, the second referencing the **other_tree**.\n"
|
||||
" :rtype: :class:`list`\n");
|
||||
" :rtype: list[tuple[int, int]]\n");
|
||||
static PyObject *py_bvhtree_overlap(PyBVHTree *self, PyBVHTree *other)
|
||||
{
|
||||
PyBVHTree_OverlapData data;
|
||||
@@ -642,9 +640,9 @@ PyDoc_STRVAR(
|
||||
" BVH tree constructed geometry passed in as arguments.\n"
|
||||
"\n"
|
||||
" :arg vertices: float triplets each representing ``(x, y, z)``\n"
|
||||
" :type vertices: float triplet sequence\n"
|
||||
" :type vertices: Sequence[Sequence[float]]\n"
|
||||
" :arg polygons: Sequence of polygons, each containing indices to the vertices argument.\n"
|
||||
" :type polygons: Sequence of sequences containing ints\n"
|
||||
" :type polygons: Sequence[Sequence[int]]\n"
|
||||
" :arg all_triangles: Use when all **polygons** are triangles for more efficient "
|
||||
"conversion.\n"
|
||||
" :type all_triangles: bool\n" PYBVH_FROM_GENERIC_EPSILON_DOC);
|
||||
|
||||
@@ -57,9 +57,9 @@ PyDoc_STRVAR(
|
||||
" :type orig: :class:`mathutils.Vector`\n"
|
||||
" :arg clip: When False, don't restrict the intersection to the area of the "
|
||||
"triangle, use the infinite plane defined by the triangle.\n"
|
||||
" :type clip: boolean\n"
|
||||
" :type clip: bool\n"
|
||||
" :return: The point of intersection or None if no intersection is found\n"
|
||||
" :rtype: :class:`mathutils.Vector` or None\n");
|
||||
" :rtype: :class:`mathutils.Vector` | None\n");
|
||||
static PyObject *M_Geometry_intersect_ray_tri(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
const char *error_prefix = "intersect_ray_tri";
|
||||
@@ -165,7 +165,7 @@ PyDoc_STRVAR(
|
||||
" :arg v4: Second point of the second line\n"
|
||||
" :type v4: :class:`mathutils.Vector`\n"
|
||||
" :return: The intersection on each line or None when the lines are co-linear.\n"
|
||||
" :rtype: tuple of :class:`mathutils.Vector`'s\n");
|
||||
" :rtype: tuple[:class:`mathutils.Vector`, :class:`mathutils.Vector`] | None\n");
|
||||
static PyObject *M_Geometry_intersect_line_line(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
const char *error_prefix = "intersect_line_line";
|
||||
@@ -244,7 +244,8 @@ PyDoc_STRVAR(
|
||||
" :arg radius_b: Radius of the second circle\n"
|
||||
" :type radius_b: float\n"
|
||||
" :return: 2 points on between intersecting circles or None when there is no intersection.\n"
|
||||
" :rtype: tuple of :class:`mathutils.Vector`'s or None when there is no intersection\n");
|
||||
" :rtype: tuple[:class:`mathutils.Vector`, :class:`mathutils.Vector`] | tuple[None, "
|
||||
"None]\n");
|
||||
static PyObject *M_Geometry_intersect_sphere_sphere_2d(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
const char *error_prefix = "intersect_sphere_sphere_2d";
|
||||
@@ -350,8 +351,8 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" Returns the normal of a 3D polygon.\n"
|
||||
"\n"
|
||||
" :arg vectors: Vectors to calculate normals with\n"
|
||||
" :type vectors: sequence of 3 or more 3d vector\n"
|
||||
" :arg vectors: 3 or more vectors to calculate normals.\n"
|
||||
" :type vectors: Sequence[Sequence[float]]\n"
|
||||
" :rtype: :class:`mathutils.Vector`\n");
|
||||
static PyObject *M_Geometry_normal(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
@@ -476,7 +477,7 @@ PyDoc_STRVAR(
|
||||
" :arg lineB_p2: Second point of the second line\n"
|
||||
" :type lineB_p2: :class:`mathutils.Vector`\n"
|
||||
" :return: The point of intersection or None when not found\n"
|
||||
" :rtype: :class:`mathutils.Vector` or None\n");
|
||||
" :rtype: :class:`mathutils.Vector` | None\n");
|
||||
static PyObject *M_Geometry_intersect_line_line_2d(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
const char *error_prefix = "intersect_line_line_2d";
|
||||
@@ -519,7 +520,7 @@ PyDoc_STRVAR(
|
||||
" :arg plane_no: The direction the plane is facing\n"
|
||||
" :type plane_no: :class:`mathutils.Vector`\n"
|
||||
" :return: The point of intersection or None when not found\n"
|
||||
" :rtype: :class:`mathutils.Vector` or None\n");
|
||||
" :rtype: :class:`mathutils.Vector` | None\n");
|
||||
static PyObject *M_Geometry_intersect_line_plane(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
const char *error_prefix = "intersect_line_plane";
|
||||
@@ -572,9 +573,10 @@ PyDoc_STRVAR(
|
||||
" :type plane_b_co: :class:`mathutils.Vector`\n"
|
||||
" :arg plane_b_no: Normal of the second plane\n"
|
||||
" :type plane_b_no: :class:`mathutils.Vector`\n"
|
||||
" :return: The line of the intersection represented as a point and a vector\n"
|
||||
" :rtype: tuple pair of :class:`mathutils.Vector` or None if the intersection can't be "
|
||||
"calculated\n");
|
||||
" :return: The line of the intersection represented as a point and a vector or None if the "
|
||||
"intersection can't be calculated\n"
|
||||
" :rtype: tuple[:class:`mathutils.Vector`, :class:`mathutils.Vector`] | tuple[None, "
|
||||
"None]\n");
|
||||
static PyObject *M_Geometry_intersect_plane_plane(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
const char *error_prefix = "intersect_plane_plane";
|
||||
@@ -645,7 +647,7 @@ PyDoc_STRVAR(
|
||||
" :type sphere_radius: float\n"
|
||||
" :return: The intersection points as a pair of vectors or None when there is no "
|
||||
"intersection\n"
|
||||
" :rtype: A tuple pair containing :class:`mathutils.Vector` or None\n");
|
||||
" :rtype: tuple[:class:`mathutils.Vector` | None, :class:`mathutils.Vector` | None]\n");
|
||||
static PyObject *M_Geometry_intersect_line_sphere(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
const char *error_prefix = "intersect_line_sphere";
|
||||
@@ -736,7 +738,7 @@ PyDoc_STRVAR(
|
||||
" :type sphere_radius: float\n"
|
||||
" :return: The intersection points as a pair of vectors or None when there is no "
|
||||
"intersection\n"
|
||||
" :rtype: A tuple pair containing :class:`mathutils.Vector` or None\n");
|
||||
" :rtype: tuple[:class:`mathutils.Vector` | None, :class:`mathutils.Vector` | None]\n");
|
||||
static PyObject *M_Geometry_intersect_line_sphere_2d(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
const char *error_prefix = "intersect_line_sphere_2d";
|
||||
@@ -822,7 +824,7 @@ PyDoc_STRVAR(
|
||||
" :type line_p1: :class:`mathutils.Vector`\n"
|
||||
" :arg line_p1: Second point of the line\n"
|
||||
" :type line_p1: :class:`mathutils.Vector`\n"
|
||||
" :rtype: (:class:`mathutils.Vector`, float)\n");
|
||||
" :rtype: tuple[:class:`mathutils.Vector`, float]\n");
|
||||
static PyObject *M_Geometry_intersect_point_line(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
const char *error_prefix = "intersect_point_line";
|
||||
@@ -873,7 +875,7 @@ PyDoc_STRVAR(
|
||||
" :arg tri_p3: Third point of the triangle\n"
|
||||
" :type tri_p3: :class:`mathutils.Vector`\n"
|
||||
" :return: Point on the triangles plane or None if its outside the triangle\n"
|
||||
" :rtype: :class:`mathutils.Vector` or None\n");
|
||||
" :rtype: :class:`mathutils.Vector` | None\n");
|
||||
static PyObject *M_Geometry_intersect_point_tri(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
const char *error_prefix = "intersect_point_tri";
|
||||
@@ -1096,7 +1098,7 @@ PyDoc_STRVAR(
|
||||
" :arg tri_b3: target triangle vertex.\n"
|
||||
" :type tri_b3: :class:`mathutils.Vector`\n"
|
||||
" :return: The transformed point\n"
|
||||
" :rtype: :class:`mathutils.Vector`'s\n");
|
||||
" :rtype: :class:`mathutils.Vector`\n");
|
||||
static PyObject *M_Geometry_barycentric_transform(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
const char *error_prefix = "barycentric_transform";
|
||||
@@ -1154,14 +1156,14 @@ PyDoc_STRVAR(
|
||||
"the planes used.\n"
|
||||
"\n"
|
||||
" :arg planes: List of planes (4D vectors).\n"
|
||||
" :type planes: list of :class:`mathutils.Vector`\n"
|
||||
" :type planes: list[:class:`mathutils.Vector`]\n"
|
||||
" :arg epsilon_coplanar: Epsilon value for interpreting plane pairs as co-plannar.\n"
|
||||
" :type epsilon_coplanar: float\n"
|
||||
" :arg epsilon_isect: Epsilon value for intersection.\n"
|
||||
" :type epsilon_isect: float\n"
|
||||
" :return: two lists, once containing the vertices inside the planes, another "
|
||||
"containing the plane indices used\n"
|
||||
" :rtype: pair of lists\n");
|
||||
" :return: Two lists, once containing the 3D coordinates inside the planes, "
|
||||
"another containing the plane indices used.\n"
|
||||
" :rtype: tuple[list[:class:`mathutils.Vector`], list[int]]\n");
|
||||
static PyObject *M_Geometry_points_in_planes(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
PyObject *py_planes;
|
||||
@@ -1231,8 +1233,8 @@ PyDoc_STRVAR(
|
||||
" :type knot2: :class:`mathutils.Vector`\n"
|
||||
" :arg resolution: Number of points to return.\n"
|
||||
" :type resolution: int\n"
|
||||
" :return: The interpolated points\n"
|
||||
" :rtype: list of :class:`mathutils.Vector`'s\n");
|
||||
" :return: The interpolated points.\n"
|
||||
" :rtype: list[:class:`mathutils.Vector`]\n");
|
||||
static PyObject *M_Geometry_interpolate_bezier(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
const char *error_prefix = "interpolate_bezier";
|
||||
@@ -1281,14 +1283,16 @@ static PyObject *M_Geometry_interpolate_bezier(PyObject * /*self*/, PyObject *ar
|
||||
PyDoc_STRVAR(
|
||||
/* Wrap. */
|
||||
M_Geometry_tessellate_polygon_doc,
|
||||
".. function:: tessellate_polygon(veclist_list)\n"
|
||||
".. function:: tessellate_polygon(polylines)\n"
|
||||
"\n"
|
||||
" Takes a list of polylines (each point a pair or triplet of numbers) and returns "
|
||||
"the point indices for a polyline filled with triangles. Does not handle degenerate "
|
||||
"geometry (such as zero-length lines due to consecutive identical points).\n"
|
||||
"\n"
|
||||
" :arg veclist_list: list of polylines\n"
|
||||
" :rtype: list\n");
|
||||
" :arg polylines: Polygons where each polygon is a sequence of 2D or 3D points.\n"
|
||||
" :type polylines: Sequence[Sequence[Sequence[float]]]"
|
||||
" :return: A list of triangles.\n"
|
||||
" :rtype: list[tuple[int, int, int]]\n");
|
||||
/* PolyFill function, uses Blenders scan-fill to fill multiple poly lines. */
|
||||
static PyObject *M_Geometry_tessellate_polygon(PyObject * /*self*/, PyObject *polyLineSeq)
|
||||
{
|
||||
@@ -1462,11 +1466,12 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" Returns a tuple with the width and height of the packed bounding box.\n"
|
||||
"\n"
|
||||
" :arg boxes: list of boxes, each box is a list where the first 4 items are [x, y, "
|
||||
"width, height, ...] other items are ignored.\n"
|
||||
" :type boxes: list\n"
|
||||
" :return: the width and height of the packed bounding box\n"
|
||||
" :rtype: tuple, pair of floats\n");
|
||||
" :arg boxes: list of boxes, each box is a list where the first 4 items are "
|
||||
"[X, Y, width, height, ...] other items are ignored. "
|
||||
"The X & Y values in this list are modified to set the packed positions.\n"
|
||||
" :type boxes: list[list[float, float, float, float, ...]]\n"
|
||||
" :return: The width and height of the packed bounding box.\n"
|
||||
" :rtype: tuple[float, float]\n");
|
||||
static PyObject *M_Geometry_box_pack_2d(PyObject * /*self*/, PyObject *boxlist)
|
||||
{
|
||||
float tot_width = 0.0f, tot_height = 0.0f;
|
||||
@@ -1506,8 +1511,8 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" Returns an angle that best fits the points to an axis aligned rectangle\n"
|
||||
"\n"
|
||||
" :arg points: list of 2d points.\n"
|
||||
" :type points: list\n"
|
||||
" :arg points: Sequence of 2D points.\n"
|
||||
" :type points: Sequence[Sequence[float]]\n"
|
||||
" :return: angle\n"
|
||||
" :rtype: float\n");
|
||||
static PyObject *M_Geometry_box_fit_2d(PyObject * /*self*/, PyObject *pointlist)
|
||||
@@ -1539,10 +1544,10 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" Returns a list of indices into the list given\n"
|
||||
"\n"
|
||||
" :arg points: list of 2d points.\n"
|
||||
" :type points: list\n"
|
||||
" :arg points: Sequence of 2D points.\n"
|
||||
" :type points: Sequence[Sequence[float]]\n"
|
||||
" :return: a list of indices\n"
|
||||
" :rtype: list of ints\n");
|
||||
" :rtype: list[int]\n");
|
||||
static PyObject *M_Geometry_convex_hull_2d(PyObject * /*self*/, PyObject *pointlist)
|
||||
{
|
||||
float(*points)[2];
|
||||
@@ -1621,11 +1626,11 @@ PyDoc_STRVAR(
|
||||
" of the orig arrays, which may save some time.\n"
|
||||
"\n"
|
||||
" :arg vert_coords: Vertex coordinates (2d)\n"
|
||||
" :type vert_coords: list of :class:`mathutils.Vector`\n"
|
||||
" :arg edges: Edges, as pairs of indices in `vert_coords`\n"
|
||||
" :type edges: list of (int, int)\n"
|
||||
" :type vert_coords: Sequence[:class:`mathutils.Vector`]\n"
|
||||
" :arg edges: Edges, as pairs of indices in ``vert_coords``\n"
|
||||
" :type edges: Sequence[Sequence[int, int]]\n"
|
||||
" :arg faces: Faces, each sublist is a face, as indices in `vert_coords` (CCW oriented)\n"
|
||||
" :type faces: list of list of int\n"
|
||||
" :type faces: Sequence[Sequence[int]]\n"
|
||||
" :arg output_type: What output looks like. 0 => triangles with convex hull. "
|
||||
"1 => triangles inside constraints. "
|
||||
"2 => the input constraints, intersected. "
|
||||
@@ -1638,12 +1643,13 @@ PyDoc_STRVAR(
|
||||
" :arg need_ids: are the orig output arrays needed?\n"
|
||||
" :type need_args: bool\n"
|
||||
" :return: Output tuple, (vert_coords, edges, faces, orig_verts, orig_edges, orig_faces)\n"
|
||||
" :rtype: (list of `mathutils.Vector`, "
|
||||
"list of (int, int), "
|
||||
"list of list of int, "
|
||||
"list of list of int, "
|
||||
"list of list of int, "
|
||||
"list of list of int)\n"
|
||||
" :rtype: tuple["
|
||||
"list[:class:`mathutils.Vector`], "
|
||||
"list[tuple[int, int]], "
|
||||
"list[list[int]], "
|
||||
"list[list[int]], "
|
||||
"list[list[int]], "
|
||||
"list[list[int]]]\n"
|
||||
"\n");
|
||||
static PyObject *M_Geometry_delaunay_2d_cdt(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
|
||||
@@ -35,9 +35,12 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" Calculate barycentric weights for a point on a polygon.\n"
|
||||
"\n"
|
||||
" :arg veclist: list of vectors\n"
|
||||
" :arg pt: point"
|
||||
" :rtype: list of per-vector weights\n");
|
||||
" :arg veclist: Sequence of 3D positions.\n"
|
||||
" :type veclist: Sequence[Sequence[float]]\n"
|
||||
" :arg pt: 2D or 3D position."
|
||||
" :type pt: Sequence[float]"
|
||||
" :return: list of per-vector weights.\n"
|
||||
" :rtype: list[float]\n");
|
||||
static PyObject *M_Interpolate_poly_3d_calc(PyObject * /*self*/, PyObject *args)
|
||||
{
|
||||
float fp[3];
|
||||
|
||||
@@ -115,7 +115,7 @@ PyDoc_STRVAR(
|
||||
" Insert a point into the KDTree.\n"
|
||||
"\n"
|
||||
" :arg co: Point 3d position.\n"
|
||||
" :type co: float triplet\n"
|
||||
" :type co: Sequence[float]\n"
|
||||
" :arg index: The index of the point.\n"
|
||||
" :type index: int\n");
|
||||
static PyObject *py_kdtree_insert(PyKDTree *self, PyObject *args, PyObject *kwargs)
|
||||
@@ -202,13 +202,13 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" Find nearest point to ``co``.\n"
|
||||
"\n"
|
||||
" :arg co: 3d coordinates.\n"
|
||||
" :type co: float triplet\n"
|
||||
" :arg co: 3D coordinates.\n"
|
||||
" :type co: Sequence[float]\n"
|
||||
" :arg filter: function which takes an index and returns True for indices to "
|
||||
"include in the search.\n"
|
||||
" :type filter: callable\n"
|
||||
" :return: Returns (:class:`Vector`, index, distance).\n"
|
||||
" :rtype: :class:`tuple`\n");
|
||||
" :type filter: Callable[[int], bool]\n"
|
||||
" :return: Returns (position, index, distance).\n"
|
||||
" :rtype: tuple[:class:`Vector`, int, float]\n");
|
||||
static PyObject *py_kdtree_find(PyKDTree *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
PyObject *py_co, *py_filter = nullptr;
|
||||
@@ -259,12 +259,12 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" Find nearest ``n`` points to ``co``.\n"
|
||||
"\n"
|
||||
" :arg co: 3d coordinates.\n"
|
||||
" :type co: float triplet\n"
|
||||
" :arg co: 3D coordinates.\n"
|
||||
" :type co: Sequence[float]\n"
|
||||
" :arg n: Number of points to find.\n"
|
||||
" :type n: int\n"
|
||||
" :return: Returns a list of tuples (:class:`Vector`, index, distance).\n"
|
||||
" :rtype: :class:`list`\n");
|
||||
" :return: Returns a list of tuples (position, index, distance).\n"
|
||||
" :rtype: list[tuple[:class:`Vector`, int, float]]\n");
|
||||
static PyObject *py_kdtree_find_n(PyKDTree *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
PyObject *py_list;
|
||||
@@ -315,12 +315,12 @@ PyDoc_STRVAR(
|
||||
"\n"
|
||||
" Find all points within ``radius`` of ``co``.\n"
|
||||
"\n"
|
||||
" :arg co: 3d coordinates.\n"
|
||||
" :type co: float triplet\n"
|
||||
" :arg co: 3D coordinates.\n"
|
||||
" :type co: Sequence[float]\n"
|
||||
" :arg radius: Distance to search for points.\n"
|
||||
" :type radius: float\n"
|
||||
" :return: Returns a list of tuples (:class:`Vector`, index, distance).\n"
|
||||
" :rtype: :class:`list`\n");
|
||||
" :return: Returns a list of tuples (position, index, distance).\n"
|
||||
" :rtype: list[tuple[:class:`Vector`, int, float]]\n");
|
||||
static PyObject *py_kdtree_find_range(PyKDTree *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
PyObject *py_list;
|
||||
|
||||
@@ -150,13 +150,13 @@ static float frand()
|
||||
"'VORONOI_F1', 'VORONOI_F2', " \
|
||||
"'VORONOI_F3', 'VORONOI_F4', 'VORONOI_F2F1', 'VORONOI_CRACKLE', " \
|
||||
"'CELLNOISE'].\n" \
|
||||
" :type noise_basis: string\n"
|
||||
" :type noise_basis: str\n"
|
||||
|
||||
#define BPY_NOISE_METRIC_ENUM_DOC \
|
||||
" :arg distance_metric: Enumerator in ['DISTANCE', 'DISTANCE_SQUARED', 'MANHATTAN', " \
|
||||
"'CHEBYCHEV', " \
|
||||
"'MINKOVSKY', 'MINKOVSKY_HALF', 'MINKOVSKY_FOUR'].\n" \
|
||||
" :type distance_metric: string\n"
|
||||
" :type distance_metric: str\n"
|
||||
|
||||
/* Noise basis enum */
|
||||
#define DEFAULT_NOISE_TYPE TEX_STDPERLIN
|
||||
@@ -487,7 +487,7 @@ PyDoc_STRVAR(
|
||||
" :type octaves: int\n"
|
||||
" :arg hard: Specifies whether returned turbulence is hard (sharp transitions) or "
|
||||
"soft (smooth transitions).\n"
|
||||
" :type hard: boolean\n" BPY_NOISE_BASIS_ENUM_DOC
|
||||
" :type hard: bool\n" BPY_NOISE_BASIS_ENUM_DOC
|
||||
" :arg amplitude_scale: The amplitude scaling factor.\n"
|
||||
" :type amplitude_scale: float\n"
|
||||
" :arg frequency_scale: The frequency scaling factor\n"
|
||||
@@ -548,7 +548,7 @@ PyDoc_STRVAR(
|
||||
" :type octaves: int\n"
|
||||
" :arg hard: Specifies whether returned turbulence is hard (sharp transitions) or "
|
||||
"soft (smooth transitions).\n"
|
||||
" :type hard: boolean\n" BPY_NOISE_BASIS_ENUM_DOC
|
||||
" :type hard: bool\n" BPY_NOISE_BASIS_ENUM_DOC
|
||||
" :arg amplitude_scale: The amplitude scaling factor.\n"
|
||||
" :type amplitude_scale: float\n"
|
||||
" :arg frequency_scale: The frequency scaling factor\n"
|
||||
@@ -722,12 +722,12 @@ PyDoc_STRVAR(
|
||||
"'VORONOI_F1', 'VORONOI_F2', "
|
||||
"'VORONOI_F3', 'VORONOI_F4', 'VORONOI_F2F1', 'VORONOI_CRACKLE', "
|
||||
"'CELLNOISE'].\n"
|
||||
" :type noise_type1: string\n"
|
||||
" :type noise_type1: str\n"
|
||||
" :arg noise_type2: Enumerator in ['BLENDER', 'PERLIN_ORIGINAL', 'PERLIN_NEW', "
|
||||
"'VORONOI_F1', 'VORONOI_F2', "
|
||||
"'VORONOI_F3', 'VORONOI_F4', 'VORONOI_F2F1', 'VORONOI_CRACKLE', "
|
||||
"'CELLNOISE'].\n"
|
||||
" :type noise_type2: string\n"
|
||||
" :type noise_type2: str\n"
|
||||
" :return: The variable lacunarity noise value.\n"
|
||||
" :rtype: float\n");
|
||||
static PyObject *M_Noise_variable_lacunarity(PyObject * /*self*/, PyObject *args, PyObject *kw)
|
||||
@@ -980,7 +980,7 @@ PyDoc_STRVAR(
|
||||
" :arg exponent: The exponent for Minkowski distance metric.\n"
|
||||
" :type exponent: float\n"
|
||||
" :return: A list of distances to the four closest features and their locations.\n"
|
||||
" :rtype: list of four floats, list of four :class:`mathutils.Vector` types\n");
|
||||
" :rtype: list[list[float], list[:class:`mathutils.Vector`]]\n");
|
||||
static PyObject *M_Noise_voronoi(PyObject * /*self*/, PyObject *args, PyObject *kw)
|
||||
{
|
||||
static const char *kwlist[] = {"", "distance_metric", "exponent", nullptr};
|
||||
|
||||
Reference in New Issue
Block a user