Blender  V2.93
object_add.c File Reference
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
#include "DNA_camera_types.h"
#include "DNA_collection_types.h"
#include "DNA_curve_types.h"
#include "DNA_gpencil_modifier_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_key_types.h"
#include "DNA_light_types.h"
#include "DNA_lightprobe_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meta_types.h"
#include "DNA_object_fluidsim_types.h"
#include "DNA_object_force_types.h"
#include "DNA_object_types.h"
#include "DNA_pointcloud_types.h"
#include "DNA_scene_types.h"
#include "DNA_vfont_types.h"
#include "BLI_ghash.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "BKE_action.h"
#include "BKE_anim_data.h"
#include "BKE_armature.h"
#include "BKE_camera.h"
#include "BKE_collection.h"
#include "BKE_constraint.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_displist.h"
#include "BKE_duplilist.h"
#include "BKE_effect.h"
#include "BKE_font.h"
#include "BKE_geometry_set.h"
#include "BKE_gpencil_curve.h"
#include "BKE_gpencil_geom.h"
#include "BKE_gpencil_modifier.h"
#include "BKE_hair.h"
#include "BKE_key.h"
#include "BKE_lattice.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_lib_remap.h"
#include "BKE_light.h"
#include "BKE_lightprobe.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_mball.h"
#include "BKE_mesh.h"
#include "BKE_mesh_runtime.h"
#include "BKE_nla.h"
#include "BKE_object.h"
#include "BKE_particle.h"
#include "BKE_pointcloud.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_speaker.h"
#include "BKE_volume.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "DEG_depsgraph_query.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "UI_interface.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_armature.h"
#include "ED_curve.h"
#include "ED_gpencil.h"
#include "ED_mball.h"
#include "ED_mesh.h"
#include "ED_node.h"
#include "ED_object.h"
#include "ED_outliner.h"
#include "ED_physics.h"
#include "ED_render.h"
#include "ED_screen.h"
#include "ED_transform.h"
#include "ED_view3d.h"
#include "UI_resources.h"
#include "object_intern.h"

Go to the source code of this file.

Functions

Local Helpers
static void object_add_drop_xy_props (wmOperatorType *ot)
 
static bool object_add_drop_xy_is_set (const wmOperator *op)
 
static bool object_add_drop_xy_get (bContext *C, wmOperator *op, int(*r_mval)[2])
 
static int object_add_drop_xy_generic_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
Public Add Object API
void ED_object_location_from_view (bContext *C, float loc[3])
 
void ED_object_rotation_from_quat (float rot[3], const float viewquat[4], const char align_axis)
 
void ED_object_rotation_from_view (bContext *C, float rot[3], const char align_axis)
 
void ED_object_base_init_transform_on_add (Object *object, const float loc[3], const float rot[3])
 
float ED_object_new_primitive_matrix (bContext *C, Object *obedit, const float loc[3], const float rot[3], float r_primmat[4][4])
 
Add Object Operator
static void view_align_update (struct Main *UNUSED(main), struct Scene *UNUSED(scene), struct PointerRNA *ptr)
 
void ED_object_add_unit_props_size (wmOperatorType *ot)
 
void ED_object_add_unit_props_radius_ex (wmOperatorType *ot, float default_value)
 
void ED_object_add_unit_props_radius (wmOperatorType *ot)
 
void ED_object_add_generic_props (wmOperatorType *ot, bool do_editmode)
 
void ED_object_add_mesh_props (wmOperatorType *ot)
 
bool ED_object_add_generic_get_opts (bContext *C, wmOperator *op, const char view_align_axis, float loc[3], float rot[3], float scale[3], bool *enter_editmode, ushort *local_view_bits, bool *is_view_aligned)
 
ObjectED_object_add_type_with_obdata (bContext *C, const int type, const char *name, const float loc[3], const float rot[3], const bool enter_editmode, const ushort local_view_bits, ID *obdata)
 
ObjectED_object_add_type (bContext *C, const int type, const char *name, const float loc[3], const float rot[3], const bool enter_editmode, const ushort local_view_bits)
 
static int object_add_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_add (wmOperatorType *ot)
 
Add Probe Operator
static const char * get_lightprobe_defname (int type)
 
static int lightprobe_add_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_lightprobe_add (wmOperatorType *ot)
 
Add Effector Operator
static const char * get_effector_defname (ePFieldType type)
 
static int effector_add_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_effector_add (wmOperatorType *ot)
 
Add Camera Operator
static int object_camera_add_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_camera_add (wmOperatorType *ot)
 
Add Metaball Operator
static int object_metaball_add_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_metaball_add (wmOperatorType *ot)
 
Add Text Operator
static int object_add_text_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_text_add (wmOperatorType *ot)
 
Add Armature Operator
static int object_armature_add_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_armature_add (wmOperatorType *ot)
 
