65 return "OBJECT_OT_editmode_toggle";
68 return "SCULPT_OT_sculptmode_toggle";
71 return "PAINT_OT_vertex_paint_toggle";
74 return "PAINT_OT_weight_paint_toggle";
77 return "PAINT_OT_texture_paint_toggle";
80 return "PARTICLE_OT_particle_edit_toggle";
83 return "OBJECT_OT_posemode_toggle";
86 return "GREASE_PENCIL_OT_paintmode_toggle";
89 return "GREASE_PENCIL_OT_sculptmode_toggle";
92 return "GREASE_PENCIL_OT_weightmode_toggle";
95 return "GREASE_PENCIL_OT_vertexmode_toggle";
98 return "CURVES_OT_sculptmode_toggle";
196 if (ob->
mode == mode) {
216 if (ob->
mode != mode) {
220 const ID &obdata_id = *
static_cast<ID *
>(ob->
data);
228 "The '%s' %s data-block is packed and not editable. Use \"Make Local\" to "
231 obdata_idtype_name_lower);
237 "The '%s' %s data-block is linked and not editable. Use \"Make Local\" to "
240 obdata_idtype_name_lower);
299 if (ob->
pose !=
nullptr) {
350 const bool is_mode_set)
356 if (ob_arm !=
nullptr) {
385 for (; md; md = md->
next) {
453 if (anim_time < 0.0f) {
473 for (
const auto &item : start_times.
items()) {
476 factors.
add_new(item.key, alpha);
507 if (mode_transferred) {
527 return mode_transferred;
547 if (ob_src == ob_dst) {
555 "Unable to transfer mode, the source and/or target objects are not editable");
562 "Current mode of source object '%s' is not compatible with target liboverride object '%s'",
570 "Current mode of source object '%s' is not compatible with target object '%s'",
577 C, op, scene, ob_src, ob_dst, mode_src);
578 if (!mode_transferred) {
599 ot->name =
"Transfer Mode";
600 ot->idname =
"OBJECT_OT_transfer_mode";
602 "Switches the active object and assigns the same mode to a new one under the mouse cursor, "
603 "leaving the active mode in the current one";
615 "use_flash_on_transfer",
618 "Flash the target object when transferring the mode");
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
RegionView3D * CTX_wm_region_view3d(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
const char * BKE_idtype_idcode_to_name(short idcode)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
void BKE_view_layer_base_deselect_all(const Scene *scene, ViewLayer *view_layer)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
void BKE_view_layer_base_select_and_set_active(ViewLayer *view_layer, Base *selbase)
const char * BKE_id_name(const ID &id)
ModifierData * BKE_modifiers_get_virtual_modifierlist(const Object *ob, VirtualModifierData *data)
General operations, lookup, etc. for blender objects.
bool BKE_object_is_in_editmode(const Object *ob)
Paint * BKE_paint_get_active_from_context(const bContext *C)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
MINLINE void copy_v3_v3(float r[3], const float a[3])
char * STRNCPY(char(&dst)[N], const char *src)
void BLI_str_tolower_ascii(char *str, size_t len) ATTR_NONNULL(1)
Platform independent time functions.
double BLI_time_now_seconds(void)
void DEG_id_tag_update(ID *id, unsigned int flags)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
#define ID_IS_PACKED(_id)
#define ID_IS_LINKED(_id)
#define ID_IS_EDITABLE(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
@ eModifierType_GreasePencilArmature
#define OB_MODE_ALL_PAINT
#define OB_MODE_ALL_MODE_DATA
@ OB_MODE_VERTEX_GREASE_PENCIL
@ OB_MODE_PAINT_GREASE_PENCIL
@ OB_MODE_SCULPT_GREASE_PENCIL
@ OB_MODE_WEIGHT_GREASE_PENCIL
Object is a sort of wrapper for general info.
#define BASE_SELECTED(v3d, base)
#define BASE_VISIBLE(v3d, base)
void ED_outliner_select_sync_from_object_tag(bContext *C)
void ED_object_wpaintmode_exit_ex(Object &ob)
void ED_object_vpaintmode_exit_ex(Object &ob)
void ED_object_texture_paint_mode_exit_ex(Main &bmain, Scene &scene, Object &ob)
bool ED_object_particle_edit_mode_supported(const Object *ob)
void ED_object_particle_edit_mode_exit_ex(Scene *scene, Object *ob)
void ED_undo_push(bContext *C, const char *str)
void ED_undo_group_begin(bContext *C)
void ED_undo_group_end(bContext *C)
bool ED_view3d_autodist_simple(ARegion *region, const int mval[2], float mouse_worldloc[3], int margin, const float *force_depth)
Base * ED_view3d_give_base_under_cursor(bContext *C, const int mval[2])
@ OPTYPE_DEPENDS_ON_CURSOR
BPy_StructRNA * depsgraph
void add_new(const Key &key, const Value &value)
int64_t remove_if(Predicate &&predicate)
ItemIterator items() const &
DEG_id_tag_update_ex(cb_data->bmain, cb_data->owner_id, ID_RECALC_TAG_FOR_UNDO|ID_RECALC_SYNC_TO_EVAL)
bool mode_generic_has_data(Depsgraph *depsgraph, const Object *ob)
constexpr float mode_transfer_flash_length
static void object_overlay_mode_transfer_animation_start(bContext *C, Object *ob_dst)
static wmOperatorStatus object_transfer_mode_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static bool ed_object_mode_generic_exit_ex(Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob, bool only_test)
static float alpha_from_time_get(const float anim_time)
Map< std::string, float, 1 > mode_transfer_overlay_current_state()
bool mode_set_ex(bContext *C, eObjectMode mode, bool use_undo, ReportList *reports)
void mode_generic_exit(Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob)
static bool object_transfer_mode_to_base(bContext *C, wmOperator *op, Scene *scene, Object *, Object *ob_dst, const eObjectMode mode_dst)
bool mode_compat_test(const Object *ob, eObjectMode mode)
static void ed_object_posemode_set_for_weight_paint_ex(bContext *C, Main *bmain, Object *ob_arm, const bool is_mode_set)
void posemode_set_for_weight_paint(bContext *C, Main *bmain, Object *ob, bool is_mode_set)
bool mode_compat_set(bContext *C, Object *ob, eObjectMode mode, ReportList *reports)
static const char * object_mode_op_string(eObjectMode mode)
static auto & mode_transfer_overlay_start_times()
static bool object_transfer_mode_poll(bContext *C)
static void object_transfer_mode_reposition_view_pivot(ARegion *region, Paint *paint, const int mval[2])
bool mode_set(bContext *C, eObjectMode mode)
bool editmode_exit_ex(Main *bmain, Scene *scene, Object *obedit, int flag)
void OBJECT_OT_transfer_mode(wmOperatorType *ot)
void object_sculpt_mode_exit(Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob)
bool ED_object_posemode_enter_ex(Main *bmain, Object *ob)
bool ED_object_posemode_exit_ex(Main *bmain, Object *ob)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
struct ModifierData * next
struct SculptSession * sculpt
PaintRuntimeHandle * runtime
blender::float3 average_stroke_accum
int average_stroke_counter
struct ReportList * reports
wmOperatorStatus WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, blender::wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, blender::wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)