213 float eul[3], oldeul[3], quat1[4] = {0};
226 eul[0] = eul[1] = eul[2] = 0.0f;
241 if ((quat1[0] < 0.0f && ob->
quat[0] > 0.0f) || (quat1[0] > 0.0f && ob->
quat[0] < 0.0f)) {
302 void (*clear_func)(
Object *,
const bool),
303 const char default_ksName[])
322 if (objects.is_empty()) {
327 const bool use_transform_skip_children = (scene->toolsettings->transform_flag &
329 const bool use_transform_data_origin = (scene->toolsettings->transform_flag &
334 if (use_transform_skip_children) {
338 xcs, scene, view_layer, objects.data(), objects.size());
340 if (use_transform_data_origin) {
352 for (
Object *ob : objects) {
353 if (use_transform_data_origin) {
358 clear_func(ob, clear_delta);
366 if (use_transform_skip_children) {
371 if (use_transform_data_origin) {
396 ot->
name =
"Clear Location";
398 ot->
idname =
"OBJECT_OT_location_clear";
413 "Clear delta location in addition to clearing the normal location transform");
430 ot->
name =
"Clear Rotation";
432 ot->
idname =
"OBJECT_OT_rotation_clear";
447 "Clear delta rotation in addition to clearing the normal rotation transform");
466 ot->
idname =
"OBJECT_OT_scale_clear";
481 "Clear delta scale in addition to clearing the normal scale transform");
499 v3 = ob->parentinv[3];
518 ot->
name =
"Clear Origin";
520 ot->
idname =
"OBJECT_OT_origin_clear";
544 if (ob_child->parent == ob) {
568 if (!
ELEM(object->parent,
nullptr, root_object)) {
570 root_object, object->
parent, sorted_objects, object_index);
573 sorted_objects[*object_index] = object;
575 object->
id.
tag &= ~ID_TAG_DOIT;
591 if (objects_num == 0) {
597 int object_index = 0;
606 return sorted_objects;
616 if (
ELEM(
nullptr, obact, obact->
data)) {
624 bool all_objects_same_data =
true;
625 bool obact_selected =
false;
628 if (ob->data != obact->
data) {
629 all_objects_same_data =
false;
634 obact_selected =
true;
639 return all_objects_same_data && obact_selected;
660 for (float3 &position : positions.slice(range)) {
661 position = math::transform_point(matrix, position);
677 float rsmat[3][3], obmat[3][3], iobmat[3][3], mat[4][4], scale;
680 float obact_invmat[4][4], obact_parent[4][4], obact_parentinv[4][4];
684 bool make_single_user =
false;
688 invert_m4_m4(obact_invmat, obact->object_to_world().ptr());
694 if (do_single_user) {
695 make_single_user =
true;
698 ID *obact_data =
static_cast<ID *
>(obact->
data);
701 R
"(Cannot apply to a multi user: Object "%s", %s "%s", aborting)",
704 obact_data->name + 2);
725 ID *obdata =
static_cast<ID *
>(ob->data);
729 R
"(Cannot apply to a multi user: Object "%s", %s "%s", aborting)",
739 R
"(Cannot apply to library or override data: Object "%s", %s "%s", aborting)",
748 ID *obdata =
static_cast<ID *
>(ob->data);
755 R
"(Rotation/Location can't apply to a 2D curve: Object "%s", %s "%s", aborting)",
764 R
"(Can't apply to a curve with shape-keys: Object "%s", %s "%s", aborting)",
773 if (apply_rot || apply_loc) {
776 "Text objects can only have their scale applied: \"%s\"",
787 bool has_unparented_layers =
false;
792 if (gpl->parent ==
nullptr) {
793 has_unparented_layers =
true;
798 if (has_unparented_layers ==
false) {
801 "Can't apply to a GP data-block where all layers are parented: Object "
802 "\"%s\", %s \"%s\", aborting",
814 R
"(Can't apply to GP data-block with no layers: Object "%s", %s "%s", aborting)",
825 if (apply_rot || apply_loc) {
828 "Area Lights can only have scale applied: \"%s\"",
845 if (make_single_user) {
854 if (objects.is_empty()) {
858 for (
Object *ob : objects) {
860 if (apply_scale && apply_rot) {
863 else if (apply_scale) {
866 else if (apply_rot) {
867 float tmat[3][3], timat[3][3];
888 if (!(apply_scale && apply_rot)) {
899 if (do_multi_user && ob != obact) {
903 ob->data = obact->
data;
906 else if (ob->type ==
OB_MESH) {
907 Mesh *mesh =
static_cast<Mesh *
>(ob->data);
934 else if (ob->type ==
OB_FONT) {
939 for (
int i = 0; i < cu->
totbox; i++) {
958 curves.geometry.wrap().calculate_bezier_auto_handles();
965 for (
const int layer_i : grease_pencil.layers().index_range()) {
967 const float4x4 layer_to_object = layer.to_object_space(*ob);
980 threading::parallel_for(radii.index_range(), 8192, [&](
const IndexRange range) {
981 for (const int i : range) {
986 curves.transform(object_to_layer *
float4x4(mat) * layer_to_object);
987 curves.calculate_bezier_auto_handles();
994 pointcloud.tag_positions_changed();
1023 if ((apply_loc ==
false) && (apply_rot ==
false) && (apply_scale ==
true)) {
1025 ob->empty_drawsize *= max_scale;
1028 else if (ob->type ==
OB_LAMP) {
1057 if (do_multi_user && ob != obact) {
1058 float _obmat[4][4], _iobmat[4][4];
1061 copy_m4_m4(_obmat, ob->object_to_world().ptr());
1069 if (apply_loc && apply_scale && apply_rot) {
1073 Object ob_temp = dna::shallow_copy(*ob);
1142 bool changed =
false;
1168 ot->
name =
"Apply Visual Transform";
1169 ot->
description =
"Apply the object's visual transformation to its data";
1170 ot->
idname =
"OBJECT_OT_visual_transform_apply";
1188 if (loc ||
rot || sca) {
1202 if ((ob !=
nullptr) && (ob->
data !=
nullptr) && need_single_user) {
1210 IFACE_(
"Apply Object Transformations"),
1211 IFACE_(
"Warning: Multiple objects share the same data.\nMake "
1212 "single user and then apply transformations?"),
1224 ot->
name =
"Apply Object Transform";
1225 ot->
description =
"Apply the object's transformation to its data";
1226 ot->
idname =
"OBJECT_OT_transform_apply";
1243 "Modify properties such as curve vertex radius, font size and bone envelope");
1247 "Isolate Multi User Data",
1248 "Create new object-data users if needed");
1262 if (ob->parent ==
nullptr) {
1279 ot->
name =
"Apply Parent Inverse";
1280 ot->
description =
"Apply the object's parent inverse to its data";
1281 ot->
idname =
"OBJECT_OT_parent_inverse_apply";
1307 if (values.is_empty()) {
1311 return std::accumulate(values.begin(), values.end(),
float3(0)) / values.size();
1316 threading::parallel_for(positions.index_range(), 2048, [&](
const IndexRange range) {
1317 for (float3 &position : positions.slice(range)) {
1318 position += translation;
1330 float3 cent, cent_neg, centn;
1331 const float *cursor = scene->cursor.location;
1335 int tot_change = 0, tot_lib_error = 0, tot_multiuser_arm_error = 0;
1364 BMEditMesh *em = mesh->runtime->edit_mesh.get();
1371 mul_m4_v3(obedit->world_to_object().ptr(), cent);
1375 float min[3], max[3];
1403 if (objects.is_empty()) {
1408 for (
const int object_index : objects.index_range()) {
1409 Object *ob = objects[object_index];
1410 ob->
flag &= ~OB_DONE;
1413 if (ob == obact && objects.size() > 1) {
1414 memmove(&objects[1], objects.data(), object_index *
sizeof(
Object *));
1421 ((
ID *)tob->data)->tag &= ~ID_TAG_DOIT;
1423 if (tob->instance_collection) {
1424 ((
ID *)tob->instance_collection)->tag &= ~ID_TAG_DOIT;
1428 for (
Object *ob : objects) {
1433 bool do_inverse_offset =
false;
1438 invert_m4_m4(ob->runtime->world_to_object.ptr(), ob->object_to_world().ptr());
1439 mul_m4_v3(ob->world_to_object().ptr(), cent);
1442 if (ob->data ==
nullptr) {
1445 (ob->instance_collection->id.tag &
ID_TAG_DOIT) == 0)
1455 float min[3], max[3];
1460 invert_m4_m4(ob->runtime->world_to_object.ptr(), ob->object_to_world().ptr());
1461 mul_m4_v3(ob->world_to_object().ptr(), cent);
1464 add_v3_v3(ob->instance_collection->instance_offset, cent);
1468 do_inverse_offset =
true;
1475 else if (ob->type ==
OB_MESH) {
1476 if (obedit ==
nullptr) {
1477 Mesh *mesh =
static_cast<Mesh *
>(ob->data);
1502 do_inverse_offset =
true;
1530 do_inverse_offset =
true;
1539 else if (ob->type ==
OB_FONT) {
1559 cu->
xof = cu->
xof - cent[0];
1560 cu->
yof = cu->
yof - cent[1];
1564 do_inverse_offset =
true;
1575 tot_multiuser_arm_error++;
1619 do_inverse_offset =
true;
1648 do_inverse_offset =
true;
1657 add_v3_v3(gpcenter, ob->object_to_world().location());
1664 float imat[3][3], bmat[3][3];
1665 float offset_global[3];
1666 float offset_local[3];
1669 sub_v3_v3v3(offset_global, gpcenter, ob->object_to_world().location());
1670 copy_m3_m4(bmat, obact->object_to_world().ptr());
1675 float diff_mat[4][4];
1676 float inverse_diff_mat[4][4];
1687 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
1695 if (gps->editcurve !=
nullptr) {
1696 for (i = 0; i < gps->editcurve->tot_curve_points; i++) {
1697 BezTriple *bezt = &gps->editcurve->curve_points[i].bezt;
1698 for (
int j = 0; j < 3; j++) {
1718 do_inverse_offset =
true;
1723 "Grease Pencil Object does not support this set origin option");
1734 op->
reports,
RPT_WARNING,
"Curves Object does not support this set origin operation");
1738 if (curves.points_num() == 0) {
1754 curves.translate(-cent);
1756 do_inverse_offset =
true;
1765 "Grease Pencil Object does not support this set origin operation");
1773 const int current_frame = scene->r.cfra;
1778 const int current_frame = scene->r.cfra;
1780 int total_points = 0;
1782 for (
const int layer_i : grease_pencil.layers().index_range()) {
1784 const float4x4 layer_to_object = layer.local_transform();
1785 if (!layer.is_visible()) {
1789 layer, current_frame))
1793 for (
const int i : curves.points_range()) {
1796 total_points += curves.points_num();
1800 if (total_points != 0) {
1801 cent = center / total_points;
1807 for (
const int layer_i : grease_pencil.layers().index_range()) {
1809 const float4x4 layer_to_object = layer.local_transform();
1823 curves.calculate_bezier_auto_handles();
1828 do_inverse_offset =
true;
1838 "Point cloud object does not support this set origin operation");
1856 pointcloud.tag_positions_changed();
1858 do_inverse_offset =
true;
1891 for (
Object *ob_other : objects) {
1892 if ((ob_other->flag &
OB_DONE) == 0 &&
1893 ((ob->data && (ob->data == ob_other->data)) ||
1894 (ob->instance_collection == ob_other->instance_collection &&
1901 centn, ob_other->object_to_world().ptr(), cent);
1926 else if (tob->instance_collection && tob->instance_collection->id.tag &
ID_TAG_DOIT) {
1937 if (tot_lib_error + tot_multiuser_arm_error) {
1940 "%i object(s) not centered, %i changed:",
1941 tot_lib_error + tot_multiuser_arm_error,
1943 if (tot_lib_error) {
1946 if (tot_multiuser_arm_error) {
1948 op->
reports,
RPT_WARNING,
"|%i multiuser armature object(s)", tot_multiuser_arm_error);
1961 "Geometry to Origin",
1962 "Move object geometry to object origin"},
1966 "Origin to Geometry",
1967 "Calculate the center of geometry based on the current pivot point (median, otherwise "
1972 "Origin to 3D Cursor",
1973 "Move object origin to position of the 3D cursor"},
1976 "ORIGIN_CENTER_OF_MASS",
1978 "Origin to Center of Mass (Surface)",
1979 "Calculate the center of mass from the surface area"},
1981 "ORIGIN_CENTER_OF_VOLUME",
1983 "Origin to Center of Mass (Volume)",
1984 "Calculate the center of mass from the volume (must be manifold geometry with consistent "
1986 {0,
nullptr, 0,
nullptr,
nullptr},
1992 {0,
nullptr, 0,
nullptr,
nullptr},
1998 "Set the object's origin, by either moving the data, or set to center of data, or use 3D "
2000 ot->
idname =
"OBJECT_OT_origin_set";
2026#define USE_RELATIVE_ROTATION
2028#define USE_RENDER_OVERRIDE
2033#define USE_FAKE_DEPTH_INIT
2037 float rot_mat[3][3];
2042#ifdef USE_RELATIVE_ROTATION
2044 float xform_rot_offset[3][3];
2064#ifdef USE_FAKE_DEPTH_INIT
2067 float view_co_a[3], view_co_b[3];
2071 float center[3] = {0.0f};
2074 const Object *ob = item.ob;
2075 const float *ob_co_a = ob->object_to_world().location();
2077 add_v3_v3v3(ob_co_b, ob->object_to_world().location(), ob->object_to_world().ptr()[2]);
2078 float view_isect[3], ob_isect[3];
2079 if (
isect_line_line_v3(view_co_a, view_co_b, ob_co_a, ob_co_b, view_isect, ob_isect)) {
2086 float center_proj[3];
2115#ifdef USE_RENDER_OVERRIDE
2146 Object ob_prev = dna::shallow_copy(*ob);
2148 copy_m4_m4(mat, ob->object_to_world().ptr());
2152 *ob = dna::shallow_copy(ob_prev);
2157 const float rot_orig[3][3],
2158 const float axis[3],
2159 const float location[3],
2163 sub_v3_v3v3(delta, ob->object_to_world().location(), location);
2170 float delta_rot[3][3];
2171 float final_rot[3][3];
2206#ifdef USE_RENDER_OVERRIDE
2215#ifdef USE_RENDER_OVERRIDE
2219 if (depths ==
nullptr) {
2232 xfd->
vc.
mval[0] =
event->mval[0];
2233 xfd->
vc.
mval[1] =
event->mval[1];
2258 float full_mat3[3][3];
2260 item.is_z_flip =
dot_v3v3(item.rot_mat[2], full_mat3[2]) < 0.0f;
2275 const bool is_translate =
event->modifier &
KM_CTRL;
2276 const bool is_translate_init = is_translate && (xfd->
is_translate != is_translate);
2280 if (depths && (
uint(event->
mval[0]) < depths->
w) && (
uint(event->
mval[1]) < depths->
h)) {
2281 float depth_fl = 1.0f;
2283 float location_world[3];
2284 if (depth_fl == 1.0f) {
2290#ifdef USE_FAKE_DEPTH_INIT
2292 if (depth_fl == 1.0f) {
2302 double depth =
double(depth_fl);
2303 if ((depth > depths->
depth_range[0]) && (depth < depths->depth_range[1])) {
2310 bool normal_found =
false;
2312 normal_found =
true;
2316 for (
int x = -ofs; x <= ofs; x += ofs / 2) {
2317 for (
int y = -ofs; y <= ofs; y += ofs / 2) {
2318 if (x != 0 && y != 0) {
2319 const int mval_ofs[2] = {
event->mval[0] +
x,
event->mval[1] + y};
2331 normal_found =
true;
2335#ifdef USE_RELATIVE_ROTATION
2336 if (is_translate_init && xfd->
object_data.size() > 1) {
2337 float xform_rot_offset_inv_first[3][3];
2338 for (
const int i : xfd->
object_data.index_range()) {
2355 for (
const int i : xfd->
object_data.index_range()) {
2357 if (is_translate_init) {
2369 float target_normal[3];
2378#ifdef USE_RELATIVE_ROTATION
2410 item.ob, item.rot_mat, item.rot_mat[2], location_world, item.is_z_flip))
2426 bool is_finished =
false;
2454 ot->
name =
"Interactive Light Track to Cursor";
2455 ot->
description =
"Interactively point cameras and lights to a location (Ctrl translates)";
2456 ot->
idname =
"OBJECT_OT_transform_axis_target";
2468#undef USE_RELATIVE_ROTATION
Functions and classes to work with Actions.
Functions to insert, delete or modify keyframes.
void BKE_armature_copy_bone_transforms(bArmature *armature_dst, const bArmature *armature_src)
void BKE_armature_transform(bArmature *arm, const float mat[4][4], bool do_props)
void BKE_pose_where_is(Depsgraph *depsgraph, Scene *scene, Object *ob)
#define CTX_DATA_BEGIN(C, Type, instance, member)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
#define CTX_DATA_COUNT(C, member)
Scene * CTX_data_scene(const bContext *C)
Object * CTX_data_edit_object(const bContext *C)
Main * CTX_data_main(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
void BKE_curve_translate(Curve *cu, const float offset[3], bool do_keys)
bool BKE_curve_center_median(Curve *cu, float cent[3])
std::optional< blender::Bounds< blender::float3 > > BKE_curve_minmax(const Curve *cu, bool use_radius)
void BKE_curve_transform_ex(Curve *cu, const float mat[4][4], bool do_keys, bool do_props, float unit_scale)
Low-level operations for curves.
void BKE_gpencil_centroid_3d(struct bGPdata *gpd, float r_centroid[3])
void BKE_gpencil_stroke_geometry_update(struct bGPdata *gpd, struct bGPDstroke *gps)
void BKE_gpencil_transform(struct bGPdata *gpd, const float mat[4][4])
void BKE_gpencil_layer_transform_matrix_get(const struct Depsgraph *depsgraph, struct Object *obact, struct bGPDlayer *gpl, float diff_mat[4][4])
Low-level operations for grease pencil.
const char * BKE_idtype_idcode_to_name(short idcode)
void BKE_lattice_transform(Lattice *lt, const float mat[4][4], bool do_keys)
std::optional< blender::Bounds< blender::float3 > > BKE_lattice_minmax(const Lattice *lt)
void BKE_lattice_center_median(Lattice *lt, float cent[3])
void BKE_lattice_translate(Lattice *lt, const float offset[3], bool do_keys)
#define FOREACH_SELECTED_EDITABLE_OBJECT_END
#define FOREACH_SELECTED_EDITABLE_OBJECT_BEGIN(_view_layer, _v3d, _instance)
bool BKE_id_is_editable(const Main *bmain, const ID *id)
void BKE_main_id_newptr_and_tag_clear(Main *bmain)
void BKE_main_id_tag_all(Main *mainvar, int tag, bool value)
bool BKE_mball_center_bounds(const MetaBall *mb, float r_cent[3])
void BKE_mball_translate(MetaBall *mb, const float offset[3])
void BKE_mball_transform(MetaBall *mb, const float mat[4][4], bool do_props)
bool BKE_mball_center_median(const MetaBall *mb, float r_cent[3])
bool BKE_mesh_center_of_surface(const Mesh *mesh, float r_cent[3])
void BKE_mesh_translate(Mesh *mesh, const float offset[3], bool do_keys)
bool BKE_mesh_center_median(const Mesh *mesh, float r_cent[3])
bool BKE_mesh_center_of_volume(const Mesh *mesh, float r_cent[3])
void BKE_mesh_transform(Mesh *mesh, const float mat[4][4], bool do_keys)
void multiresModifier_scale_disp(Depsgraph *depsgraph, Scene *scene, Object *ob)
General operations, lookup, etc. for blender objects.
void BKE_object_rot_to_mat3(const Object *ob, float r_mat[3][3], bool use_drot)
blender::float4x4 BKE_object_calc_parent(Depsgraph *depsgraph, Scene *scene, Object *ob)
MovieClip * BKE_object_movieclip_get(Scene *scene, const Object *ob, bool use_default)
void BKE_object_tfm_restore(Object *ob, void *obtfm_pt)
void BKE_object_apply_mat4(Object *ob, const float mat[4][4], bool use_compat, bool use_parent)
void BKE_object_batch_cache_dirty_tag(Object *ob)
void BKE_object_eval_transform_all(Depsgraph *depsgraph, Scene *scene, Object *object)
void BKE_object_scale_to_mat3(const Object *ob, float r_mat[3][3])
void BKE_object_apply_parent_inverse(Object *ob)
bool BKE_object_minmax_dupli(Depsgraph *depsgraph, Scene *scene, Object *ob, float r_min[3], float r_max[3], bool use_hidden)
void BKE_object_to_mat4(const Object *ob, float r_mat[4][4])
void * BKE_object_tfm_backup(Object *ob)
void BKE_object_to_mat3(const Object *ob, float r_mat[3][3])
void BKE_object_where_is_calc(Depsgraph *depsgraph, Scene *scene, Object *ob)
void BKE_object_transform_copy(Object *ob_tar, const Object *ob_src)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BKE_scene_graph_evaluated_ensure(Depsgraph *depsgraph, Main *bmain)
void BKE_tracking_reconstruction_scale(struct MovieTracking *tracking, float scale[3])
#define LISTBASE_FOREACH(type, var, list)
MINLINE float max_fff(float a, float b, float c)
MINLINE int compare_ff_relative(float a, float b, float max_diff, int max_ulps)
int isect_line_line_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3], float r_i1[3], float r_i2[3])
float mat3_to_scale(const float mat[3][3])
float mat4_to_scale(const float mat[4][4])
void mul_m3_v3(const float M[3][3], float r[3])
void unit_m3(float m[3][3])
void copy_m3_m4(float m1[3][3], const float m2[4][4])
bool invert_m3_m3(float inverse[3][3], const float mat[3][3])
void copy_m4_m3(float m1[4][4], const float m2[3][3])
void normalize_m3(float R[3][3]) ATTR_NONNULL()
void mul_m4_v3(const float M[4][4], float r[3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
void mul_v3_m3v3(float r[3], const float M[3][3], const float a[3])
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
void mul_m4_m4_post(float R[4][4], const float B[4][4])
void mul_v3_mat3_m4v3(float r[3], const float mat[4][4], const float vec[3])
void eulO_to_axis_angle(float axis[3], float *angle, const float eul[3], short order)
void mul_qt_fl(float q[4], float f)
void eul_to_quat(float quat[4], const float eul[3])
void quat_to_eul(float eul[3], const float quat[4])
void axis_angle_to_eulO(float eul[3], short order, const float axis[3], float angle)
void rotation_between_vecs_to_mat3(float m[3][3], const float v1[3], const float v2[3])
void unit_axis_angle(float axis[3], float *angle)
void copy_qt_qt(float q[4], const float a[4])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void negate_v3_v3(float r[3], const float a[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void negate_v3(float r[3])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float normalize_v3(float n[3])
#define INIT_MINMAX(min, max)
typedef double(DMatrix)[4][4]
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
Object * DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object)
#define ID_IS_EDITABLE(_id)
#define ID_REAL_USERS(id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
@ SCE_XFORM_SKIP_CHILDREN
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_CENTER_MEDIAN
#define ANIM_KS_LOCATION_ID
#define ANIM_KS_SCALING_ID
#define ANIM_KS_ROTATION_ID
void EDBM_mesh_normals_update(BMEditMesh *em)
bool ED_operator_objectmode(bContext *C)
bool ED_operator_scene_editable(bContext *C)
bool ED_operator_region_view3d_active(bContext *C)
void ED_region_tag_redraw(ARegion *region)
bool ED_view3d_depth_read_cached(const ViewDepths *vd, const int mval[2], int margin, float *r_depth)
void ED_view3d_win_to_ray(const ARegion *region, const float mval[2], float r_ray_start[3], float r_ray_normal[3])
ViewContext ED_view3d_viewcontext_init(bContext *C, Depsgraph *depsgraph)
void ED_view3d_depth_override(Depsgraph *depsgraph, ARegion *region, View3D *v3d, Object *obact, eV3DDepthOverrideMode mode, ViewDepths **r_depths)
bool ED_view3d_depth_read_cached_normal(const ARegion *region, const ViewDepths *depths, const int mval[2], float r_normal[3])
void view3d_operator_needs_opengl(const bContext *C)
void ED_view3d_depths_free(ViewDepths *depths)
void ED_view3d_project_v3(const ARegion *region, const float world[3], float r_region_co[3])
bool ED_view3d_depth_unproject_v3(const ARegion *region, const int mval[2], double depth, float r_location_world[3])
Read Guarded memory(de)allocation.
void ANIM_deselect_keys_in_animation_editors(bContext *C)
void ED_armature_origin_set(Main *bmain, Object *ob, const float cursor[3], int centermode, int around)
static void translate_positions(MutableSpan< float3 > positions, const float3 &translation)
#define BM_ITER_MESH(ele, iter, bm, itype)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
void foreach_item(const FuncT &func) const
void append(const T &value)
void translate(const float3 &translation)
MutableSpan< float > radii_for_write()
bke::CurvesGeometry & strokes_for_write()
const Depsgraph * depsgraph
draw_view in_light_buf[] float
static void transform_positions(const Span< blender::float3 > src, const blender::float4x4 &transform, blender::MutableSpan< blender::float3 > dst)
KeyingSet * ANIM_get_keyingset_for_autokeying(const Scene *scene, const char *transformKSName)
void MEM_freeN(void *vmemh)
void autokeyframe_object(bContext *C, Scene *scene, Object *ob, Span< RNAPath > rna_paths)
bool is_autokey_on(const Scene *scene)
static int object_origin_set_exec(bContext *C, wmOperator *op)
void xform_skip_child_container_item_ensure_from_array(XFormObjectSkipChild_Container *xcs, const Scene *scene, ViewLayer *view_layer, Object **objects, uint objects_len)
static bool apply_objects_internal_need_single_user(bContext *C)
void single_obdata_user_make(Main *bmain, Scene *scene, Object *ob)
static Array< Object * > sorted_selected_editable_objects(bContext *C)
static void object_transform_axis_target_calc_depth_init(XFormAxisData *xfd, const int mval[2])
static void object_clear_scale(Object *ob, const bool clear_delta)
void OBJECT_OT_origin_set(wmOperatorType *ot)
static bool object_orient_to_location(Object *ob, const float rot_orig[3][3], const float axis[3], const float location[3], const bool z_flip)
void data_xform_container_destroy(XFormObjectData_Container *xds)
static void object_apply_location(Object *ob, const float loc[3])
static int visual_transform_apply_exec(bContext *C, wmOperator *)
void OBJECT_OT_transform_axis_target(wmOperatorType *ot)
static void object_clear_loc(Object *ob, const bool clear_delta)
void OBJECT_OT_origin_clear(wmOperatorType *ot)
static int object_rotation_clear_exec(bContext *C, wmOperator *op)
static void object_transform_axis_target_free_data(wmOperator *op)
XFormObjectSkipChild_Container * xform_skip_child_container_create()
static void append_sorted_object_parent_hierarchy(Object *root_object, Object *object, Object **sorted_objects, int *object_index)
void OBJECT_OT_rotation_clear(wmOperatorType *ot)
static bool apply_objects_internal_can_multiuser(bContext *C)
static int object_transform_axis_target_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void data_xform_container_update_all(XFormObjectData_Container *xds, Main *bmain, Depsgraph *depsgraph)
static int object_origin_clear_exec(bContext *C, wmOperator *)
void object_xform_skip_child_container_destroy(XFormObjectSkipChild_Container *xcs)
static void object_clear_rot(Object *ob, const bool clear_delta)
Object * context_active_object(const bContext *C)
static bool object_is_target_compat(const Object *ob)
static void object_transform_axis_target_cancel(bContext *C, wmOperator *op)
static void ignore_parent_tx(Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob)
void OBJECT_OT_scale_clear(wmOperatorType *ot)
void OBJECT_OT_visual_transform_apply(wmOperatorType *ot)
static int object_parent_inverse_apply_exec(bContext *C, wmOperator *)
static int object_transform_axis_target_modal(bContext *C, wmOperator *op, const wmEvent *event)
static int object_clear_transform_generic_exec(bContext *C, wmOperator *op, void(*clear_func)(Object *, const bool), const char default_ksName[])
static int apply_objects_internal(bContext *C, ReportList *reports, bool apply_loc, bool apply_rot, bool apply_scale, bool do_props, bool do_single_user)
void OBJECT_OT_location_clear(wmOperatorType *ot)
static int object_transform_apply_invoke(bContext *C, wmOperator *op, const wmEvent *)
void OBJECT_OT_parent_inverse_apply(wmOperatorType *ot)
static float3 arithmetic_mean(const Span< float3 > values)
void data_xform_container_item_ensure(XFormObjectData_Container *xds, Object *ob)
void object_xform_skip_child_container_update_all(XFormObjectSkipChild_Container *xcs, Main *bmain, Depsgraph *depsgraph)
static int object_scale_clear_exec(bContext *C, wmOperator *op)
static void transform_positions(MutableSpan< float3 > positions, const float4x4 &matrix)
XFormObjectData_Container * data_xform_container_create()
static void object_apply_rotation(Object *ob, const float rmat[3][3])
static int object_location_clear_exec(bContext *C, wmOperator *op)
static int object_transform_apply_exec(bContext *C, wmOperator *op)
void OBJECT_OT_transform_apply(wmOperatorType *ot)
@ ORIGIN_TO_CENTER_OF_MASS_VOLUME
@ ORIGIN_TO_CENTER_OF_MASS_SURFACE
CartesianBasis invert(const CartesianBasis &basis)
T midpoint(const T &a, const T &b)
VecBase< T, 3 > transform_direction(const MatBase< T, 3, 3 > &mat, const VecBase< T, 3 > &direction)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
float wrap(float value, float max, float min)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
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)
ObjectRuntimeHandle * runtime
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* modal)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
void(* cancel)(bContext *C, wmOperator *op)
struct ReportList * reports
int WM_userdef_event_type_from_keymap_type(int kmitype)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
#define ISMOUSE_BUTTON(event_type)
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
int WM_operator_confirm_ex(bContext *C, wmOperator *op, const char *title, const char *message, const char *confirm_text, int icon, bool cancel_default)