Blender  V2.59
Classes | Defines | Typedefs | Functions | Variables
blender.c File Reference
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include <string.h>
#include <fcntl.h>
#include "MEM_guardedalloc.h"
#include "DNA_userdef_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_sequence_types.h"
#include "DNA_sound_types.h"
#include "BLI_blenlib.h"
#include "BLI_bpath.h"
#include "BLI_dynstr.h"
#include "BLI_path_util.h"
#include "BLI_utildefines.h"
#include "BLI_callbacks.h"
#include "IMB_imbuf.h"
#include "BKE_blender.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_displist.h"
#include "BKE_global.h"
#include "BKE_idprop.h"
#include "BKE_ipo.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_node.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "BKE_sequencer.h"
#include "BLO_undofile.h"
#include "BLO_readfile.h"
#include "BLO_writefile.h"
#include "BKE_utildefines.h"
#include "WM_api.h"

Go to the source code of this file.

Classes

struct  UndoElem

Defines

#define UNDO_DISK   0
#define MAXUNDONAME   64

Typedefs

typedef struct UndoElem UndoElem

Functions

void free_blender (void)
void initglobals (void)
static void clear_global (void)
static void clean_paths (Main *main)
static void setup_app_data (bContext *C, BlendFileData *bfd, const char *filepath)
static int handle_subversion_warning (Main *main)
static void keymap_item_free (wmKeyMapItem *kmi)
void BKE_userdef_free (void)
int BKE_read_file (bContext *C, const char *filepath, ReportList *reports)
int BKE_read_file_from_memory (bContext *C, char *filebuf, int filelength, ReportList *reports)
int BKE_read_file_from_memfile (bContext *C, MemFile *memfile, ReportList *reports)
void set_blender_test_break_cb (void(*func)(void))
int blender_test_break (void)
static int read_undosave (bContext *C, UndoElem *uel)
void BKE_write_undo (bContext *C, const char *name)
void BKE_undo_step (bContext *C, int step)
void BKE_reset_undo (void)
void BKE_undo_number (bContext *C, int nr)
void BKE_undo_name (bContext *C, const char *name)
int BKE_undo_valid (const char *name)
char * BKE_undo_get_name (int nr, int *active)
char * BKE_undo_menu_string (void)
void BKE_undo_save_quit (void)
MainBKE_undo_get_main (Scene **scene)

Variables

Global G
UserDef U
short ENDIAN_ORDER
char versionstr [48] = ""
static void(* blender_test_break_cb )(void) = NULL
static ListBase undobase = {NULL, NULL}
static UndoElemcurundo = NULL

Detailed Description

Definition in file blender.c.


Define Documentation

#define MAXUNDONAME   64

Definition at line 455 of file blender.c.

Referenced by BKE_write_undo().

#define UNDO_DISK   0

Definition at line 453 of file blender.c.

Referenced by BKE_write_undo(), and read_undosave().


Typedef Documentation

typedef struct UndoElem UndoElem

Function Documentation

int BKE_read_file ( bContext C,
const char *  filepath,
ReportList reports 
)
int BKE_read_file_from_memfile ( bContext C,
MemFile memfile,
ReportList reports 
)
int BKE_read_file_from_memory ( bContext C,
char *  filebuf,
int  filelength,
ReportList reports 
)

Definition at line 402 of file blender.c.

References BKE_reports_prepend(), BLO_read_from_memory(), and setup_app_data().

Referenced by WM_read_homefile().

void BKE_reset_undo ( void  )
Main* BKE_undo_get_main ( Scene **  scene) [read]
char* BKE_undo_get_name ( int  nr,
int *  active 
)

Definition at line 670 of file blender.c.

References BLI_findlink(), UndoElem::name, and NULL.

Referenced by rna_undo_itemf().

char* BKE_undo_menu_string ( void  )
void BKE_undo_name ( bContext C,
const char *  name 
)

Definition at line 647 of file blender.c.