Add Empty Operator
static int object_empty_add_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_empty_add (wmOperatorType *ot)
 
static int empty_drop_named_image_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void OBJECT_OT_drop_named_image (wmOperatorType *ot)
 
Add Light Operator
static const char * get_light_defname (int type)
 
static int object_light_add_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_light_add (wmOperatorType *ot)
 
Add Collection Instance Operator
static int collection_instance_add_exec (bContext *C, wmOperator *op)
 
static int object_instance_add_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void OBJECT_OT_collection_instance_add (wmOperatorType *ot)
 
Add Data Instance Operator

Use for dropping ID's from the outliner.

static int object_data_instance_add_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_data_instance_add (wmOperatorType *ot)
 
Add Speaker Operator
static int object_speaker_add_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_speaker_add (wmOperatorType *ot)
 
Add Hair Operator
static bool object_hair_add_poll (bContext *C)
 
static int object_hair_add_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_hair_add (wmOperatorType *ot)
 
Add Point Cloud Operator
static bool object_pointcloud_add_poll (bContext *C)
 
static int object_pointcloud_add_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_pointcloud_add (wmOperatorType *ot)
 
Delete Object Operator
void ED_object_base_free_and_unlink (Main *bmain, Scene *scene, Object *ob)
 
void ED_object_base_free_and_unlink_no_indirect_check (Main *bmain, Scene *scene, Object *ob)
 
static int object_delete_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_delete (wmOperatorType *ot)
 
Copy Object Utilities
static void copy_object_set_idnew (bContext *C)
 
Make Instanced Objects Real Operator
static uint dupliobject_hash (const void *ptr)
 
static uint dupliobject_instancer_hash (const void *ptr)
 
static bool dupliobject_cmp (const void *a_, const void *b_)
 
static bool dupliobject_instancer_cmp (const void *a_, const void *b_)
 
static bool object_has_geometry_set_instances (const Object *object_eval)
 
static void make_object_duplilist_real (bContext *C, Depsgraph *depsgraph, Scene *scene, Base *base, const bool use_base_parent, const bool use_hierarchy)
 
static int object_duplicates_make_real_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_duplicates_make_real (wmOperatorType *ot)
 
Duplicate Object Operator
static Baseobject_add_duplicate_internal (Main *bmain, Scene *scene, ViewLayer *view_layer, Object *ob, const eDupli_ID_Flags dupflag, const eLibIDDuplicateFlags duplicate_options)
 
BaseED_object_add_duplicate (Main *bmain, Scene *scene, ViewLayer *view_layer, Base *base, const eDupli_ID_Flags dupflag)
 
static int duplicate_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_duplicate (wmOperatorType *ot)
 
Add Named Object Operator

Use for drag & drop.

static int object_add_named_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_add_named (wmOperatorType *ot)
 
Join Object Operator
static bool object_join_poll (bContext *C)
 
static int object_join_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_join (wmOperatorType *ot)
 
Join as Shape Key Operator
static bool join_shapes_poll (bContext *C)
 
static int join_shapes_exec (bContext *C, wmOperator *op)
 
void OBJECT_OT_join_shapes (wmOperatorType *ot)
 

Local Enum Declarations

enum  { ALIGN_WORLD = 0 , ALIGN_VIEW , ALIGN_CURSOR }
 
const EnumPropertyItem rna_enum_light_type_items []
 
static const EnumPropertyItem field_type_items []
 
static EnumPropertyItem lightprobe_type_items []
 
static const EnumPropertyItem align_options []
 

Add Gpencil Operator

static EnumPropertyItem rna_enum_gpencil_add_stroke_depth_order_items []
 
static bool object_gpencil_add_poll (bContext *C)
 
static int object_gpencil_add_exec (bContext *C, wmOperator *op)
 
static void object_add_ui (bContext *UNUSED(C), wmOperator *op)
 
void OBJECT_OT_gpencil_add (wmOperatorType *ot)
 

Data Convert Operator

static const EnumPropertyItem convert_target_items []
 
static void object_data_convert_ensure_curve_cache (Depsgraph *depsgraph, Scene *scene, Object *ob)
 
static void object_data_convert_curve_to_mesh (Main *bmain, Depsgraph *depsgraph, Object *ob)
 
static bool object_convert_poll (bContext *C)
 
static Baseduplibase_for_convert (Main *bmain, Depsgraph *depsgraph, Scene *scene, ViewLayer *view_layer, Base *base, Object *ob)
 
static int object_convert_exec (bContext *C, wmOperator *op)
 
static void object_convert_ui (bContext *C, wmOperator *op)
 
void OBJECT_OT_convert (wmOperatorType *ot)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ALIGN_WORLD 
ALIGN_VIEW 
ALIGN_CURSOR 

Definition at line 179 of file object_add.c.

Function Documentation

◆ collection_instance_add_exec()

