84#include "RNA_prototypes.hh"
214 float eul[3], oldeul[3], quat1[4] = {0};
227 eul[0] = eul[1] = eul[2] = 0.0f;
242 if ((quat1[0] < 0.0f && ob->
quat[0] > 0.0f) || (quat1[0] > 0.0f && ob->
quat[0] < 0.0f)) {
303 void (*clear_func)(
Object *,
305 const char default_ksName[])
336 if (use_transform_skip_children) {
340 xcs, scene, view_layer, objects.
data(), objects.
size());
342 if (use_transform_data_origin) {
354 for (
Object *ob : objects) {
355 if (use_transform_data_origin) {
360 clear_func(ob, clear_delta);
368 if (use_transform_skip_children) {
373 if (use_transform_data_origin) {
398 ot->name =
"Clear Location";
399 ot->description =
"Clear the object's location";
400 ot->idname =
"OBJECT_OT_location_clear";
415 "Clear delta location in addition to clearing the normal location transform");
432 ot->name =
"Clear Rotation";
433 ot->description =
"Clear the object's rotation";
434 ot->idname =
"OBJECT_OT_rotation_clear";
449 "Clear delta rotation in addition to clearing the normal rotation transform");
466 ot->name =
"Clear Scale";
467 ot->description =
"Clear the object's scale";
468 ot->idname =
"OBJECT_OT_scale_clear";
483 "Clear delta scale in addition to clearing the normal scale transform");
501 v3 = ob->parentinv[3];
520 ot->name =
"Clear Origin";
521 ot->description =
"Clear the object's origin";
522 ot->idname =
"OBJECT_OT_origin_clear";
546 if (ob_child->parent == ob) {
570 if (!
ELEM(
object->parent,
nullptr, root_object)) {
572 root_object,
object->parent, sorted_objects, object_index);
575 sorted_objects[*object_index] =
object;
593 if (objects_num == 0) {
599 int object_index = 0;
608 return sorted_objects;
618 if (
ELEM(
nullptr, obact, obact->
data)) {
626 bool all_objects_same_data =
true;
627 bool obact_selected =
false;
630 if (ob->data != obact->
data) {
631 all_objects_same_data =
false;
636 obact_selected =
true;
641 return all_objects_same_data && obact_selected;
662 for (float3 &position : positions.slice(range)) {
663 position = math::transform_point(matrix, position);
679 float rsmat[3][3], obmat[3][3], iobmat[3][3], mat[4][4], scale;
682 float obact_invmat[4][4], obact_parent[4][4], obact_parentinv[4][4];
686 bool make_single_user =
false;
690 invert_m4_m4(obact_invmat, obact->object_to_world().ptr());
696 if (do_single_user) {
697 make_single_user =
true;
700 ID *obact_data =
static_cast<ID *
>(obact->
data);
703 R
"(Cannot apply to a multi user: Object "%s", %s "%s", aborting)",
706 obact_data->name + 2);
726 ID *obdata =
static_cast<ID *
>(ob->data);
730 R
"(Cannot apply to a multi user: Object "%s", %s "%s", aborting)",
740 R
"(Cannot apply to library or override data: Object "%s", %s "%s", aborting)",
749 ID *obdata =
static_cast<ID *
>(ob->data);
756 R
"(Rotation/Location can't apply to a 2D curve: Object "%s", %s "%s", aborting)",
765 R
"(Can't apply to a curve with shape-keys: Object "%s", %s "%s", aborting)",
774 if (apply_rot || apply_loc) {
777 "Text objects can only have their scale applied: \"%s\"",
786 if (apply_rot || apply_loc) {
789 "Area Lights can only have scale applied: \"%s\"",
806 if (make_single_user) {
819 bool has_non_invertable_matrix =
false;
821 for (
Object *ob : objects) {
823 if (apply_scale && apply_rot) {
826 else if (apply_scale) {
829 else if (apply_rot) {
830 float tmat[3][3], timat[3][3];
841 "Object \"%s\" has a non-invertible transformation matrix, not applying transform",
843 has_non_invertable_matrix =
true;
859 if (!(apply_scale && apply_rot)) {
870 if (do_multi_user && ob != obact) {
874 ob->data = obact->
data;
877 else if (ob->type ==
OB_MESH) {
905 else if (ob->type ==
OB_FONT) {
925 curves.geometry.wrap().calculate_bezier_auto_handles();
932 for (
const int layer_i : grease_pencil.layers().index_range()) {
948 for (const int i : range) {
953 curves.transform(object_to_layer *
float4x4(mat) * layer_to_object);
954 curves.calculate_bezier_auto_handles();
992 ob->empty_drawsize *= max_scale;
995 else if (ob->type ==
OB_LAMP) {
1024 if (do_multi_user && ob != obact) {
1025 float _obmat[4][4], _iobmat[4][4];
1028 copy_m4_m4(_obmat, ob->object_to_world().ptr());
1036 if (apply_loc && apply_scale && apply_rot) {
1040 Object ob_temp = dna::shallow_copy(*ob);
1100 if (has_non_invertable_matrix) {
1112 bool changed =
false;
1138 ot->name =
"Apply Visual Transform";
1139 ot->description =
"Apply the object's visual transformation to its data";
1140 ot->idname =
"OBJECT_OT_visual_transform_apply";
1158 if (loc ||
rot || sca) {
1174 if ((ob !=
nullptr) && (ob->
data !=
nullptr) && need_single_user) {
1182 IFACE_(
"Apply Object Transformations"),
1183 IFACE_(
"Warning: Multiple objects share the same data.\nMake "
1184 "single user and then apply transformations?"),
1196 ot->name =
"Apply Object Transform";
1197 ot->description =
"Apply the object's transformation to its data";
1198 ot->idname =
"OBJECT_OT_transform_apply";
1215 "Modify properties such as curve vertex radius, font size and bone envelope");
1219 "Isolate Multi User Data",
1220 "Create new object-data users if needed");
1234 if (ob->parent ==
nullptr) {
1251 ot->name =
"Apply Parent Inverse";
1252 ot->description =
"Apply the object's parent inverse to its data";
1253 ot->idname =
"OBJECT_OT_parent_inverse_apply";
1289 for (float3 &position : positions.slice(range)) {
1290 position += translation;
1302 float3 cent, cent_neg, centn;
1307 int tot_change = 0, tot_lib_error = 0, tot_multiuser_arm_error = 0;
1343 mul_m4_v3(obedit->world_to_object().ptr(), cent);
1356 const float total_div = 1.0f / float(em->
bm->
totvert);
1380 for (
const int object_index : objects.
index_range()) {
1381 Object *ob = objects[object_index];
1385 if (ob == obact && objects.
size() > 1) {
1386 memmove(&objects[1], objects.
data(), object_index *
sizeof(
Object *));
1395 if (tob->instance_collection) {
1400 for (
Object *ob : objects) {
1405 bool do_inverse_offset =
false;
1410 invert_m4_m4(ob->runtime->world_to_object.ptr(), ob->object_to_world().ptr());
1411 mul_m4_v3(ob->world_to_object().ptr(), cent);
1414 if (ob->data ==
nullptr) {
1417 (ob->instance_collection->id.tag &
ID_TAG_DOIT) == 0)
1432 invert_m4_m4(ob->runtime->world_to_object.ptr(), ob->object_to_world().ptr());
1433 mul_m4_v3(ob->world_to_object().ptr(), cent);
1436 add_v3_v3(ob->instance_collection->instance_offset, cent);
1440 do_inverse_offset =
true;
1447 else if (ob->type ==
OB_MESH) {
1448 if (obedit ==
nullptr) {
1474 do_inverse_offset =
true;
1502 do_inverse_offset =
true;
1511 else if (ob->type ==
OB_FONT) {
1531 cu->
xof = cu->
xof - cent[0];
1532 cu->
yof = cu->
yof - cent[1];
1536 do_inverse_offset =
true;
1547 tot_multiuser_arm_error++;
1591 do_inverse_offset =
true;
1620 do_inverse_offset =
true;
1629 op->
reports,
RPT_WARNING,
"Curves Object does not support this set origin operation");
1651 do_inverse_offset =
true;
1660 "Grease Pencil Object does not support this set origin operation");
1668 const int current_frame = scene->
r.
cfra;
1673 const int current_frame = scene->
r.
cfra;
1675 int total_points = 0;
1677 for (
const int layer_i : grease_pencil.layers().index_range()) {
1680 if (!layer.is_visible()) {
1684 layer, current_frame))
1688 for (
const int i :
curves.points_range()) {
1691 total_points +=
curves.points_num();
1695 if (total_points != 0) {
1696 cent = center / total_points;
1702 for (
const int layer_i : grease_pencil.layers().index_range()) {
1718 curves.calculate_bezier_auto_handles();
1723 do_inverse_offset =
true;
1733 "Point cloud object does not support this set origin operation");
1753 do_inverse_offset =
true;
1786 for (
Object *ob_other : objects) {
1787 if ((ob_other->flag &
OB_DONE) == 0 &&
1788 ((ob->data && (ob->data == ob_other->data)) ||
1789 (ob->instance_collection == ob_other->instance_collection &&
1796 centn, ob_other->object_to_world().ptr(), cent);
1821 else if (tob->instance_collection && tob->instance_collection->id.tag &
ID_TAG_DOIT) {
1832 if (tot_lib_error + tot_multiuser_arm_error) {
1835 "%i object(s) not centered, %i changed:",
1836 tot_lib_error + tot_multiuser_arm_error,
1838 if (tot_lib_error) {
1841 if (tot_multiuser_arm_error) {
1843 op->
reports,
RPT_WARNING,
"|%i multiuser armature object(s)", tot_multiuser_arm_error);
1856 "Geometry to Origin",
1857 "Move object geometry to object origin"},
1861 "Origin to Geometry",
1862 "Calculate the center of geometry based on the current pivot point (median, otherwise "
1867 "Origin to 3D Cursor",
1868 "Move object origin to position of the 3D cursor"},
1871 "ORIGIN_CENTER_OF_MASS",
1873 "Origin to Center of Mass (Surface)",
1874 "Calculate the center of mass from the surface area"},
1876 "ORIGIN_CENTER_OF_VOLUME",
1878 "Origin to Center of Mass (Volume)",
1879 "Calculate the center of mass from the volume (must be manifold geometry with consistent "
1881 {0,
nullptr, 0,
nullptr,
nullptr},
1887 {0,
nullptr, 0,
nullptr,
nullptr},
1891 ot->name =
"Set Origin";
1893 "Set the object's origin, by either moving the data, or set to center of data, or use 3D "
1895 ot->idname =
"OBJECT_OT_origin_set";
1906 ot->prop =
RNA_def_enum(
ot->srna,
"type", prop_set_center_types, 0,
"Type",
"");
1921#define USE_RELATIVE_ROTATION
1923#define USE_RENDER_OVERRIDE
1928#define USE_FAKE_DEPTH_INIT
1937#ifdef USE_RELATIVE_ROTATION
1959#ifdef USE_FAKE_DEPTH_INIT
1962 float view_co_a[3], view_co_b[3];
1963 const float2 mval_fl = {float(mval[0]), float(mval[1])};
1966 float center[3] = {0.0f};
1970 const float *ob_co_a = ob->object_to_world().location();
1972 add_v3_v3v3(ob_co_b, ob->object_to_world().location(), ob->object_to_world().ptr()[2]);
1973 float view_isect[3], ob_isect[3];
1974 if (
isect_line_line_v3(view_co_a, view_co_b, ob_co_a, ob_co_b, view_isect, ob_isect)) {
1981 float center_proj[3];
2010#ifdef USE_RENDER_OVERRIDE
2041 Object ob_prev = dna::shallow_copy(*ob);
2043 copy_m4_m4(mat, ob->object_to_world().ptr());
2047 *ob = dna::shallow_copy(ob_prev);
2052 const float rot_orig[3][3],
2053 const float axis[3],
2054 const float location[3],
2058 sub_v3_v3v3(delta, ob->object_to_world().location(), location);
2065 float delta_rot[3][3];
2066 float final_rot[3][3];
2103#ifdef USE_RENDER_OVERRIDE
2112#ifdef USE_RENDER_OVERRIDE
2116 if (depths ==
nullptr) {
2129 xfd->
vc.
mval[0] =
event->mval[0];
2130 xfd->
vc.
mval[1] =
event->mval[1];
2155 float full_mat3[3][3];
2174 const bool is_translate =
event->modifier &
KM_CTRL;
2175 const bool is_translate_init = is_translate && (xfd->
is_translate != is_translate);
2179 if (depths && (
uint(event->
mval[0]) < depths->
w) && (
uint(event->
mval[1]) < depths->
h)) {
2180 float depth_fl = 1.0f;
2182 float location_world[3];
2183 if (depth_fl == 1.0f) {
2189#ifdef USE_FAKE_DEPTH_INIT
2191 if (depth_fl == 1.0f) {
2201 double depth = double(depth_fl);
2202 if ((depth > depths->
depth_range[0]) && (depth < depths->depth_range[1])) {
2209 bool normal_found =
false;
2211 normal_found =
true;
2215 for (
int x = -ofs;
x <= ofs;
x += ofs / 2) {
2216 for (
int y = -ofs;
y <= ofs;
y += ofs / 2) {
2217 if (
x != 0 &&
y != 0) {
2218 const int mval_ofs[2] = {
event->mval[0] +
x,
event->mval[1] +
y};
2230 normal_found =
true;
2234#ifdef USE_RELATIVE_ROTATION
2235 if (is_translate_init && xfd->
object_data.size() > 1) {
2236 float xform_rot_offset_inv_first[3][3];
2256 if (is_translate_init) {
2268 float target_normal[3];
2277#ifdef USE_RELATIVE_ROTATION
2325 bool is_finished =
false;
2343 const char *rotation_property =
"rotation_euler";
2346 rotation_property =
"rotation_quaternion";
2349 rotation_property =
"rotation_axis_angle";
2372 ot->name =
"Interactive Light Track to Cursor";
2373 ot->description =
"Interactively point cameras and lights to a location (Ctrl translates)";
2374 ot->idname =
"OBJECT_OT_transform_axis_target";
2386#undef USE_RELATIVE_ROTATION
Functions and classes to work with Actions.
Functions to insert, delete or modify keyframes.
Functionality to interact with keying sets.
static constexpr const char * ANIM_KS_ROTATION_ID
static constexpr const char * ANIM_KS_SCALING_ID
static constexpr const char * ANIM_KS_LOCATION_ID
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.
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])
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 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])
bool BKE_object_minmax_dupli(Depsgraph *depsgraph, Scene *scene, Object *ob, blender::float3 &r_min, blender::float3 &r_max, bool use_hidden)
void BKE_object_apply_parent_inverse(Object *ob)
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])
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
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)
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)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *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
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])
void ED_view3d_depth_override(Depsgraph *depsgraph, ARegion *region, View3D *v3d, Object *obact, eV3DDepthOverrideMode mode, bool use_overlay, ViewDepths **r_depths)
ViewContext ED_view3d_viewcontext_init(bContext *C, Depsgraph *depsgraph)
bool ED_view3d_depth_read_cached_normal(const ARegion *region, const ViewDepths *depths, const int mval[2], float r_normal[3])
void ED_view3d_depths_free(ViewDepths *depths)
void ED_view3d_project_v3(const ARegion *region, const float world[3], float r_region_co[3])
void view3d_operator_needs_gpu(const bContext *C)
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)
#define BM_ITER_MESH(ele, iter, bm, itype)
BPy_StructRNA * depsgraph
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
IndexRange index_range() const
void foreach_item(const FuncT &func) const
constexpr IndexRange index_range() const
constexpr int64_t size() const
constexpr const T * end() const
constexpr const T * begin() const
constexpr bool is_empty() const
void append(const T &value)
MutableSpan< float > radii_for_write()
bke::CurvesGeometry & strokes_for_write()
const Map< FramesMapKeyT, GreasePencilFrame > & frames() const
float4x4 local_transform() const
float4x4 to_object_space(const Object &object) const
VecBase< float, 3 > float3
#define ID_IS_EDITABLE(_id)
#define ID_REAL_USERS(id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
static void transform_positions(const Span< blender::float3 > src, const blender::float4x4 &transform, blender::MutableSpan< blender::float3 > dst)
void MEM_freeN(void *vmemh)
bool is_autokey_on(const Scene *scene)
KeyingSet * get_keyingset_for_autokeying(const Scene *scene, const char *transformKSName)
bool autokeyframe_property(bContext *C, Scene *scene, PointerRNA *ptr, PropertyRNA *prop, int rnaindex, float cfra, bool only_if_property_keyed)
void autokeyframe_object(bContext *C, const Scene *scene, Object *ob, Span< RNAPath > rna_paths)
void mesh_transform(Mesh &mesh, const float4x4 &transform, bool do_shape_keys)
void mesh_translate(Mesh &mesh, const float3 &translation, bool do_shape_keys)
static wmOperatorStatus visual_transform_apply_exec(bContext *C, wmOperator *)
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)
@ ORIGIN_TO_CENTER_OF_MASS_VOLUME
@ ORIGIN_TO_CENTER_OF_MASS_SURFACE
static wmOperatorStatus apply_objects_internal(bContext *C, ReportList *reports, bool apply_loc, bool apply_rot, bool apply_scale, bool do_props, bool do_single_user)
void single_obdata_user_make(Main *bmain, Scene *scene, Object *ob)
static Array< Object * > sorted_selected_editable_objects(bContext *C)
static void translate_positions(MutableSpan< float3 > positions, const float3 &translation)
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 wmOperatorStatus object_transform_axis_target_modal(bContext *C, wmOperator *op, const wmEvent *event)
void OBJECT_OT_transform_axis_target(wmOperatorType *ot)
static void object_clear_loc(Object *ob, const bool clear_delta)
static wmOperatorStatus object_clear_transform_generic_exec(bContext *C, wmOperator *op, void(*clear_func)(Object *, const bool), const char default_ksName[])
void OBJECT_OT_origin_clear(wmOperatorType *ot)
static wmOperatorStatus object_origin_set_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)
void data_xform_container_update_all(XFormObjectData_Container *xds, Main *bmain, Depsgraph *depsgraph)
static wmOperatorStatus object_scale_clear_exec(bContext *C, wmOperator *op)
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)
static wmOperatorStatus object_transform_apply_invoke(bContext *C, wmOperator *op, const wmEvent *)
void OBJECT_OT_visual_transform_apply(wmOperatorType *ot)
static wmOperatorStatus object_parent_inverse_apply_exec(bContext *C, wmOperator *)
static wmOperatorStatus object_transform_apply_exec(bContext *C, wmOperator *op)
static wmOperatorStatus object_origin_clear_exec(bContext *C, wmOperator *)
void OBJECT_OT_location_clear(wmOperatorType *ot)
static wmOperatorStatus object_transform_axis_target_invoke(bContext *C, wmOperator *op, const wmEvent *event)
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 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 wmOperatorStatus object_rotation_clear_exec(bContext *C, wmOperator *op)
void OBJECT_OT_transform_apply(wmOperatorType *ot)
static wmOperatorStatus object_location_clear_exec(bContext *C, wmOperator *op)
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))
MatBase< float, 4, 4 > float4x4
VecBase< float, 2 > float2
VecBase< float, 3 > float3
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)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
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)
struct MovieTracking tracking
ObjectRuntimeHandle * runtime
struct ToolSettings * toolsettings
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)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
wmOperatorStatus WM_operator_confirm_ex(bContext *C, wmOperator *op, const char *title, const char *message, const char *confirm_text, int icon, bool cancel_default)