| 
									
										
										
										
											2011-02-23 10:52:22 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  |  * This program is free software; you can redistribute it and/or | 
					
						
							|  |  |  |  * modify it under the terms of the GNU General Public License | 
					
						
							|  |  |  |  * as published by the Free Software Foundation; either version 2 | 
					
						
							|  |  |  |  * of the License, or (at your option) any later version. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  |  * GNU General Public License for more details. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  |  * along with this program; if not, write to the Free Software Foundation, | 
					
						
							| 
									
										
										
										
											2010-02-12 13:34:04 +00:00
										 |  |  |  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2011-02-27 20:10:08 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-18 08:08:12 +11:00
										 |  |  | /** \file
 | 
					
						
							|  |  |  |  * \ingroup pythonintern | 
					
						
							| 
									
										
										
										
											2011-11-05 08:21:12 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * This file defines the '_bpy' module which is used by python's 'bpy' package | 
					
						
							|  |  |  |  * to access C defined builtin functions. | 
					
						
							|  |  |  |  * A script writer should never directly access this module. | 
					
						
							| 
									
										
										
										
											2011-02-27 20:10:08 +00:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2010-03-03 13:59:57 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-14 04:15:25 +00:00
										 |  |  | #include <Python.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-01-07 05:26:12 +00:00
										 |  |  | #include "BLI_string.h"
 | 
					
						
							| 
									
										
										
										
											2020-03-19 09:33:03 +01:00
										 |  |  | #include "BLI_utildefines.h"
 | 
					
						
							| 
									
										
										
										
											2013-03-07 02:44:55 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-23 14:37:13 +01:00
										 |  |  | #include "BKE_appdir.h"
 | 
					
						
							| 
									
										
										
										
											2016-04-24 22:42:41 +10:00
										 |  |  | #include "BKE_blender_version.h"
 | 
					
						
							| 
									
										
										
										
											2013-01-07 05:26:12 +00:00
										 |  |  | #include "BKE_bpath.h"
 | 
					
						
							| 
									
										
										
										
											2020-03-19 09:33:03 +01:00
										 |  |  | #include "BKE_global.h" /* XXX, G_MAIN only */
 | 
					
						
							| 
									
										
										
										
											2013-01-07 05:26:12 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-07 02:44:55 +00:00
										 |  |  | #include "RNA_access.h"
 | 
					
						
							| 
									
										
										
										
											2020-03-19 09:33:03 +01:00
										 |  |  | #include "RNA_types.h"
 | 
					
						
							| 
									
										
										
										
											2013-01-07 05:26:12 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-09 16:33:24 +02:00
										 |  |  | #include "GPU_state.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-01-07 05:26:12 +00:00
										 |  |  | #include "bpy.h"
 | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  | #include "bpy_app.h"
 | 
					
						
							| 
									
										
										
										
											2020-03-19 09:33:03 +01:00
										 |  |  | #include "bpy_capi_utils.h"
 | 
					
						
							| 
									
										
										
										
											2012-09-15 01:52:28 +00:00
										 |  |  | #include "bpy_library.h"
 | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  | #include "bpy_operator.h"
 | 
					
						
							| 
									
										
										
										
											2020-03-19 09:33:03 +01:00
										 |  |  | #include "bpy_props.h"
 | 
					
						
							|  |  |  | #include "bpy_rna.h"
 | 
					
						
							| 
									
										
										
										
											2021-03-09 01:01:31 +11:00
										 |  |  | #include "bpy_rna_data.h"
 | 
					
						
							| 
									
										
										
										
											2020-03-19 09:33:03 +01:00
										 |  |  | #include "bpy_rna_gizmo.h"
 | 
					
						
							|  |  |  | #include "bpy_rna_id_collection.h"
 | 
					
						
							| 
									
										
										
										
											2020-05-13 15:05:09 +10:00
										 |  |  | #include "bpy_rna_types_capi.h"
 | 
					
						
							| 
									
										
										
										
											2015-05-11 16:29:12 +02:00
										 |  |  | #include "bpy_utils_previews.h"
 | 
					
						
							| 
									
										
										
										
											2014-06-17 16:03:40 +02:00
										 |  |  | #include "bpy_utils_units.h"
 | 
					
						
							| 
									
										
										
										
											2010-05-11 07:08:32 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-08-11 17:53:42 +10:00
										 |  |  | #include "../generic/py_capi_utils.h"
 | 
					
						
							| 
									
										
										
										
											2015-01-06 17:39:47 +11:00
										 |  |  | #include "../generic/python_utildefines.h"
 | 
					
						
							| 
									
										
										
										
											2014-08-11 17:53:42 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-26 20:41:54 +00:00
										 |  |  | /* external util modules */ | 
					
						
							| 
									
										
										
										
											2011-11-15 09:28:15 +00:00
										 |  |  | #include "../generic/idprop_py_api.h"
 | 
					
						
							| 
									
										
										
										
											2017-11-13 19:43:34 +11:00
										 |  |  | #include "bpy_msgbus.h"
 | 
					
						
							| 
									
										
										
										
											2010-02-13 01:13:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-12-20 07:57:26 +00:00
										 |  |  | #ifdef WITH_FREESTYLE
 | 
					
						
							|  |  |  | #  include "BPy_Freestyle.h"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2010-02-16 22:34:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-26 12:26:11 +00:00
										 |  |  | PyObject *bpy_package_py = NULL; | 
					
						
							| 
									
										
										
										
											2011-02-20 23:39:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-05-24 16:05:51 +00:00
										 |  |  | PyDoc_STRVAR(bpy_script_paths_doc, | 
					
						
							| 
									
										
										
										
											2010-07-15 20:02:53 +00:00
										 |  |  |              ".. function:: script_paths()\n" | 
					
						
							| 
									
										
										
										
											2010-02-16 15:01:34 +00:00
										 |  |  |              "\n" | 
					
						
							| 
									
										
										
										
											2010-07-15 20:02:53 +00:00
										 |  |  |              "   Return 2 paths to blender scripts directories.\n" | 
					
						
							| 
									
										
										
										
											2010-02-16 15:01:34 +00:00
										 |  |  |              "\n" | 
					
						
							| 
									
										
										
										
											2010-07-15 20:02:53 +00:00
										 |  |  |              "   :return: (system, user) strings will be empty when not found.\n" | 
					
						
							| 
									
										
										
										
											2011-04-11 13:56:58 +00:00
										 |  |  |              "   :rtype: tuple of strings\n"); | 
					
						
							| 
									
										
										
										
											2011-02-13 10:52:18 +00:00
										 |  |  | static PyObject *bpy_script_paths(PyObject *UNUSED(self)) | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-12-26 12:26:11 +00:00
										 |  |  |   PyObject *ret = PyTuple_New(2); | 
					
						
							| 
									
										
										
										
											2012-03-21 22:29:49 +00:00
										 |  |  |   PyObject *item; | 
					
						
							| 
									
										
										
										
											2013-03-05 03:17:46 +00:00
										 |  |  |   const char *path; | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-23 15:54:29 +01:00
										 |  |  |   path = BKE_appdir_folder_id(BLENDER_SYSTEM_SCRIPTS, NULL); | 
					
						
							| 
									
										
										
										
											2014-08-11 17:53:42 +10:00
										 |  |  |   item = PyC_UnicodeFromByte(path ? path : ""); | 
					
						
							| 
									
										
										
										
											2012-03-21 22:29:49 +00:00
										 |  |  |   BLI_assert(item != NULL); | 
					
						
							|  |  |  |   PyTuple_SET_ITEM(ret, 0, item); | 
					
						
							| 
									
										
										
										
											2014-11-23 15:54:29 +01:00
										 |  |  |   path = BKE_appdir_folder_id(BLENDER_USER_SCRIPTS, NULL); | 
					
						
							| 
									
										
										
										
											2014-08-11 17:53:42 +10:00
										 |  |  |   item = PyC_UnicodeFromByte(path ? path : ""); | 
					
						
							| 
									
										
										
										
											2012-03-21 22:29:49 +00:00
										 |  |  |   BLI_assert(item != NULL); | 
					
						
							|  |  |  |   PyTuple_SET_ITEM(ret, 1, item); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-22 09:30:00 +00:00
										 |  |  |   return ret; | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-24 03:06:32 +00:00
										 |  |  | static bool bpy_blend_paths_visit_cb(void *userdata, char *UNUSED(path_dst), const char *path_src) | 
					
						
							| 
									
										
										
										
											2011-10-27 01:25:07 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2015-01-06 17:39:47 +11:00
										 |  |  |   PyList_APPEND((PyObject *)userdata, PyC_UnicodeFromByte(path_src)); | 
					
						
							| 
									
										
										
										
											2013-01-07 05:26:12 +00:00
										 |  |  |   return false; /* never edits the path */ | 
					
						
							| 
									
										
										
										
											2011-10-27 01:25:07 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-05-24 16:05:51 +00:00
										 |  |  | PyDoc_STRVAR(bpy_blend_paths_doc, | 
					
						
							| 
									
										
										
										
											2011-10-27 03:40:12 +00:00
										 |  |  |              ".. function:: blend_paths(absolute=False, packed=False, local=False)\n" | 
					
						
							| 
									
										
										
										
											2010-05-11 07:08:32 +00:00
										 |  |  |              "\n" | 
					
						
							| 
									
										
										
										
											2010-08-07 18:34:16 +00:00
										 |  |  |              "   Returns a list of paths to external files referenced by the loaded .blend file.\n" | 
					
						
							| 
									
										
										
										
											2010-05-11 07:08:32 +00:00
										 |  |  |              "\n" | 
					
						
							|  |  |  |              "   :arg absolute: When true the paths returned are made absolute.\n" | 
					
						
							|  |  |  |              "   :type absolute: boolean\n" | 
					
						
							| 
									
										
										
										
											2011-10-27 03:40:12 +00:00
										 |  |  |              "   :arg packed: When true skip file paths for packed data.\n" | 
					
						
							|  |  |  |              "   :type packed: boolean\n" | 
					
						
							|  |  |  |              "   :arg local: When true skip linked library paths.\n" | 
					
						
							|  |  |  |              "   :type local: boolean\n" | 
					
						
							| 
									
										
										
										
											2010-05-11 07:08:32 +00:00
										 |  |  |              "   :return: path list.\n" | 
					
						
							| 
									
										
										
										
											2011-04-11 13:56:58 +00:00
										 |  |  |              "   :rtype: list of strings\n"); | 
					
						
							| 
									
										
										
										
											2010-10-13 23:25:08 +00:00
										 |  |  | static PyObject *bpy_blend_paths(PyObject *UNUSED(self), PyObject *args, PyObject *kw) | 
					
						
							| 
									
										
										
										
											2010-05-11 07:08:32 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-12-26 12:26:11 +00:00
										 |  |  |   int flag = 0; | 
					
						
							| 
									
										
										
										
											2011-10-27 01:25:07 +00:00
										 |  |  |   PyObject *list; | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-04 18:34:20 +10:00
										 |  |  |   bool absolute = false; | 
					
						
							|  |  |  |   bool packed = false; | 
					
						
							|  |  |  |   bool local = false; | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-05 10:52:18 +11:00
										 |  |  |   static const char *_keywords[] = {"absolute", "packed", "local", NULL}; | 
					
						
							| 
									
										
											  
											
												PyAPI: use keyword only arguments
