Blender  V3.3
Macros | Functions | Variables
python_utildefines.h File Reference

header-only utilities More...

Go to the source code of this file.

Macros

#define PyTuple_SET_ITEMS(op_arg, ...)
 

Functions

 Py_LOCAL_INLINE (PyObject *) Py_INCREF_RET(PyObject *op)
 
 Py_LOCAL_INLINE (int) PyList_APPEND(PyObject *op
 
 Py_DecRef (v)
 

Variables

PyObject * v
 
return ret
 

Detailed Description

header-only utilities

Note
light addition to Python.h, use py_capi_utils.h for larger features.

Definition in file python_utildefines.h.

Macro Definition Documentation

◆ PyTuple_SET_ITEMS

#define PyTuple_SET_ITEMS (   op_arg,
  ... 
)
Value:
{ \
PyTupleObject *op = (PyTupleObject *)op_arg; \
PyObject **ob_items = op->ob_item; \
CHECK_TYPE_ANY(op_arg, PyObject *, PyTupleObject *); \
BLI_assert(VA_NARGS_COUNT(__VA_ARGS__) == PyTuple_GET_SIZE(op)); \
ARRAY_SET_ITEMS(ob_items, __VA_ARGS__); \
} \
(void)0
#define VA_NARGS_COUNT(...)
SyclQueue void void size_t num_bytes void

Definition at line 15 of file python_utildefines.h.

Function Documentation

◆ Py_DecRef()

Py_DecRef ( v  )

◆ Py_LOCAL_INLINE() [1/2]

Py_LOCAL_INLINE ( int  )

Append & transfer ownership to the list, avoids inline #Py_DECREF all over (which is quite a large macro).

References ret, and v.

◆ Py_LOCAL_INLINE() [2/2]

Py_LOCAL_INLINE ( PyObject *  )

Wrap #Py_INCREF & return the result, use sparingly to avoid comma operator or temp var assignment.

Definition at line 29 of file python_utildefines.h.

Variable Documentation

◆ ret

return ret

Definition at line 43 of file python_utildefines.h.

