use PyDoc_STRVAR macro, so its possible to build without docstrings.
This commit is contained in:
@@ -64,14 +64,14 @@
|
||||
|
||||
PyObject *bpy_package_py= NULL;
|
||||
|
||||
static char bpy_script_paths_doc[] =
|
||||
PyDoc_STRVAR(bpy_script_paths_doc,
|
||||
".. function:: script_paths()\n"
|
||||
"\n"
|
||||
" 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"
|
||||
;
|
||||
);
|
||||
static PyObject *bpy_script_paths(PyObject *UNUSED(self))
|
||||
{
|
||||
PyObject *ret= PyTuple_New(2);
|
||||
@@ -85,7 +85,7 @@ static PyObject *bpy_script_paths(PyObject *UNUSED(self))
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char bpy_blend_paths_doc[] =
|
||||
PyDoc_STRVAR(bpy_blend_paths_doc,
|
||||
".. function:: blend_paths(absolute=False)\n"
|
||||
"\n"
|
||||
" Returns a list of paths to external files referenced by the loaded .blend file.\n"
|
||||
@@ -94,7 +94,7 @@ static char bpy_blend_paths_doc[] =
|
||||
" :type absolute: boolean\n"
|
||||
" :return: path list.\n"
|
||||
" :rtype: list of strings\n"
|
||||
;
|
||||
);
|
||||
static PyObject *bpy_blend_paths(PyObject *UNUSED(self), PyObject *args, PyObject *kw)
|
||||
{
|
||||
struct BPathIterator *bpi;
|
||||
@@ -137,7 +137,7 @@ static PyObject *bpy_blend_paths(PyObject *UNUSED(self), PyObject *args, PyObjec
|
||||
}
|
||||
|
||||
|
||||
// static char bpy_user_resource_doc[]= // now in bpy/utils.py
|
||||
// PyDoc_STRVAR(bpy_user_resource_doc[]= // now in bpy/utils.py
|
||||
static PyObject *bpy_user_resource(PyObject *UNUSED(self), PyObject *args, PyObject *kw)
|
||||
{
|
||||
char *type;
|
||||
@@ -169,7 +169,7 @@ static PyObject *bpy_user_resource(PyObject *UNUSED(self), PyObject *args, PyObj
|
||||
return PyUnicode_DecodeFSDefault(path ? path : "");
|
||||
}
|
||||
|
||||
static char bpy_resource_path_doc[] =
|
||||
PyDoc_STRVAR(bpy_resource_path_doc,
|
||||
".. function:: resource_path(type, major=2, minor=57)\n"
|
||||
"\n"
|
||||
" Return the base path for storing system files.\n"
|
||||
@@ -182,7 +182,7 @@ static char bpy_resource_path_doc[] =
|
||||
" :type minor: string\n"
|
||||
" :return: the resource path (not necessarily existing).\n"
|
||||
" :rtype: string\n"
|
||||
;
|
||||
);
|
||||
static PyObject *bpy_resource_path(PyObject *UNUSED(self), PyObject *args, PyObject *kw)
|
||||
{
|
||||
char *type;
|
||||
|
||||
@@ -163,7 +163,7 @@ static PyTypeObject bpy_lib_Type= {
|
||||
NULL
|
||||
};
|
||||
|
||||
static char bpy_lib_load_doc[] =
|
||||
PyDoc_STRVAR(bpy_lib_load_doc,
|
||||
".. method:: load(filepath, link=False, relative=False)\n"
|
||||
"\n"
|
||||
" Returns a context manager which exposes 2 library objects on entering.\n"
|
||||
@@ -175,7 +175,7 @@ static char bpy_lib_load_doc[] =
|
||||
" :type link: bool\n"
|
||||
" :arg relative: When True the path is stored relative to the open blend file.\n"
|
||||
" :type relative: bool\n"
|
||||
;
|
||||
);
|
||||
static PyObject *bpy_lib_load(PyObject *UNUSED(self), PyObject *args, PyObject *kwds)
|
||||
{
|
||||
static const char *kwlist[]= {"filepath", "link", "relative", NULL};
|
||||
|
||||
@@ -194,7 +194,7 @@ static int bpy_struct_id_used(StructRNA *srna, char *identifier)
|
||||
|
||||
/* Function that sets RNA, NOTE - self is NULL when called from python, but being abused from C so we can pass the srna allong
|
||||
* This isnt incorrect since its a python object - but be careful */
|
||||
static char BPy_BoolProperty_doc[] =
|
||||
PyDoc_STRVAR(BPy_BoolProperty_doc,
|
||||
".. function:: BoolProperty(name=\"\", description=\"\", default=False, options={'ANIMATABLE'}, subtype='NONE')\n"
|
||||
"\n"
|
||||
" Returns a new boolean property definition.\n"
|
||||
@@ -205,7 +205,7 @@ BPY_PROPDEF_DESC_DOC
|
||||
" :type options: set\n"
|
||||
" :arg subtype: Enumerator in ['UNSIGNED', 'PERCENTAGE', 'FACTOR', 'ANGLE', 'TIME', 'DISTANCE', 'NONE'].\n"
|
||||
" :type subtype: string\n"
|
||||
;
|
||||
);
|
||||
static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -248,7 +248,7 @@ static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char BPy_BoolVectorProperty_doc[] =
|
||||
PyDoc_STRVAR(BPy_BoolVectorProperty_doc,
|
||||
".. function:: BoolVectorProperty(name=\"\", description=\"\", default=(False, False, False), options={'ANIMATABLE'}, subtype='NONE', size=3)\n"
|
||||
"\n"
|
||||
" Returns a new vector boolean property definition.\n"
|
||||
@@ -263,7 +263,7 @@ BPY_PROPDEF_DESC_DOC
|
||||
" :type subtype: string\n"
|
||||
" :arg size: Vector dimensions in [1, and " STRINGIFY(PYRNA_STACK_ARRAY) "].\n"
|
||||
" :type size: int\n"
|
||||
;
|
||||
);
|
||||
static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -318,7 +318,7 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char BPy_IntProperty_doc[] =
|
||||
PyDoc_STRVAR(BPy_IntProperty_doc,
|
||||
".. function:: IntProperty(name=\"\", description=\"\", default=0, min=-sys.maxint, max=sys.maxint, soft_min=-sys.maxint, soft_max=sys.maxint, step=1, options={'ANIMATABLE'}, subtype='NONE')\n"
|
||||
"\n"
|
||||
" Returns a new int property definition.\n"
|
||||
@@ -329,7 +329,7 @@ BPY_PROPDEF_DESC_DOC
|
||||
" :type options: set\n"
|
||||
" :arg subtype: Enumerator in ['UNSIGNED', 'PERCENTAGE', 'FACTOR', 'ANGLE', 'TIME', 'DISTANCE', 'NONE'].\n"
|
||||
" :type subtype: string\n"
|
||||
;
|
||||
);
|
||||
static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -374,7 +374,7 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char BPy_IntVectorProperty_doc[] =
|
||||
PyDoc_STRVAR(BPy_IntVectorProperty_doc,
|
||||
".. function:: IntVectorProperty(name=\"\", description=\"\", default=(0, 0, 0), min=-sys.maxint, max=sys.maxint, soft_min=-sys.maxint, soft_max=sys.maxint, options={'ANIMATABLE'}, subtype='NONE', size=3)\n"
|
||||
"\n"
|
||||
" Returns a new vector int property definition.\n"
|
||||
@@ -389,7 +389,7 @@ BPY_PROPDEF_DESC_DOC
|
||||
" :type subtype: string\n"
|
||||
" :arg size: Vector dimensions in [1, and " STRINGIFY(PYRNA_STACK_ARRAY) "].\n"
|
||||
" :type size: int\n"
|
||||
;
|
||||
);
|
||||
static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -447,7 +447,7 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject
|
||||
}
|
||||
|
||||
|
||||
static char BPy_FloatProperty_doc[] =
|
||||
PyDoc_STRVAR(BPy_FloatProperty_doc,
|
||||
".. function:: FloatProperty(name=\"\", description=\"\", default=0.0, min=sys.float_info.min, max=sys.float_info.max, soft_min=sys.float_info.min, soft_max=sys.float_info.max, step=3, precision=2, options={'ANIMATABLE'}, subtype='NONE', unit='NONE')\n"
|
||||
"\n"
|
||||
" Returns a new float property definition.\n"
|
||||
@@ -460,7 +460,7 @@ BPY_PROPDEF_DESC_DOC
|
||||
" :type subtype: string\n"
|
||||
" :arg unit: Enumerator in ['NONE', 'LENGTH', 'AREA', 'VOLUME', 'ROTATION', 'TIME', 'VELOCITY', 'ACCELERATION'].\n"
|
||||
" :type unit: string\n"
|
||||
;
|
||||
);
|
||||
static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -514,7 +514,7 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char BPy_FloatVectorProperty_doc[] =
|
||||
PyDoc_STRVAR(BPy_FloatVectorProperty_doc,
|
||||
".. function:: FloatVectorProperty(name=\"\", description=\"\", default=(0.0, 0.0, 0.0), min=sys.float_info.min, max=sys.float_info.max, soft_min=sys.float_info.min, soft_max=sys.float_info.max, step=3, precision=2, options={'ANIMATABLE'}, subtype='NONE', size=3)\n"
|
||||
"\n"
|
||||
" Returns a new vector float property definition.\n"
|
||||
@@ -529,7 +529,7 @@ BPY_PROPDEF_DESC_DOC
|
||||
" :type subtype: string\n"
|
||||
" :arg size: Vector dimensions in [1, and " STRINGIFY(PYRNA_STACK_ARRAY) "].\n"
|
||||
" :type size: int\n"
|
||||
;
|
||||
);
|
||||
static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -586,7 +586,7 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char BPy_StringProperty_doc[] =
|
||||
PyDoc_STRVAR(BPy_StringProperty_doc,
|
||||
".. function:: StringProperty(name=\"\", description=\"\", default=\"\", maxlen=0, options={'ANIMATABLE'}, subtype='NONE')\n"
|
||||
"\n"
|
||||
" Returns a new string property definition.\n"
|
||||
@@ -597,7 +597,7 @@ BPY_PROPDEF_DESC_DOC
|
||||
" :type options: set\n"
|
||||
" :arg subtype: Enumerator in ['FILE_PATH', 'DIR_PATH', 'FILENAME', 'NONE'].\n"
|
||||
" :type subtype: string\n"
|
||||
;
|
||||
);
|
||||
static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -741,7 +741,7 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i
|
||||
return items;
|
||||
}
|
||||
|
||||
static char BPy_EnumProperty_doc[] =
|
||||
PyDoc_STRVAR(BPy_EnumProperty_doc,
|
||||
".. function:: EnumProperty(items, name=\"\", description=\"\", default=\"\", options={'ANIMATABLE'})\n"
|
||||
"\n"
|
||||
" Returns a new enumerator property definition.\n"
|
||||
@@ -754,7 +754,7 @@ BPY_PROPDEF_DESC_DOC
|
||||
" :type options: set\n"
|
||||
" :arg items: sequence of enum items formatted: [(identifier, name, description), ...] where the identifier is used for python access and other values are used for the interface.\n"
|
||||
" :type items: sequence of string triplets\n"
|
||||
;
|
||||
);
|
||||
static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -840,7 +840,7 @@ static StructRNA *pointer_type_from_py(PyObject *value, const char *error_prefix
|
||||
return srna;
|
||||
}
|
||||
|
||||
static char BPy_PointerProperty_doc[] =
|
||||
PyDoc_STRVAR(BPy_PointerProperty_doc,
|
||||
".. function:: PointerProperty(type=\"\", description=\"\", options={'ANIMATABLE'})\n"
|
||||
"\n"
|
||||
" Returns a new pointer property definition.\n"
|
||||
@@ -851,7 +851,7 @@ BPY_PROPDEF_NAME_DOC
|
||||
BPY_PROPDEF_DESC_DOC
|
||||
" :arg options: Enumerator in ['HIDDEN', 'ANIMATABLE'].\n"
|
||||
" :type options: set\n"
|
||||
;
|
||||
);
|
||||
static PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -893,7 +893,7 @@ static PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *k
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char BPy_CollectionProperty_doc[] =
|
||||
PyDoc_STRVAR(BPy_CollectionProperty_doc,
|
||||
".. function:: CollectionProperty(items, type=\"\", description=\"\", default=\"\", options={'ANIMATABLE'})\n"
|
||||
"\n"
|
||||
" Returns a new collection property definition.\n"
|
||||
@@ -904,7 +904,7 @@ BPY_PROPDEF_NAME_DOC
|
||||
BPY_PROPDEF_DESC_DOC
|
||||
" :arg options: Enumerator in ['HIDDEN', 'ANIMATABLE'].\n"
|
||||
" :type options: set\n"
|
||||
;
|
||||
);
|
||||
static PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
@@ -946,14 +946,14 @@ static PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char BPy_RemoveProperty_doc[] =
|
||||
PyDoc_STRVAR(BPy_RemoveProperty_doc,
|
||||
".. function:: RemoveProperty(attr)\n"
|
||||
"\n"
|
||||
" Removes a dynamically defined property.\n"
|
||||
"\n"
|
||||
" :arg attr: Property name.\n"
|
||||
" :type attr: string\n"
|
||||
;
|
||||
);
|
||||
static PyObject *BPy_RemoveProperty(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
StructRNA *srna;
|
||||
|
||||
@@ -2527,7 +2527,7 @@ static PyMappingMethods pyrna_struct_as_mapping= {
|
||||
(objobjargproc) pyrna_struct_ass_subscript, /* mp_ass_subscript */
|
||||
};
|
||||
|
||||
static char pyrna_struct_keys_doc[] =
|
||||
PyDoc_STRVAR(pyrna_struct_keys_doc,
|
||||
".. method:: keys()\n"
|
||||
"\n"
|
||||
" Returns the keys of this objects custom properties (matches pythons dictionary function of the same name).\n"
|
||||
@@ -2535,8 +2535,8 @@ static char pyrna_struct_keys_doc[] =
|
||||
" :return: custom property keys.\n"
|
||||
" :rtype: list of strings\n"
|
||||
"\n"
|
||||
" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone` classes support custom properties.\n";
|
||||
|
||||
" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone` classes support custom properties.\n"
|
||||
);
|
||||
static PyObject *pyrna_struct_keys(BPy_PropertyRNA *self)
|
||||
{
|
||||
IDProperty *group;
|
||||
@@ -2554,7 +2554,7 @@ static PyObject *pyrna_struct_keys(BPy_PropertyRNA *self)
|
||||
return BPy_Wrap_GetKeys(group);
|
||||
}
|
||||
|
||||
static char pyrna_struct_items_doc[] =
|
||||
PyDoc_STRVAR(pyrna_struct_items_doc,
|
||||
".. method:: items()\n"
|
||||
"\n"
|
||||
" Returns the items of this objects custom properties (matches pythons dictionary function of the same name).\n"
|
||||
@@ -2562,8 +2562,8 @@ static char pyrna_struct_items_doc[] =
|
||||
" :return: custom property key, value pairs.\n"
|
||||
" :rtype: list of key, value tuples\n"
|
||||
"\n"
|
||||
" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone` classes support custom properties.\n";
|
||||
|
||||
" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone` classes support custom properties.\n"
|
||||
);
|
||||
static PyObject *pyrna_struct_items(BPy_PropertyRNA *self)
|
||||
{
|
||||
IDProperty *group;
|
||||
@@ -2581,7 +2581,7 @@ static PyObject *pyrna_struct_items(BPy_PropertyRNA *self)
|
||||
return BPy_Wrap_GetItems(self->ptr.id.data, group);
|
||||
}
|
||||
|
||||
static char pyrna_struct_values_doc[] =
|
||||
PyDoc_STRVAR(pyrna_struct_values_doc,
|
||||
".. method:: values()\n"
|
||||
"\n"
|
||||
" Returns the values of this objects custom properties (matches pythons dictionary function of the same name).\n"
|
||||
@@ -2589,8 +2589,8 @@ static char pyrna_struct_values_doc[] =
|
||||
" :return: custom property values.\n"
|
||||
" :rtype: list\n"
|
||||
"\n"
|
||||
" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone` classes support custom properties.\n";
|
||||
|
||||
" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone` classes support custom properties.\n"
|
||||
);
|
||||
static PyObject *pyrna_struct_values(BPy_PropertyRNA *self)
|
||||
{
|
||||
IDProperty *group;
|
||||
@@ -2609,14 +2609,14 @@ static PyObject *pyrna_struct_values(BPy_PropertyRNA *self)
|
||||
}
|
||||
|
||||
|
||||
static char pyrna_struct_is_property_set_doc[] =
|
||||
PyDoc_STRVAR(pyrna_struct_is_property_set_doc,
|
||||
".. method:: is_property_set(property)\n"
|
||||
"\n"
|
||||
" Check if a property is set, use for testing operator properties.\n"
|
||||
"\n"
|
||||
" :return: True when the property has been set.\n"
|
||||
" :rtype: boolean\n"
|
||||
;
|
||||
);
|
||||
static PyObject *pyrna_struct_is_property_set(BPy_StructRNA *self, PyObject *args)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
@@ -2653,14 +2653,14 @@ static PyObject *pyrna_struct_is_property_set(BPy_StructRNA *self, PyObject *arg
|
||||
return PyBool_FromLong(ret);
|
||||
}
|
||||
|
||||
static char pyrna_struct_is_property_hidden_doc[] =
|
||||
PyDoc_STRVAR(pyrna_struct_is_property_hidden_doc,
|
||||
".. method:: is_property_hidden(property)\n"
|
||||
"\n"
|
||||
" Check if a property is hidden.\n"
|
||||
"\n"
|
||||
" :return: True when the property is hidden.\n"
|
||||
" :rtype: boolean\n"
|
||||
;
|
||||
);
|
||||
static PyObject *pyrna_struct_is_property_hidden(BPy_StructRNA *self, PyObject *args)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
@@ -2681,7 +2681,7 @@ static PyObject *pyrna_struct_is_property_hidden(BPy_StructRNA *self, PyObject *
|
||||
return PyBool_FromLong(RNA_property_flag(prop) & PROP_HIDDEN);
|
||||
}
|
||||
|
||||
static char pyrna_struct_path_resolve_doc[] =
|
||||
PyDoc_STRVAR(pyrna_struct_path_resolve_doc,
|
||||
".. method:: path_resolve(path, coerce=True)\n"
|
||||
"\n"
|
||||
" Returns the property from the path, raise an exception when not found.\n"
|
||||
@@ -2690,7 +2690,7 @@ static char pyrna_struct_path_resolve_doc[] =
|
||||
" :type path: string\n"
|
||||
" :arg coerce: optional argument, when True, the property will be converted into its python representation.\n"
|
||||
" :type coerce: boolean\n"
|
||||
;
|
||||
);
|
||||
static PyObject *pyrna_struct_path_resolve(BPy_StructRNA *self, PyObject *args)
|
||||
{
|
||||
const char *path;
|
||||
@@ -2738,7 +2738,7 @@ static PyObject *pyrna_struct_path_resolve(BPy_StructRNA *self, PyObject *args)
|
||||
}
|
||||
}
|
||||
|
||||
static char pyrna_struct_path_from_id_doc[] =
|
||||
PyDoc_STRVAR(pyrna_struct_path_from_id_doc,
|
||||
".. method:: path_from_id(property=\"\")\n"
|
||||
"\n"
|
||||
" Returns the data path from the ID to this object (string).\n"
|
||||
@@ -2747,7 +2747,7 @@ static char pyrna_struct_path_from_id_doc[] =
|
||||
" :type property: string\n"
|
||||
" :return: The path from :class:`bpy_struct.id_data` to this struct and property (when given).\n"
|
||||
" :rtype: str\n"
|
||||
;
|
||||
);
|
||||
static PyObject *pyrna_struct_path_from_id(BPy_StructRNA *self, PyObject *args)
|
||||
{
|
||||
const char *name= NULL;
|
||||
@@ -2795,14 +2795,14 @@ static PyObject *pyrna_struct_path_from_id(BPy_StructRNA *self, PyObject *args)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char pyrna_prop_path_from_id_doc[] =
|
||||
PyDoc_STRVAR(pyrna_prop_path_from_id_doc,
|
||||
".. method:: path_from_id()\n"
|
||||
"\n"
|
||||
" Returns the data path from the ID to this property (string).\n"
|
||||
"\n"
|
||||
" :return: The path from :class:`bpy_struct.id_data` to this property.\n"
|
||||
" :rtype: str\n"
|
||||
;
|
||||
);
|
||||
static PyObject *pyrna_prop_path_from_id(BPy_PropertyRNA *self)
|
||||
{
|
||||
const char *path;
|
||||
@@ -2824,14 +2824,14 @@ static PyObject *pyrna_prop_path_from_id(BPy_PropertyRNA *self)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char pyrna_struct_type_recast_doc[] =
|
||||
PyDoc_STRVAR(pyrna_struct_type_recast_doc,
|
||||
".. method:: type_recast()\n"
|
||||
"\n"
|
||||
" Return a new instance, this is needed because types 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_struct`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *pyrna_struct_type_recast(BPy_StructRNA *self)
|
||||
{
|
||||
PointerRNA r_ptr;
|
||||
@@ -3434,14 +3434,14 @@ static PyGetSetDef pyrna_struct_getseters[]= {
|
||||
{NULL, NULL, NULL, NULL, NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
static char pyrna_prop_collection_keys_doc[] =
|
||||
PyDoc_STRVAR(pyrna_prop_collection_keys_doc,
|
||||
".. method:: keys()\n"
|
||||
"\n"
|
||||
" Return the identifiers of collection members (matching pythons dict.keys() functionality).\n"
|
||||
"\n"
|
||||
" :return: the identifiers for each member of this collection.\n"
|
||||
" :rtype: list of stings\n"
|
||||
;
|
||||
);
|
||||
static PyObject *pyrna_prop_collection_keys(BPy_PropertyRNA *self)
|
||||
{
|
||||
PyObject *ret= PyList_New(0);
|
||||
@@ -3467,14 +3467,14 @@ static PyObject *pyrna_prop_collection_keys(BPy_PropertyRNA *self)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char pyrna_prop_collection_items_doc[] =
|
||||
PyDoc_STRVAR(pyrna_prop_collection_items_doc,
|
||||
".. method:: items()\n"
|
||||
"\n"
|
||||
" Return the identifiers of collection members (matching pythons dict.items() functionality).\n"
|
||||
"\n"
|
||||
" :return: (key, value) pairs for each member of this collection.\n"
|
||||
" :rtype: list of tuples\n"
|
||||
;
|
||||
);
|
||||
static PyObject *pyrna_prop_collection_items(BPy_PropertyRNA *self)
|
||||
{
|
||||
PyObject *ret= PyList_New(0);
|
||||
@@ -3508,21 +3508,21 @@ static PyObject *pyrna_prop_collection_items(BPy_PropertyRNA *self)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char pyrna_prop_collection_values_doc[] =
|
||||
PyDoc_STRVAR(pyrna_prop_collection_values_doc,
|
||||
".. method:: values()\n"
|
||||
"\n"
|
||||
" Return the values of collection (matching pythons dict.values() functionality).\n"
|
||||
"\n"
|
||||
" :return: the members of this collection.\n"
|
||||
" :rtype: list\n"
|
||||
;
|
||||
);
|
||||
static PyObject *pyrna_prop_collection_values(BPy_PropertyRNA *self)
|
||||
{
|
||||
/* re-use slice*/
|
||||
return pyrna_prop_collection_subscript_slice(self, 0, PY_SSIZE_T_MAX);
|
||||
}
|
||||
|
||||
static char pyrna_struct_get_doc[] =
|
||||
PyDoc_STRVAR(pyrna_struct_get_doc,
|
||||
".. method:: get(key, default=None)\n"
|
||||
"\n"
|
||||
" Returns the value of the custom property assigned to key or default when not found (matches pythons dictionary function of the same name).\n"
|
||||
@@ -3533,7 +3533,7 @@ static char pyrna_struct_get_doc[] =
|
||||
" :type default: Undefined\n"
|
||||
"\n"
|
||||
" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone` classes support custom properties.\n"
|
||||
;
|
||||
);
|
||||
static PyObject *pyrna_struct_get(BPy_StructRNA *self, PyObject *args)
|
||||
{
|
||||
IDProperty *group, *idprop;
|
||||
@@ -3563,7 +3563,7 @@ static PyObject *pyrna_struct_get(BPy_StructRNA *self, PyObject *args)
|
||||
return Py_INCREF(def), def;
|
||||
}
|
||||
|
||||
static char pyrna_struct_as_pointer_doc[] =
|
||||
PyDoc_STRVAR(pyrna_struct_as_pointer_doc,
|
||||
".. method:: as_pointer()\n"
|
||||
"\n"
|
||||
" Returns the memory address which holds a pointer to blenders internal data\n"
|
||||
@@ -3572,13 +3572,13 @@ static char pyrna_struct_as_pointer_doc[] =
|
||||
" :rtype: int\n"
|
||||
"\n"
|
||||
" .. note:: This is intended only for advanced script writers who need to pass blender data to their own C/Python modules.\n"
|
||||
;
|
||||
);
|
||||
static PyObject *pyrna_struct_as_pointer(BPy_StructRNA *self)
|
||||
{
|
||||
return PyLong_FromVoidPtr(self->ptr.data);
|
||||
}
|
||||
|
||||
static char pyrna_prop_collection_get_doc[] =
|
||||
PyDoc_STRVAR(pyrna_prop_collection_get_doc,
|
||||
".. method:: get(key, default=None)\n"
|
||||
"\n"
|
||||
" Returns the value of the item assigned to key or default when not found (matches pythons dictionary function of the same name).\n"
|
||||
@@ -3587,7 +3587,7 @@ static char pyrna_prop_collection_get_doc[] =
|
||||
" :type key: string\n"
|
||||
" :arg default: Optional argument for the value to return if *key* is not found.\n"
|
||||
" :type default: Undefined\n"
|
||||
;
|
||||
);
|
||||
static PyObject *pyrna_prop_collection_get(BPy_PropertyRNA *self, PyObject *args)
|
||||
{
|
||||
PointerRNA newptr;
|
||||
@@ -3851,7 +3851,7 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char pyrna_prop_collection_foreach_get_doc[] =
|
||||
PyDoc_STRVAR(pyrna_prop_collection_foreach_get_doc,
|
||||
".. method:: foreach_get(attr, seq)\n"
|
||||
"\n"
|
||||
" This is a function to give fast access to attributes within a collection.\n"
|
||||
@@ -3863,7 +3863,7 @@ static char pyrna_prop_collection_foreach_get_doc[] =
|
||||
" # Python equivalent\n"
|
||||
" for i in range(len(seq)): someseq[i]= getattr(collection, attr)\n"
|
||||
"\n"
|
||||
;
|
||||
);
|
||||
static PyObject *pyrna_prop_collection_foreach_get(BPy_PropertyRNA *self, PyObject *args)
|
||||
{
|
||||
PYRNA_PROP_CHECK_OBJ(self)
|
||||
@@ -3871,7 +3871,7 @@ static PyObject *pyrna_prop_collection_foreach_get(BPy_PropertyRNA *self, PyObje
|
||||
return foreach_getset(self, args, 0);
|
||||
}
|
||||
|
||||
static char pyrna_prop_collection_foreach_set_doc[] =
|
||||
PyDoc_STRVAR(pyrna_prop_collection_foreach_set_doc,
|
||||
".. method:: foreach_set(attr, seq)\n"
|
||||
"\n"
|
||||
" This is a function to give fast access to attributes within a collection.\n"
|
||||
@@ -3883,7 +3883,7 @@ static char pyrna_prop_collection_foreach_set_doc[] =
|
||||
" # Python equivalent\n"
|
||||
" for i in range(len(seq)): setattr(collection[i], attr, seq[i])\n"
|
||||
"\n"
|
||||
;
|
||||
);
|
||||
static PyObject *pyrna_prop_collection_foreach_set(BPy_PropertyRNA *self, PyObject *args)
|
||||
{
|
||||
PYRNA_PROP_CHECK_OBJ(self)
|
||||
@@ -6359,7 +6359,7 @@ void pyrna_free_types(void)
|
||||
* the decref. This is not so bad because the leak only happens when re-registering (hold F8)
|
||||
* - Should still be fixed - Campbell
|
||||
* */
|
||||
static char pyrna_register_class_doc[] =
|
||||
PyDoc_STRVAR(pyrna_register_class_doc,
|
||||
".. method:: register_class(cls)\n"
|
||||
"\n"
|
||||
" Register a subclass of a blender type in (:class:`Panel`, :class:`Menu`, :class:`Header`, :class:`Operator`, :class:`KeyingSetInfo`, :class:`RenderEngine`).\n"
|
||||
@@ -6368,7 +6368,7 @@ static char pyrna_register_class_doc[] =
|
||||
"\n"
|
||||
" .. note:: :exc:`ValueError` exception is raised if the class is not a subclass of a registerable blender class.\n"
|
||||
"\n"
|
||||
;
|
||||
);
|
||||
PyMethodDef meth_bpy_register_class= {"register_class", pyrna_register_class, METH_O, pyrna_register_class_doc};
|
||||
static PyObject *pyrna_register_class(PyObject *UNUSED(self), PyObject *py_class)
|
||||
{
|
||||
@@ -6487,13 +6487,13 @@ static int pyrna_srna_contains_pointer_prop_srna(StructRNA *srna_props, StructRN
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char pyrna_unregister_class_doc[] =
|
||||
PyDoc_STRVAR(pyrna_unregister_class_doc,
|
||||
".. method:: unregister_class(cls)\n"
|
||||
"\n"
|
||||
" Unload the python class from blender.\n"
|
||||
"\n"
|
||||
" If the class has an *unregister* class method it will be called before unregistering.\n"
|
||||
;
|
||||
);
|
||||
PyMethodDef meth_bpy_unregister_class= {"unregister_class", pyrna_unregister_class, METH_O, pyrna_unregister_class_doc};
|
||||
static PyObject *pyrna_unregister_class(PyObject *UNUSED(self), PyObject *py_class)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user