Blender V5.0
object_ops.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2008 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cstdlib>
10
11#include "DNA_object_types.h"
12#include "DNA_space_types.h"
13
14#include "BKE_context.hh"
15
16#include "RNA_access.hh"
17
18#include "WM_api.hh"
19#include "WM_types.hh"
20
21#include "ED_object.hh"
22
23#include "object_intern.hh"
24
25/* ************************** registration **********************************/
26
27namespace blender::ed::object {
28
30{
40
54
56
67
71
81
87
119
153
154 /* Shader FX. */
161
166
191
219
221
226
236
242
250
264
266
270
274
277
279
280 /* Light linking. */
281
285
289
291
292 /* Custom cameras. */
294
297}
298
300{
302 wmOperatorTypeMacro *otmacro;
303
304 ot = WM_operatortype_append_macro("OBJECT_OT_duplicate_move",
305 "Duplicate Objects",
306 "Duplicate the selected objects and move them",
308 if (ot) {
309 WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate");
310 otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
311 RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
312 }
313
315 "OBJECT_OT_duplicate_move_linked",
316 "Duplicate Linked",
317 "Duplicate the selected objects, but not their object data, and move them",
319 if (ot) {
320 otmacro = WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate");
321 RNA_boolean_set(otmacro->ptr, "linked", true);
322 otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
323 RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
324 }
325}
326
328{
330 return (!ob || ob->mode == OB_MODE_OBJECT);
331}
332
334{
335 wmKeyMap *keymap;
336
337 /* Objects, Regardless of Mode -------------------------------------------------- */
338 keymap = WM_keymap_ensure(keyconf, "Object Non-modal", SPACE_EMPTY, RGN_TYPE_WINDOW);
339
340 /* Object Mode ---------------------------------------------------------------- */
341 /* NOTE: this keymap gets disabled in non-object-mode. */
342 keymap = WM_keymap_ensure(keyconf, "Object Mode", SPACE_EMPTY, RGN_TYPE_WINDOW);
343 keymap->poll = object_mode_poll;
344}
345
346} // namespace blender::ed::object
Object * CTX_data_active_object(const bContext *C)
@ OB_MODE_OBJECT
Object is a sort of wrapper for general info.
@ RGN_TYPE_WINDOW
@ SPACE_EMPTY
#define C
Definition RandGen.cpp:29
@ OPTYPE_UNDO
Definition WM_types.hh:182
@ OPTYPE_REGISTER
Definition WM_types.hh:180
void OBJECT_OT_simulation_nodes_cache_bake(wmOperatorType *ot)
void OBJECT_OT_geometry_node_bake_delete_single(wmOperatorType *ot)
void OBJECT_OT_geometry_node_bake_unpack_single(wmOperatorType *ot)
void OBJECT_OT_geometry_node_bake_pack_single(wmOperatorType *ot)
void OBJECT_OT_geometry_node_bake_single(wmOperatorType *ot)
void OBJECT_OT_simulation_nodes_cache_calculate_to_frame(wmOperatorType *ot)
void OBJECT_OT_simulation_nodes_cache_delete(wmOperatorType *ot)
void OBJECT_OT_paths_update_visible(wmOperatorType *ot)
void OBJECT_OT_shape_key_clear(wmOperatorType *ot)
void OBJECT_OT_metaball_add(wmOperatorType *ot)
void OBJECT_OT_vertex_weight_paste(wmOperatorType *ot)
void OBJECT_OT_shade_smooth(wmOperatorType *ot)
void OBJECT_OT_vertex_group_normalize(wmOperatorType *ot)
void OBJECT_OT_hook_select(wmOperatorType *ot)
void OBJECT_OT_vertex_group_sort(wmOperatorType *ot)
void OBJECT_OT_vertex_group_levels(wmOperatorType *ot)
void OBJECT_OT_multires_base_apply(wmOperatorType *ot)
void OBJECT_OT_vertex_weight_set_active(wmOperatorType *ot)
void OBJECT_OT_editmode_toggle(wmOperatorType *ot)
void OBJECT_OT_light_linking_receiver_collection_new(wmOperatorType *ot)
void OBJECT_OT_make_local(wmOperatorType *ot)
void OBJECT_OT_curves_empty_hair_add(wmOperatorType *ot)
void keymap_object(wmKeyConfig *keyconf)
void OBJECT_OT_vertex_group_set_active(wmOperatorType *ot)
void CONSTRAINT_OT_move_down(wmOperatorType *ot)
void OBJECT_OT_clear_override_library(wmOperatorType *ot)
void OBJECT_OT_mode_set(wmOperatorType *ot)
void OBJECT_OT_origin_set(wmOperatorType *ot)
void OBJECT_OT_vertex_group_smooth(wmOperatorType *ot)
void OBJECT_OT_text_add(wmOperatorType *ot)
void OBJECT_OT_select_more(wmOperatorType *ot)
void OBJECT_OT_posemode_toggle(wmOperatorType *ot)
void OBJECT_OT_vertex_group_lock(wmOperatorType *ot)
void OBJECT_OT_geometry_node_tree_copy_assign(wmOperatorType *ot)
void OBJECT_OT_select_mirror(wmOperatorType *ot)
void OBJECT_OT_update_shapes(wmOperatorType *ot)
void OBJECT_OT_shade_flat(wmOperatorType *ot)
void OBJECT_OT_vertex_weight_normalize_active_vertex(wmOperatorType *ot)
void OBJECT_OT_hide_view_clear(wmOperatorType *ot)
void OBJECT_OT_shape_key_move(wmOperatorType *ot)
void OBJECT_OT_shade_auto_smooth(wmOperatorType *ot)
void OBJECT_OT_unlink_data(wmOperatorType *ot)
void OBJECT_OT_vertex_group_assign(wmOperatorType *ot)
void OBJECT_OT_delete(wmOperatorType *ot)
void OBJECT_OT_transform_to_mouse(wmOperatorType *ot)
void OBJECT_OT_vertex_group_limit_total(wmOperatorType *ot)
void OBJECT_OT_select_all(wmOperatorType *ot)
void OBJECT_OT_collection_instance_add(wmOperatorType *ot)
void OBJECT_OT_multires_rebuild_subdiv(wmOperatorType *ot)
void OBJECT_OT_select_same_collection(wmOperatorType *ot)
void OBJECT_OT_bake_image(wmOperatorType *ot)
void OBJECT_OT_grease_pencil_dash_modifier_segment_add(wmOperatorType *ot)
void OBJECT_OT_multires_reshape(wmOperatorType *ot)
void OBJECT_OT_shade_smooth_by_angle(wmOperatorType *ot)
void OBJECT_OT_data_transfer(wmOperatorType *ot)
void OBJECT_OT_bake(wmOperatorType *ot)
void OBJECT_OT_transform_axis_target(wmOperatorType *ot)
void OBJECT_OT_vertex_group_copy_to_selected(wmOperatorType *ot)
void OBJECT_OT_move_to_collection(wmOperatorType *ot)
void OBJECT_OT_make_links_scene(wmOperatorType *ot)
void OBJECT_OT_collection_external_asset_drop(wmOperatorType *ot)
void OBJECT_OT_meshdeform_bind(wmOperatorType *ot)
void OBJECT_OT_track_clear(wmOperatorType *ot)
void OBJECT_OT_vertex_weight_copy(wmOperatorType *ot)
void OBJECT_OT_data_instance_add(wmOperatorType *ot)
void OBJECT_OT_armature_add(wmOperatorType *ot)
void OBJECT_OT_lattice_add_to_selected(wmOperatorType *ot)
void OBJECT_OT_hide_view_set(wmOperatorType *ot)
void OBJECT_OT_multires_unsubdivide(wmOperatorType *ot)
void OBJECT_OT_origin_clear(wmOperatorType *ot)
void OBJECT_OT_modifier_move_to_index(wmOperatorType *ot)
void OBJECT_OT_hook_remove(wmOperatorType *ot)
void OBJECT_OT_speaker_add(wmOperatorType *ot)
void OBJECT_OT_explode_refresh(wmOperatorType *ot)
void OBJECT_OT_constraint_add_with_targets(wmOperatorType *ot)
void CONSTRAINT_OT_objectsolver_set_inverse(wmOperatorType *ot)
void OBJECT_OT_ocean_bake(wmOperatorType *ot)
void OBJECT_OT_skin_root_mark(wmOperatorType *ot)
void OBJECT_OT_drop_named_material(wmOperatorType *ot)
void OBJECT_OT_shaderfx_add(wmOperatorType *ot)
void OBJECT_OT_voxel_size_edit(wmOperatorType *ot)
void OBJECT_OT_hook_add_selob(wmOperatorType *ot)
void OBJECT_OT_collection_objects_select(wmOperatorType *ot)
void OBJECT_OT_datalayout_transfer(wmOperatorType *ot)
void OBJECT_OT_collection_link(wmOperatorType *ot)
void OBJECT_OT_parent_no_inverse_set(wmOperatorType *ot)
void CONSTRAINT_OT_limitdistance_reset(wmOperatorType *ot)
void operatortypes_object()
Definition object_ops.cc:29
void OBJECT_OT_vertex_group_mirror(wmOperatorType *ot)
void OBJECT_OT_pointcloud_random_add(wmOperatorType *ot)
void OBJECT_OT_light_linking_blocker_collection_new(wmOperatorType *ot)
void OBJECT_OT_select_linked(wmOperatorType *ot)
void OBJECT_OT_multires_subdivide(wmOperatorType *ot)
void OBJECT_OT_mode_set_with_submode(wmOperatorType *ot)
void OBJECT_OT_lightprobe_add(wmOperatorType *ot)
void OBJECT_OT_hide_collection(wmOperatorType *ot)
void OBJECT_OT_modifier_move_down(wmOperatorType *ot)
void OBJECT_OT_rotation_clear(wmOperatorType *ot)
void OBJECT_OT_track_set(wmOperatorType *ot)
void OBJECT_OT_select_by_type(wmOperatorType *ot)
void CONSTRAINT_OT_copy(wmOperatorType *ot)
void OBJECT_OT_modifier_remove(wmOperatorType *ot)
void OBJECT_OT_grease_pencil_dash_modifier_segment_remove(wmOperatorType *ot)
void OBJECT_OT_join_shapes(wmOperatorType *ot)
void OBJECT_OT_grease_pencil_add(wmOperatorType *ot)
void OBJECT_OT_shape_key_copy(wmOperatorType *ot)
void CONSTRAINT_OT_apply(wmOperatorType *ot)
void OBJECT_OT_paths_update(wmOperatorType *ot)
void OBJECT_OT_modifier_apply(wmOperatorType *ot)
void OBJECT_OT_vertex_parent_set(wmOperatorType *ot)
void OBJECT_OT_vertex_group_deselect(wmOperatorType *ot)
void OBJECT_OT_convert(wmOperatorType *ot)
void OBJECT_OT_light_linking_unlink_from_collection(wmOperatorType *ot)
void CONSTRAINT_OT_move_up(wmOperatorType *ot)
void link_to_collection_menu_register()
void OBJECT_OT_paths_calculate(wmOperatorType *ot)
void POSE_OT_constraints_copy(wmOperatorType *ot)
void OBJECT_OT_select_less(wmOperatorType *ot)
void OBJECT_OT_modifier_apply_as_shapekey(wmOperatorType *ot)
void OBJECT_OT_shaderfx_copy(wmOperatorType *ot)
void OBJECT_OT_vertex_group_invert(wmOperatorType *ot)
void OBJECT_OT_vertex_group_move(wmOperatorType *ot)
void OBJECT_OT_modifier_convert(wmOperatorType *ot)
void OBJECT_OT_voxel_remesh(wmOperatorType *ot)
void OBJECT_OT_grease_pencil_time_modifier_segment_move(wmOperatorType *ot)
void OBJECT_OT_vertex_group_remove_from(wmOperatorType *ot)
void OBJECT_OT_forcefield_toggle(wmOperatorType *ot)
void TRANSFORM_OT_vertex_warp(wmOperatorType *ot)
void OBJECT_OT_make_links_data(wmOperatorType *ot)
void OBJECT_OT_light_linking_receivers_link(wmOperatorType *ot)
void OBJECT_OT_hook_add_newob(wmOperatorType *ot)
void OBJECT_OT_camera_custom_update(wmOperatorType *ot)
void OBJECT_OT_effector_add(wmOperatorType *ot)
void OBJECT_OT_modifier_move_up(wmOperatorType *ot)
void OBJECT_OT_geometry_nodes_input_attribute_toggle(wmOperatorType *ot)
void OBJECT_OT_multires_external_save(wmOperatorType *ot)
void OBJECT_OT_light_linking_blockers_select(wmOperatorType *ot)
void OBJECT_OT_add_named(wmOperatorType *ot)
void POSE_OT_ik_add(wmOperatorType *ot)
void POSE_OT_ik_clear(wmOperatorType *ot)
void OBJECT_OT_modifiers_copy_to_selected(wmOperatorType *ot)
void OBJECT_OT_link_to_collection(wmOperatorType *ot)
void OBJECT_OT_shaderfx_remove(wmOperatorType *ot)
void OBJECT_OT_light_add(wmOperatorType *ot)
void POSE_OT_constraint_add(wmOperatorType *ot)
void OBJECT_OT_hook_assign(wmOperatorType *ot)
void CONSTRAINT_OT_delete(wmOperatorType *ot)
void OBJECT_OT_collection_add(wmOperatorType *ot)
void OBJECT_OT_vertex_group_assign_new(wmOperatorType *ot)
void OBJECT_OT_shaderfx_move_up(wmOperatorType *ot)
void OBJECT_OT_shape_key_lock(wmOperatorType *ot)
void OBJECT_OT_vertex_weight_delete(wmOperatorType *ot)
void OBJECT_OT_scale_clear(wmOperatorType *ot)
void move_to_collection_menu_register()
void OBJECT_OT_multires_higher_levels_delete(wmOperatorType *ot)
void OBJECT_OT_vertex_group_copy(wmOperatorType *ot)
void CONSTRAINT_OT_stretchto_reset(wmOperatorType *ot)
void OBJECT_OT_visual_transform_apply(wmOperatorType *ot)
void OBJECT_OT_empty_image_add(wmOperatorType *ot)
void OBJECT_OT_shape_key_make_basis(wmOperatorType *ot)
void OBJECT_OT_constraint_add(wmOperatorType *ot)
void OBJECT_OT_volume_add(wmOperatorType *ot)
void OBJECT_OT_correctivesmooth_bind(wmOperatorType *ot)
void OBJECT_OT_surfacedeform_bind(wmOperatorType *ot)
void TRANSFORM_OT_vertex_random(wmOperatorType *ot)
void OBJECT_OT_volume_import(wmOperatorType *ot)
void OBJECT_OT_vertex_group_quantize(wmOperatorType *ot)
void OBJECT_OT_skin_radii_equalize(wmOperatorType *ot)
void CONSTRAINT_OT_move_to_index(wmOperatorType *ot)
void OBJECT_OT_quadriflow_remesh(wmOperatorType *ot)
void OBJECT_OT_constraints_copy(wmOperatorType *ot)
void OBJECT_OT_reset_override_library(wmOperatorType *ot)
void OBJECT_OT_parent_clear(wmOperatorType *ot)
void COLLECTION_OT_create(wmOperatorType *ot)
void OBJECT_OT_empty_add(wmOperatorType *ot)
void OBJECT_OT_select_grouped(wmOperatorType *ot)
void OBJECT_OT_shape_key_retime(wmOperatorType *ot)
void OBJECT_OT_shape_key_add(wmOperatorType *ot)
void OBJECT_OT_modifier_add(wmOperatorType *ot)
void OBJECT_OT_make_override_library(wmOperatorType *ot)
void OBJECT_OT_collection_unlink(wmOperatorType *ot)
void OBJECT_OT_duplicates_make_real(wmOperatorType *ot)
void OBJECT_OT_modifier_copy(wmOperatorType *ot)
void OBJECT_OT_laplaciandeform_bind(wmOperatorType *ot)
void OBJECT_OT_collection_remove(wmOperatorType *ot)
void OBJECT_OT_drop_geometry_nodes(wmOperatorType *ot)
void OBJECT_OT_make_single_user(wmOperatorType *ot)
void OBJECT_OT_shaderfx_move_down(wmOperatorType *ot)
void OBJECT_OT_vertex_group_remove(wmOperatorType *ot)
void OBJECT_OT_skin_loose_mark_clear(wmOperatorType *ot)
void COLLECTION_OT_objects_add_active(wmOperatorType *ot)
void OBJECT_OT_constraints_clear(wmOperatorType *ot)
void OBJECT_OT_modifier_copy_to_selected(wmOperatorType *ot)
void OBJECT_OT_add(wmOperatorType *ot)
void OBJECT_OT_modifier_set_active(wmOperatorType *ot)
void OBJECT_OT_shape_key_remove(wmOperatorType *ot)
void OBJECT_OT_vertex_group_add(wmOperatorType *ot)
void OBJECT_OT_location_clear(wmOperatorType *ot)
static bool object_mode_poll(bContext *C)
void OBJECT_OT_select_random(wmOperatorType *ot)
void OBJECT_OT_curves_random_add(wmOperatorType *ot)
void OBJECT_OT_multires_external_pack(wmOperatorType *ot)
void OBJECT_OT_parent_inverse_apply(wmOperatorType *ot)
void OBJECT_OT_modifiers_clear(wmOperatorType *ot)
void COLLECTION_OT_objects_remove_all(wmOperatorType *ot)
void OBJECT_OT_light_linking_receivers_select(wmOperatorType *ot)
void OBJECT_OT_duplicate(wmOperatorType *ot)
void OBJECT_OT_parent_set(wmOperatorType *ot)
void OBJECT_OT_join(wmOperatorType *ot)
void OBJECT_OT_vertex_group_clean(wmOperatorType *ot)
void OBJECT_OT_grease_pencil_time_modifier_segment_remove(wmOperatorType *ot)
void CONSTRAINT_OT_objectsolver_clear_inverse(wmOperatorType *ot)
void OBJECT_OT_hook_recenter(wmOperatorType *ot)
void OBJECT_OT_hook_reset(wmOperatorType *ot)
void OBJECT_OT_shaderfx_move_to_index(wmOperatorType *ot)
void OBJECT_OT_vertex_group_select(wmOperatorType *ot)
void CONSTRAINT_OT_childof_clear_inverse(wmOperatorType *ot)
void OBJECT_OT_paths_clear(wmOperatorType *ot)
void OBJECT_OT_camera_add(wmOperatorType *ot)
void COLLECTION_OT_objects_remove_active(wmOperatorType *ot)
void CONSTRAINT_OT_followpath_path_animate(wmOperatorType *ot)
void OBJECT_OT_transfer_mode(wmOperatorType *ot)
void OBJECT_OT_grease_pencil_time_modifier_segment_add(wmOperatorType *ot)
void CONSTRAINT_OT_childof_set_inverse(wmOperatorType *ot)
void OBJECT_OT_grease_pencil_dash_modifier_segment_move(wmOperatorType *ot)
void OBJECT_OT_visual_geometry_to_objects(wmOperatorType *ot)
void OBJECT_OT_shape_key_mirror(wmOperatorType *ot)
void COLLECTION_OT_objects_remove(wmOperatorType *ot)
void OBJECT_OT_light_linking_blockers_link(wmOperatorType *ot)
void POSE_OT_constraint_add_with_targets(wmOperatorType *ot)
void CONSTRAINT_OT_copy_to_selected(wmOperatorType *ot)
void POSE_OT_constraints_clear(wmOperatorType *ot)
void OBJECT_OT_transform_apply(wmOperatorType *ot)
void OBJECT_OT_skin_armature_create(wmOperatorType *ot)
void OBJECT_OT_vertex_group_normalize_all(wmOperatorType *ot)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
bool(* poll)(struct bContext *)
wmOperatorType * ot
Definition wm_files.cc:4237
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
Definition wm_keymap.cc:895
wmOperatorTypeMacro * WM_operatortype_macro_define(wmOperatorType *ot, const char *idname)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
wmOperatorType * WM_operatortype_append_macro(const char *idname, const char *name, const char *description, int flag)