Blender
V3.3
|
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BLT_translation.h"
#include "BKE_collection.h"
#include "BKE_global.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_remap.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_multires.h"
#include "BKE_object.h"
#include "BKE_packedFile.h"
#include "BKE_paint.h"
#include "BKE_screen.h"
#include "BKE_undo_system.h"
#include "DEG_depsgraph.h"
#include "DNA_gpencil_types.h"
#include "ED_armature.h"
#include "ED_asset.h"
#include "ED_gpencil.h"
#include "ED_image.h"
#include "ED_mesh.h"
#include "ED_object.h"
#include "ED_paint.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_util.h"
#include "GPU_immediate.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "RNA_access.h"
#include "WM_api.h"
#include "WM_types.h"
Go to the source code of this file.
Functions | |
void | ED_editors_init_for_undo (Main *bmain) |
void | ED_editors_init (bContext *C) |
void | ED_editors_exit (Main *bmain, bool do_undo_system) |
bool | ED_editors_flush_edits_for_object_ex (Main *bmain, Object *ob, bool for_render, bool check_needs_flush) |
bool | ED_editors_flush_edits_for_object (Main *bmain, Object *ob) |
bool | ED_editors_flush_edits_ex (Main *bmain, bool for_render, bool check_needs_flush) |
bool | ED_editors_flush_edits (Main *bmain) |
void | apply_keyb_grid (bool shift, bool ctrl, float *val, float fac1, float fac2, float fac3, int invert) |
void | unpack_menu (bContext *C, const char *opname, const char *id_name, const char *abs_name, const char *folder, struct PackedFile *pf) |
void | ED_spacedata_id_remap (struct ScrArea *area, struct SpaceLink *sl, const struct IDRemapper *mappings) |
void | ED_spacedata_id_remap_single (struct ScrArea *area, struct SpaceLink *sl, ID *old_id, ID *new_id) |
void apply_keyb_grid | ( | bool | shift, |
bool | ctrl, | ||
float * | val, | ||
float | fac1, | ||
float | fac2, | ||
float | fac3, | ||
int | invert | ||
) |
Now only used in 2D spaces, like time, f-curve, NLA, image, etc.
Definition at line 332 of file ed_util.c.
References floorf, and invert().
Referenced by ed_marker_move_modal().
Frees all edit-mode stuff.
Definition at line 213 of file ed_util.c.
References BKE_undosys_stack_destroy(), DEG_id_tag_update(), ED_mesh_mirror_spatial_table_end(), ED_mesh_mirror_topo_table_end(), ED_object_editmode_free_ex(), ListBase::first, G_MAIN, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, NULL, Main::objects, and wmWindowManager::undo_stack.
Referenced by memfile_undosys_step_decode(), WM_exit_ex(), and wm_window_match_init().
Definition at line 325 of file ed_util.c.
References ED_editors_flush_edits_ex().
Referenced by ed_flush_edits_exec(), scene_add(), wm_autosave_write(), WM_exit_ex(), wm_file_write(), and wm_homefile_write_exec().
Flush any temp data from object editing to DNA before writing files, rendering, copying, etc.
Definition at line 308 of file ed_util.c.
References ED_editors_flush_edits_for_object_ex(), ListBase::first, Object::id, Main::is_memfile_undo_flush_needed, ID::next, and Main::objects.
Referenced by ED_editors_flush_edits(), memfile_undosys_step_encode(), and screen_render_invoke().
Definition at line 303 of file ed_util.c.
References ED_editors_flush_edits_for_object_ex().
bool ED_editors_flush_edits_for_object_ex | ( | Main * | bmain, |
Object * | ob, | ||
bool | for_render, | ||
bool | check_needs_flush | ||
) |
Definition at line 254 of file ed_util.c.
References BKE_object_data_editmode_flush_ptr_get(), BKE_sculptsession_bm_to_me(), BKE_sculptsession_bm_to_me_for_render(), SculptSession::cache, Object::data, ED_object_editmode_load(), Object::mode, multires_flush_sculpt_updates(), SculptSession::needs_flush_to_id, NULL, OB_MODE_EDIT, OB_MODE_SCULPT, and Object::sculpt.
Referenced by ED_editors_flush_edits_ex(), and ED_editors_flush_edits_for_object().
Definition at line 78 of file ed_util.c.
References blender::compositor::area(), BKE_collection_has_object_recursive(), BKE_id_is_editable(), BKE_object_has_mode_data(), BKE_object_sculpt_data_create(), BKE_scene_has_object(), BLI_assert_unreachable, C, CTX_data_active_object(), CTX_data_expect_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_wm_manager(), CTX_wm_reports(), DEG_id_tag_update(), depsgraph, ED_area_tag_redraw(), ED_assetlist_storage_tag_main_data_dirty(), ED_gpencil_toggle_brush_cursor(), ED_object_editmode_enter_ex(), ED_object_mode_set(), ED_object_posemode_enter_ex(), ED_object_sculptmode_enter_ex(), ED_object_vpaintmode_enter_ex(), ED_object_wpaintmode_enter_ex(), ED_screen_areas_iter, ED_space_image_paint_update(), ListBase::first, bGPdata::flag, ReportList::flag, GP_DATA_STROKE_EDITMODE, GP_DATA_STROKE_PAINTMODE, GP_DATA_STROKE_SCULPTMODE, GP_DATA_STROKE_VERTEXMODE, GP_DATA_STROKE_WEIGHTMODE, ID_RECALC_COPY_ON_WRITE, LISTBASE_FOREACH, Scene::master_collection, NULL, OB_GPENCIL, OB_HIDE_VIEWPORT, OB_MODE_ALL_PAINT_GPENCIL, OB_MODE_ALL_SCULPT, OB_MODE_EDIT, OB_MODE_OBJECT, OB_MODE_POSE, OB_MODE_SCULPT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, Main::objects, wmWindowManager::op_undo_depth, RPT_STORE, scene, SWAP, Object::type, wmWindowManager::windows, and WM_window_get_active_screen().
Referenced by wm_file_read_post().
Definition at line 60 of file ed_util.c.
References BASACT, BKE_texpaint_slots_refresh_object(), ED_paint_proj_mesh_data_check(), ListBase::first, LISTBASE_FOREACH, Object::mode, NULL, OB_MODE_TEXTURE_PAINT, Base::object, scene, wmWindowManager::windows, Main::wm, WM_window_get_active_scene(), and WM_window_get_active_view_layer().
Referenced by image_undosys_step_decode(), and memfile_undosys_step_decode().
void ED_spacedata_id_remap | ( | struct ScrArea * | area, |
struct SpaceLink * | sl, | ||
const struct IDRemapper * | mappings | ||
) |
Definition at line 452 of file ed_util.c.
References blender::compositor::area(), BKE_spacetype_from_id(), SpaceLink::spacetype, and usdtokens::st().
Referenced by WM_main_remap_editor_id_reference().
void ED_spacedata_id_remap_single | ( | struct ScrArea * | area, |
struct SpaceLink * | sl, | ||
struct ID * | old_id, | ||
struct ID * | new_id | ||
) |
Use to free ID references within runtime data (stored outside of DNA)
new_id | may be NULL to unlink old_id. |
Definition at line 462 of file ed_util.c.
References blender::compositor::area(), BKE_id_remapper_add(), BKE_id_remapper_create(), BKE_id_remapper_free(), BKE_spacetype_from_id(), SpaceLink::spacetype, and usdtokens::st().
Referenced by WM_init().
void unpack_menu | ( | bContext * | C, |
const char * | opname, | ||
const char * | id_name, | ||
const char * | abs_name, | ||
const char * | folder, | ||
struct PackedFile * | pf | ||
) |
Definition at line 357 of file ed_util.c.
References BKE_main_blendfile_path(), BKE_packedfile_compare_to_file(), BLI_snprintf(), BLI_split_file_part(), C, CTX_data_main(), FILE_MAX, FILE_MAXDIR, id_name(), IFACE_, NULL, ot, pf, PF_CMP_DIFFERS, PF_CMP_EQUAL, PF_CMP_NOFILE, PF_REMOVE, PF_USE_LOCAL, PF_USE_ORIGINAL, PF_WRITE_LOCAL, PF_WRITE_ORIGINAL, RNA_enum_set(), RNA_string_set(), STREQ, TIP_, UI_popup_menu_begin(), UI_popup_menu_end(), UI_popup_menu_layout(), uiItemFullO_ptr(), WM_OP_EXEC_DEFAULT, and WM_operatortype_find().
Referenced by image_unpack_invoke(), and sound_unpack_invoke().