static int collection_instance_add_exec ( bContext C,
wmOperator op 
)
static

◆ copy_object_set_idnew()

static void copy_object_set_idnew ( bContext C)
static

◆ duplibase_for_convert()

static Base* duplibase_for_convert ( Main bmain,
Depsgraph depsgraph,
Scene scene,
ViewLayer view_layer,
Base base,
Object ob 
)
static

◆ duplicate_exec()

static int duplicate_exec ( bContext C,
wmOperator op 
)
static

◆ dupliobject_cmp()

static bool dupliobject_cmp ( const void *  a_,
const void *  b_ 
)
static

◆ dupliobject_hash()

static uint dupliobject_hash ( const void *  ptr)
static
Note
regarding hashing dupli-objects which come from OB_DUPLICOLLECTION, skip the first member of DupliObject.persistent_id since its a unique index and we only want to know if the group objects are from the same dupli-group instance.
regarding hashing dupli-objects which come from non-OB_DUPLICOLLECTION, include the first member of DupliObject.persistent_id since its the index of the vertex/face the object is instantiated on and we want to identify objects on the same vertex/face. In other words, we consider each group of objects from a same item as being the 'local group' where to check for parents.

Definition at line 2163 of file object_add.c.

References BLI_ghashutil_ptrhash(), hash, MAX_DUPLI_RECUR, DupliObject::ob, OB_DUPLICOLLECTION, DupliObject::persistent_id, ptr, and DupliObject::type.

Referenced by make_object_duplilist_real().

◆ dupliobject_instancer_cmp()

static bool dupliobject_instancer_cmp ( const void *  a_,
const void *  b_ 
)
static

Definition at line 2230 of file object_add.c.

References Freestyle::a, MAX_DUPLI_RECUR, and DupliObject::persistent_id.

Referenced by make_object_duplilist_real().

◆ dupliobject_instancer_hash()

static uint dupliobject_instancer_hash ( const void *  ptr)
static
Note
regarding hashing dupli-objects when using OB_DUPLICOLLECTION, skip the first member of DupliObject.persistent_id since its a unique index and we only want to know if the group objects are from the same dupli-group instance.

Definition at line 2185 of file object_add.c.

References BLI_ghashutil_inthash, hash, MAX_DUPLI_RECUR, DupliObject::persistent_id, and ptr.

Referenced by make_object_duplilist_real().

◆ ED_object_add_duplicate()

Base* ED_object_add_duplicate ( Main bmain,
Scene scene,
ViewLayer view_layer,
Base base,
const eDupli_ID_Flags  dupflag 
)

◆ ED_object_add_generic_get_opts()

bool ED_object_add_generic_get_opts ( bContext C,
wmOperator op,
const char  view_align_axis,
float  loc[3],
float  rot[3],
float  scale[3],
bool *  enter_editmode,
ushort local_view_bits,
bool *  is_view_aligned 
)

◆ ED_object_add_generic_props()

void ED_object_add_generic_props ( wmOperatorType ot,
bool  do_editmode 
)

Definition at line 397 of file object_add.c.

References align_options, ALIGN_WORLD, DEG2RADF, NULL, OBJECT_ADD_SIZE_MAXF, ot, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_enum(), RNA_def_float_rotation(), RNA_def_float_vector_xyz(), RNA_def_property_flag(), RNA_def_property_update_runtime(), wmOperatorType::srna, and view_align_update().

Referenced by CURVE_OT_primitive_bezier_circle_add(), CURVE_OT_primitive_bezier_curve_add(), CURVE_OT_primitive_nurbs_circle_add(), CURVE_OT_primitive_nurbs_curve_add(), CURVE_OT_primitive_nurbs_path_add(), MESH_OT_primitive_circle_add(), MESH_OT_primitive_cone_add(), MESH_OT_primitive_cube_add(), MESH_OT_primitive_cube_add_gizmo(), MESH_OT_primitive_cylinder_add(), MESH_OT_primitive_grid_add(), MESH_OT_primitive_ico_sphere_add(), MESH_OT_primitive_monkey_add(), MESH_OT_primitive_plane_add(), MESH_OT_primitive_uv_sphere_add(), OBJECT_OT_add(), OBJECT_OT_armature_add(), OBJECT_OT_camera_add(), OBJECT_OT_collection_instance_add(), OBJECT_OT_data_instance_add(), OBJECT_OT_drop_named_image(), OBJECT_OT_effector_add(), OBJECT_OT_empty_add(), OBJECT_OT_gpencil_add(), OBJECT_OT_hair_add(), OBJECT_OT_light_add(), OBJECT_OT_lightprobe_add(), OBJECT_OT_metaball_add(), OBJECT_OT_pointcloud_add(), OBJECT_OT_speaker_add(), OBJECT_OT_text_add(), OBJECT_OT_volume_add(), OBJECT_OT_volume_import(), SURFACE_OT_primitive_nurbs_surface_circle_add(), SURFACE_OT_primitive_nurbs_surface_curve_add(), SURFACE_OT_primitive_nurbs_surface_cylinder_add(), SURFACE_OT_primitive_nurbs_surface_sphere_add(), SURFACE_OT_primitive_nurbs_surface_surface_add(), and SURFACE_OT_primitive_nurbs_surface_torus_add().

