80#include "RNA_prototypes.hh"
210 float eul[3], oldeul[3], quat1[4] = {0};
223 eul[0] = eul[1] = eul[2] = 0.0f;
238 if ((quat1[0] < 0.0f && ob->
quat[0] > 0.0f) || (quat1[0] > 0.0f && ob->
quat[0] < 0.0f)) {
299 void (*clear_func)(
Object *,
301 const char default_ksName[])
332 if (use_transform_skip_children) {
336 xcs, *bmain, scene, view_layer, objects.
data(), objects.
size());
338 if (use_transform_data_origin) {
350 for (
Object *ob : objects) {
351 if (use_transform_data_origin) {
356 clear_func(ob, clear_delta);
364 if (use_transform_skip_children) {
369 if (use_transform_data_origin) {
394 ot->
name =
"Clear Location";
396 ot->
idname =
"OBJECT_OT_location_clear";
411 "Clear delta location in addition to clearing the normal location transform");
428 ot->
name =
"Clear Rotation";
430 ot->
idname =
"OBJECT_OT_rotation_clear";
445 "Clear delta rotation in addition to clearing the normal rotation transform");
462 ot->
name =
"Clear Scale";
464 ot->
idname =
"OBJECT_OT_scale_clear";
479 "Clear delta scale in addition to clearing the normal scale transform");
497 v3 = ob->parentinv[3];
516 ot->
name =
"Clear Origin";
518 ot->
idname =
"OBJECT_OT_origin_clear";
542 if (ob_child.
parent == ob) {
566 if (!
ELEM(
object->parent,
nullptr, root_object)) {
568 root_object,
object->parent, sorted_objects, object_index);
571 sorted_objects[*object_index] =
object;
589 if (objects_num == 0) {
595 int object_index = 0;
604 return sorted_objects;
614 if (
ELEM(
nullptr, obact, obact->
data)) {
622 bool all_objects_same_data =
true;
623 bool obact_selected =
false;
626 if (ob->data != obact->
data) {
627 all_objects_same_data =
false;
632 obact_selected =
true;
637 return all_objects_same_data && obact_selected;
662 bool corrective_flip_normals)
667 float rsmat[3][3], obmat[3][3], iobmat[3][3], mat[4][4],
scale;
670 float obact_invmat[4][4], obact_parent[4][4], obact_parentinv[4][4];
674 bool make_single_user =
false;
678 invert_m4_m4(obact_invmat, obact->object_to_world().ptr());
684 if (do_single_user) {
685 make_single_user =
true;
688 ID *obact_data = obact->
data;
691 R
"(Cannot apply to a multi user: Object "%s", %s "%s", aborting)",
694 obact_data->name + 2);
714 ID *obdata = ob->data;
718 R
"(Cannot apply to a multi user: Object "%s", %s "%s", aborting)",
728 R
"(Cannot apply to library or override data: Object "%s", %s "%s", aborting)",
737 ID *obdata = ob->data;
738 Curve *cu = id_cast<Curve *>(ob->data);
744 R
"(Rotation/Location cannot apply to a 2D curve: Object "%s", %s "%s", aborting)",
753 R
"(Can't apply to a curve with shape-keys: Object "%s", %s "%s", aborting)",
762 if (apply_rot || apply_loc) {
765 "Text objects can only have their scale applied: \"%s\"",
772 Light *la = id_cast<Light *>(ob->data);
774 if (apply_rot || apply_loc) {
777 "Area Lights can only have scale applied: \"%s\"",
794 if (make_single_user) {
807 bool has_non_invertable_matrix =
false;
809 for (
Object *ob : objects) {
811 if (apply_scale && apply_rot) {
814 else if (apply_scale) {
817 else if (apply_rot) {
818 float tmat[3][3], timat[3][3];
829 "Object \"%s\" has a non-invertible transformation matrix, not applying transform",
831 has_non_invertable_matrix =
true;
847 if (!(apply_scale && apply_rot)) {
858 if (do_multi_user && ob != obact) {
862 ob->data = obact->
data;
865 else if (ob->type ==
OB_MESH) {
866 Mesh *
mesh = id_cast<Mesh *>(ob->data);
882 bArmature *arm = id_cast<bArmature *>(ob->data);
886 Lattice *lt = id_cast<Lattice *>(ob->data);
891 MetaBall *mb = id_cast<MetaBall *>(ob->data);
895 Curve *cu = id_cast<Curve *>(ob->data);
899 else if (ob->type ==
OB_FONT) {
900 Curve *cu = id_cast<Curve *>(ob->data);
904 for (
int i = 0; i < cu->
totbox; i++) {
919 curves.geometry.wrap().calculate_bezier_auto_handles();
926 for (
const int layer_i :
grease_pencil.layers().index_range()) {
942 for (const int i : range) {
947 curves.transform(object_to_layer *
float4x4(mat) * layer_to_object);
948 curves.calculate_bezier_auto_handles();
985 float max_scale = std::max(
987 ob->empty_drawsize *= max_scale;
990 else if (ob->type ==
OB_LAMP) {
991 Light *la = id_cast<Light *>(ob->data);
999 la->area_sizey = la->area_size;
1001 else if ((la->area_shape ==
LA_AREA_DISK) && !keeps_aspect_ratio) {
1003 la->area_sizey = la->area_size;
1006 la->area_size *= rsmat[0][0];
1007 la->area_sizey *= rsmat[1][1];
1008 la->area_sizez *= rsmat[2][2];
1019 if (do_multi_user && ob != obact) {
1020 float _obmat[4][4], _iobmat[4][4];
1023 copy_m4_m4(_obmat, ob->object_to_world().ptr());
1031 if (apply_loc && apply_scale && apply_rot) {
1080 id_cast<bArmature *>(ob->data));
1095 if (has_non_invertable_matrix) {
1107 bool changed =
false;
1133 ot->
name =
"Apply Visual Transform";
1134 ot->
description =
"Apply the object's visual transformation to its data";
1135 ot->
idname =
"OBJECT_OT_visual_transform_apply";
1152 const bool corrective_flip_normals =
RNA_boolean_get(op->
ptr,
"corrective_flip_normals");
1154 if (loc ||
rot || sca) {
1156 C, op->
reports, loc,
rot, sca, do_props, do_single_user, corrective_flip_normals);
1171 if ((ob !=
nullptr) && (ob->
data !=
nullptr) && need_single_user) {
1179 IFACE_(
"Apply Object Transformations"),
1180 IFACE_(
"Warning: Multiple objects share the same data.\nMake "
1181 "single user and then apply transformations?"),
1193 ot->
name =
"Apply Object Transform";
1194 ot->
description =
"Apply the object's transformation to its data";
1195 ot->
idname =
"OBJECT_OT_transform_apply";
1212 "Modify properties such as curve vertex radius, font size and bone envelope");
1214 "corrective_flip_normals",
1216 "Corrective Flip Normals",
1217 "Invert normals for negative scaled objects.");
1221 "Isolate Multi User Data",
1222 "Create new object-data users if needed");
1236 if (ob->parent ==
nullptr) {
1253 ot->
name =
"Apply Parent Inverse";
1254 ot->
description =
"Apply the object's parent inverse to its data";
1255 ot->
idname =
"OBJECT_OT_parent_inverse_apply";
1291 for (float3 &position : positions.slice(range)) {
1292 position += translation;
1304 float3 cent, cent_neg, centn;
1309 int tot_change = 0, tot_lib_error = 0, tot_multiuser_arm_error = 0;
1345 mul_m4_v3(obedit->world_to_object().ptr(), cent);
1382 for (
const int object_index : objects.
index_range()) {
1383 Object *ob = objects[object_index];
1387 if (ob == obact && objects.
size() > 1) {
1388 memmove(&objects[1], objects.
data(), object_index *
sizeof(
Object *));
1402 bool reported_empty =
false;
1403 std::array<bool, INDEX_ID_MAX> reported{
false};
1404 for (
Object *ob : objects) {
1409 bool do_inverse_offset =
false;
1414 invert_m4_m4(ob->runtime->world_to_object.ptr(), ob->object_to_world().ptr());
1415 mul_m4_v3(ob->world_to_object().ptr(), cent);
1418 if (ob->data ==
nullptr) {
1421 (ob->instance_collection->id.tag &
ID_TAG_DOIT) == 0)
1436 invert_m4_m4(ob->runtime->world_to_object.ptr(), ob->object_to_world().ptr());
1437 mul_m4_v3(ob->world_to_object().ptr(), cent);
1439 add_v3_v3(ob->instance_collection->instance_offset, cent);
1443 do_inverse_offset =
true;
1448 if (!reported_empty) {
1449 reported_empty =
true;
1457 else if (ob->type ==
OB_MESH) {
1458 if (obedit ==
nullptr) {
1459 Mesh *
mesh = id_cast<Mesh *>(ob->data);
1484 do_inverse_offset =
true;
1488 Curve *cu = id_cast<Curve *>(ob->data);
1512 do_inverse_offset =
true;
1521 else if (ob->type ==
OB_FONT) {
1524 Curve *cu = id_cast<Curve *>(ob->data);
1541 cu->
xof = cu->
xof - cent[0];
1542 cu->
yof = cu->
yof - cent[1];
1546 do_inverse_offset =
true;
1550 bArmature *arm = id_cast<bArmature *>(ob->data);
1557 tot_multiuser_arm_error++;
1572 id_cast<bArmature *>(ob->data));
1584 MetaBall *mb = id_cast<MetaBall *>(ob->data);
1601 do_inverse_offset =
true;
1611 Lattice *lt = id_cast<Lattice *>(ob->data);
1630 do_inverse_offset =
true;
1633 Curves &curves_id = *id_cast<Curves *>(ob->data);
1639 op->
reports,
RPT_WARNING,
"Curves Object does not support this set origin operation");
1661 do_inverse_offset =
true;
1670 "Grease Pencil Object does not support this set origin operation");
1678 const int current_frame = scene->
r.
cfra;
1686 const int current_frame = scene->
r.
cfra;
1688 int total_points = 0;
1690 for (
const int layer_i :
grease_pencil.layers().index_range()) {
1693 if (!
layer.is_visible()) {
1697 layer, current_frame))
1705 total_points += positions.
size();
1709 if (total_points != 0) {
1710 cent = center / total_points;
1716 for (
const int layer_i :
grease_pencil.layers().index_range()) {
1732 curves.calculate_bezier_auto_handles();
1737 do_inverse_offset =
true;
1747 "Point cloud object does not support this set origin operation");
1767 do_inverse_offset =
true;
1770 const ID *obdata =
static_cast<const ID *
>(ob->data);
1771 const short idcode =
GS(obdata->
name);
1774 if (!reported[id_index]) {
1775 reported[id_index] =
true;
1778 "Set Origin not supported for %s object(s)",
1802 id_cast<bArmature *>(ob->data));
1813 for (
Object *ob_other : objects) {
1814 if ((ob_other->flag &
OB_DONE) == 0 &&
1815 ((ob->data && (ob->data == ob_other->data)) ||
1816 (ob->instance_collection == ob_other->instance_collection &&
1823 centn, ob_other->object_to_world().ptr(), cent);
1832 id_cast<bArmature *>(ob->data));
1859 if (tot_lib_error + tot_multiuser_arm_error) {
1862 "%i object(s) not centered, %i changed:",
1863 tot_lib_error + tot_multiuser_arm_error,
1865 if (tot_lib_error) {
1868 if (tot_multiuser_arm_error) {
1870 op->
reports,
RPT_WARNING,
"|%i multiuser armature object(s)", tot_multiuser_arm_error);
1883 "Geometry to Origin",
1884 "Move object geometry to object origin"},
1888 "Origin to Geometry",
1889 "Calculate the center of geometry based on the current pivot point (median, otherwise "
1894 "Origin to 3D Cursor",
1895 "Move object origin to position of the 3D cursor"},
1898 "ORIGIN_CENTER_OF_MASS",
1900 "Origin to Center of Mass (Surface)",
1901 "Calculate the center of mass from the surface area"},
1903 "ORIGIN_CENTER_OF_VOLUME",
1905 "Origin to Center of Mass (Volume)",
1906 "Calculate the center of mass from the volume (must be manifold geometry with consistent "
1908 {0,
nullptr, 0,
nullptr,
nullptr},
1914 {0,
nullptr, 0,
nullptr,
nullptr},
1918 ot->
name =
"Set Origin";
1920 "Set the object's origin, by either moving the data, or set to center of data, or use 3D "
1922 ot->
idname =
"OBJECT_OT_origin_set";
1948#define USE_RELATIVE_ROTATION
1950#define USE_RENDER_OVERRIDE
1955#define USE_FAKE_DEPTH_INIT
1971#ifdef USE_RELATIVE_ROTATION
1993#ifdef USE_FAKE_DEPTH_INIT
1996 float view_co_a[3], view_co_b[3];
2000 float center[3] = {0.0f};
2004 const float *ob_co_a = ob->object_to_world().location();
2006 add_v3_v3v3(ob_co_b, ob->object_to_world().location(), ob->object_to_world().ptr()[2]);
2007 float view_isect[3], ob_isect[3];
2008 if (
isect_line_line_v3(view_co_a, view_co_b, ob_co_a, ob_co_b, view_isect, ob_isect)) {
2015 float center_proj[3];
2017 xfd->
prev.depth = center_proj[2];
2018 xfd->
prev.is_depth_valid =
true;
2026 const Light *la = id_cast<Light *>(ob->
data);
2041#ifdef USE_RENDER_OVERRIDE
2074 copy_m4_m4(mat, ob->object_to_world().ptr());
2083 const float rot_orig[3][3],
2084 const float axis[3],
2085 const float location[3],
2089 sub_v3_v3v3(delta, ob->object_to_world().location(), location);
2096 float delta_rot[3][3];
2097 float final_rot[3][3];
2128 {0,
nullptr, 0,
nullptr,
nullptr},
2132 keyconf,
"Transform Axis Target Modal Map", modal_items);
2161#ifdef USE_RENDER_OVERRIDE
2170#ifdef USE_RENDER_OVERRIDE
2174 if (depths ==
nullptr) {
2187 xfd->
vc.
mval[0] =
event->mval[0];
2188 xfd->
vc.
mval[1] =
event->mval[1];
2190 xfd->
prev.depth = 1.0f;
2191 xfd->
prev.is_depth_valid =
false;
2192 xfd->
prev.is_normal_valid =
false;
2213 float full_mat3[3][3];
2233 bool is_translate_init =
false;
2236 bool update =
false;
2240 switch (event->
val) {
2250 if (!is_translate) {
2251 is_translate =
true;
2252 is_translate_init =
true;
2259 is_translate =
false;
2279 if (depths && (
uint(event->
mval[0]) < depths->
w) && (
uint(event->
mval[1]) < depths->
h)) {
2280 float depth_fl = 1.0f;
2282 float location_world[3];
2283 if (depth_fl == 1.0f) {
2284 if (xfd->
prev.is_depth_valid) {
2285 depth_fl = xfd->
prev.depth;
2289#ifdef USE_FAKE_DEPTH_INIT
2291 if (depth_fl == 1.0f) {
2292 if (xfd->
prev.is_depth_valid ==
false) {
2294 if (xfd->
prev.is_depth_valid) {
2295 depth_fl = xfd->
prev.depth;
2301 double depth = double(depth_fl);
2302 if ((depth > depths->
depth_range[0]) && (depth < depths->depth_range[1])) {
2303 xfd->
prev.depth = depth_fl;
2304 xfd->
prev.is_depth_valid =
true;
2309 bool normal_found =
false;
2311 normal_found =
true;
2315 for (
int x = -ofs;
x <= ofs;
x += ofs / 2) {
2316 for (
int y = -ofs;
y <= ofs;
y += ofs / 2) {
2317 if (
x != 0 &&
y != 0) {
2318 const int mval_ofs[2] = {
event->mval[0] +
x,
event->mval[1] +
y};
2328 else if (xfd->
prev.is_normal_valid) {
2330 normal_found =
true;
2334#ifdef USE_RELATIVE_ROTATION
2335 if (is_translate_init && xfd->
object_data.size() > 1) {
2336 float xform_rot_offset_inv_first[3][3];
2337 for (
const int i : xfd->
object_data.index_range()) {
2354 for (
const int i : xfd->
object_data.index_range()) {
2356 if (is_translate_init) {
2368 float target_normal[3];
2377#ifdef USE_RELATIVE_ROTATION
2402 xfd->
prev.is_normal_valid =
true;
2415 xfd->
prev.is_normal_valid =
false;
2433 const char *rotation_property =
"rotation_euler";
2436 rotation_property =
"rotation_quaternion";
2439 rotation_property =
"rotation_axis_angle";
2460 ot->
name =
"Look at Surface";
2462 "Interactively point cameras and lights to the surface under the pointer (Ctrl to "
2464 ot->
idname =
"OBJECT_OT_transform_axis_target";
2476#undef USE_RELATIVE_ROTATION
Functions to insert, delete or modify keyframes.
Functionality to interact with keying sets.
#define CTX_DATA_BEGIN(C, Type, instance, member)
#define CTX_DATA_COUNT(C, member)
Low-level operations for curves.
Low-level operations for grease pencil.
#define FOREACH_SELECTED_EDITABLE_OBJECT_END
#define FOREACH_SELECTED_EDITABLE_OBJECT_BEGIN(_view_layer, _v3d, _instance)
General operations, lookup, etc. for blender objects.
#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.
Read Blender memory allocation and freeing.
#define INIT_MINMAX(min, max)
#define BM_ITER_MESH(ele, iter, bm, itype)
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)
void opmodal(std::string text, const wmOperatorType *ot, int propvalue, bool inverted=false)
MutableSpan< float > radii_for_write()
bke::CurvesGeometry & strokes_for_write()
float3x3 scale(float3x3 mat, float2 scale)
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_flip_faces(Mesh &mesh, const IndexMask &selection)
void mesh_transform(Mesh &mesh, const float4x4 &transform, bool do_shape_keys)
void mesh_translate(Mesh &mesh, const float3 &translation, bool do_shape_keys)
internal::ShallowDataConstRef< T > shallow_copy(const T &other)
static wmOperatorStatus visual_transform_apply_exec(bContext *C, wmOperator *)
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 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)
@ ORIGIN_TO_CENTER_OF_MASS_VOLUME
@ ORIGIN_TO_CENTER_OF_MASS_SURFACE
void OBJECT_OT_transform_axis_target(wmOperatorType *ot)
static void object_clear_loc(Object *ob, const bool clear_delta)
static void object_transform_axis_target_update_status(bContext *C, wmOperator *op, const XFormAxisData *xfd)
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)
void object_transform_axis_target_modal_keymap(wmKeyConfig *keyconf)
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 *)
@ AXIS_TARGET_MODAL_TRANSLATE_DISABLE
@ AXIS_TARGET_MODAL_TRANSLATE_ENABLE
@ AXIS_TARGET_MODAL_CONFIRM
@ AXIS_TARGET_MODAL_CANCEL
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)
void xform_skip_child_container_item_ensure_from_array(XFormObjectSkipChild_Container *xcs, const Main &bmain, const Scene *scene, ViewLayer *view_layer, Object **objects, uint objects_len)
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)
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, bool corrective_flip_normals)
void OBJECT_OT_transform_apply(wmOperatorType *ot)
static wmOperatorStatus object_location_clear_exec(bContext *C, wmOperator *op)
BLI_INLINE Texture * wrap(MTLTexture *texture)
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)
T determinant(const MatBase< T, Size, Size > &mat)
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))
const char * BKE_idtype_idcode_to_name(short idcode)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void negate_v3_v3(float r[3], const float a[3])
void mul_m3_v3(const float M[3][3], float r[3])
bool BKE_mesh_center_median(const Mesh *mesh, float r_cent[3])
bool ED_operator_scene_editable(bContext *C)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
void BKE_object_rot_to_mat3(const Object *ob, float r_mat[3][3], bool use_drot)
int RNA_enum_get(PointerRNA *ptr, const char *name)
MINLINE int compare_ff_relative(float a, float b, float max_diff, int max_ulps)
void axis_angle_to_eulO(float eul[3], short order, const float axis[3], float angle)
void ED_view3d_win_to_ray(const ARegion *region, const float mval[2], float r_ray_start[3], float r_ray_normal[3])
void BKE_mball_translate(MetaBall *mb, const float offset[3])
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
BMesh * BKE_editmesh_bmesh_get_for_write(Mesh *mesh)
void BKE_object_apply_parent_inverse(Object *ob)
ViewContext ED_view3d_viewcontext_init(bContext *C, Depsgraph *depsgraph)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void ED_armature_origin_set(Main *bmain, Object *ob, const float cursor[3], int centermode, int around)
void BKE_curve_translate(Curve *cu, const float offset[3], bool do_keys)
void copy_m3_m4(float m1[3][3], const float m2[4][4])
@ SCE_XFORM_SKIP_CHILDREN
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
void ED_view3d_depths_free(ViewDepths *depths)
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
void multiresModifier_scale_disp(Depsgraph *depsgraph, Scene *scene, Object *ob)
void copy_m4_m3(float m1[4][4], const float m2[3][3])
bool BKE_mball_center_bounds(const MetaBall *mb, float r_cent[3])
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
float mat4_to_scale(const float mat[4][4])
bool invert_m3_m3(float inverse[3][3], const float mat[3][3])
void normalize_m3(float R[3][3]) ATTR_NONNULL()
void BKE_lattice_transform(Lattice *lt, const float mat[4][4], bool do_keys)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
std::optional< Bounds< float3 > > BKE_lattice_minmax(const Lattice *lt)
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_CENTER_MEDIAN
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void quat_to_eul(float eul[3], const float quat[4])
void mul_v3_mat3_m4v3(float r[3], const float mat[4][4], const float vec[3])
void BKE_curve_transform_ex(Curve *cu, const float mat[4][4], bool do_keys, bool do_props, float unit_scale)
void view3d_operator_needs_gpu(const bContext *C)
void BKE_pose_where_is(Depsgraph *depsgraph, Scene *scene, Object *ob)
MatBase< float, 4, 4 > float4x4
void ED_region_tag_redraw(ARegion *region)
MovieClip * BKE_object_movieclip_get(Scene *scene, const Object *ob, bool use_default)
ViewLayer * CTX_data_view_layer(const bContext *C)
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_scene_graph_evaluated_ensure(Depsgraph *depsgraph, Main *bmain)
MINLINE void mul_v3_fl(float r[3], float f)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
MINLINE void sub_v3_v3(float r[3], const float a[3])
void unit_axis_angle(float axis[3], float *angle)
void mul_m4_v3(const float M[4][4], float r[3])
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
void BKE_tracking_reconstruction_scale(MovieTracking *tracking, float scale[3])
VecBase< float, 2 > float2
void eulO_to_axis_angle(float axis[3], float *angle, const float eul[3], short order)
bool BKE_mesh_center_of_surface(const Mesh *mesh, float r_cent[3])
void BKE_object_scale_to_mat3(const Object *ob, float r_mat[3][3])
void copy_qt_qt(float q[4], const float a[4])
void BKE_object_to_mat4(const Object *ob, float r_mat[4][4])
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
void ANIM_deselect_keys_in_animation_editors(bContext *C)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C, bool rna_write_check=false)
void * BKE_object_tfm_backup(Object *ob)
Object * CTX_data_edit_object(const bContext *C)
void eul_to_quat(float quat[4], const float eul[3])
int BKE_idtype_idcode_to_index(short idcode)
MINLINE void negate_v3(float r[3])
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
void BKE_mball_transform(MetaBall *mb, const float mat[4][4], bool do_props)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void ED_view3d_project_v3(const ARegion *region, const float world[3], float r_region_co[3])
wmOperatorStatus WM_operator_confirm_ex(bContext *C, wmOperator *op, const char *title, const char *message, const char *confirm_text, ui::AlertIcon icon, bool cancel_default)
MINLINE void zero_v3(float r[3])
void BKE_main_id_tag_all(Main *mainvar, int tag, bool value)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void BKE_object_tfm_restore(Object *ob, void *obtfm_pt)
void BKE_object_transform_copy(Object *ob_tar, const Object *ob_src)
MINLINE float normalize_v3_v3(float r[3], const float a[3])
void BKE_main_id_newptr_and_tag_clear(Main *bmain)
MINLINE float normalize_v3(float n[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
bool ED_operator_objectmode(bContext *C)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
bool BKE_curve_center_median(Curve *cu, float cent[3])
float4x4 BKE_object_calc_parent(Depsgraph *depsgraph, Scene *scene, Object *ob)
Main * CTX_data_main(const bContext *C)
void unit_m3(float m[3][3])
MINLINE void copy_v3_fl(float r[3], float f)
void BKE_object_to_mat3(const Object *ob, float r_mat[3][3])
void ED_view3d_depth_override(Depsgraph *depsgraph, ARegion *region, View3D *v3d, Object *obact, eV3DDepthOverrideMode mode, bool use_overlay, ViewDepths **r_depths)
bool ED_view3d_depth_read_cached(const ViewDepths *vd, const int mval[2], int margin, float *r_depth)
void EDBM_mesh_normals_update(BMesh *bm)
void mul_m4_m4_post(float R[4][4], const float B[4][4])
ID_Type GS(const char *name)
void BKE_lattice_translate(Lattice *lt, const float offset[3], bool do_keys)
bool BKE_object_minmax_dupli(Depsgraph *depsgraph, Object *ob, float3 &r_min, float3 &r_max, bool use_hidden)
bool ED_operator_region_view3d_active(bContext *C)
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
bool ED_view3d_depth_read_cached_normal(const ARegion *region, const ViewDepths *depths, const int mval[2], float r_normal[3])
void WM_modalkeymap_assign(wmKeyMap *km, const char *opname)
bool BKE_mesh_center_of_volume(const Mesh *mesh, float r_cent[3])
void BKE_armature_copy_bone_transforms(bArmature *armature_dst, const bArmature *armature_src)
void DEG_relations_tag_update(Main *bmain)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
Scene * CTX_data_scene(const bContext *C)
MINLINE void copy_v4_v4(float r[4], const float a[4])
wmKeyMap * WM_modalkeymap_ensure(wmKeyConfig *keyconf, const char *idname, const EnumPropertyItem *items)
void BKE_lattice_center_median(Lattice *lt, float cent[3])
bool ED_view3d_depth_unproject_v3(const ARegion *region, const int mval[2], double depth, float r_location_world[3])
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void BKE_object_where_is_calc(Depsgraph *depsgraph, Scene *scene, Object *ob)
std::optional< Bounds< float3 > > BKE_curve_minmax(const Curve *cu, bool use_radius)
VecBase< float, 3 > float3
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
int WM_userdef_event_type_from_keymap_type(int kmitype)
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
bool BKE_id_is_editable(const Main *bmain, const ID *id)
void BKE_object_tfm_free(void *obtfm_pt)
Object * CTX_data_active_object(const bContext *C)
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void ED_workspace_status_text(bContext *C, const char *str)
bool BKE_mball_center_median(const MetaBall *mb, float r_cent[3])
float mat3_to_scale(const float mat[3][3])
void mul_qt_fl(float q[4], float f)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
void rotation_between_vecs_to_mat3(float m[3][3], const float v1[3], const float v2[3])
void BKE_object_eval_transform_all(Depsgraph *depsgraph, Scene *scene, Object *object)
View3D * CTX_wm_view3d(const bContext *C)
void BKE_armature_transform(bArmature *arm, const float mat[4][4], bool do_props)
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])
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
GreasePencilDrawingType type
ListBaseT< Object > objects
const c_style_mat & ptr() const
struct MovieTracking tracking
bke::ObjectRuntime * runtime
eObject_ProtectFlag protectflag
struct Collection * instance_collection
struct ToolSettings * toolsettings
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
void(*) cancel(bContext *C, wmOperator *op)
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) modal(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
struct wmOperatorType * type
#define ISMOUSE_BUTTON(event_type)