References BKE_undo_step(), BLI_rfindstring(), and UndoElem::prev.

Referenced by ed_undo_step().

void BKE_undo_number ( bContext C,
int  nr 
)

Definition at line 640 of file blender.c.

References BKE_undo_step(), and BLI_findlink().

Referenced by undo_history_exec().

void BKE_undo_save_quit ( void  )
void BKE_undo_step ( bContext C,
int  step 
)
int BKE_undo_valid ( const char *  name)

Definition at line 658 of file blender.c.

References BLI_rfindstring(), ListBase::first, ListBase::last, and UndoElem::prev.

Referenced by ED_undo_valid().

void BKE_userdef_free ( void  )
void BKE_write_undo ( bContext C,
const char *  name 
)
int blender_test_break ( void  )
static void clean_paths ( Main main) [static]
static void clear_global ( void  ) [static]

Definition at line 157 of file blender.c.

References free_main(), Global::main, and NULL.

Referenced by setup_app_data().

void free_blender ( void  )
static int handle_subversion_warning ( Main main) [static]
void initglobals ( void  )
static void keymap_item_free ( wmKeyMapItem kmi) [static]

Definition at line 333 of file blender.c.

References IDP_FreeProperty(), MEM_freeN(), wmKeyMapItem::properties, and wmKeyMapItem::ptr.

Referenced by BKE_userdef_free().

static int read_undosave ( bContext C,
UndoElem uel 
) [static]
void set_blender_test_break_cb ( void(*)(void)  func)

Definition at line 434 of file blender.c.

References blender_test_break_cb.

Referenced by WM_init().

static void setup_app_data ( bContext C,
BlendFileData bfd,
const char *  filepath 
) [static]

Variable Documentation

void(* blender_test_break_cb)(void) = NULL [static]

Definition at line 432 of file blender.c.

Referenced by blender_test_break(), and set_blender_test_break_cb().

UndoElem* curundo = NULL [static]

Definition at line 465 of file blender.c.

Referenced by BKE_undo_save_quit().

short ENDIAN_ORDER

Definition at line 95 of file blender.c.