◆ ED_object_add_mesh_props()

void ED_object_add_mesh_props ( wmOperatorType ot)

◆ ED_object_add_type()

Object* ED_object_add_type ( bContext C,
const int  type,
const char *  name,
const float  loc[3],
const float  rot[3],
const bool  enter_editmode,
const ushort  local_view_bits 
)

◆ ED_object_add_type_with_obdata()

Object* ED_object_add_type_with_obdata ( bContext C,
const int  type,
const char *  name,
const float  loc[3],
const float  rot[3],
const bool  enter_editmode,
const ushort  local_view_bits,
ID obdata 
)

◆ ED_object_add_unit_props_radius()

void ED_object_add_unit_props_radius ( wmOperatorType ot)

◆ ED_object_add_unit_props_radius_ex()

void ED_object_add_unit_props_radius_ex ( wmOperatorType ot,
float  default_value 
)

◆ ED_object_add_unit_props_size()

void ED_object_add_unit_props_size ( wmOperatorType ot)

◆ ED_object_base_free_and_unlink()

void ED_object_base_free_and_unlink ( Main bmain,
Scene scene,
Object ob 
)

◆ ED_object_base_free_and_unlink_no_indirect_check()

void ED_object_base_free_and_unlink_no_indirect_check ( Main bmain,
Scene scene,
Object ob 
)

Remove base from a specific scene. ob must not be indirectly used.

Definition at line 1979 of file object_add.c.

References BKE_library_ID_is_indirectly_used(), BKE_scene_collections_object_remove(), BLI_assert, DEG_id_tag_update_ex(), Object::id, ID_RECALC_BASE_FLAGS, and scene.

Referenced by object_delete_exec().

◆ ED_object_base_init_transform_on_add()

void ED_object_base_init_transform_on_add ( Object object,
const float  loc[3],
const float  rot[3] 
)

◆ ED_object_location_from_view()

void ED_object_location_from_view ( bContext C,
float  loc[3] 
)

◆ ED_object_new_primitive_matrix()

float ED_object_new_primitive_matrix ( bContext C,
Object obedit,
const float  loc[3],
const float  rot[3],
float  r_primmat[4][4] 
)

◆ ED_object_rotation_from_quat()

void ED_object_rotation_from_quat ( float  rot[3],
const float  viewquat[4],
const char  align_axis 
)

◆ ED_object_rotation_from_view()

void ED_object_rotation_from_view ( bContext C,
float  rot[3],
const char  align_axis 
)

◆ effector_add_exec()

static int effector_add_exec ( bContext C,
wmOperator op 
)
static

◆ empty_drop_named_image_invoke()

static int empty_drop_named_image_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ get_effector_defname()

static const char* get_effector_defname ( ePFieldType  type)
static

◆ get_light_defname()

static const char* get_light_defname ( int  type)
static

Definition at line 1532 of file object_add.c.

References BLT_I18NCONTEXT_ID_LIGHT, CTX_DATA_, LA_AREA, LA_LOCAL, LA_SPOT, LA_SUN, and type.

Referenced by object_light_add_exec().

◆ get_lightprobe_defname()

static const char* get_lightprobe_defname ( int  type)
static

◆ join_shapes_exec()

static int join_shapes_exec ( bContext C,
wmOperator op 
)
static

◆ join_shapes_poll()

static bool join_shapes_poll ( bContext C)
static

◆ lightprobe_add_exec()

static int lightprobe_add_exec ( bContext C,
wmOperator op 
)
static

◆ make_object_duplilist_real()

static void make_object_duplilist_real ( bContext C,
Depsgraph depsgraph,
Scene scene,
Base base,
const bool  use_base_parent,
const bool  use_hierarchy 
)
static

Definition at line 2255 of file object_add.c.