Referenced by add_primitive_cube_gizmo_invoke(), app_translations_locales_get(), armature_calc_roll_exec(), atexit_func_call(), atomic_cas_float(), av_image_deinterlace(), available_devices_func(), BaseMathObject_owner_get(), BKE_id_material_pop(), BKE_mesh_debug_info(), BKE_object_data_transfer_get_dttypes_capacity(), BKE_object_data_transfer_get_dttypes_item_types(), BKE_ptcache_read(), BKE_sculpt_mask_layers_ensure(), blender::io::alembic::blend_matrices(), BLF_width_to_rstrlen(), BLF_width_to_strlen(), BLI_copy(), BLI_dir_create_recursive(), BLI_file_attributes(), BLI_file_unzstd_to_mem_at_pos(), BLI_file_zstd_from_mem_at_pos(), BLI_mempool_iterstep(), BLI_path_extension_check_n(), BLI_path_sequence_decode(), BLI_strcmp_ignore_pad(), BLT_pgettext(), BM_mesh_debug_info(), bm_uuidwalk_face_lookup(), bm_uuidwalk_vert_lookup(), BMO_iter_step(), BMO_slot_as_arrayN(), bmp_slots_as_args(), BPY_app_alembic_struct(), BPY_app_build_options_struct(), BPY_app_ffmpeg_struct(), bpy_app_generic_callback(), BPY_app_handlers_struct(), BPY_app_ocio_struct(), BPY_app_oiio_struct(), BPY_app_opensubdiv_struct(), BPY_app_openvdb_struct(), BPY_app_sdl_struct(), BPY_app_struct(), bpy_app_timers_is_registered(), BPY_app_translations_struct(), BPY_app_usd_struct(), bpy_batch_remove(), bpy_bm_generic_valid_check_source(), bpy_bm_geometry_intersect_face_point(), bpy_bm_utils_edge_split(), bpy_bm_utils_face_split(), bpy_bm_utils_face_split_edgenet(), bpy_bm_utils_vert_separate(), bpy_bmdeformvert_items(), bpy_bmdeformvert_keys(), bpy_bmdeformvert_values(), BPy_BMEdge_Array_As_Tuple(), bpy_bmedgeseq_get__method(), bpy_bmedgeseq_new(), BPy_BMElem_Array_As_Tuple(), BPy_BMElem_PySeq_As_Array(), BPy_BMElem_StringFromHType(), BPy_BMElem_StringFromHType_ex(), bpy_bmesh_calc_loop_triangles(), bpy_bmesh_op_doc_get(), BPy_BMFace_Array_As_Tuple(), bpy_bmfaceseq_get__method(), bpy_bmfaceseq_new(), bpy_bmlayercollection_items(), bpy_bmlayercollection_iter(), bpy_bmlayercollection_keys(), bpy_bmlayercollection_values(), BPy_BMLayerItem_GetItem(), BPy_BMLayerItem_SetItem(), BPy_BMLoop_Array_As_Tuple(), BPy_BMO_call(), BPy_BMVert_Array_As_Tuple(), bpy_class_call(), bpy_context_temp_override(), BPy_Group_IterItems_next(), BPy_IDGroup_iter(), bpy_lib_enter(), bpy_lib_load(), bpy_lib_write(), bpy_msgbus_notify(), bpy_prop_boolean_array_get_fn(), bpy_prop_boolean_array_set_fn(), bpy_prop_boolean_get_fn(), bpy_prop_boolean_set_fn(), bpy_prop_deferred_function_get(), bpy_prop_deferred_keywords_get(), bpy_prop_enum_get_fn(), bpy_prop_enum_set_fn(), bpy_prop_float_array_get_fn(), bpy_prop_float_array_set_fn(), bpy_prop_float_get_fn(), bpy_prop_float_set_fn(), bpy_prop_int_array_get_fn(), bpy_prop_int_array_set_fn(), bpy_prop_int_get_fn(), bpy_prop_int_set_fn(), bpy_prop_pointer_poll_fn(), bpy_prop_string_get_fn(), bpy_prop_string_length_fn(), bpy_prop_string_set_fn(), bpy_prop_string_visit_for_search_fn(), bpy_prop_update_fn(), BPy_RemoveProperty(), bpy_rna_data_temp_data(), bpy_script_paths(), bpy_types_module_dir(), bpy_types_module_getattro(), bpy_user_map(), BPy_Wrap_GetItems_View_WithID(), BPy_Wrap_GetKeys_View_WithID(), BPy_Wrap_GetValues_View_WithID(), bpyunits_to_value(), btAlignedAllocDefault(), Buffer_ass_item(), bvhtree_update_from_cloth(), bvhtree_update_from_mvert(), Freestyle::CurveInternal::CurvePointIterator::castToInterface0DIterator(), Freestyle::StrokeInternal::StrokeVertexIterator::castToInterface0DIterator(), change_frame_modal(), clear_keyframe(), iTaSC::ConstraintSet::closeLoop(), cloth_bvh_collision(), cloth_bvh_objcollisions_resolve(), cloth_bvh_selfcollisions_resolve(), Color_hsv_get(), Color_repr(), Color_to_tuple_ex(), compare_date(), compare_extension(), compare_name(), compare_size(), computeConstraintMatrixDiagElementMultiBody(), console_selectword_invoke(), console_textview_main__internal(), convert_tree(), HullLibrary::CreateConvexHull(), ctx_data_get(), CTX_data_get(), cubemap_glob(), curve_draw_modal(), curve_pen_modal(), data_transfer_layersmapping_cdlayers(), data_transfer_layersmapping_generate(), data_transfer_layersmapping_vgroups(), dBoxBox2(), delete_keyframe(), Director_BPy_BinaryPredicate0D___call__(), Director_BPy_BinaryPredicate1D___call__(), Director_BPy_UnaryPredicate0D___call__(), Director_BPy_UnaryPredicate1D___call__(), do_step_cloth(), btReducedVector::dot(), DRW_color_background_blend_get(), DRW_select_buffer_sample_point(), dynamic_paint_effect_drip_cb(), dynamicPaint_doStep(), ed_redo_exec(), ED_space_clip_color_sample(), ED_space_image_color_sample(), ED_space_image_show_uvedit(), ED_space_node_color_sample(), ed_undo_exec(), ED_undo_operator_repeat(), ed_undo_redo_exec(), ED_uvedit_test(), ED_view3d_project_base(), ED_view3d_project_float_ex(), ED_view3d_project_int_ex(), ED_view3d_project_short_ex(), edbm_point_normals_modal(), edbm_rip_invoke(), EDBM_selectmode_toggle_multi(), edbm_spin_invoke(), Euler_repr(), Euler_to_tuple_ex(), execute_functions_if_necessary(), file_box_select_exec(), file_select_exec(), filelist_file_create_entry(), filelist_file_ex(), filelist_geticon_ex(), find_iobject(), get_effector_data(), get_pointcache_times_for_particle(), gpencil_lasso_select_exec(), blender::nodes::node_shader_map_range_cc::gpu_shader_map_range(), blender::nodes::node_shader_math_cc::gpu_shader_math(), blender::nodes::node_shader_mix_rgb_cc::gpu_shader_mix_rgb(), GPU_viewport_do_update(), gzip_read(), handle_returned_value(), image_file_format_writable(), info_textview_main__internal(), insert_keyframe(), intersectRectQuad2(), is_quad_flip_v3(), GHOST_WindowX11::isDialog(), isect_aabb_planes_v3(), knifetool_invoke(), lib_relocate(), lineart_mem_acquire(), lineart_mem_acquire_thread(), lineIntersectsTriangle(), M_Geometry_box_pack_2d(), M_Geometry_intersect_line_sphere(), M_Geometry_intersect_line_sphere_2d(), M_Geometry_intersect_plane_plane(), M_Geometry_intersect_point_line(), M_Geometry_intersect_sphere_sphere_2d(), M_Geometry_intersect_tri_tri_2d(), M_Geometry_normal(), M_Geometry_points_in_planes(), M_Interpolate_poly_3d_calc(), M_Noise_voronoi(), main(), mathutils_array_parse_alloc(), mathutils_dynstr_to_py(), matrix__apply_to_copy(), Matrix_decompose(), Matrix_translation_get(), MatrixAccess_iter(), mempool_iter_threadsafe_step(), mesh_bisect_exec(), mesh_bisect_invoke(), mesh_bisect_modal(), btKrylovSolver< MatrixX >::norm(), ob_keyframes_loop(), object_join_exec(), operator*(), btReducedVector::operator+(), Freestyle::StrokeInternal::StrokeVertexIterator::operator++(), Freestyle::Interface0DIterator::operator++(), Freestyle::FEdgeInternal::SVertexIterator::operator++(), Freestyle::ViewEdgeInternal::SVertexIterator::operator++(), btReducedVector::operator-(), Freestyle::StrokeInternal::StrokeVertexIterator::operator--(), Freestyle::Interface0DIterator::operator--(), Freestyle::FEdgeInternal::SVertexIterator::operator--(), Freestyle::ViewEdgeInternal::SVertexIterator::operator--(), outliner_lib_reload_invoke(), outliner_lib_relocate_invoke(), outliner_lib_relocate_invoke_do(), outliner_orphans_purge_invoke(), paint_weight_gradient_invoke(), paint_weight_gradient_modal(), Freestyle::Curve::pointsBegin(), Freestyle::Curve::pointsEnd(), poselib_preview_handle_event(), poselib_preview_modal(), btReducedVector::proj(), project_paint_occlude_ptv_clip(), prop_subscript_ass_array_slice(), py_blf_dimensions(), py_bvhtree_find_nearest_range(), py_bvhtree_overlap(), Py_LOCAL_INLINE(), py_rna_gizmo_handler_get_cb(), py_rna_gizmo_handler_range_get_cb(), py_rna_gizmo_handler_set_cb(), py_timer_execute(), PyC_AsArray(), PyC_AsArray_Multi_impl(), PyC_FlagSet_FromBitfield(), PyC_FlagSet_ToBitfield(), PyC_FrozenSetFromStrings(), PyC_RunQuicky(), pygpu_batch__tp_new(), pygpu_buffer__sq_ass_item(), pygpu_framebuffer_bind(), pygpu_framebuffer_viewport_get(), pygpu_matrix_push_pop_impl(), pygpu_offscreen_bind(), pygpu_shader_uniform_bool(), pygpu_shader_uniform_int(), pygpu_state_viewport_get(), pyop_poll(), pyrna_callback_classmethod_add(), pyrna_deferred_register_class_from_type_hints(), pyrna_deferred_register_class_recursive(), pyrna_deferred_register_props(), pyrna_enum_bitfield_as_set(), pyrna_enum_bitfield_from_set(), pyrna_enum_bitmap_from_set(), pyrna_enum_to_py(), pyrna_func_call(), pyrna_func_doc_get(), pyrna_math_object_from_array(), pyrna_param_to_py(), pyrna_prop_array_ass_subscript(), pyrna_prop_array_iter(), pyrna_prop_as_bytes(), pyrna_prop_collection_get(), pyrna_prop_collection_getattro(), pyrna_prop_collection_items(), pyrna_prop_collection_keys(), pyrna_prop_dir(), pyrna_prop_new(), pyrna_prop_path_from_id(), pyrna_prop_repr_ex(), pyrna_prop_str(), pyrna_prop_to_enum_bitfield(), pyrna_prop_to_py(), pyrna_py_from_array(), pyrna_py_from_array_index(), pyrna_py_to_array(), pyrna_py_to_array_index(), pyrna_py_to_prop_array_index(), pyrna_register_class(), pyrna_struct_bl_rna_get_subclass_py(), pyrna_struct_dir(), pyrna_struct_driver_add(), pyrna_struct_getattro(), pyrna_struct_meta_idprop_setattro(), pyrna_struct_new(), pyrna_struct_path_from_id(), pyrna_struct_pop(), pyrna_struct_repr(), pyrna_struct_str(), pyrna_unregister_class(), quat__apply_to_copy(), Quaternion_repr(), Quaternion_to_axis_angle(), Quaternion_to_swing_twist(), Quaternion_to_tuple_ext(), radial_control_modal(), recursive_operation(), RNA_def_function_output(), RNA_def_function_return(), RNA_function_call_direct(), RNA_function_call_direct_lookup(), RNA_path_full_property_py_ex(), RNA_path_full_struct_py(), RNA_path_property_py(), RNA_path_struct_property_py(), RNA_property_path_from_ID_check(), rule_avoid_collision(), rule_fight(), rule_flock(), rule_follow_leader(), rule_goal_avoid(), rule_separate(), scene_keyframes_loop(), screen_opengl_render_exec(), screen_opengl_render_modal(), snap_target_select_from_spacetype(), iTaSC::WDLSSolver::solve(), iTaSC::WSDLSSolver::solve(), TEST(), test_frustum_aabb(), btReducedVector::testAdd(), btReducedVector::testDot(), btReducedVector::testMinus(), btReducedVector::testMultiply(), text_insert_invoke(), transform_snap_context_project_ray_impl(), txt_get_span(), ui_do_but_EXIT(), undo_history_exec(), undosys_stack_push_main(), uv_mouse_select_loop_generic(), vec__apply_to_copy(), Vector_cross(), Vector_dot(), Vector_repr(), Vector_to_tuple_ex(), vertex_group_sort_exec(), Freestyle::Stroke::verticesBegin(), Freestyle::FEdge::verticesBegin(), Freestyle::ViewEdge::verticesBegin(), Freestyle::Stroke::verticesEnd(), Freestyle::FEdge::verticesEnd(), Freestyle::ViewEdge::verticesEnd(), vgroup_move_exec(), viewdolly_modal(), viewmove_modal(), viewroll_modal(), viewrotate_modal(), viewzoom_modal(), walk_floor_distance_get(), walk_ray_cast(), walkApply(), walkEvent(), wind_func(), WM_modalkeymap_operator_items_to_string_buf(), WM_operator_repeat(), WM_operator_repeat_last(), WM_prop_pystring_assign(), wm_prop_pystring_from_context(), and wm_save_mainfile_invoke().

◆ v

PyObject* v
Initial value:
{
int ret = PyList_Append(op, v)
return ret
PyObject * v

Definition at line 39 of file python_utildefines.h.

Referenced by Py_LOCAL_INLINE().