83#include "RNA_prototypes.hh"
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 *,
304 const char default_ksName[])
335 if (use_transform_skip_children) {
339 xcs, scene, view_layer, objects.
data(), objects.
size());
341 if (use_transform_data_origin) {
353 for (
Object *ob : objects) {
354 if (use_transform_data_origin) {
359 clear_func(ob, clear_delta);
367 if (use_transform_skip_children) {
372 if (use_transform_data_origin) {
397 ot->name =
"Clear Location";
398 ot->description =
"Clear the object's location";
399 ot->idname =
"OBJECT_OT_location_clear";
414 "Clear delta location in addition to clearing the normal location transform");
431 ot->name =
"Clear Rotation";
432 ot->description =
"Clear the object's rotation";
433 ot->idname =
"OBJECT_OT_rotation_clear";
448 "Clear delta rotation in addition to clearing the normal rotation transform");
465 ot->name =
"Clear Scale";
466 ot->description =
"Clear the object's scale";
467 ot->idname =
"OBJECT_OT_scale_clear";
482 "Clear delta scale in addition to clearing the normal scale transform");
500 v3 = ob->parentinv[3];
519 ot->name =
"Clear Origin";
520 ot->description =
"Clear the object's origin";
521 ot->idname =
"OBJECT_OT_origin_clear";
545 if (ob_child->parent == ob) {
569 if (!
ELEM(
object->parent,
nullptr, root_object)) {
571 root_object,
object->parent, sorted_objects, object_index);
574 sorted_objects[*object_index] =
object;
592 if (objects_num == 0) {
598 int object_index = 0;
607 return sorted_objects;
617 if (
ELEM(
nullptr, obact, obact->
data)) {
625 bool all_objects_same_data =
true;
626 bool obact_selected =
false;
629 if (ob->data != obact->
data) {
630 all_objects_same_data =
false;
635 obact_selected =
true;
640 return all_objects_same_data && obact_selected;
669 float rsmat[3][3], obmat[3][3], iobmat[3][3], mat[4][4], scale;
672 float obact_invmat[4][4], obact_parent[4][4], obact_parentinv[4][4];
676 bool make_single_user =
false;
680 invert_m4_m4(obact_invmat, obact->object_to_world().ptr());
686 if (do_single_user) {
687 make_single_user =
true;
690 ID *obact_data =
static_cast<ID *
>(obact->
data);
693 R
"(Cannot apply to a multi user: Object "%s", %s "%s", aborting)",
696 obact_data->name + 2);
716 ID *obdata =
static_cast<ID *
>(ob->data);
720 R
"(Cannot apply to a multi user: Object "%s", %s "%s", aborting)",
730 R
"(Cannot apply to library or override data: Object "%s", %s "%s", aborting)",
739 ID *obdata =
static_cast<ID *
>(ob->data);
746 R
"(Rotation/Location cannot apply to a 2D curve: Object "%s", %s "%s", aborting)",
755 R
"(Can't apply to a curve with shape-keys: Object "%s", %s "%s", aborting)",
764 if (apply_rot || apply_loc) {
767 "Text objects can only have their scale applied: \"%s\"",
776 if (apply_rot || apply_loc) {
779 "Area Lights can only have scale applied: \"%s\"",
796 if (make_single_user) {
809 bool has_non_invertable_matrix =
false;
811 for (
Object *ob : objects) {
813 if (apply_scale && apply_rot) {
816 else if (apply_scale) {
819 else if (apply_rot) {
820 float tmat[3][3], timat[3][3];
831 "Object \"%s\" has a non-invertible transformation matrix, not applying transform",
833 has_non_invertable_matrix =
true;
849 if (!(apply_scale && apply_rot)) {
860 if (do_multi_user && ob != obact) {
864 ob->data = obact->
data;
867 else if (ob->type ==
OB_MESH) {
895 else if (ob->type ==
OB_FONT) {
915 curves.geometry.wrap().calculate_bezier_auto_handles();
922 for (
const int layer_i : grease_pencil.layers().index_range()) {
938 for (const int i : range) {
943 curves.transform(object_to_layer *
float4x4(mat) * layer_to_object);
944 curves.calculate_bezier_auto_handles();
982 ob->empty_drawsize *= max_scale;
985 else if (ob->type ==
OB_LAMP) {
1014 if (do_multi_user && ob != obact) {
1015 float _obmat[4][4], _iobmat[4][4];
1018 copy_m4_m4(_obmat, ob->object_to_world().ptr());
1026 if (apply_loc && apply_scale && apply_rot) {
1030 Object ob_temp = dna::shallow_copy(*ob);
1090 if (has_non_invertable_matrix) {
1102 bool changed =
false;
1128 ot->name =
"Apply Visual Transform";
1129 ot->description =
"Apply the object's visual transformation to its data";
1130 ot->idname =
"OBJECT_OT_visual_transform_apply";
1148 if (loc ||
rot || sca) {
1164 if ((ob !=
nullptr) && (ob->
data !=
nullptr) && need_single_user) {
1172 IFACE_(
"Apply Object Transformations"),
1173 IFACE_(
"Warning: Multiple objects share the same data.\nMake "
1174 "single user and then apply transformations?"),
1186 ot->name =
"Apply Object Transform";
1187 ot->description =
"Apply the object's transformation to its data";
1188 ot->idname =
"OBJECT_OT_transform_apply";
1205 "Modify properties such as curve vertex radius, font size and bone envelope");
1209 "Isolate Multi User Data",
1210 "Create new object-data users if needed");
1224 if (ob->parent ==
nullptr) {
1241 ot->name =
"Apply Parent Inverse";
1242 ot->description =
"Apply the object's parent inverse to its data";
1243 ot->idname =
"OBJECT_OT_parent_inverse_apply";
1279 for (float3 &position : positions.slice(range)) {
1280 position += translation;
1292 float3 cent, cent_neg, centn;
1297 int tot_change = 0, tot_lib_error = 0, tot_multiuser_arm_error = 0;
1333 mul_m4_v3(obedit->world_to_object().ptr(), cent);
1370 for (
const int object_index : objects.
index_range()) {
1371 Object *ob = objects[object_index];
1375 if (ob == obact && objects.
size() > 1) {
1376 memmove(&objects[1], objects.
data(), object_index *
sizeof(
Object *));
1385 if (tob->instance_collection) {
1390 for (
Object *ob : objects) {
1395 bool do_inverse_offset =
false;
1400 invert_m4_m4(ob->runtime->world_to_object.ptr(), ob->object_to_world().ptr());
1401 mul_m4_v3(ob->world_to_object().ptr(), cent);
1404 if (ob->data ==
nullptr) {
1407 (ob->instance_collection->id.tag &
ID_TAG_DOIT) == 0)
1422 invert_m4_m4(ob->runtime->world_to_object.ptr(), ob->object_to_world().ptr());
1423 mul_m4_v3(ob->world_to_object().ptr(), cent);
1426 add_v3_v3(ob->instance_collection->instance_offset, cent);
1430 do_inverse_offset =
true;
1437 else if (ob->type ==
OB_MESH) {
1438 if (obedit ==
nullptr) {
1464 do_inverse_offset =
true;
1492 do_inverse_offset =
true;
1501 else if (ob->type ==
OB_FONT) {
1521 cu->
xof = cu->
xof - cent[0];
1522 cu->
yof = cu->
yof - cent[1];
1526 do_inverse_offset =
true;
1537 tot_multiuser_arm_error++;
1581 do_inverse_offset =
true;
1610 do_inverse_offset =
true;
1619 op->
reports,
RPT_WARNING,
"Curves Object does not support this set origin operation");
1641 do_inverse_offset =
true;
1650 "Grease Pencil Object does not support this set origin operation");
1658 const int current_frame = scene->
r.
cfra;
1663 const int current_frame = scene->
r.
cfra;
1665 int total_points = 0;
1667 for (
const int layer_i : grease_pencil.layers().index_range()) {
1670 if (!layer.is_visible()) {
1674 layer, current_frame))
1682 total_points += positions.
size();
1686 if (total_points != 0) {
1687 cent = center / total_points;
1693 for (
const int layer_i : grease_pencil.layers().index_range()) {
1709 curves.calculate_bezier_auto_handles();
1714 do_inverse_offset =
true;
1724 "Point cloud object does not support this set origin operation");
1744 do_inverse_offset =
true;
1777 for (
Object *ob_other : objects) {
1778 if ((ob_other->flag &
OB_DONE) == 0 &&
1779 ((ob->data && (ob->data == ob_other->data)) ||
1780 (ob->instance_collection == ob_other->instance_collection &&
1787 centn, ob_other->object_to_world().ptr(), cent);
1812 else if (tob->instance_collection && tob->instance_collection->id.tag &
ID_TAG_DOIT) {
1823 if (tot_lib_error + tot_multiuser_arm_error) {
1826 "%i object(s) not centered, %i changed:",
1827 tot_lib_error + tot_multiuser_arm_error,
1829 if (tot_lib_error) {
1832 if (tot_multiuser_arm_error) {
1834 op->
reports,
RPT_WARNING,
"|%i multiuser armature object(s)", tot_multiuser_arm_error);
1847 "Geometry to Origin",
1848 "Move object geometry to object origin"},
1852 "Origin to Geometry",
1853 "Calculate the center of geometry based on the current pivot point (median, otherwise "
1858 "Origin to 3D Cursor",
1859 "Move object origin to position of the 3D cursor"},
1862 "ORIGIN_CENTER_OF_MASS",
1864 "Origin to Center of Mass (Surface)",
1865 "Calculate the center of mass from the surface area"},
1867 "ORIGIN_CENTER_OF_VOLUME",
1869 "Origin to Center of Mass (Volume)",
1870 "Calculate the center of mass from the volume (must be manifold geometry with consistent "
1872 {0,
nullptr, 0,
nullptr,
nullptr},
1878 {0,
nullptr, 0,
nullptr,
nullptr},
1882 ot->name =
"Set Origin";
1884 "Set the object's origin, by either moving the data, or set to center of data, or use 3D "
1886 ot->idname =
"OBJECT_OT_origin_set";
1897 ot->prop =
RNA_def_enum(
ot->srna,
"type", prop_set_center_types, 0,
"Type",
"");
1912#define USE_RELATIVE_ROTATION
1914#define USE_RENDER_OVERRIDE
1919#define USE_FAKE_DEPTH_INIT
1928#ifdef USE_RELATIVE_ROTATION
1950#ifdef USE_FAKE_DEPTH_INIT
1953 float view_co_a[3], view_co_b[3];
1957 float center[3] = {0.0f};
1961 const float *ob_co_a = ob->object_to_world().location();
1963 add_v3_v3v3(ob_co_b, ob->object_to_world().location(), ob->object_to_world().ptr()[2]);
1964 float view_isect[3], ob_isect[3];
1965 if (
isect_line_line_v3(view_co_a, view_co_b, ob_co_a, ob_co_b, view_isect, ob_isect)) {
1972 float center_proj[3];
2001#ifdef USE_RENDER_OVERRIDE
2032 Object ob_prev = dna::shallow_copy(*ob);
2034 copy_m4_m4(mat, ob->object_to_world().ptr());
2038 *ob = dna::shallow_copy(ob_prev);
2043 const float rot_orig[3][3],
2044 const float axis[3],
2045 const float location[3],
2049 sub_v3_v3v3(delta, ob->object_to_world().location(), location);
2056 float delta_rot[3][3];
2057 float final_rot[3][3];
2094#ifdef USE_RENDER_OVERRIDE
2103#ifdef USE_RENDER_OVERRIDE
2107 if (depths ==
nullptr) {
2120 xfd->
vc.
mval[0] =
event->mval[0];
2121 xfd->
vc.
mval[1] =
event->mval[1];
2146 float full_mat3[3][3];
2165 const bool is_translate =
event->modifier &
KM_CTRL;
2166 const bool is_translate_init = is_translate && (xfd->
is_translate != is_translate);
2170 if (depths && (
uint(event->
mval[0]) < depths->
w) && (
uint(event->
mval[1]) < depths->
h)) {
2171 float depth_fl = 1.0f;
2173 float location_world[3];
2174 if (depth_fl == 1.0f) {
2180#ifdef USE_FAKE_DEPTH_INIT
2182 if (depth_fl == 1.0f) {
2192 double depth = double(depth_fl);
2193 if ((depth > depths->
depth_range[0]) && (depth < depths->depth_range[1])) {
2200 bool normal_found =
false;
2202 normal_found =
true;
2206 for (
int x = -ofs;
x <= ofs;
x += ofs / 2) {
2207 for (
int y = -ofs;
y <= ofs;
y += ofs / 2) {
2208 if (
x != 0 &&
y != 0) {
2209 const int mval_ofs[2] = {
event->mval[0] +
x,
event->mval[1] +
y};
2221 normal_found =
true;
2225#ifdef USE_RELATIVE_ROTATION
2226 if (is_translate_init && xfd->
object_data.size() > 1) {
2227 float xform_rot_offset_inv_first[3][3];
2247 if (is_translate_init) {
2259 float target_normal[3];
2268#ifdef USE_RELATIVE_ROTATION
2316 bool is_finished =
false;
2334 const char *rotation_property =
"rotation_euler";
2337 rotation_property =
"rotation_quaternion";
2340 rotation_property =
"rotation_axis_angle";
2363 ot->name =
"Interactive Light Track to Cursor";
2364 ot->description =
"Interactively point cameras and lights to a location (Ctrl translates)";
2365 ot->idname =
"OBJECT_OT_transform_axis_target";
2377#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)
#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
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 IndexRange index_range() 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
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)
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()
@ ORIGIN_TO_CENTER_OF_MASS_VOLUME
@ ORIGIN_TO_CENTER_OF_MASS_SURFACE
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)
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)
void transform_points(const float4x4 &transform, MutableSpan< float3 > points, bool use_threading=true)
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)