References Object::adt, BA_DESELECT, BA_SELECT, BKE_animdata_free(), BKE_collection_object_add_from(), BKE_constraints_free(), BKE_id_copy(), BKE_libblock_relink_to_newid(), BKE_main_id_clear_newpoins(), BKE_object_apply_mat4(), BKE_scene_object_base_flag_sync_from_base(), BKE_view_layer_base_find(), BLI_assert, BLI_ghash_ensure_p(), BLI_ghash_free(), BLI_ghash_insert(), BLI_ghash_lookup(), BLI_ghash_new(), BLI_ghash_ptr_new(), BLI_listbase_is_empty(), BLI_strncpy(), C, Object::constraints, copy_m4_m4(), CTX_data_main(), CTX_data_view_layer(), Object_Runtime::curve_cache, DEG_get_evaluated_object(), DEG_get_original_object(), DEG_id_tag_update(), depsgraph, dupliobject_cmp(), dupliobject_hash(), dupliobject_instancer_cmp(), dupliobject_instancer_hash(), ED_object_base_select(), free_object_duplilist(), Object::id, ID_NEW_SET, ID_RECALC_COPY_ON_WRITE, ID_RECALC_GEOMETRY, ID_RECALC_SELECT, ID_RECALC_TRANSFORM, id_us_min(), Object::instance_collection, LISTBASE_FOREACH, Object::mat, MAX_DUPLI_RECUR, NULL, DupliObject::ob, OB_DUPLI, OB_DUPLICOLLECTION, Base::object, object_duplilist(), object_has_geometry_set_instances(), Main::objects, Object::obmat, Object::par1, Object::par2, Object::par3, Object::parent, Object::parentinv, PAROBJECT, Object::parsubstr, Object::partype, DupliObject::persistent_id, Object::proxy, Object::proxy_from, Object::proxy_group, Object::runtime, scene, Object::totcol, Object::transflag, and DupliObject::type.

Referenced by object_duplicates_make_real_exec().

◆ object_add_drop_xy_generic_invoke()

static int object_add_drop_xy_generic_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

Set the drop coordinate to the mouse position (if not already set) and call the operator's exec() callback.

Definition at line 257 of file object_add.c.

References C, wmOperatorType::exec, object_add_drop_xy_is_set(), wmOperator::ptr, RNA_int_set(), wmOperator::type, wmEvent::x, and wmEvent::y.

Referenced by OBJECT_OT_add_named(), and OBJECT_OT_data_instance_add().

◆ object_add_drop_xy_get()

static bool object_add_drop_xy_get ( bContext C,
wmOperator op,
int(*)  r_mval[2] 
)
static

Query the currently set X- and Y-coordinate to position the new object under.

Parameters
r_mvalReturned pointer to the coordinate in region-space.

Definition at line 238 of file object_add.c.

References C, CTX_wm_region(), object_add_drop_xy_is_set(), wmOperator::ptr, RNA_int_get(), ARegion::winrct, rcti::xmin, and rcti::ymin.

Referenced by collection_instance_add_exec(), object_add_named_exec(), and object_data_instance_add_exec().

◆ object_add_drop_xy_is_set()

static bool object_add_drop_xy_is_set ( const wmOperator op)
static

◆ object_add_drop_xy_props()

static void object_add_drop_xy_props ( wmOperatorType ot)
static

Operator properties for creating an object under a screen space (2D) coordinate. Used for object dropping like behavior (drag object and drop into 3D View).

Definition at line 202 of file object_add.c.

References ot, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_int(), RNA_def_property_flag(), and wmOperatorType::srna.

Referenced by OBJECT_OT_add_named(), OBJECT_OT_collection_instance_add(), and OBJECT_OT_data_instance_add().

◆ object_add_duplicate_internal()

static Base* object_add_duplicate_internal ( Main bmain,
Scene scene,
ViewLayer view_layer,
Object ob,
const eDupli_ID_Flags  dupflag,
const eLibIDDuplicateFlags  duplicate_options 
)
static

◆ object_add_exec()

static int object_add_exec ( bContext C,
wmOperator op 
)
static

◆ object_add_named_exec()

static int object_add_named_exec ( bContext C,
wmOperator op 
)
static

◆ object_add_text_exec()

static int object_add_text_exec ( bContext C,
wmOperator op 
)
static

◆ object_add_ui()

static void object_add_ui ( bContext UNUSEDC,
wmOperator op 
)
static

◆ object_armature_add_exec()

static int object_armature_add_exec ( bContext C,
wmOperator op 
)
static

◆ object_camera_add_exec()

static int object_camera_add_exec ( bContext C,
wmOperator op 
)
static

◆ object_convert_exec()

static int object_convert_exec ( bContext C,
wmOperator op 
)
static

Definition at line 2663 of file object_add.c.

