13#include <fmt/format.h>
121#define INDEX_UNSET -1
122 int par1, par2, par3, par4;
172 for (
Nurb *nu =
static_cast<Nurb *
>(editnurb->
first); nu !=
nullptr; nu = nu->
next) {
175 for (
int nurb_index = 0; nurb_index < nu->pntsu; nurb_index++, bezt++, curr_index++) {
197 const int points_num = nu->pntsu * nu->pntsv;
198 for (
int nurb_index = 0; nurb_index < points_num; nurb_index++, bp++, curr_index++) {
226 for (
int curr_index = 0; curr_index < points_num; curr_index++, bp++) {
296 ot->name =
"Make Vertex Parent";
297 ot->description =
"Parent selected objects to the selected vertices";
298 ot->idname =
"OBJECT_OT_vertex_parent_set";
319 "Completely clear the parenting relationship, including involved modifiers if any"},
321 "CLEAR_KEEP_TRANSFORM",
323 "Clear and Keep Transformation",
324 "As 'Clear Parent', but keep the current visual transformations of the object"},
328 "Clear Parent Inverse",
329 "Reset the transform corrections applied to the parenting relationship, does not remove "
331 {0,
nullptr, 0,
nullptr,
nullptr},
386 if (ob->
parent ==
nullptr) {
446 ot->name =
"Clear Parent";
447 ot->description =
"Clear the object's parenting";
448 ot->idname =
"OBJECT_OT_parent_clear";
495 {
PAR_CURVE,
"CURVE", 0,
"Curve Deform",
""},
501 {0,
nullptr, 0,
nullptr,
nullptr},
510 Object *
const parent_eval,
513 const bool keep_transform,
514 const int vert_par[3])
556 bmain, act,
nullptr, &id_ptr, {
"eval_time", 0});
575 if (pchan ==
nullptr || pchan_eval ==
nullptr) {
584 if (keep_transform) {
642 if (par->
runtime->curve_cache &&
643 par->
runtime->curve_cache->anim_path_accum_length ==
nullptr)
693 ob->
par1 = vert_par[0];
706 const bool is_armature_parent =
ELEM(
711 float cmat[4][4], vec[3];
720 sub_v3_v3v3(vec, ob->object_to_world().location(), cmat[3]);
782 const bool keep_transform,
783 const int vert_par[3])
803 const float *co_find = child->object_to_world().location();
805 KDTreeNearest_3d nearest[3];
808 tot = BLI_kdtree_3d_find_nearest_n(
tree, co_find, nearest, 3);
812 vert_par[0] = nearest[0].index;
813 vert_par[1] = nearest[1].index;
814 vert_par[2] = nearest[2].index;
819 vert_par[0] = BLI_kdtree_3d_find_nearest(
tree, co_find,
nullptr);
842 if (ob == parenting_context->
par) {
850 parenting_context->
scene,
853 parenting_context->
par,
872 int vert_par[3] = {0, 0, 0};
875 if (ob == parenting_context->
par) {
884 parenting_context->
scene,
886 parenting_context->
par,
901 KDTree_3d *
tree =
nullptr;
912 BLI_kdtree_3d_free(
tree);
917 BLI_kdtree_3d_free(
tree);
928 parenting_context.
partype = partype;
963 opptr = layout->
op(
ot,
964 IFACE_(
"Object (Keep Transform)"),
972 "OBJECT_OT_parent_no_inverse_set",
IFACE_(
"Object (Without Inverse)"), ICON_NONE);
975 op_ptr = layout->
op(
"OBJECT_OT_parent_no_inverse_set",
976 IFACE_(
"Object (Keep Transform Without Inverse)"),
981 bool armature_deform, empty_groups, envelope_weights, automatic_weights, attach_surface;
982 } can_support = {
false};
985 if (child == parent) {
988 if (
ELEM(child->type,
996 can_support.armature_deform =
true;
997 can_support.envelope_weights =
true;
1000 can_support.empty_groups =
true;
1003 can_support.automatic_weights =
true;
1006 can_support.attach_surface =
true;
1013 if (can_support.armature_deform) {
1014 op_ptr = layout->
op(
ot,
IFACE_(
"Armature Deform"), ICON_NONE);
1017 if (can_support.empty_groups) {
1018 op_ptr = layout->
op(
ot,
IFACE_(
" With Empty Groups"), ICON_NONE);
1021 if (can_support.envelope_weights) {
1022 op_ptr = layout->
op(
ot,
IFACE_(
" With Envelope Weights"), ICON_NONE);
1025 if (can_support.automatic_weights) {
1026 op_ptr = layout->
op(
ot,
IFACE_(
" With Automatic Weights"), ICON_NONE);
1029 op_ptr = layout->
op(
ot,
IFACE_(
"Bone"), ICON_NONE);
1031 op_ptr = layout->
op(
ot,
IFACE_(
"Bone Relative"), ICON_NONE);
1035 op_ptr = layout->
op(
ot,
IFACE_(
"Curve Deform"), ICON_NONE);
1037 op_ptr = layout->
op(
ot,
IFACE_(
"Follow Path"), ICON_NONE);
1039 op_ptr = layout->
op(
ot,
IFACE_(
"Path Constraint"), ICON_NONE);
1043 op_ptr = layout->
op(
ot,
IFACE_(
"Lattice Deform"), ICON_NONE);
1047 if (can_support.attach_surface) {
1048 layout->
op(
"CURVES_OT_surface_set",
IFACE_(
"Object (Attach Curves to Surface)"), ICON_NONE);
1054 op_ptr = layout->
op(
ot,
IFACE_(
"Vertex"), ICON_NONE);
1056 op_ptr = layout->
op(
ot,
IFACE_(
"Vertex (Triangle)"), ICON_NONE);
1080 if (
STREQ(prop_id,
"xmirror")) {
1094 ot->name =
"Make Parent";
1095 ot->description =
"Set the object's parenting";
1096 ot->idname =
"OBJECT_OT_parent_set";
1113 "Apply weights symmetrically along X axis, for Envelope/Automatic vertex groups creation");
1118 "Apply transformation before parenting");
1150 if (keep_transform) {
1157 memset(ob->loc, 0,
sizeof(
float[3]));
1173 ot->name =
"Make Parent without Inverse";
1174 ot->description =
"Set the object's parenting without setting the inverse parent correction";
1175 ot->idname =
"OBJECT_OT_parent_no_inverse_set";
1188 "Preserve the world transform throughout parenting");
1205 "CLEAR_KEEP_TRANSFORM",
1207 "Clear and Keep Transformation (Clear Track)",
1209 {0,
nullptr, 0,
nullptr,
nullptr},
1226 ob->track =
nullptr;
1230 for (con =
static_cast<bConstraint *
>(ob->constraints.last); con; con = pcon) {
1256 ot->name =
"Clear Track";
1257 ot->description =
"Clear tracking constraint or flag from object";
1258 ot->idname =
"OBJECT_OT_track_clear";
1288 {0,
nullptr, 0,
nullptr,
nullptr},
1378 ot->name =
"Make Track";
1379 ot->description =
"Make the object track another object, using various methods/constraints";
1380 ot->idname =
"OBJECT_OT_track_set";
1407 if (sce ==
nullptr) {
1414 for (base = FIRSTBASE; base; base = base->
next) {
1431 if (scene_to ==
nullptr) {
1532 LinkNode *ob_collections =
nullptr;
1533 bool is_cycle =
false;
1534 bool is_lib =
false;
1544 Object *ob_dst = base_dst->object;
1546 if (ob_src != ob_dst) {
1548 obdata_id =
static_cast<ID *
>(ob_dst->
data);
1554 obdata_id =
static_cast<ID *
>(ob_src->
data);
1556 ob_dst->
data = obdata_id;
1568 for (a = 0; a < ob_src->
totcol; a++) {
1577 if (ob_dst->data && ob_src->data) {
1595 for (collection_node = ob_collections; collection_node;
1596 collection_node = collection_node->
next)
1598 if (ob_dst->instance_collection != collection_node->
link) {
1600 bmain,
static_cast<Collection *
>(collection_node->
link), ob_dst);
1609 ob_dst->instance_collection = ob_src->instance_collection;
1610 if (ob_dst->instance_collection) {
1611 id_us_plus(&ob_dst->instance_collection->id);
1622 Curve *cu_src =
static_cast<Curve *
>(ob_src->data);
1623 Curve *cu_dst =
static_cast<Curve *
>(ob_dst->data);
1630#define CURVE_VFONT_SET(vfont_member) \
1632 if (cu_dst->vfont_member) { \
1633 id_us_min(&cu_dst->vfont_member->id); \
1635 cu_dst->vfont_member = cu_src->vfont_member; \
1636 id_us_plus((ID *)cu_dst->vfont_member); \
1645#undef CURVE_VFONT_SET
1663 if (ob_collections) {
1689 ot->name =
"Link Objects to Scene";
1690 ot->description =
"Link selection to another scene";
1691 ot->idname =
"OBJECT_OT_make_links_scene";
1711 {
MAKE_LINKS_OBDATA,
"OBDATA", 0,
"Link Object Data",
"Replace assigned Object Data"},
1716 "Link Animation Data",
1717 "Replace assigned Animation Data"},
1718 {
MAKE_LINKS_GROUP,
"GROUPS", 0,
"Link Collections",
"Replace assigned Collections"},
1722 "Link Instance Collection",
1723 "Replace assigned Collection Instance"},
1724 {
MAKE_LINKS_FONTS,
"FONTS", 0,
"Link Fonts to Text",
"Replace Text object Fonts"},
1730 "Copy Grease Pencil Effects",
1731 "Replace Grease Pencil Effects"},
1732 {0,
nullptr, 0,
nullptr,
nullptr},
1736 ot->name =
"Link/Transfer Data";
1737 ot->description =
"Transfer data from active object to selected objects";
1738 ot->idname =
"OBJECT_OT_make_links_data";
1748 ot->prop =
RNA_def_enum(
ot->srna,
"type", make_links_items, 0,
"Type",
"");
1767 const bool do_collection)
1769 if (do_collection) {
1789 const bool copy_collections,
1790 const bool is_master_collection)
1794 if (copy_collections && !is_master_collection) {
1820 for (; child !=
nullptr; child = child_next) {
1821 child_next = child->
next;
1825 if (is_master_collection && copy_collections && child->
collection != collection_child_new) {
1833 if (child == orig_child_last) {
1892 id =
static_cast<ID *
>(ob->data);
1900 static_cast<const ID *
>(ob->data),
1905 ob->data = la =
static_cast<Light *
>(
1908 static_cast<const ID *
>(ob->data),
1913 ob->data = cam =
static_cast<Camera *
>(
1916 static_cast<const ID *
>(ob->data),
1923 ob->data =
mesh =
static_cast<Mesh *
>(
1926 static_cast<const ID *
>(ob->data),
1933 static_cast<const ID *
>(ob->data),
1940 ob->data = cu =
static_cast<Curve *
>(
1943 static_cast<const ID *
>(ob->data),
1950 ob->data = lat =
static_cast<Lattice *
>(
1953 static_cast<const ID *
>(ob->data),
1961 static_cast<const ID *
>(ob->data),
1969 static_cast<const ID *
>(ob->data),
1976 static_cast<const ID *
>(ob->data),
1983 static_cast<const ID *
>(ob->data),
1990 static_cast<const ID *
>(ob->data),
1997 static_cast<const ID *
>(ob->data),
2004 static_cast<const ID *
>(ob->data),
2009 printf(
"ERROR %s: cannot copy %s\n", __func__, id->
name);
2049 if (adt ==
nullptr) {
2068 ID *id_obdata = (
ID *)ob->data;
2070 if (adt ==
nullptr) {
2092 for (a = 1; a <= ob->totcol; a++) {
2184 bool changed =
false;
2272 "Orphan library objects added to the current scene to avoid loss");
2291 for (a = 0; a < ob->totcol; a++) {
2300 for (a = 0; a < ob->totcol; a++) {
2310 ob->data !=
nullptr)
2312 ID *ob_data =
static_cast<ID *
>(ob->data);
2321 bmain,
nullptr,
nullptr,
true,
false,
true);
2333 "SELECT_OBDATA_MATERIAL",
2335 "Selected Objects, Data and Materials",
2338 {0,
nullptr, 0,
nullptr,
nullptr},
2342 ot->name =
"Make Local";
2343 ot->description =
"Make library linked data-blocks local to this file";
2344 ot->idname =
"OBJECT_OT_make_local";
2387 ID *id_root =
nullptr;
2388 bool is_override_instancing_object =
false;
2390 bool user_overrides_from_selected_objects =
false;
2398 "Collection '%s' (instantiated by the active object) is not overridable",
2404 is_override_instancing_object =
true;
2405 user_overrides_from_selected_objects =
false;
2409 const uint collection_session_uid = *((
const uint *)&
i);
2413 "Could not find an overridable root hierarchy for object '%s'",
2419 &collection_session_uid,
2420 sizeof(collection_session_uid),
2422 id_root = &collection->
id;
2423 user_overrides_from_selected_objects =
true;
2429 id_root = &obact->
id;
2430 user_overrides_from_selected_objects =
true;
2434 bool is_active_override =
false;
2438 is_active_override = is_active_override || (&ob_iter->id == id_root);
2448 if (is_active_override) {
2453 const bool do_fully_editable =
false;
2455 GSet *user_overrides_objects_uids = do_fully_editable ?
nullptr :
2460 if (do_fully_editable) {
2463 else if (user_overrides_from_selected_objects) {
2485 if (user_overrides_objects_uids !=
nullptr) {
2505 ID *id_root_override;
2516 if (!do_fully_editable) {
2538 if (is_override_instancing_object) {
2545 switch (
GS(id_root->
name)) {
2620 if (potential_root_collections.
is_empty()) {
2621 potential_root_collections.
add_new(collection);
2624 bool has_parents_in_potential_roots =
false;
2625 bool is_potential_root =
false;
2626 for (
auto *collection_root_iter : potential_root_collections) {
2629 "Invalid loop in collection hierarchy");
2632 has_parents_in_potential_roots =
true;
2636 "Invalid loop in collection hierarchy");
2639 is_potential_root =
true;
2640 potential_root_collections.remove(collection_root_iter);
2645 is_potential_root =
true;
2650 if (is_potential_root && !has_parents_in_potential_roots) {
2651 potential_root_collections.add_new(collection);
2656 if (potential_root_collections.
is_empty()) {
2660 if (potential_root_collections.
size() == 1) {
2661 Collection *collection_root = potential_root_collections.
pop();
2668 "Too many potential root collections (%d) for the override hierarchy, "
2669 "please use the Outliner instead",
2670 int(potential_root_collections.
size()));
2695 ot->name =
"Make Library Override";
2697 "Create a local override of the selected linked objects, and their hierarchy of "
2699 ot->idname =
"OBJECT_OT_make_override_library";
2716 "Override Collection",
2717 "Session UID of the directly linked collection containing the selected "
2718 "object, to make an override from",
2768 ot->name =
"Reset Library Override";
2769 ot->description =
"Reset the selected local overrides to their linked references values";
2770 ot->idname =
"OBJECT_OT_reset_override_library";
2791 LinkNode *todo_objects =
nullptr, *todo_object_iter;
2802 for (todo_object_iter = todo_objects; todo_object_iter !=
nullptr;
2803 todo_object_iter = todo_object_iter->
next)
2805 Object *ob_iter =
static_cast<Object *
>(todo_object_iter->link);
2807 bool do_remap_active =
false;
2810 do_remap_active =
true;
2816 if (do_remap_active) {
2820 if (basact !=
nullptr) {
2821 view_layer->
basact = basact;
2843 ot->name =
"Clear Library Override";
2845 "Delete the selected local overrides and relink their usages to the linked data-blocks if "
2846 "possible, else reset them and mark them as non editable";
2847 ot->idname =
"OBJECT_OT_clear_override_library";
2875 const bool copy_collections =
false;
2876 bool update_deps =
false;
2924 C, op, event,
IFACE_(
"Make Selected Objects Single-User"),
IFACE_(
"Make Single"));
2932 {0,
nullptr, 0,
nullptr,
nullptr},
2936 ot->name =
"Make Single User";
2937 ot->description =
"Make linked data local to each object";
2938 ot->idname =
"OBJECT_OT_make_single_user";
2954 RNA_def_boolean(
ot->srna,
"object",
false,
"Object",
"Make single user objects");
2955 RNA_def_boolean(
ot->srna,
"obdata",
false,
"Object Data",
"Make single user object data");
2957 ot->srna,
"material",
false,
"Materials",
"Make materials local to each data-block");
2962 "Make object animation data local to each object");
2966 "Object Data Animation",
2967 "Make object data (mesh, curve etc.) animation data local to each object");
2980 if (ob ==
nullptr) {
2983 mat_slot =
max_ii(mat_slot, 1);
2988 return fmt::format(fmt::runtime(
TIP_(
"Drop {} on {} (slot {}, replacing {})")),
2995 fmt::runtime(
TIP_(
"Drop {} on {} (slot {})")),
name, ob->
id.
name + 2, mat_slot);
3005 mat_slot =
max_ii(mat_slot, 1);
3010 if (ob ==
nullptr || ma ==
nullptr) {
3036 ot->name =
"Drop Named Material on Object";
3037 ot->idname =
"OBJECT_OT_drop_named_material";
3059 if (ob ==
nullptr) {
3063 const uint32_t session_uid =
RNA_int_get(properties,
"session_uid");
3069 return fmt::format(fmt::runtime(
TIP_(
"Add modifier with node group \"{}\" on object \"{}\"")),
3076 tree->ensure_interface_cache();
3077 if (!
tree->interface_outputs().is_empty()) {
3079 if (!first_output) {
3147 ot->name =
"Drop Geometry Node Group on Object";
3148 ot->idname =
"OBJECT_OT_drop_geometry_nodes";
3161 "Session UID of the geometry node group being dropped",
3166 "show_datablock_in_modifier",
3168 "Show the data-block selector in the modifier",
3185 if (pprop.
prop ==
nullptr) {
3195 ID *id_data =
static_cast<ID *
>(ob->
data);
3216 ot->name =
"Unlink";
3217 ot->idname =
"OBJECT_OT_unlink_data";
Functions and classes to work with Actions.
Functions to work with AnimData.
Blender kernel action and pose functionality.
bPoseChannel * BKE_pose_channel_active_if_bonecoll_visible(Object *ob) ATTR_WARN_UNUSED_RESULT
bool BKE_animdata_copy_id(Main *bmain, ID *id_to, ID *id_from, int flag)
AnimData * BKE_animdata_from_id(const ID *id)
void BKE_animdata_duplicate_id_action(Main *bmain, ID *id, uint duplicate_flags)
void BKE_pose_rebuild(Main *bmain, Object *ob, bArmature *arm, bool do_id_user)
bool BKE_collection_has_object_recursive(Collection *collection, Object *ob)
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_END
#define FOREACH_SCENE_OBJECT_END
bool BKE_collection_child_remove(Main *bmain, Collection *parent, Collection *child)
bool BKE_collection_has_object(Collection *collection, const Object *ob)
void BKE_scene_objects_iterator_end(BLI_Iterator *iter)
bool BKE_collection_child_add_no_sync(Main *bmain, Collection *parent, Collection *child)
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(_collection, _object)
#define FOREACH_SCENE_OBJECT_BEGIN(scene, _instance)
bool BKE_collection_has_collection(const Collection *parent, const Collection *collection)
bool BKE_collection_object_add(Main *bmain, Collection *collection, Object *ob)
bool BKE_constraint_remove_ex(ListBase *list, struct Object *ob, struct bConstraint *con)
struct bConstraint * BKE_constraint_add_for_object(struct Object *ob, const char *name, short type)
void BKE_constraint_target_matrix_get(struct Depsgraph *depsgraph, struct Scene *scene, struct bConstraint *con, int index, short ownertype, void *ownerdata, float mat[4][4], float ctime)
#define CTX_DATA_BEGIN(C, Type, instance, member)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Object * CTX_data_edit_object(const bContext *C)
Base * CTX_data_active_base(const bContext *C)
Main * CTX_data_main(const bContext *C)
Collection * CTX_data_collection(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
display list (or rather multi purpose list) stuff.
void BKE_displist_make_curveTypes(struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *ob, bool for_render)
void BKE_editmesh_looptris_and_normals_calc(BMEditMesh *em)
FModifier * add_fmodifier(ListBase *modifiers, int type, FCurve *owner_fcu)
bool BKE_view_layer_has_collection(const ViewLayer *view_layer, const Collection *collection)
void BKE_view_layer_selected_objects_tag(const Scene *scene, ViewLayer *view_layer, int tag)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
#define FOREACH_OBJECT_FLAG_END
#define FOREACH_SELECTED_OBJECT_BEGIN(_view_layer, _v3d, _instance)
void BKE_view_layer_base_deselect_all(const Scene *scene, ViewLayer *view_layer)
void BKE_main_collection_sync_remap(const Main *bmain)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
#define FOREACH_OBJECT_FLAG_BEGIN(_scene, _view_layer, _v3d, _flag, _instance)
#define FOREACH_SELECTED_OBJECT_END
ID * BKE_libblock_find_session_uid(Main *bmain, short type, uint32_t session_uid)
void BKE_id_delete(Main *bmain, void *idv) ATTR_NONNULL()
bool BKE_id_is_editable(const Main *bmain, const ID *id)
#define MAIN_ID_SESSION_UID_UNSET
void BKE_library_make_local(Main *bmain, const Library *lib, GHash *old_to_new_ids, bool untagged_only, bool set_fake, bool clear_asset_data)
void BKE_main_id_newptr_and_tag_clear(Main *bmain)
ID * BKE_id_copy_ex(Main *bmain, const ID *id, ID **new_id_p, int flag)
void BKE_main_id_tag_all(Main *mainvar, int tag, bool value)
void BKE_lib_override_library_id_reset(Main *bmain, ID *id_root, bool do_reset_system_override)
bool BKE_lib_override_library_create(Main *bmain, Scene *scene, ViewLayer *view_layer, Library *owner_library, ID *id_root_reference, ID *id_hierarchy_root_reference, ID *id_instance_hint, ID **r_id_root_override, const bool do_fully_editable)
bool BKE_lib_override_library_is_hierarchy_leaf(Main *bmain, ID *id)
void BKE_library_foreach_ID_link(Main *bmain, ID *id, blender::FunctionRef< LibraryIDLinkCallback > callback, void *user_data, LibraryForeachIDFlag flag)
void BKE_libblock_relink_to_newid(Main *bmain, ID *id, int remap_flag) ATTR_NONNULL()
void void BKE_libblock_remap(Main *bmain, void *old_idv, void *new_idv, int remap_flags) ATTR_NONNULL(1
@ ID_REMAP_SKIP_INDIRECT_USAGE
#define FOREACH_MAIN_ID_END
#define FOREACH_MAIN_ID_BEGIN(_bmain, _id)
General operations, lookup, etc. for materials.
@ BKE_MAT_ASSIGN_USERPREF
void BKE_object_materials_sync_length(Main *bmain, Object *ob, ID *id)
Material * BKE_object_material_get(Object *ob, short act)
void BKE_object_material_assign(Main *bmain, Object *ob, Material *ma, short act, int assign_type)
Material *** BKE_object_material_array_p(Object *ob)
Object * BKE_modifiers_is_deformed_by_curve(Object *ob)
Object * BKE_modifiers_is_deformed_by_lattice(Object *ob)
void BKE_modifier_free(ModifierData *md)
void BKE_modifier_remove_from_list(Object *ob, ModifierData *md)
Object * BKE_modifiers_is_deformed_by_armature(Object *ob)
General operations, lookup, etc. for blender objects.
blender::float4x4 BKE_object_calc_parent(Depsgraph *depsgraph, Scene *scene, Object *ob)
KDTree_3d * BKE_object_as_kdtree(Object *ob, int *r_tot)
void BKE_object_groups_clear(Main *bmain, Scene *scene, Object *object)
void BKE_object_apply_mat4(Object *ob, const float mat[4][4], bool use_compat, bool use_parent)
int BKE_object_scenes_users_get(Main *bmain, Object *ob)
bool BKE_object_parent_loop_check(const Object *parent, const Object *ob)
void BKE_object_link_modifiers(Object *ob_dst, const Object *ob_src)
void BKE_object_apply_parent_inverse(Object *ob)
LinkNode * BKE_object_groups(Main *bmain, Scene *scene, Object *ob)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
@ RPT_ERROR_INVALID_INPUT
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BKE_scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain)
#define BLI_assert_msg(a, msg)
bool BLI_gset_haskey(const GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT
GSet * BLI_gset_new(GSetHashFP hashfp, GSetCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
bool BLI_ghashutil_intcmp(const void *a, const void *b)
unsigned int BLI_ghashutil_inthash_p(const void *ptr)
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
bool BLI_gset_add(GSet *gs, void *key)
A KD-tree for nearest neighbor search.
void BLI_kdtree_nd_ free(KDTree *tree)
void BLI_linklist_free(LinkNode *list, LinkNodeFreeFP freefunc)
#define BLI_linklist_prepend_alloca(listp, ptr)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void * BLI_listbase_bytes_find(const ListBase *listbase, const void *bytes, size_t bytes_size, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
MINLINE int max_ii(int a, int b)
MINLINE int min_iii(int a, int b, int c)
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
void unit_m4(float m[4][4])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void copy_v3_v3_int(int r[3], const int a[3])
#define STRNCPY_UTF8(dst, src)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define POINTER_FROM_UINT(i)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
#define ID_IS_OVERRIDE_LIBRARY_REAL(_id)
#define ID_IS_OVERRIDABLE_LIBRARY(_id)
#define ID_IS_LINKED(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
#define ID_NEW_SET(_id, _idn)
@ LIBOVERRIDE_FLAG_SYSTEM_DEFINED
@ FMODIFIER_TYPE_GENERATOR
@ BONE_RELATIVE_PARENTING
Object groups, one object can be in many groups at once.
@ CONSTRAINT_TYPE_TRACKTO
@ CONSTRAINT_TYPE_LOCKTRACK
@ CONSTRAINT_TYPE_FOLLOWPATH
@ CONSTRAINT_TYPE_DAMPTRACK
@ CONSTRAINT_OBTYPE_OBJECT
#define BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt)
@ NODES_MODIFIER_HIDE_DATABLOCK_SELECTOR
@ NODES_MODIFIER_HIDE_MANAGE_PANEL
@ eModifierType_GreasePencilArmature
@ GEO_NODE_ASSET_HIDE_MODIFIER_MANAGE_PANEL
Object is a sort of wrapper for general info.
#define OB_TYPE_SUPPORT_PARVERT(_type)
#define OB_TYPE_SUPPORT_MATERIAL(_type)
#define BASE_SELECTED(v3d, base)
#define ARM_GROUPS_ENVELOPE
void EDBM_mesh_make(Object *ob, int select_mode, bool add_key_index)
void EDBM_mesh_load(Main *bmain, Object *ob)
bool ED_operator_object_active(bContext *C)
bool ED_operator_editsurfcurve(bContext *C)
bool ED_operator_objectmode(bContext *C)
bool ED_operator_objectmode_with_view3d_poll_msg(bContext *C)
bool ED_operator_view3d_active(bContext *C)
bool ED_operator_object_active_editable(bContext *C)
bool ED_operator_editlattice(bContext *C)
bool ED_operator_editmesh(bContext *C)
Object * ED_view3d_give_material_slot_under_cursor(bContext *C, const int mval[2], int *r_material_slot)
Object * ED_view3d_give_object_under_cursor(bContext *C, const int mval[2])
Read Guarded memory(de)allocation.
void MOD_nodes_update_interface(Object *object, NodesModifierData *nmd)
const EnumPropertyItem * RNA_scene_local_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
#define RNA_ENUM_ITEM_SEPR
void UI_popup_menu_end(bContext *C, uiPopupMenu *pup)
uiPopupMenu * UI_popup_menu_begin(bContext *C, const char *title, int icon) ATTR_NONNULL()
uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
void UI_context_active_but_prop_get_templateID(const bContext *C, PointerRNA *r_ptr, PropertyRNA **r_prop)
#define ND_LIB_OVERRIDE_CHANGED
void ED_object_vgroup_calc_from_armature(ReportList *reports, Depsgraph *depsgraph, Scene *scene, Object *ob, Object *par, const int mode, const bool mirror)
#define BM_elem_flag_test(ele, hflag)
#define BM_ITER_MESH_INDEX(ele, iter, bm, itype, indexvar)
BMesh const char void * data
BPy_StructRNA * depsgraph
void add_new(const Key &key)
ListBase * object_editcurve_get(Object *ob)
void * MEM_mallocN(size_t len, const char *str)
void MEM_freeN(void *vmemh)
bAction * id_action_ensure(Main *bmain, ID *id)
FCurve * action_fcurve_ensure_ex(Main *bmain, bAction *act, const char group[], PointerRNA *ptr, const FCurveDescriptor &fcurve_descriptor)
void add_armature_automatic_weights(Scene &scene, Object &object, const Object &ob_armature)
void add_armature_envelope_weights(Scene &scene, Object &object, const Object &ob_armature)
bool add_armature_vertex_groups(Object &object, const Object &ob_armature)
@ CLEAR_PARENT_KEEP_TRANSFORM
ModifierData * modifier_add(ReportList *reports, Main *bmain, Scene *scene, Object *ob, const char *name, int type)
static wmOperatorStatus object_unlink_data_exec(bContext *C, wmOperator *op)
void single_obdata_user_make(Main *bmain, Scene *scene, Object *ob)
static bool make_override_library_object_overridable_check(Main *bmain, Object *object)
static wmOperatorStatus drop_geometry_nodes_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void OBJECT_OT_make_local(wmOperatorType *ot)
static wmOperatorStatus clear_override_library_exec(bContext *C, wmOperator *)
void OBJECT_OT_clear_override_library(wmOperatorType *ot)
const EnumPropertyItem prop_clear_parent_types[]
static const EnumPropertyItem prop_clear_track_types[]
static bool parent_set_vertex_parent_with_kdtree(bContext *C, ParentingContext *parenting_context, KDTree_3d *tree)
void OBJECT_OT_unlink_data(wmOperatorType *ot)
static bool check_geometry_node_group_sockets(wmOperator *op, const bNodeTree *tree)
static void single_mat_users(Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, const int flag)
static bool parent_set_vertex_parent(bContext *C, ParentingContext *parenting_context)
static void parent_clear_data(Object *ob)
static void make_local_animdata_tag_strips(ListBase *strips)
static wmOperatorStatus object_track_clear_exec(bContext *C, wmOperator *op)
static wmOperatorStatus parent_set_invoke(bContext *C, wmOperator *op, const wmEvent *)
std::string drop_named_material_tooltip(bContext *C, const char *name, const int mval[2])
void OBJECT_OT_make_links_scene(wmOperatorType *ot)
std::string drop_geometry_nodes_tooltip(bContext *C, PointerRNA *properties, const int mval[2])
void OBJECT_OT_track_clear(wmOperatorType *ot)
static void single_obdata_users(Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, const int flag)
static wmOperatorStatus make_links_scene_exec(bContext *C, wmOperator *op)
void OBJECT_OT_drop_named_material(wmOperatorType *ot)
const EnumPropertyItem prop_make_parent_types[]
void base_select(Base *base, eObjectSelect_Mode mode)
void parent_clear(Object *ob, int type)
void OBJECT_OT_parent_no_inverse_set(wmOperatorType *ot)
static wmOperatorStatus make_single_user_exec(bContext *C, wmOperator *op)
static void object_remove_parent_deform_modifiers(Object *ob, const Object *par)
static bool single_data_needs_duplication(ID *id)
static void parent_set_vert_find(KDTree_3d *tree, Object *child, int vert_par[3], bool is_tri)
void OBJECT_OT_track_set(wmOperatorType *ot)
static const EnumPropertyItem prop_make_track_types[]
static wmOperatorStatus track_set_exec(bContext *C, wmOperator *op)
static wmOperatorStatus vertex_parent_set_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_parent_set(wmOperatorType *ot)
static void single_objectdata_action_users(Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, const int flag)
static wmOperatorStatus parent_clear_exec(bContext *C, wmOperator *op)
bool parent_set(ReportList *reports, const bContext *C, Scene *scene, Object *const ob, Object *const par, int partype, bool xmirror, bool keep_transform, const int vert_par[3])
static wmOperatorStatus make_local_exec(bContext *C, wmOperator *op)
@ MAKE_LINKS_DUPLICOLLECTION
static wmOperatorStatus make_override_library_invoke(bContext *C, wmOperator *op, const wmEvent *)
Object * context_active_object(const bContext *C)
void OBJECT_OT_make_links_data(wmOperatorType *ot)
static wmOperatorStatus parent_noinv_set_exec(bContext *C, wmOperator *op)
static bool allow_make_links_data(const int type, Object *ob_src, Object *ob_dst)
static wmOperatorStatus reset_override_library_exec(bContext *C, wmOperator *)
@ CLEAR_TRACK_KEEP_TRANSFORM
static wmOperatorStatus make_links_data_exec(bContext *C, wmOperator *op)
static bool reset_clear_override_library_poll(bContext *C)
static bool make_override_library_poll(bContext *C)
void OBJECT_OT_reset_override_library(wmOperatorType *ot)
void OBJECT_OT_parent_clear(wmOperatorType *ot)
static void make_local_animdata_tag(AnimData *adt)
void base_free_and_unlink(Main *bmain, Scene *scene, Object *ob)
void OBJECT_OT_make_override_library(wmOperatorType *ot)
static bool parent_set_nonvertex_parent(bContext *C, ParentingContext *parenting_context)
void OBJECT_OT_drop_geometry_nodes(wmOperatorType *ot)
static void single_object_users(Main *bmain, Scene *scene, View3D *v3d, const int flag, const bool copy_collections)
void OBJECT_OT_make_single_user(wmOperatorType *ot)
static wmOperatorStatus parent_set_invoke_menu(bContext *C, wmOperatorType *ot)
static bool vertex_parent_set_poll(bContext *C)
static void make_local_material_tag(Material *ma)
static void libblock_relink_collection(Main *bmain, Collection *collection, const bool do_collection)
@ MAKE_LOCAL_SELECT_OBDATA_MATERIAL
@ MAKE_LOCAL_SELECT_OBDATA
static void tag_localizable_objects(bContext *C, const int mode)
static bool parent_set_poll_property(const bContext *, wmOperator *op, const PropertyRNA *prop)
static wmOperatorStatus drop_named_material_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void OBJECT_OT_parent_set(wmOperatorType *ot)
static bool parent_set_with_depsgraph(ReportList *reports, const bContext *C, Scene *scene, Depsgraph *depsgraph, Object *const ob, Object *const par, Object *const parent_eval, int partype, const bool xmirror, const bool keep_transform, const int vert_par[3])
static wmOperatorStatus parent_set_exec(bContext *C, wmOperator *op)
static int tag_localizable_looper(LibraryIDLinkCallbackData *cb_data)
static bool make_local_all__instance_indirect_unused(Main *bmain, const Scene *scene, ViewLayer *view_layer, Collection *collection)
void object_single_user_make(Main *bmain, Scene *scene, Object *ob)
static void single_object_action_users(Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, const int flag)
static Collection * single_object_users_collection(Main *bmain, Scene *scene, Collection *collection, const int flag, const bool copy_collections, const bool is_master_collection)
static wmOperatorStatus make_override_library_exec(bContext *C, wmOperator *op)
static wmOperatorStatus make_single_user_invoke(bContext *C, wmOperator *op, const wmEvent *event)
@ MAKE_SINGLE_USER_SELECTED
void shaderfx_link(Object *dst, Object *src)
#define CURVE_VFONT_SET(vfont_member)
void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
int RNA_int_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
int RNA_enum_get(PointerRNA *ptr, const char *name)
const char * RNA_property_identifier(const PropertyRNA *prop)
PointerRNA RNA_id_pointer_create(ID *id)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
const EnumPropertyItem rna_enum_dummy_NULL_items[]
struct Object * focus_object
struct CameraDOFSettings dof
struct Collection * collection
struct CollectionChild * next
struct CollectionObject * next
CollectionRuntimeHandle * runtime
struct ID * hierarchy_root
IDOverrideLibrary * override_library
struct EditLatt * editlatt
struct ModifierData * next
struct bNodeTree * node_group
struct Collection * instance_collection
ObjectRuntimeHandle * runtime
struct Collection * master_collection
struct ToolSettings * toolsettings
struct bConstraint * prev
struct GeometryNodeAssetTraits * geometry_node_asset_traits
PointerRNA op(wmOperatorType *ot, std::optional< blender::StringRef > name, int icon, blender::wm::OpCallContext context, eUI_Item_Flag flag)
struct ReportList * reports
struct wmOperatorType * type
void WM_cursor_wait(bool val)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
ID * WM_operator_properties_id_lookup_from_name_or_session_uid(Main *bmain, PointerRNA *ptr, const ID_Type type)
void WM_operator_properties_id_lookup(wmOperatorType *ot, const bool add_name_prop)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
wmOperatorStatus WM_enum_search_invoke(bContext *C, wmOperator *op, const wmEvent *)
wmOperatorStatus WM_operator_props_popup_confirm_ex(bContext *C, wmOperator *op, const wmEvent *, std::optional< std::string > title, std::optional< std::string > confirm_text, const bool cancel_default, std::optional< std::string > message)