Referenced by actcon_get_tarmat(), action_idcode_patch_check(), action_move_fcurves_by_basepath(), action_to_animdata(), add_armature(), add_brush(), add_camera(), add_curve(), add_empty_action(), add_empty_text(), add_group(), add_key(), add_lamp(), add_lattice(), add_material(), add_mball(), add_mesh(), add_only_object(), add_render_lamp(), add_scene(), add_text(), add_texture(), add_world(), adduplicateflagNurb(), all_local(), ANIM_list_elem_update(), animchannels_rearrange_exec(), animdata_filter_dopesheet(), animdata_filter_dopesheet_texs(), animdata_filter_gpencil(), animsys_write_rna_setting(), applyarmature_fix_boneparents(), automatname(), autotexname(), backdrawview3d(), background_mode(), bake_freejob(), bake_image_exec(), bake_startjob(), Bevel(), bevel_menu(), bfree(), BIF_draw_manipulator(), BIF_selectOrientation(), BKE_add_image_extension(), BKE_add_image_file(), BKE_all_animdata_fix_paths_rename(), BKE_animdata_separate_by_basepath(), BKE_animsys_evaluate_all_animation(), BKE_icon_changed(), BKE_icon_getid(), BKE_image_all_free_anim_ibufs(), BKE_image_free_all_textures(), BKE_image_merge(), BKE_image_print_memlist(), BKE_image_signal(), BKE_image_verify_viewer(), BKE_keyingset_add_path(), BKE_makepicstring(), BKE_nla_tweakmode_enter(), BKE_ptcache_bake(), BKE_ptcache_toggle_disk_cache(), BKE_report(), BKE_reportf(), BL_MakeScreenShot(), blend_file_thumb(), blender_esc(), blo_find_main(), BLO_write_file(), bones_merge(), bookmark_select_exec(), BOP_intersectionBoolOp(), bpy_app_debug_get(), bpy_app_debug_set(), bpy_app_debug_value_get(), bpy_app_debug_value_set(), bpy_blend_paths(), bpy_class_free(), BPY_context_member_get(), BPY_driver_exec(), bpy_lib_exit(), bpy_lib_load(), BPY_modules_load_user(), BPY_rna_module(), BPY_update_rna_module(), brush_clone_image_set_nr(), brush_texture_set_nr(), build_grids_leaf_node(), build_mesh_leaf_node(), cache_break_test(), cache_voxeldata(), calc_fcurve_bounds(), ccgDM_drawEdges(), ccgDM_drawMappedEdges(), ccgDM_drawMappedEdgesInterp(), cdDM_drawMappedFaces(), change_frame_poll(), check_material_alpha(), check_ob_drawface_dot(), checkPackedFile(), clear_id_newpoins(), clear_sca_new_poins(), cloth_build_springs(), cloth_free_modifier_extern(), cloth_from_object(), connect_hair(), copy_libblock(), count_proportional_objects(), DocumentImporter::create_camera_object(), DocumentImporter::create_lamp_object(), MeshImporter::create_mesh_object(), customdata_external_filename(), dag_id_flush_update(), DAG_id_tag_update(), DAG_scene_sort(), debug_mode(), default_break(), defocus_blur(), deformVerts(), delete_key_button_exec(), delete_key_exec(), delete_keyframe(), disable_python(), distribute_threads_init_data(), do_merge_fullsample(), do_render_composite_fields_blur_3d(), do_render_fields_blur_3d(), do_running_jobs(), do_versions(), do_versions_ipos_to_animato(), draw_armature(), draw_ebones(), draw_em_measure_stats(), draw_glsl_material(), draw_gpencil_view3d_ext(), draw_image_main(), draw_image_seq(), draw_line_bone(), draw_manipulator_rotate(), draw_manipulator_rotate_cyl(), draw_manipulator_scale(), draw_manipulator_translate(), draw_mesh_fancy(), draw_object(), draw_object_backbufsel(), draw_pose_bones(), draw_seq_handle(), draw_seq_strip(), drawcamera(), drawlamp(), drawmball(), dtar_get_prop_val(), ED_area_overdraw(), ED_armature_bone_rename(), ED_armature_from_edit(), ED_fileselect_set_params(), ED_node_composit_default(), ED_node_shader_default(), ED_node_texture_default(), ED_operator_screenactive_norender(), ED_preview_init_dbase(), ED_screen_add(), ED_screen_full_toggle(), ED_screen_refresh(), ED_screens_initialize(), ED_spacetype_sequencer(), ED_undo_operator_repeat(), ED_undo_push(), ED_view3d_draw_offscreen(), EM_select_face_fgon(), enable_python(), envmap_save_invoke(), exist_object(), face_duplilist(), file_browse_exec(), file_delete_exec(), file_directory_exec(), file_exec(), file_extension_type(), file_parent_exec(), file_select_do(), file_sfile_to_operator(), filelist_from_library(), filelist_from_main(), filelist_read_dir(), filelist_read_library(), filepath_avi(), filterSmartReebGraph(), find_family_object(), find_group(), find_id(), find_missing_files_exec(), findMissingFiles(), DocumentImporter::finish(), finish_bake_internal(), flag_all_listbases_ids(), fluid_init_filepaths(), fluidbake_breakjob(), fluidbake_startjob(), fluidsim_delete_until_lastframe(), fluidsim_read_cache(), framechange_poses_clear_unkeyed(), free_ipo(), free_libblock(), free_old_images(), free_openrecent(), freeData(), get_brush_icon(), get_builtin_font(), ghost_event_proc(), gp_draw_data(), gp_draw_stroke_buffer(), gp_drawui_layer(), gp_paint_initstroke(), gp_session_initpaint(), gp_stroke_newfrombuffer(), gpencil_data_addnew(), gpencil_draw_apply(), gpencil_draw_exit(), gpencil_draw_invoke(), gpencil_draw_poll(), GPU_free_images(), GPU_free_images_anim(), GPU_materials_free(), GPU_paint_set_mipmap(), GPU_print_error(), GPU_update_images_framechange(), graph_init(), group_duplilist(), handleEventBevel(), icon_create_rect(), icon_draw_size(), icon_set_image(), icu_to_fcurves(), id_unlink(), image_alloc(), image_fix_relative_path(), image_initialize_after_load(), image_load_image_file(), image_load_movie_file(), image_load_sequence_file(), image_unpack_exec(), image_unpack_invoke(), IMB_isanim(), IMB_ispic(), imb_load_dpx_cineon(), imb_save_dpx_cineon(), implicit_init(), implicit_set_positions(), init_render_texture(), init_userdef_do_versions(), initBevel(), insert_key_button_exec(), insert_key_exec(), ipo_to_animato(), ipo_to_animdata(), joined_armature_fix_links(), lib_link_scene(), library_append_begin(), library_append_end(), load_editMesh(), load_file(), load_vfont(), localize_lamp(), localize_material(), localize_texture(), localize_world(), logic_buttons(), main(), make_app_info(), make_local_action(), make_local_armature(), make_local_brush(), make_local_camera(), make_local_curve(), make_local_lamp(), make_local_lattice(), make_local_material(), make_local_mball(), make_local_mesh(), make_local_object(), make_local_particlesettings(), make_local_texture(), make_local_world(), make_paths_absolute_exec(), make_paths_relative_exec(), make_renderinfo_string(), make_sss_tree(), makeBevelList(), makeDispListMBall(), manipulator_selectbuf(), meshdeformModifier_do(), metaball_polygonize(), motionpaths_calc_optimise_depsgraph(), motionpaths_calc_update_scene(), mouse_anim_channels(), mouse_nla_channels(), multires_external_save_exec(), multiresbake_image_exec(), multiresbake_test_break(), namebutton_cb(), new_id(), new_particle_duplilist(), newPackedFile(), nla_init(), nlaevalchan_verify(), no_joystick(), node_add_node(), node_composit_exec_output_file(), nodeAddNodeType(), nodeGroupSocketUseFlags(), nodeGroupUnGroup(), nodeGroupVerify(), ntreeAddTree(), ntreeCompositExecTree(), ntreeCompositTagRender(), ntreeCopyTree(), ntreeMakeLocal(), nupdate_abk_bezt(), nurbs_to_mesh(), object_add_particle_system(), object_duplilist_recursive(), object_handle_update(), object_remove_material_slot(), object_remove_particle_system(), objects_bake_render_invoke(), open_exec(), open_invoke(), open_set_use_scripts(), ImagesExporter::operator()(), operator_search_cb(), pack_all_exec(), particles_fluid_step(), pastebuf_match_path_property(), PE_undo_step(), playback_mode(), psys_check_enabled(), psys_find_parents(), psys_new_settings(), psys_render_set(), psys_threads_init_path(), ptcache_bake_all_exec(), ptcache_bake_exec(), ptcache_bake_thread(), ptcache_disk_frame_to_mem(), ptcache_file_open(), ptcache_filename(), ptcache_mem_frame_to_disk(), ptcache_path(), ptcache_read_stream(), ptcache_write_stream(), pycon_evaluate(), pycon_get_tarmat(), pyrna_py_from_array_index(), pyrna_srna_ExternalType(), pyrna_unregister_class(), RE_bake_shade_all_selected(), RE_BlenderAnim(), RE_BlenderFrame(), RE_Database_Free(), RE_InitRenderCB(), RE_MergeFullSample(), read_global(), read_libraries(), readBitmapFontVersion0(), recent_files_menu_draw(), region_azone_initialize(), region_rect_recursive(), register_extension(), reload_sequence_new_file(), rename_id(), renamebutton_cb(), render_breakjob(), render_endjob(), render_new_particle_system(), render_view_show_invoke(), reopen_text(), report_missing_files_exec(), reports_to_text_exec(), sample_apply(), save_as_invoke(), save_envmap(), save_exec(), save_image_doit(), save_set_compress(), sb_detect_vertex_collisionCached(), scene_unique_exr_name(), screen_render_exec(), screen_render_invoke(), screenshot_exec(), screenshot_invoke(), search_id_collection(), separated_armature_fix_links(), seq_load_operator_info(), seq_proxy_get_fname(), seq_render_scene_strip_impl(), seq_render_strip(), sequencer_add_movie_strip(), sequencer_generic_invoke_path__internal(), set_factory_startup(), set_sca_new_poins(), set_scene_name(), set_threads(), set_trans_object_base_flags(), set_unified_alpha(), set_unified_settings(), set_unified_size(), set_unified_unprojected_radius(), Color32::setBGRA(), setExecutableNodes(), Color32::setRGBA(), shader_print_errors(), single_obdata_users(), softbody_calc_forces(), softbody_step(), sound_new_file(), sound_unpack_exec(), sound_unpack_invoke(), special_aftertrans_update(), stampdata(), StartKetsjiShell(), test_idbutton(), test_object_materials(), text_file_modified(), text_ignore_modified(), thread_break(), threaded_makeshadowbufs(), time_main_area_draw(), touch_seq_files(), VBVH_optimalPackSIMD< Node, TestCost >::transform(), transform_exec(), transform_invoke(), transformEvent(), transformops_data(), transformops_exit(), txt_write_file(), UI_icon_get_height(), UI_icon_get_width(), UI_view2d_totRect_set_resize(), uiStyleInit(), undo_editmode_step(), undo_stack_step(), unified_alpha(), unified_settings(), unified_size(), unified_unprojected_radius(), unlink_actuator(), unlink_controller(), unlink_group(), unlink_object(), unpack_all_exec(), unpack_all_invoke(), unpack_menu(), untitled(), validate_pyconstraint_cb(), versions_gpencil_add_main(), vertex_duplilist(), view3d_opengl_select(), view_editmove(), viewnumpad_exec(), wm_autosave_timer(), wm_block_create_splash(), WM_check(), WM_clipboard_text_get(), WM_clipboard_text_set(), WM_cursor_grab(), WM_cursor_ungrab(), WM_cursor_wait(), wm_debug_menu_exec(), wm_debug_menu_invoke(), wm_event_add_ghostevent(), wm_event_do_handlers(), wm_event_do_notifiers(), WM_exit(), wm_handler_fileselect_call(), WM_init(), wm_init_userdef(), wm_link_append_exec(), wm_link_append_invoke(), WM_main_add_notifier(), wm_open_mainfile_exec(), wm_open_mainfile_invoke(), wm_operator_finished(), wm_operator_invoke(), wm_operator_reports(), WM_read_file(), WM_read_history(), WM_read_homefile(), wm_recover_auto_save_exec(), wm_recover_last_session_exec(), wm_save_as_mainfile_exec(), wm_save_as_mainfile_invoke(), wm_save_mainfile_invoke(), wm_set_apple_prefsize(), wm_subwindow_open(), wm_window_fullscreen_toggle_exec(), wm_window_make_drawable(), wm_window_match_do(), wm_window_match_init(), wm_window_title(), WM_write_file(), WM_write_homefile(), write_crash_blend(), write_global(), write_history(), writePackedFile(), and zbuffer_transp_shade().

Definition at line 96 of file blender.c.

ListBase undobase = {NULL, NULL} [static]

Definition at line 464 of file blender.c.

Referenced by undoCurve_to_editCurve().

char versionstr[48] = ""

Definition at line 100 of file blender.c.

Referenced by initglobals(), and stats_string().