References Freestyle::a, Object::actcol, angle(), BASACT, Object::base_flag, BASE_SELECTED, BKE_curve_dimension_update(), BKE_gpencil_convert_curve(), BKE_gpencil_convert_mesh(), BKE_id_copy(), BKE_mball_basis_find(), BKE_mball_is_basis(), BKE_mesh_add(), BKE_mesh_copy_for_eval(), BKE_mesh_edges_set_draw_render(), BKE_mesh_from_metaball(), BKE_mesh_nomain_to_mesh(), BKE_mesh_to_curve(), BKE_mesh_to_pointcloud(), BKE_object_free_curve_cache(), BKE_object_free_modifiers(), BKE_object_free_shaderfx(), BKE_object_material_slot_remove(), BKE_object_material_slot_used(), BKE_object_materials_test(), BKE_pointcloud_to_mesh(), BKE_report(), BKE_scene_graph_update_tagged(), BKE_vfont_to_curve_ex(), BLI_freelistN(), C, CD_MASK_MESH, copy_v3_v3(), CTX_data_active_object(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_data_selected_editable_bases(), CTX_data_view_layer(), CTX_wm_view3d(), CU_3D, Object_Runtime::curve_cache, Scene::customdata_mask, CustomData_MeshMasks_update(), Object::data, DEG_get_evaluated_id(), DEG_get_evaluated_object(), DEG_id_tag_update(), DEG_relations_tag_update(), depsgraph, CurveCache::disp, bGPdata::draw_mode, duplibase_for_convert(), ED_gpencil_add_object(), ED_object_base_activate(), ED_object_base_free_and_unlink(), ED_rigidbody_object_remove(), ELEM, ListBase::first, Curve::flag, Base::flag, Object::flag, FO_EDIT, FOREACH_SCENE_OBJECT_BEGIN, FOREACH_SCENE_OBJECT_END, GP_DRAWMODE_3D, Curve::id, Mesh::id, MetaBall::id, Object::id, PointCloud::id, Scene::id, VFont::id, ID_IS_LINKED, ID_REAL_USERS, ID_RECALC_ANIMATION, ID_RECALC_GEOMETRY, ID_RECALC_SELECT, ID_RECALC_TRANSFORM, id_us_min(), id_us_plus(), IS_TAGGED, LIB_TAG_DOIT, LISTBASE_FOREACH, Object::loc, View3D::local_view_uuid, View3D::localvd, Mesh::mat, MetaBall::mat, mat3_to_eul(), mat4_to_loc_rot_size(), MEM_dupallocN, mesh_get_eval_final(), NC_OBJECT, NC_SCENE, ND_DATA, ND_DRAW, ND_LAYER_CONTENT, ND_MODIFIER, ND_OB_SELECT, ID::next, NULL, Curve::nurb, OB_CURVE, OB_DONE, OB_FONT, OB_GPENCIL, OB_MBALL, OB_MESH, OB_POINTCLOUD, OB_SURF, Base::object, object_data_convert_curve_to_mesh(), object_data_convert_ensure_curve_cache(), Main::objects, Object::obmat, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, Object::rigidbody_object, RNA_boolean_get(), RNA_enum_get(), RNA_float_get(), RNA_int_get(), rot, Object::rot, RPT_ERROR, RPT_INFO, Object::runtime, Object::scale, scene, SELECT, size(), Mesh::totcol, MetaBall::totcol, Object::totcol, Curve::type, Object::type, unit_m4(), Curve::vfont, Curve::vfontb, Curve::vfontbi, Curve::vfonti, and WM_event_add_notifier().

Referenced by OBJECT_OT_convert().

◆ object_convert_poll()

static bool object_convert_poll ( bContext C)
static

◆ object_convert_ui()

static void object_convert_ui ( bContext C,
wmOperator op 
)
static

◆ object_data_convert_curve_to_mesh()

static void object_data_convert_curve_to_mesh ( Main bmain,
Depsgraph depsgraph,
Object ob 
)
static

◆ object_data_convert_ensure_curve_cache()

static void object_data_convert_ensure_curve_cache ( Depsgraph depsgraph,
Scene scene,
Object ob 
)
static

◆ object_data_instance_add_exec()

static int object_data_instance_add_exec ( bContext C,
wmOperator op 
)
static

◆ object_delete_exec()

static int object_delete_exec ( bContext C,
wmOperator op 
)
static

◆ object_duplicates_make_real_exec()

static int object_duplicates_make_real_exec ( bContext C,
wmOperator op 
)
static

◆ object_empty_add_exec()

static int object_empty_add_exec ( bContext C,
wmOperator op 
)
static

◆ object_gpencil_add_exec()

static int object_gpencil_add_exec ( bContext C,
wmOperator op 
)
static

◆ object_gpencil_add_poll()

static bool object_gpencil_add_poll ( bContext C)
static

◆ object_hair_add_exec()

static int object_hair_add_exec ( bContext C,
wmOperator op 
)
static

◆ object_hair_add_poll()

static bool object_hair_add_poll ( bContext C)
static

Definition at line 1867 of file object_add.c.

References C, and ED_operator_objectmode().

Referenced by OBJECT_OT_hair_add().

◆ object_has_geometry_set_instances()

static bool object_has_geometry_set_instances ( const Object object_eval)
static

◆ object_instance_add_invoke()

static int object_instance_add_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ object_join_exec()

static int object_join_exec ( bContext C,
wmOperator op 
)
static

◆ object_join_poll()

static bool object_join_poll ( bContext C)
static

◆ object_light_add_exec()

static int object_light_add_exec ( bContext C,
wmOperator op 
)
static

◆ object_metaball_add_exec()

static int object_metaball_add_exec ( bContext C,
wmOperator op 
)
static

◆ OBJECT_OT_add()

void OBJECT_OT_add ( wmOperatorType ot)

◆ OBJECT_OT_add_named()

void OBJECT_OT_add_named ( wmOperatorType ot)

◆ OBJECT_OT_armature_add()

void OBJECT_OT_armature_add ( wmOperatorType ot)

◆ OBJECT_OT_camera_add()

void OBJECT_OT_camera_add ( wmOperatorType ot)

◆ OBJECT_OT_collection_instance_add()

void OBJECT_OT_collection_instance_add ( wmOperatorType ot)

◆ OBJECT_OT_convert()

void OBJECT_OT_convert ( wmOperatorType ot)

◆ OBJECT_OT_data_instance_add()

void OBJECT_OT_data_instance_add ( wmOperatorType ot)

◆ OBJECT_OT_delete()

void OBJECT_OT_delete ( wmOperatorType ot)

◆ OBJECT_OT_drop_named_image()

void OBJECT_OT_drop_named_image ( wmOperatorType ot)

◆ OBJECT_OT_duplicate()

void OBJECT_OT_duplicate ( wmOperatorType ot)

◆ OBJECT_OT_duplicates_make_real()

void OBJECT_OT_duplicates_make_real ( wmOperatorType ot)

◆ OBJECT_OT_effector_add()

void OBJECT_OT_effector_add ( wmOperatorType ot)

◆ OBJECT_OT_empty_add()

void OBJECT_OT_empty_add ( wmOperatorType ot)

◆ OBJECT_OT_gpencil_add()

void OBJECT_OT_gpencil_add ( wmOperatorType ot)

◆ OBJECT_OT_hair_add()

void OBJECT_OT_hair_add ( wmOperatorType ot)

◆ OBJECT_OT_join()

void OBJECT_OT_join ( wmOperatorType ot)

◆ OBJECT_OT_join_shapes()

void OBJECT_OT_join_shapes ( wmOperatorType ot)

◆ OBJECT_OT_light_add()

void OBJECT_OT_light_add ( wmOperatorType ot)

◆ OBJECT_OT_lightprobe_add()

void OBJECT_OT_lightprobe_add ( wmOperatorType ot)

◆ OBJECT_OT_metaball_add()

void OBJECT_OT_metaball_add ( wmOperatorType ot)

◆ OBJECT_OT_pointcloud_add()

void OBJECT_OT_pointcloud_add ( wmOperatorType ot)

◆ OBJECT_OT_speaker_add()

void OBJECT_OT_speaker_add ( wmOperatorType ot)

◆ OBJECT_OT_text_add()

void OBJECT_OT_text_add ( wmOperatorType ot)

◆ object_pointcloud_add_exec()

static int object_pointcloud_add_exec ( bContext C,
wmOperator op 
)
static

◆ object_pointcloud_add_poll()

static bool object_pointcloud_add_poll ( bContext C)
static

Definition at line 1912 of file object_add.c.

References C, and ED_operator_objectmode().

Referenced by OBJECT_OT_pointcloud_add().

◆ object_speaker_add_exec()

static int object_speaker_add_exec ( bContext C,
wmOperator op 
)
static

◆ view_align_update()

static void view_align_update ( struct Main UNUSEDmain,
struct Scene UNUSEDscene,
struct PointerRNA ptr 
)
static

Definition at line 373 of file object_add.c.

References ptr, and RNA_struct_idprops_unset().

Referenced by ED_object_add_generic_props().

Variable Documentation

◆ align_options

const EnumPropertyItem align_options[]
static
Initial value:
= {
{ALIGN_WORLD, "WORLD", 0, "World", "Align the new object to the world"},
{ALIGN_VIEW, "VIEW", 0, "View", "Align the new object to the view"},
{ALIGN_CURSOR, "CURSOR", 0, "3D Cursor", "Use the 3D cursor orientation for the new object"},
{0, NULL, 0, NULL, NULL},
}
@ ALIGN_VIEW
Definition: object_add.c:181
@ ALIGN_WORLD
Definition: object_add.c:180
@ ALIGN_CURSOR
Definition: object_add.c:182

Definition at line 185 of file object_add.c.

Referenced by ED_object_add_generic_props().

◆ convert_target_items

const EnumPropertyItem convert_target_items[]
static
Initial value:
= {
{OB_CURVE, "CURVE", ICON_OUTLINER_OB_CURVE, "Curve", "Curve from Mesh or Text objects"},
"MESH",
ICON_OUTLINER_OB_MESH,
"Mesh",
"Mesh from Curve, Surface, Metaball, or Text objects"},
"GPENCIL",
ICON_OUTLINER_OB_GREASEPENCIL,
"Grease Pencil",
"Grease Pencil from Curve or Mesh objects"},
{0, NULL, 0, NULL, NULL},
}
@ OB_MESH
@ OB_CURVE
@ OB_GPENCIL