Use keyword only arguments for the following functions.
- addon_utils.module_bl_info 2nd arg `info_basis`.
- addon_utils.modules 1st `module_cache`, 2nd arg `refresh`.
- addon_utils.modules_refresh 1st arg `module_cache`.
- bl_app_template_utils.activate 1nd arg `template_id`.
- bl_app_template_utils.import_from_id 2nd arg `ignore_not_found`.
- bl_app_template_utils.import_from_path 2nd arg `ignore_not_found`.
- bl_keymap_utils.keymap_from_toolbar.generate 2nd & 3rd args `use_fallback_keys` & `use_reset`.
- bl_keymap_utils.platform_helpers.keyconfig_data_oskey_from_ctrl 2nd arg `filter_fn`.
- bl_ui_utils.bug_report_url.url_prefill_from_blender 1st arg `addon_info`.
- bmesh.types.BMFace.copy 1st & 2nd args `verts`, `edges`.
- bmesh.types.BMesh.calc_volume 1st arg `signed`.
- bmesh.types.BMesh.from_mesh 2nd..4th args `face_normals`, `use_shape_key`, `shape_key_index`.
- bmesh.types.BMesh.from_object 3rd & 4th args `cage`, `face_normals`.
- bmesh.types.BMesh.transform 2nd arg `filter`.
- bmesh.types.BMesh.update_edit_mesh 2nd & 3rd args `loop_triangles`, `destructive`.
- bmesh.types.{BMVertSeq,BMEdgeSeq,BMFaceSeq}.sort 1st & 2nd arg `key`, `reverse`.
- bmesh.utils.face_split 4th..6th args `coords`, `use_exist`, `example`.
- bpy.data.libraries.load 2nd..4th args `link`, `relative`, `assets_only`.
- bpy.data.user_map 1st..3rd args `subset`, `key_types, `value_types`.
- bpy.msgbus.subscribe_rna 5th arg `options`.
- bpy.path.abspath 2nd & 3rd args `start` & `library`.
- bpy.path.clean_name 2nd arg `replace`.
- bpy.path.ensure_ext 3rd arg `case_sensitive`.
- bpy.path.module_names 2nd arg `recursive`.
- bpy.path.relpath 2nd arg `start`.
- bpy.types.EditBone.transform 2nd & 3rd arg `scale`, `roll`.
- bpy.types.Operator.as_keywords 1st arg `ignore`.
- bpy.types.Struct.{keyframe_insert,keyframe_delete} 2nd..5th args `index`, `frame`, `group`, `options`.
- bpy.types.WindowManager.popup_menu 2nd & 3rd arg `title`, `icon`.
- bpy.types.WindowManager.popup_menu_pie 3rd & 4th arg `title`, `icon`.
- bpy.utils.app_template_paths 1st arg `subdir`.
- bpy.utils.app_template_paths 1st arg `subdir`.
- bpy.utils.blend_paths 1st..3rd args `absolute`, `packed`, `local`.
- bpy.utils.execfile 2nd arg `mod`.
- bpy.utils.keyconfig_set 2nd arg `report`.
- bpy.utils.load_scripts 1st & 2nd `reload_scripts` & `refresh_scripts`.
- bpy.utils.preset_find 3rd & 4th args `display_name`, `ext`.
- bpy.utils.resource_path 2nd & 3rd arg `major`, `minor`.
- bpy.utils.script_paths 1st..4th args `subdir`, `user_pref`, `check_all`, `use_user`.
- bpy.utils.smpte_from_frame 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.smpte_from_seconds 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.system_resource 2nd arg `subdir`.
- bpy.utils.time_from_frame 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.time_to_frame 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.units.to_string 4th..6th `precision`, `split_unit`, `compatible_unit`.
- bpy.utils.units.to_value 4th arg `str_ref_unit`.
- bpy.utils.user_resource 2nd & 3rd args `subdir`, `create`
- bpy_extras.view3d_utils.location_3d_to_region_2d 4th arg `default`.
- bpy_extras.view3d_utils.region_2d_to_origin_3d 4th arg `clamp`.
- gpu.offscreen.unbind 1st arg `restore`.
- gpu_extras.batch.batch_for_shader 4th arg `indices`.
- gpu_extras.batch.presets.draw_circle_2d 4th arg `segments`.
- gpu_extras.presets.draw_circle_2d 4th arg `segments`.
- imbuf.types.ImBuf.resize 2nd arg `resize`.
- imbuf.write 2nd arg `filepath`.
- mathutils.kdtree.KDTree.find 2nd arg `filter`.
- nodeitems_utils.NodeCategory 3rd & 4th arg `descriptions`, `items`.
- nodeitems_utils.NodeItem 2nd..4th args `label`, `settings`, `poll`.
- nodeitems_utils.NodeItemCustom 1st & 2nd arg `poll`, `draw`.
- rna_prop_ui.draw 5th arg `use_edit`.
- rna_prop_ui.rna_idprop_ui_get 2nd arg `create`.
- rna_prop_ui.rna_idprop_ui_prop_clear 3rd arg `remove`.
- rna_prop_ui.rna_idprop_ui_prop_get 3rd arg `create`.
- rna_xml.xml2rna 2nd arg `root_rna`.
- rna_xml.xml_file_write 4th arg `skip_typemap`.
											
										 
											2021-06-08 18:03:14 +10:00
										 |  |  |   static _PyArg_Parser _parser = {"|$O&O&O&:blend_paths", _keywords, 0}; | 
					
						
							| 
									
										
										
										
											2017-10-05 10:52:18 +11:00
										 |  |  |   if (!_PyArg_ParseTupleAndKeywordsFast(args, | 
					
						
							|  |  |  |                                         kw, | 
					
						
							|  |  |  |                                         &_parser, | 
					
						
							| 
									
										
										
										
											2015-08-04 18:34:20 +10:00
										 |  |  |                                         PyC_ParseBool, | 
					
						
							|  |  |  |                                         &absolute, | 
					
						
							|  |  |  |                                         PyC_ParseBool, | 
					
						
							|  |  |  |                                         &packed, | 
					
						
							|  |  |  |                                         PyC_ParseBool, | 
					
						
							|  |  |  |                                         &local)) { | 
					
						
							| 
									
										
										
										
											2010-05-11 07:08:32 +00:00
										 |  |  |     return NULL; | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-30 06:12:48 +11:00
										 |  |  |   if (absolute) { | 
					
						
							|  |  |  |     flag |= BKE_BPATH_TRAVERSE_ABS; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   if (!packed) { | 
					
						
							|  |  |  |     flag |= BKE_BPATH_TRAVERSE_SKIP_PACKED; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   if (local) { | 
					
						
							|  |  |  |     flag |= BKE_BPATH_TRAVERSE_SKIP_LIBRARY; | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-26 12:26:11 +00:00
										 |  |  |   list = PyList_New(0); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-06-22 11:37:47 +02:00
										 |  |  |   BKE_bpath_traverse_main(G_MAIN, bpy_blend_paths_visit_cb, flag, (void *)list); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-11 07:08:32 +00:00
										 |  |  |   return list; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-26 12:26:11 +00:00
										 |  |  | // PyDoc_STRVAR(bpy_user_resource_doc[] = /* now in bpy/utils.py */
 | 
					
						
							| 
									
										
										
										
											2010-10-13 23:25:08 +00:00
										 |  |  | static PyObject *bpy_user_resource(PyObject *UNUSED(self), PyObject *args, PyObject *kw) | 
					
						
							| 
									
										
										
										
											2010-10-03 20:00:22 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2019-10-01 05:16:40 +10:00
										 |  |  |   const struct PyC_StringEnumItems type_items[] = { | 
					
						
							|  |  |  |       {BLENDER_USER_DATAFILES, "DATAFILES"}, | 
					
						
							|  |  |  |       {BLENDER_USER_CONFIG, "CONFIG"}, | 
					
						
							|  |  |  |       {BLENDER_USER_SCRIPTS, "SCRIPTS"}, | 
					
						
							|  |  |  |       {BLENDER_USER_AUTOSAVE, "AUTOSAVE"}, | 
					
						
							|  |  |  |       {0, NULL}, | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  |   struct PyC_StringEnum type = {type_items}; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-04-27 00:21:23 +10:00
										 |  |  |   const char *subdir = NULL; | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-05 03:17:46 +00:00
										 |  |  |   const char *path; | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
											  
											
												PyAPI: use keyword only arguments
Use keyword only arguments for the following functions.
- addon_utils.module_bl_info 2nd arg `info_basis`.
- addon_utils.modules 1st `module_cache`, 2nd arg `refresh`.
- addon_utils.modules_refresh 1st arg `module_cache`.
- bl_app_template_utils.activate 1nd arg `template_id`.
- bl_app_template_utils.import_from_id 2nd arg `ignore_not_found`.
- bl_app_template_utils.import_from_path 2nd arg `ignore_not_found`.
- bl_keymap_utils.keymap_from_toolbar.generate 2nd & 3rd args `use_fallback_keys` & `use_reset`.
- bl_keymap_utils.platform_helpers.keyconfig_data_oskey_from_ctrl 2nd arg `filter_fn`.
- bl_ui_utils.bug_report_url.url_prefill_from_blender 1st arg `addon_info`.
- bmesh.types.BMFace.copy 1st & 2nd args `verts`, `edges`.
- bmesh.types.BMesh.calc_volume 1st arg `signed`.
- bmesh.types.BMesh.from_mesh 2nd..4th args `face_normals`, `use_shape_key`, `shape_key_index`.
- bmesh.types.BMesh.from_object 3rd & 4th args `cage`, `face_normals`.
- bmesh.types.BMesh.transform 2nd arg `filter`.
- bmesh.types.BMesh.update_edit_mesh 2nd & 3rd args `loop_triangles`, `destructive`.
- bmesh.types.{BMVertSeq,BMEdgeSeq,BMFaceSeq}.sort 1st & 2nd arg `key`, `reverse`.
- bmesh.utils.face_split 4th..6th args `coords`, `use_exist`, `example`.
- bpy.data.libraries.load 2nd..4th args `link`, `relative`, `assets_only`.
- bpy.data.user_map 1st..3rd args `subset`, `key_types, `value_types`.
- bpy.msgbus.subscribe_rna 5th arg `options`.
- bpy.path.abspath 2nd & 3rd args `start` & `library`.
- bpy.path.clean_name 2nd arg `replace`.
- bpy.path.ensure_ext 3rd arg `case_sensitive`.
- bpy.path.module_names 2nd arg `recursive`.
- bpy.path.relpath 2nd arg `start`.
- bpy.types.EditBone.transform 2nd & 3rd arg `scale`, `roll`.
- bpy.types.Operator.as_keywords 1st arg `ignore`.
- bpy.types.Struct.{keyframe_insert,keyframe_delete} 2nd..5th args `index`, `frame`, `group`, `options`.
- bpy.types.WindowManager.popup_menu 2nd & 3rd arg `title`, `icon`.
- bpy.types.WindowManager.popup_menu_pie 3rd & 4th arg `title`, `icon`.
- bpy.utils.app_template_paths 1st arg `subdir`.
- bpy.utils.app_template_paths 1st arg `subdir`.
- bpy.utils.blend_paths 1st..3rd args `absolute`, `packed`, `local`.
- bpy.utils.execfile 2nd arg `mod`.
- bpy.utils.keyconfig_set 2nd arg `report`.
- bpy.utils.load_scripts 1st & 2nd `reload_scripts` & `refresh_scripts`.
- bpy.utils.preset_find 3rd & 4th args `display_name`, `ext`.
- bpy.utils.resource_path 2nd & 3rd arg `major`, `minor`.
- bpy.utils.script_paths 1st..4th args `subdir`, `user_pref`, `check_all`, `use_user`.
- bpy.utils.smpte_from_frame 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.smpte_from_seconds 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.system_resource 2nd arg `subdir`.
- bpy.utils.time_from_frame 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.time_to_frame 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.units.to_string 4th..6th `precision`, `split_unit`, `compatible_unit`.
- bpy.utils.units.to_value 4th arg `str_ref_unit`.
- bpy.utils.user_resource 2nd & 3rd args `subdir`, `create`
- bpy_extras.view3d_utils.location_3d_to_region_2d 4th arg `default`.
- bpy_extras.view3d_utils.region_2d_to_origin_3d 4th arg `clamp`.
- gpu.offscreen.unbind 1st arg `restore`.
- gpu_extras.batch.batch_for_shader 4th arg `indices`.
- gpu_extras.batch.presets.draw_circle_2d 4th arg `segments`.
- gpu_extras.presets.draw_circle_2d 4th arg `segments`.
- imbuf.types.ImBuf.resize 2nd arg `resize`.
- imbuf.write 2nd arg `filepath`.
- mathutils.kdtree.KDTree.find 2nd arg `filter`.
- nodeitems_utils.NodeCategory 3rd & 4th arg `descriptions`, `items`.
- nodeitems_utils.NodeItem 2nd..4th args `label`, `settings`, `poll`.
- nodeitems_utils.NodeItemCustom 1st & 2nd arg `poll`, `draw`.
- rna_prop_ui.draw 5th arg `use_edit`.
- rna_prop_ui.rna_idprop_ui_get 2nd arg `create`.
- rna_prop_ui.rna_idprop_ui_prop_clear 3rd arg `remove`.
- rna_prop_ui.rna_idprop_ui_prop_get 3rd arg `create`.
- rna_xml.xml2rna 2nd arg `root_rna`.
- rna_xml.xml_file_write 4th arg `skip_typemap`.
											
										 
											2021-06-08 18:03:14 +10:00
										 |  |  |   static const char *_keywords[] = {"type", "path", NULL}; | 
					
						
							|  |  |  |   static _PyArg_Parser _parser = {"O&|$s:user_resource", _keywords, 0}; | 
					
						
							| 
									
										
										
										
											2019-10-01 05:16:40 +10:00
										 |  |  |   if (!_PyArg_ParseTupleAndKeywordsFast(args, kw, &_parser, PyC_ParseStringEnum, &type, &subdir)) { | 
					
						
							| 
									
										
										
										
											2010-10-03 20:00:22 +00:00
										 |  |  |     return NULL; | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-29 19:59:13 +10:00
										 |  |  |   /* same logic as BKE_appdir_folder_id_create(),
 | 
					
						
							|  |  |  |    * but best leave it up to the script author to create */ | 
					
						
							| 
									
										
										
										
											2019-10-01 05:16:40 +10:00
										 |  |  |   path = BKE_appdir_folder_id_user_notest(type.value_found, subdir); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-08-11 17:53:42 +10:00
										 |  |  |   return PyC_UnicodeFromByte(path ? path : ""); | 
					
						
							| 
									
										
										
										
											2010-10-03 20:00:22 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-23 16:23:56 +10:00
										 |  |  | PyDoc_STRVAR(bpy_system_resource_doc, | 
					
						
							|  |  |  |              ".. function:: system_resource(type, path=\"\")\n" | 
					
						
							|  |  |  |              "\n" | 
					
						
							|  |  |  |              "   Return a system resource path.\n" | 
					
						
							|  |  |  |              "\n" | 
					
						
							|  |  |  |              "   :arg type: string in ['DATAFILES', 'SCRIPTS', 'PYTHON'].\n" | 
					
						
							|  |  |  |              "   :type type: string\n" | 
					
						
							|  |  |  |              "   :arg path: Optional subdirectory.\n" | 
					
						
							|  |  |  |              "   :type path: string\n"); | 
					
						
							|  |  |  | static PyObject *bpy_system_resource(PyObject *UNUSED(self), PyObject *args, PyObject *kw) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-10-01 05:16:40 +10:00
										 |  |  |   const struct PyC_StringEnumItems type_items[] = { | 
					
						
							|  |  |  |       {BLENDER_SYSTEM_DATAFILES, "DATAFILES"}, | 
					
						
							|  |  |  |       {BLENDER_SYSTEM_SCRIPTS, "SCRIPTS"}, | 
					
						
							|  |  |  |       {BLENDER_SYSTEM_PYTHON, "PYTHON"}, | 
					
						
							|  |  |  |       {0, NULL}, | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  |   struct PyC_StringEnum type = {type_items}; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-23 16:23:56 +10:00
										 |  |  |   const char *subdir = NULL; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   const char *path; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   static const char *_keywords[] = {"type", "path", NULL}; | 
					
						
							| 
									
										
											  
											
												PyAPI: use keyword only arguments
Use keyword only arguments for the following functions.
- addon_utils.module_bl_info 2nd arg `info_basis`.
- addon_utils.modules 1st `module_cache`, 2nd arg `refresh`.
- addon_utils.modules_refresh 1st arg `module_cache`.
- bl_app_template_utils.activate 1nd arg `template_id`.
- bl_app_template_utils.import_from_id 2nd arg `ignore_not_found`.
- bl_app_template_utils.import_from_path 2nd arg `ignore_not_found`.
- bl_keymap_utils.keymap_from_toolbar.generate 2nd & 3rd args `use_fallback_keys` & `use_reset`.
- bl_keymap_utils.platform_helpers.keyconfig_data_oskey_from_ctrl 2nd arg `filter_fn`.
- bl_ui_utils.bug_report_url.url_prefill_from_blender 1st arg `addon_info`.
- bmesh.types.BMFace.copy 1st & 2nd args `verts`, `edges`.
- bmesh.types.BMesh.calc_volume 1st arg `signed`.
- bmesh.types.BMesh.from_mesh 2nd..4th args `face_normals`, `use_shape_key`, `shape_key_index`.
- bmesh.types.BMesh.from_object 3rd & 4th args `cage`, `face_normals`.
- bmesh.types.BMesh.transform 2nd arg `filter`.
- bmesh.types.BMesh.update_edit_mesh 2nd & 3rd args `loop_triangles`, `destructive`.
- bmesh.types.{BMVertSeq,BMEdgeSeq,BMFaceSeq}.sort 1st & 2nd arg `key`, `reverse`.
- bmesh.utils.face_split 4th..6th args `coords`, `use_exist`, `example`.
- bpy.data.libraries.load 2nd..4th args `link`, `relative`, `assets_only`.
- bpy.data.user_map 1st..3rd args `subset`, `key_types, `value_types`.
- bpy.msgbus.subscribe_rna 5th arg `options`.
- bpy.path.abspath 2nd & 3rd args `start` & `library`.
- bpy.path.clean_name 2nd arg `replace`.
- bpy.path.ensure_ext 3rd arg `case_sensitive`.
- bpy.path.module_names 2nd arg `recursive`.
- bpy.path.relpath 2nd arg `start`.
- bpy.types.EditBone.transform 2nd & 3rd arg `scale`, `roll`.
- bpy.types.Operator.as_keywords 1st arg `ignore`.
- bpy.types.Struct.{keyframe_insert,keyframe_delete} 2nd..5th args `index`, `frame`, `group`, `options`.
- bpy.types.WindowManager.popup_menu 2nd & 3rd arg `title`, `icon`.
- bpy.types.WindowManager.popup_menu_pie 3rd & 4th arg `title`, `icon`.
- bpy.utils.app_template_paths 1st arg `subdir`.
- bpy.utils.app_template_paths 1st arg `subdir`.
- bpy.utils.blend_paths 1st..3rd args `absolute`, `packed`, `local`.
- bpy.utils.execfile 2nd arg `mod`.
- bpy.utils.keyconfig_set 2nd arg `report`.
- bpy.utils.load_scripts 1st & 2nd `reload_scripts` & `refresh_scripts`.
- bpy.utils.preset_find 3rd & 4th args `display_name`, `ext`.
- bpy.utils.resource_path 2nd & 3rd arg `major`, `minor`.
- bpy.utils.script_paths 1st..4th args `subdir`, `user_pref`, `check_all`, `use_user`.
- bpy.utils.smpte_from_frame 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.smpte_from_seconds 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.system_resource 2nd arg `subdir`.
- bpy.utils.time_from_frame 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.time_to_frame 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.units.to_string 4th..6th `precision`, `split_unit`, `compatible_unit`.
- bpy.utils.units.to_value 4th arg `str_ref_unit`.
- bpy.utils.user_resource 2nd & 3rd args `subdir`, `create`
- bpy_extras.view3d_utils.location_3d_to_region_2d 4th arg `default`.
- bpy_extras.view3d_utils.region_2d_to_origin_3d 4th arg `clamp`.
- gpu.offscreen.unbind 1st arg `restore`.
- gpu_extras.batch.batch_for_shader 4th arg `indices`.
- gpu_extras.batch.presets.draw_circle_2d 4th arg `segments`.
- gpu_extras.presets.draw_circle_2d 4th arg `segments`.
- imbuf.types.ImBuf.resize 2nd arg `resize`.
- imbuf.write 2nd arg `filepath`.
- mathutils.kdtree.KDTree.find 2nd arg `filter`.
- nodeitems_utils.NodeCategory 3rd & 4th arg `descriptions`, `items`.
- nodeitems_utils.NodeItem 2nd..4th args `label`, `settings`, `poll`.
- nodeitems_utils.NodeItemCustom 1st & 2nd arg `poll`, `draw`.
- rna_prop_ui.draw 5th arg `use_edit`.
- rna_prop_ui.rna_idprop_ui_get 2nd arg `create`.
- rna_prop_ui.rna_idprop_ui_prop_clear 3rd arg `remove`.
- rna_prop_ui.rna_idprop_ui_prop_get 3rd arg `create`.
- rna_xml.xml2rna 2nd arg `root_rna`.
- rna_xml.xml_file_write 4th arg `skip_typemap`.
											
										 
											2021-06-08 18:03:14 +10:00
										 |  |  |   static _PyArg_Parser _parser = {"O&|$s:system_resource", _keywords, 0}; | 
					
						
							| 
									
										
										
										
											2019-10-01 05:16:40 +10:00
										 |  |  |   if (!_PyArg_ParseTupleAndKeywordsFast(args, kw, &_parser, PyC_ParseStringEnum, &type, &subdir)) { | 
					
						
							| 
									
										
										
										
											2019-07-23 16:23:56 +10:00
										 |  |  |     return NULL; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-01 05:16:40 +10:00
										 |  |  |   path = BKE_appdir_folder_id(type.value_found, subdir); | 
					
						
							| 
									
										
										
										
											2019-07-23 16:23:56 +10:00
										 |  |  | 
 | 
					
						
							|  |  |  |   return PyC_UnicodeFromByte(path ? path : ""); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-05-24 16:05:51 +00:00
										 |  |  | PyDoc_STRVAR( | 
					
						
							|  |  |  |     bpy_resource_path_doc, | 
					
						
							| 
									
										
										
										
											2012-09-29 11:51:18 +00:00
										 |  |  |     ".. function:: resource_path(type, major=bpy.app.version[0], minor=bpy.app.version[1])\n" | 
					
						
							| 
									
										
										
										
											2011-04-11 13:56:58 +00:00
										 |  |  |     "\n" | 
					
						
							|  |  |  |     "   Return the base path for storing system files.\n" | 
					
						
							|  |  |  |     "\n" | 
					
						
							|  |  |  |     "   :arg type: string in ['USER', 'LOCAL', 'SYSTEM'].\n" | 
					
						
							|  |  |  |     "   :type type: string\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" | 
					
						
							|  |  |  |     "   :return: the resource path (not necessarily existing).\n" | 
					
						
							|  |  |  |     "   :rtype: string\n"); | 
					
						
							|  |  |  | static PyObject *bpy_resource_path(PyObject *UNUSED(self), PyObject *args, PyObject *kw) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-10-01 05:16:40 +10:00
										 |  |  |   const struct PyC_StringEnumItems type_items[] = { | 
					
						
							|  |  |  |       {BLENDER_RESOURCE_PATH_USER, "USER"}, | 
					
						
							|  |  |  |       {BLENDER_RESOURCE_PATH_LOCAL, "LOCAL"}, | 
					
						
							|  |  |  |       {BLENDER_RESOURCE_PATH_SYSTEM, "SYSTEM"}, | 
					
						
							|  |  |  |       {0, NULL}, | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  |   struct PyC_StringEnum type = {type_items}; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-26 12:26:11 +00:00
										 |  |  |   int major = BLENDER_VERSION / 100, minor = BLENDER_VERSION % 100; | 
					
						
							| 
									
										
										
										
											2013-03-05 03:17:46 +00:00
										 |  |  |   const char *path; | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-05 10:52:18 +11:00
										 |  |  |   static const char *_keywords[] = {"type", "major", "minor", NULL}; | 
					
						
							| 
									
										
											  
											
												PyAPI: use keyword only arguments
Use keyword only arguments for the following functions.
- addon_utils.module_bl_info 2nd arg `info_basis`.
- addon_utils.modules 1st `module_cache`, 2nd arg `refresh`.
- addon_utils.modules_refresh 1st arg `module_cache`.
- bl_app_template_utils.activate 1nd arg `template_id`.
- bl_app_template_utils.import_from_id 2nd arg `ignore_not_found`.
- bl_app_template_utils.import_from_path 2nd arg `ignore_not_found`.
- bl_keymap_utils.keymap_from_toolbar.generate 2nd & 3rd args `use_fallback_keys` & `use_reset`.
- bl_keymap_utils.platform_helpers.keyconfig_data_oskey_from_ctrl 2nd arg `filter_fn`.
- bl_ui_utils.bug_report_url.url_prefill_from_blender 1st arg `addon_info`.
- bmesh.types.BMFace.copy 1st & 2nd args `verts`, `edges`.
- bmesh.types.BMesh.calc_volume 1st arg `signed`.
- bmesh.types.BMesh.from_mesh 2nd..4th args `face_normals`, `use_shape_key`, `shape_key_index`.
- bmesh.types.BMesh.from_object 3rd & 4th args `cage`, `face_normals`.
- bmesh.types.BMesh.transform 2nd arg `filter`.
- bmesh.types.BMesh.update_edit_mesh 2nd & 3rd args `loop_triangles`, `destructive`.
- bmesh.types.{BMVertSeq,BMEdgeSeq,BMFaceSeq}.sort 1st & 2nd arg `key`, `reverse`.
- bmesh.utils.face_split 4th..6th args `coords`, `use_exist`, `example`.
- bpy.data.libraries.load 2nd..4th args `link`, `relative`, `assets_only`.
- bpy.data.user_map 1st..3rd args `subset`, `key_types, `value_types`.
- bpy.msgbus.subscribe_rna 5th arg `options`.
- bpy.path.abspath 2nd & 3rd args `start` & `library`.
- bpy.path.clean_name 2nd arg `replace`.
- bpy.path.ensure_ext 3rd arg `case_sensitive`.
- bpy.path.module_names 2nd arg `recursive`.
- bpy.path.relpath 2nd arg `start`.
- bpy.types.EditBone.transform 2nd & 3rd arg `scale`, `roll`.
- bpy.types.Operator.as_keywords 1st arg `ignore`.
- bpy.types.Struct.{keyframe_insert,keyframe_delete} 2nd..5th args `index`, `frame`, `group`, `options`.
- bpy.types.WindowManager.popup_menu 2nd & 3rd arg `title`, `icon`.
- bpy.types.WindowManager.popup_menu_pie 3rd & 4th arg `title`, `icon`.
- bpy.utils.app_template_paths 1st arg `subdir`.
- bpy.utils.app_template_paths 1st arg `subdir`.
- bpy.utils.blend_paths 1st..3rd args `absolute`, `packed`, `local`.
- bpy.utils.execfile 2nd arg `mod`.
- bpy.utils.keyconfig_set 2nd arg `report`.
- bpy.utils.load_scripts 1st & 2nd `reload_scripts` & `refresh_scripts`.
- bpy.utils.preset_find 3rd & 4th args `display_name`, `ext`.
- bpy.utils.resource_path 2nd & 3rd arg `major`, `minor`.
- bpy.utils.script_paths 1st..4th args `subdir`, `user_pref`, `check_all`, `use_user`.
- bpy.utils.smpte_from_frame 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.smpte_from_seconds 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.system_resource 2nd arg `subdir`.
- bpy.utils.time_from_frame 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.time_to_frame 2nd & 3rd args `fps`, `fps_base`.
- bpy.utils.units.to_string 4th..6th `precision`, `split_unit`, `compatible_unit`.
- bpy.utils.units.to_value 4th arg `str_ref_unit`.
- bpy.utils.user_resource 2nd & 3rd args `subdir`, `create`
- bpy_extras.view3d_utils.location_3d_to_region_2d 4th arg `default`.
- bpy_extras.view3d_utils.region_2d_to_origin_3d 4th arg `clamp`.
- gpu.offscreen.unbind 1st arg `restore`.
- gpu_extras.batch.batch_for_shader 4th arg `indices`.
- gpu_extras.batch.presets.draw_circle_2d 4th arg `segments`.
- gpu_extras.presets.draw_circle_2d 4th arg `segments`.
- imbuf.types.ImBuf.resize 2nd arg `resize`.
- imbuf.write 2nd arg `filepath`.
- mathutils.kdtree.KDTree.find 2nd arg `filter`.
- nodeitems_utils.NodeCategory 3rd & 4th arg `descriptions`, `items`.
- nodeitems_utils.NodeItem 2nd..4th args `label`, `settings`, `poll`.
- nodeitems_utils.NodeItemCustom 1st & 2nd arg `poll`, `draw`.
- rna_prop_ui.draw 5th arg `use_edit`.
- rna_prop_ui.rna_idprop_ui_get 2nd arg `create`.
- rna_prop_ui.rna_idprop_ui_prop_clear 3rd arg `remove`.
- rna_prop_ui.rna_idprop_ui_prop_get 3rd arg `create`.
- rna_xml.xml2rna 2nd arg `root_rna`.
- rna_xml.xml_file_write 4th arg `skip_typemap`.
											
										 
											2021-06-08 18:03:14 +10:00
										 |  |  |   static _PyArg_Parser _parser = {"O&|$ii:resource_path", _keywords, 0}; | 
					
						
							| 
									
										
										
										
											2019-10-01 05:16:40 +10:00
										 |  |  |   if (!_PyArg_ParseTupleAndKeywordsFast( | 
					
						
							|  |  |  |           args, kw, &_parser, PyC_ParseStringEnum, &type, &major, &minor)) { | 
					
						
							| 
									
										
										
										
											2011-04-11 13:56:58 +00:00
										 |  |  |     return NULL; | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-01 05:16:40 +10:00
										 |  |  |   path = BKE_appdir_folder_id_version(type.value_found, (major * 100) + minor, false); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-08-11 17:53:42 +10:00
										 |  |  |   return PyC_UnicodeFromByte(path ? path : ""); | 
					
						
							| 
									
										
										
										
											2011-04-11 13:56:58 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-25 16:18:10 +11:00
										 |  |  | PyDoc_STRVAR(bpy_escape_identifier_doc, | 
					
						
							|  |  |  |              ".. function:: escape_identifier(string)\n" | 
					
						
							|  |  |  |              "\n" | 
					
						
							|  |  |  |              "   Simple string escaping function used for animation paths.\n" | 
					
						
							|  |  |  |              "\n" | 
					
						
							|  |  |  |              "   :arg string: text\n" | 
					
						
							|  |  |  |              "   :type string: string\n" | 
					
						
							|  |  |  |              "   :return: The escaped string.\n" | 
					
						
							|  |  |  |              "   :rtype: string\n"); | 
					
						
							|  |  |  | static PyObject *bpy_escape_identifier(PyObject *UNUSED(self), PyObject *value) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   Py_ssize_t value_str_len; | 
					
						
							| 
									
										
										
										
											2021-02-13 22:57:01 +11:00
										 |  |  |   const char *value_str = PyUnicode_AsUTF8AndSize(value, &value_str_len); | 
					
						
							| 
									
										
										
										
											2014-02-25 16:18:10 +11:00
										 |  |  | 
 | 
					
						
							|  |  |  |   if (value_str == NULL) { | 
					
						
							|  |  |  |     PyErr_SetString(PyExc_TypeError, "expected a string"); | 
					
						
							|  |  |  |     return NULL; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-10 14:12:55 +11:00
										 |  |  |   const size_t size = (value_str_len * 2) + 1; | 
					
						
							|  |  |  |   char *value_escape_str = PyMem_MALLOC(size); | 
					
						
							|  |  |  |   const Py_ssize_t value_escape_str_len = BLI_str_escape(value_escape_str, value_str, size); | 
					
						
							| 
									
										
										
										
											2014-02-25 16:18:10 +11:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-10 14:12:55 +11:00
										 |  |  |   PyObject *value_escape; | 
					
						
							| 
									
										
										
										
											2014-02-25 16:18:10 +11:00
										 |  |  |   if (value_escape_str_len == value_str_len) { | 
					
						
							|  |  |  |     Py_INCREF(value); | 
					
						
							|  |  |  |     value_escape = value; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   else { | 
					
						
							|  |  |  |     value_escape = PyUnicode_FromStringAndSize(value_escape_str, value_escape_str_len); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   PyMem_FREE(value_escape_str); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   return value_escape; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-10 14:09:29 +11:00
										 |  |  | PyDoc_STRVAR(bpy_unescape_identifier_doc, | 
					
						
							|  |  |  |              ".. function:: unescape_identifier(string)\n" | 
					
						
							|  |  |  |              "\n" | 
					
						
							|  |  |  |              "   Simple string un-escape function used for animation paths.\n" | 
					
						
							|  |  |  |              "   This performs the reverse of `escape_identifier`.\n" | 
					
						
							|  |  |  |              "\n" | 
					
						
							|  |  |  |              "   :arg string: text\n" | 
					
						
							|  |  |  |              "   :type string: string\n" | 
					
						
							|  |  |  |              "   :return: The un-escaped string.\n" | 
					
						
							|  |  |  |              "   :rtype: string\n"); | 
					
						
							|  |  |  | static PyObject *bpy_unescape_identifier(PyObject *UNUSED(self), PyObject *value) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   Py_ssize_t value_str_len; | 
					
						
							| 
									
										
										
										
											2021-02-13 22:57:01 +11:00
										 |  |  |   const char *value_str = PyUnicode_AsUTF8AndSize(value, &value_str_len); | 
					
						
							| 
									
										
										
										
											2020-12-10 14:09:29 +11:00
										 |  |  | 
 | 
					
						
							|  |  |  |   if (value_str == NULL) { | 
					
						
							|  |  |  |     PyErr_SetString(PyExc_TypeError, "expected a string"); | 
					
						
							|  |  |  |     return NULL; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-10 14:12:55 +11:00
										 |  |  |   const size_t size = value_str_len + 1; | 
					
						
							|  |  |  |   char *value_unescape_str = PyMem_MALLOC(size); | 
					
						
							|  |  |  |   const Py_ssize_t value_unescape_str_len = BLI_str_unescape(value_unescape_str, value_str, size); | 
					
						
							| 
									
										
										
										
											2020-12-10 14:09:29 +11:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-10 14:12:55 +11:00
										 |  |  |   PyObject *value_unescape; | 
					
						
							| 
									
										
										
										
											2020-12-10 14:09:29 +11:00
										 |  |  |   if (value_unescape_str_len == value_str_len) { | 
					
						
							|  |  |  |     Py_INCREF(value); | 
					
						
							|  |  |  |     value_unescape = value; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   else { | 
					
						
							|  |  |  |     value_unescape = PyUnicode_FromStringAndSize(value_unescape_str, value_unescape_str_len); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   PyMem_FREE(value_unescape_str); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   return value_unescape; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-26 12:26:11 +00:00
										 |  |  | static PyMethodDef meth_bpy_script_paths = { | 
					
						
							| 
									
										
										
										
											2019-04-18 17:17:32 +02:00
										 |  |  |     "script_paths", | 
					
						
							|  |  |  |     (PyCFunction)bpy_script_paths, | 
					
						
							|  |  |  |     METH_NOARGS, | 
					
						
							|  |  |  |     bpy_script_paths_doc, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | static PyMethodDef meth_bpy_blend_paths = { | 
					
						
							|  |  |  |     "blend_paths", | 
					
						
							|  |  |  |     (PyCFunction)bpy_blend_paths, | 
					
						
							|  |  |  |     METH_VARARGS | METH_KEYWORDS, | 
					
						
							|  |  |  |     bpy_blend_paths_doc, | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2011-12-26 12:26:11 +00:00
										 |  |  | static PyMethodDef meth_bpy_user_resource = { | 
					
						
							| 
									
										
										
										
											2019-04-18 17:17:32 +02:00
										 |  |  |     "user_resource", | 
					
						
							|  |  |  |     (PyCFunction)bpy_user_resource, | 
					
						
							|  |  |  |     METH_VARARGS | METH_KEYWORDS, | 
					
						
							|  |  |  |     NULL, | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2019-07-23 16:23:56 +10:00
										 |  |  | static PyMethodDef meth_bpy_system_resource = { | 
					
						
							|  |  |  |     "system_resource", | 
					
						
							|  |  |  |     (PyCFunction)bpy_system_resource, | 
					
						
							|  |  |  |     METH_VARARGS | METH_KEYWORDS, | 
					
						
							|  |  |  |     bpy_system_resource_doc, | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2019-04-18 17:17:32 +02:00
										 |  |  | static PyMethodDef meth_bpy_resource_path = { | 
					
						
							|  |  |  |     "resource_path", | 
					
						
							|  |  |  |     (PyCFunction)bpy_resource_path, | 
					
						
							|  |  |  |     METH_VARARGS | METH_KEYWORDS, | 
					
						
							|  |  |  |     bpy_resource_path_doc, | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2014-02-25 16:18:10 +11:00
										 |  |  | static PyMethodDef meth_bpy_escape_identifier = { | 
					
						
							| 
									
										
										
										
											2019-04-18 17:17:32 +02:00
										 |  |  |     "escape_identifier", | 
					
						
							|  |  |  |     (PyCFunction)bpy_escape_identifier, | 
					
						
							|  |  |  |     METH_O, | 
					
						
							|  |  |  |     bpy_escape_identifier_doc, | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2020-12-10 14:09:29 +11:00
										 |  |  | static PyMethodDef meth_bpy_unescape_identifier = { | 
					
						
							|  |  |  |     "unescape_identifier", | 
					
						
							|  |  |  |     (PyCFunction)bpy_unescape_identifier, | 
					
						
							|  |  |  |     METH_O, | 
					
						
							|  |  |  |     bpy_unescape_identifier_doc, | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-20 23:39:29 +00:00
										 |  |  | static PyObject *bpy_import_test(const char *modname) | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-03-17 18:30:31 +00:00
										 |  |  |   PyObject *mod = PyImport_ImportModuleLevel(modname, NULL, NULL, NULL, 0); | 
					
						
							| 
									
										
										
										
											2020-10-09 16:33:24 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |   GPU_bgl_end(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-13 01:29:08 +00:00
										 |  |  |   if (mod) { | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  |     Py_DECREF(mod); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   else { | 
					
						
							|  |  |  |     PyErr_Print(); | 
					
						
							|  |  |  |     PyErr_Clear(); | 
					
						
							| 
									
										
										
										
											2012-12-11 22:00:22 +00:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-20 23:39:29 +00:00
										 |  |  |   return mod; | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-03 20:36:09 +00:00
										 |  |  | /******************************************************************************
 | 
					
						
							|  |  |  |  * Description: Creates the bpy module and adds it to sys.modules for importing | 
					
						
							|  |  |  |  ******************************************************************************/ | 
					
						
							| 
									
										
										
										
											2020-10-15 18:12:03 +11:00
										 |  |  | void BPy_init_modules(struct bContext *C) | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2010-06-09 19:31:10 +00:00
										 |  |  |   PointerRNA ctx_ptr; | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  |   PyObject *mod; | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  |   /* Needs to be first since this dir is needed for future modules */ | 
					
						
							| 
									
										
										
										
											2014-11-23 15:54:29 +01:00
										 |  |  |   const char *const modpath = BKE_appdir_folder_id(BLENDER_SYSTEM_SCRIPTS, "modules"); | 
					
						
							| 
									
										
										
										
											2011-10-13 01:29:08 +00:00
										 |  |  |   if (modpath) { | 
					
						
							| 
									
										
										
										
											2010-04-18 14:47:45 +00:00
										 |  |  |     // printf("bpy: found module path '%s'.\n", modpath);
 | 
					
						
							| 
									
										
										
										
											2011-12-26 12:26:11 +00:00
										 |  |  |     PyObject *sys_path = PySys_GetObject("path"); /* borrow */ | 
					
						
							|  |  |  |     PyObject *py_modpath = PyUnicode_FromString(modpath); | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  |     PyList_Insert(sys_path, 0, py_modpath); /* add first */ | 
					
						
							|  |  |  |     Py_DECREF(py_modpath); | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2010-04-18 14:47:45 +00:00
										 |  |  |   else { | 
					
						
							| 
									
										
										
										
											2019-08-01 13:53:25 +10:00
										 |  |  |     printf("bpy: couldn't find 'scripts/modules', blender probably wont start.\n"); | 
					
						
							| 
									
										
										
										
											2010-04-18 14:47:45 +00:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  |   /* stand alone utility modules not related to blender directly */ | 
					
						
							| 
									
										
										
										
											2010-10-29 22:59:39 +00:00
										 |  |  |   IDProp_Init_Types(); /* not actually a submodule, just types */ | 
					
						
							| 
									
										
										
										
											2012-12-20 07:57:26 +00:00
										 |  |  | #ifdef WITH_FREESTYLE
 | 
					
						
							| 
									
										
										
										
											2010-02-13 01:13:16 +00:00
										 |  |  |   Freestyle_Init(); | 
					
						
							| 
									
										
										
										
											2012-12-20 07:57:26 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-26 12:26:11 +00:00
										 |  |  |   mod = PyModule_New("_bpy"); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  |   /* add the module so we can import it */ | 
					
						
							| 
									
										
										
										
											2010-08-14 05:33:20 +00:00
										 |  |  |   PyDict_SetItemString(PyImport_GetModuleDict(), "_bpy", mod); | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  |   Py_DECREF(mod); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  |   /* run first, initializes rna types */ | 
					
						
							|  |  |  |   BPY_rna_init(); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-26 15:18:30 +00:00
										 |  |  |   /* needs to be first so bpy_types can run */ | 
					
						
							|  |  |  |   PyModule_AddObject(mod, "types", BPY_rna_types()); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-26 15:18:30 +00:00
										 |  |  |   /* needs to be first so bpy_types can run */ | 
					
						
							| 
									
										
										
										
											2020-05-29 14:50:29 +10:00
										 |  |  |   BPY_library_load_type_ready(); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-09 01:01:31 +11:00
										 |  |  |   BPY_rna_data_context_type_ready(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-14 23:49:00 +02:00
										 |  |  |   BPY_rna_gizmo_module(mod); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  |   bpy_import_test("bpy_types"); | 
					
						
							| 
									
										
										
										
											2011-06-02 08:29:16 +00:00
										 |  |  |   PyModule_AddObject(mod, "data", BPY_rna_module()); /* imports bpy_types by running this */ | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  |   bpy_import_test("bpy_types"); | 
					
						
							| 
									
										
										
										
											2012-10-21 05:46:41 +00:00
										 |  |  |   PyModule_AddObject(mod, "props", BPY_rna_props()); | 
					
						
							| 
									
										
										
										
											2012-03-26 20:41:54 +00:00
										 |  |  |   /* ops is now a python module that does the conversion from SOME_OT_foo -> some.foo */ | 
					
						
							| 
									
										
										
										
											2011-11-26 15:18:30 +00:00
										 |  |  |   PyModule_AddObject(mod, "ops", BPY_operator_module()); | 
					
						
							| 
									
										
										
										
											2011-06-02 08:29:16 +00:00
										 |  |  |   PyModule_AddObject(mod, "app", BPY_app_struct()); | 
					
						
							| 
									
										
										
										
											2014-06-17 16:03:40 +02:00
										 |  |  |   PyModule_AddObject(mod, "_utils_units", BPY_utils_units()); | 
					
						
							| 
									
										
										
										
											2015-05-11 16:29:12 +02:00
										 |  |  |   PyModule_AddObject(mod, "_utils_previews", BPY_utils_previews_module()); | 
					
						
							| 
									
										
										
										
											2017-11-13 19:43:34 +11:00
										 |  |  |   PyModule_AddObject(mod, "msgbus", BPY_msgbus_module()); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-15 18:12:03 +11:00
										 |  |  |   RNA_pointer_create(NULL, &RNA_Context, C, &ctx_ptr); | 
					
						
							| 
									
										
										
										
											2011-12-26 12:26:11 +00:00
										 |  |  |   bpy_context_module = (BPy_StructRNA *)pyrna_struct_CreatePyObject(&ctx_ptr); | 
					
						
							| 
									
										
										
										
											2010-06-09 19:31:10 +00:00
										 |  |  |   /* odd that this is needed, 1 ref on creation and another for the module
 | 
					
						
							|  |  |  |    * but without we get a crash on exit */ | 
					
						
							|  |  |  |   Py_INCREF(bpy_context_module); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-03 08:56:48 +00:00
										 |  |  |   PyModule_AddObject(mod, "context", (PyObject *)bpy_context_module); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-13 15:05:09 +10:00
										 |  |  |   /* Register methods and property get/set for RNA types. */ | 
					
						
							|  |  |  |   BPY_rna_types_extend_capi(); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  |   /* utility func's that have nowhere else to go */ | 
					
						
							| 
									
										
										
										
											2010-10-03 20:00:22 +00:00
										 |  |  |   PyModule_AddObject(mod, | 
					
						
							|  |  |  |                      meth_bpy_script_paths.ml_name, | 
					
						
							|  |  |  |                      (PyObject *)PyCFunction_New(&meth_bpy_script_paths, NULL)); | 
					
						
							|  |  |  |   PyModule_AddObject( | 
					
						
							|  |  |  |       mod, meth_bpy_blend_paths.ml_name, (PyObject *)PyCFunction_New(&meth_bpy_blend_paths, NULL)); | 
					
						
							|  |  |  |   PyModule_AddObject(mod, | 
					
						
							|  |  |  |                      meth_bpy_user_resource.ml_name, | 
					
						
							|  |  |  |                      (PyObject *)PyCFunction_New(&meth_bpy_user_resource, NULL)); | 
					
						
							| 
									
										
										
										
											2019-07-23 16:23:56 +10:00
										 |  |  |   PyModule_AddObject(mod, | 
					
						
							|  |  |  |                      meth_bpy_system_resource.ml_name, | 
					
						
							|  |  |  |                      (PyObject *)PyCFunction_New(&meth_bpy_system_resource, NULL)); | 
					
						
							| 
									
										
										
										
											2011-04-11 13:56:58 +00:00
										 |  |  |   PyModule_AddObject(mod, | 
					
						
							|  |  |  |                      meth_bpy_resource_path.ml_name, | 
					
						
							|  |  |  |                      (PyObject *)PyCFunction_New(&meth_bpy_resource_path, NULL)); | 
					
						
							| 
									
										
										
										
											2014-02-25 16:18:10 +11:00
										 |  |  |   PyModule_AddObject(mod, | 
					
						
							|  |  |  |                      meth_bpy_escape_identifier.ml_name, | 
					
						
							|  |  |  |                      (PyObject *)PyCFunction_New(&meth_bpy_escape_identifier, NULL)); | 
					
						
							| 
									
										
										
										
											2020-12-10 14:09:29 +11:00
										 |  |  |   PyModule_AddObject(mod, | 
					
						
							|  |  |  |                      meth_bpy_unescape_identifier.ml_name, | 
					
						
							|  |  |  |                      (PyObject *)PyCFunction_New(&meth_bpy_unescape_identifier, NULL)); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-11 00:11:17 +00:00
										 |  |  |   /* register funcs (bpy_rna.c) */ | 
					
						
							|  |  |  |   PyModule_AddObject(mod, | 
					
						
							|  |  |  |                      meth_bpy_register_class.ml_name, | 
					
						
							|  |  |  |                      (PyObject *)PyCFunction_New(&meth_bpy_register_class, NULL)); | 
					
						
							|  |  |  |   PyModule_AddObject(mod, | 
					
						
							|  |  |  |                      meth_bpy_unregister_class.ml_name, | 
					
						
							|  |  |  |                      (PyObject *)PyCFunction_New(&meth_bpy_unregister_class, NULL)); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-01 01:26:02 +11:00
										 |  |  |   PyModule_AddObject(mod, | 
					
						
							|  |  |  |                      meth_bpy_owner_id_get.ml_name, | 
					
						
							|  |  |  |                      (PyObject *)PyCFunction_New(&meth_bpy_owner_id_get, NULL)); | 
					
						
							|  |  |  |   PyModule_AddObject(mod, | 
					
						
							|  |  |  |                      meth_bpy_owner_id_set.ml_name, | 
					
						
							|  |  |  |                      (PyObject *)PyCFunction_New(&meth_bpy_owner_id_set, NULL)); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  |   /* add our own modules dir, this is a python package */ | 
					
						
							| 
									
										
										
										
											2011-12-26 12:26:11 +00:00
										 |  |  |   bpy_package_py = bpy_import_test("bpy"); | 
					
						
							| 
									
										
										
										
											2010-02-11 14:08:22 +00:00
										 |  |  | } |