Definition at line 2519 of file object_add.c.

Referenced by OBJECT_OT_convert().

◆ field_type_items

const EnumPropertyItem field_type_items[]
static
Initial value:
= {
{PFIELD_FORCE, "FORCE", ICON_FORCE_FORCE, "Force", ""},
{PFIELD_WIND, "WIND", ICON_FORCE_WIND, "Wind", ""},
{PFIELD_VORTEX, "VORTEX", ICON_FORCE_VORTEX, "Vortex", ""},
{PFIELD_MAGNET, "MAGNET", ICON_FORCE_MAGNETIC, "Magnetic", ""},
{PFIELD_HARMONIC, "HARMONIC", ICON_FORCE_HARMONIC, "Harmonic", ""},
{PFIELD_CHARGE, "CHARGE", ICON_FORCE_CHARGE, "Charge", ""},
{PFIELD_LENNARDJ, "LENNARDJ", ICON_FORCE_LENNARDJONES, "Lennard-Jones", ""},
{PFIELD_TEXTURE, "TEXTURE", ICON_FORCE_TEXTURE, "Texture", ""},
{PFIELD_GUIDE, "GUIDE", ICON_FORCE_CURVE, "Curve Guide", ""},
{PFIELD_BOID, "BOID", ICON_FORCE_BOID, "Boid", ""},
{PFIELD_TURBULENCE, "TURBULENCE", ICON_FORCE_TURBULENCE, "Turbulence", ""},
{PFIELD_DRAG, "DRAG", ICON_FORCE_DRAG, "Drag", ""},
{PFIELD_FLUIDFLOW, "FLUID", ICON_FORCE_FLUIDFLOW, "Fluid Flow", ""},
{0, NULL, 0, NULL, NULL},
}
@ PFIELD_MAGNET
@ PFIELD_FLUIDFLOW
@ PFIELD_FORCE
@ PFIELD_CHARGE
@ PFIELD_HARMONIC
@ PFIELD_TURBULENCE
@ PFIELD_GUIDE
@ PFIELD_LENNARDJ
@ PFIELD_VORTEX
@ PFIELD_TEXTURE

Definition at line 143 of file object_add.c.

Referenced by OBJECT_OT_effector_add(), and rna_def_field().

◆ lightprobe_type_items

EnumPropertyItem lightprobe_type_items[]
static
Initial value:
= {
"CUBEMAP",
ICON_LIGHTPROBE_CUBEMAP,
"Reflection Cubemap",
"Reflection probe with spherical or cubic attenuation"},
"PLANAR",
ICON_LIGHTPROBE_PLANAR,
"Reflection Plane",
"Planar reflection probe"},
"GRID",
ICON_LIGHTPROBE_GRID,
"Irradiance Volume",
"Irradiance probe to capture diffuse indirect lighting"},
{0, NULL, 0, NULL, NULL},
}
@ LIGHTPROBE_TYPE_CUBE
@ LIGHTPROBE_TYPE_PLANAR
@ LIGHTPROBE_TYPE_GRID

Definition at line 160 of file object_add.c.

Referenced by OBJECT_OT_lightprobe_add().

◆ rna_enum_gpencil_add_stroke_depth_order_items

EnumPropertyItem rna_enum_gpencil_add_stroke_depth_order_items[]
static
Initial value:
= {
"2D",
0,
"2D Layers",
"Display strokes using grease pencil layers to define order"},
{GP_DRAWMODE_3D, "3D", 0, "3D Location", "Display strokes using real 3D position in 3D space"},
{0, NULL, 0, NULL, NULL},
}
@ GP_DRAWMODE_3D
@ GP_DRAWMODE_2D

Definition at line 1479 of file object_add.c.

Referenced by OBJECT_OT_gpencil_add().

◆ rna_enum_light_type_items

const EnumPropertyItem rna_enum_light_type_items[]
Initial value:
= {
{LA_LOCAL, "POINT", ICON_LIGHT_POINT, "Point", "Omnidirectional point light source"},
{LA_SUN, "SUN", ICON_LIGHT_SUN, "Sun", "Constant direction parallel ray light source"},
{LA_SPOT, "SPOT", ICON_LIGHT_SPOT, "Spot", "Directional cone light source"},
{LA_AREA, "AREA", ICON_LIGHT_AREA, "Area", "Directional area light source"},
{0, NULL, 0, NULL, NULL},
}
#define LA_AREA
#define LA_SPOT
#define LA_SUN
#define LA_LOCAL

Definition at line 134 of file object_add.c.

Referenced by OBJECT_OT_light_add(), and RNA_def_main_lights().