Blender
V3.3
|
#include <stdlib.h>
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_windowmanager_types.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_string.h"
#include "BKE_constraint.h"
#include "BKE_context.h"
#include "BKE_nla.h"
#include "RNA_access.h"
#include "UI_interface.h"
#include "BLT_translation.h"
#include "transform.h"
#include "transform_convert.h"
#include "transform_orientations.h"
#include "transform_snap.h"
#include "transform_mode.h"
Go to the source code of this file.
|
static |
Definition at line 320 of file transform_mode.c.
References axis_angle_to_mat4(), eulO_to_mat4(), TransData::ext, bConstraintOb::matrix, normalize_qt_qt(), TransDataExtension::quat, quat_to_mat4(), TransDataExtension::rot, ROT_MODE_AXISANGLE, ROT_MODE_QUAT, TransDataExtension::rotAngle, TransDataExtension::rotAxis, and TransDataExtension::rotOrder.
Referenced by constraintRotLim().
Definition at line 348 of file transform_mode.c.
References BKE_constraint_typeinfo_from_type(), TransData::con, CONSTRAINT_DISABLE, CONSTRAINT_OFF, CONSTRAINT_SPACE_LOCAL, CONSTRAINT_SPACE_WORLD, CONSTRAINT_TYPE_ROTLIMIT, constraintob_from_transdata(), data, bConstraint::data, ELEM, bConstraint::enforce, bConstraintTypeInfo::evaluate_constraint, TransData::ext, bConstraint::flag, if(), LIMIT_TRANSFORM, mat4_to_axis_angle(), mat4_to_eulO(), mat4_to_quat(), bConstraintOb::matrix, TransData::mtx, mul_m4_m3m4(), bConstraint::next, NULL, bConstraint::ownspace, TransDataExtension::quat, TransDataExtension::rot, ROT_MODE_AXISANGLE, ROT_MODE_QUAT, TransDataExtension::rotAngle, TransDataExtension::rotAxis, TransDataExtension::rotOrder, TransData::smtx, and bConstraint::type.
Referenced by ElementRotation_ex().
Definition at line 421 of file transform_mode.c.
References BKE_constraint_typeinfo_from_type(), TransData::con, CON_APPLY, CONSTRAINT_DISABLE, CONSTRAINT_OFF, CONSTRAINT_SPACE_LOCAL, CONSTRAINT_SPACE_WORLD, CONSTRAINT_TYPE_SIZELIMIT, data, bConstraint::data, bConstraint::enforce, bConstraintTypeInfo::evaluate_constraint, TransData::ext, fabsf, bConstraint::flag, LIMIT_TRANSFORM, mat4_to_size(), bConstraintOb::matrix, TransData::mtx, mul_m4_m3m4(), mul_v3_v3(), bConstraint::next, NULL, bConstraint::ownspace, signf(), TransDataExtension::size, size_to_mat4(), TransData::smtx, t, TD_SINGLESIZE, and bConstraint::type.
Referenced by ElementMirror(), and ElementResize().
Definition at line 234 of file transform_mode.c.
References BKE_constraint_custom_object_space_init(), BKE_constraint_targets_for_solving_get(), BKE_constraint_typeinfo_from_type(), BLI_freelistN(), TransData::con, CONSTRAINT_DISABLE, CONSTRAINT_OFF, CONSTRAINT_SPACE_LOCAL, CONSTRAINT_SPACE_WORLD, CONSTRAINT_TYPE_DISTLIMIT, CONSTRAINT_TYPE_LOCLIMIT, copy_v3_v3(), data, bConstraint::data, bConstraint::enforce, bConstraintTypeInfo::evaluate_constraint, bConstraint::flag, float(), if(), LIMIT_TRANSFORM, LIMITDIST_TRANSFORM, bConstraintOb::matrix, TransData::mtx, mul_m4_m3m4(), bConstraint::next, NULL, bConstraint::ownspace, TransData::smtx, t, bConstraint::type, and unit_m4().
Referenced by applySnappingIndividual(), ElementMirror(), ElementResize(), ElementRotation_ex(), and transdata_elem_translate().
void ElementResize | ( | const TransInfo * | t, |
const TransDataContainer * | tc, | ||
TransData * | td, | ||
const float | mat[3][3] | ||
) |
Definition at line 907 of file transform_mode.c.
References add_v3_v3(), add_v3_v3v3(), applyNumInput(), TransData::axismtx, center, TransDataContainer::center_local, CON_APPLY, constraintSizeLim(), constraintTransLim(), copy_m3_m3(), copy_v3_v3(), copy_v4_v4(), CTX_GPENCIL_STROKES, CTX_MOVIECLIP, CTX_OBJECT, CTX_POSE_BONE, ELEM, TransData::ext, fabs(), TransData::factor, interpf(), TransDataExtension::isize, TransData::ival, mat3_to_size(), max_ff(), TransData::mtx, mul_m3_m3m3(), mul_m3_v3(), mul_mat3_m4_v3(), mul_v3_fl(), bGPDstroke_Runtime::multi_frame_falloff, Object::obmat, TransDataContainer::poseobj, protectedSizeBits(), protectedTransBits(), TransData::protectflag, bGPDstroke::runtime, TransDataExtension::size, TransData::smtx, sub_v3_v3(), sub_v3_v3v3(), t, T_EDIT, T_POINTS, T_V3D_ALIGN, TD_INDIVIDUAL_SCALE, TD_SINGLESIZE, TransConvertType_Object, TransConvertType_ObjectTexSpace, TransConvertType_Pose, TransConvertType_Sculpt, transdata_check_local_center(), transform_snap_increment(), TransMat3ToSize(), and TransData::val.
Referenced by applyResize(), and element_resize_fn().
void ElementRotation | ( | const TransInfo * | t, |
const TransDataContainer * | tc, | ||
TransData * | td, | ||
const float | mat[3][3], | ||
const short | around | ||
) |
Definition at line 791 of file transform_mode.c.
References center, TransDataContainer::center_local, ElementRotation_ex(), t, and transdata_check_local_center().
Referenced by applyAlign(), transdata_elem_bend(), transdata_elem_rotate(), and transdata_elem_trackball().
void ElementRotation_ex | ( | const TransInfo * | t, |
const TransDataContainer * | tc, | ||
TransData * | td, | ||
const float | mat[3][3], | ||
const float * | center | ||
) |
Applies values of rotation to td->loc
and td->ext->quat
based on a rotation matrix (mat) and a pivot (center).
Protected axis and other transform settings are taken into account.
HACK WARNING
This is some VERY ugly special case to deal with pose mode.
The problem is that mtx and smtx include each bone orientation.
That is needed to rotate each bone properly, HOWEVER, to calculate the translation component, we only need the actual armature object's matrix (and inverse). That is not all though. Once the proper translation has been computed, it has to be converted back into the bone's space.
Definition at line 542 of file transform_mode.c.
References add_eul_euleul(), add_v3_v3(), add_v3_v3v3(), axis_angle_to_quat(), center, constraintRotLim(), constraintTransLim(), copy_v3_v3(), CTX_GPENCIL_STROKES, CTX_POSE_BONE, TransDataExtension::dquat, TransDataExtension::drot, eulO_to_mat3(), TransData::ext, if(), TransDataContainer::imat3, interp_m3_m3m3(), invert_qt_qt_normalized(), TransDataExtension::iquat, TransDataExtension::irot, TransDataExtension::irotAngle, TransDataExtension::irotAxis, is_zero_v3(), is_zero_v4(), TransDataExtension::l_smtx, TransDataContainer::mat3, mat3_to_compatible_eulO(), mat3_to_quat(), TransData::mtx, mul_m3_m3m3(), mul_m3_series, mul_m3_v3(), mul_qt_qtqt(), bGPDstroke_Runtime::multi_frame_falloff, protectedAxisAngleBits(), protectedQuaternionBits(), protectedRotateBits(), protectedTransBits(), TransData::protectflag, TransDataExtension::quat, quat_to_axis_angle(), quat_to_mat3(), TransDataExtension::r_mtx, TransDataExtension::r_smtx, TransDataExtension::rot, ROT_MODE_AXISANGLE, ROT_MODE_QUAT, TransDataExtension::rotAngle, TransDataExtension::rotAxis, TransDataExtension::rotOrder, bGPDstroke::runtime, TransData::smtx, sub_eul_euleul(), sub_v3_v3(), sub_v3_v3v3(), t, T_POINTS, T_V3D_ALIGN, TD_NO_LOC, TD_PBONE_LOCAL_MTX_C, TD_PBONE_LOCAL_MTX_P, TD_USEQUAT, and unit_m3().
Referenced by ElementMirror(), ElementRotation(), and transdata_elem_translate().
Definition at line 816 of file transform_mode.c.
References BLI_snprintf(), BLI_snprintf_rlen(), CON_APPLY, hasNumInput(), NUM_STR_REP_LEN, outputNumInput(), str, t, T_2D_EDIT, T_PROP_EDIT_ALL, and TIP_.
Referenced by applyResize(), and applySkinResize().
Used by Transform Rotation and Transform Normal Rotation.
Definition at line 515 of file transform_mode.c.
References BLI_snprintf_rlen(), Freestyle::c, hasNumInput(), NUM_STR_REP_LEN, outputNumInput(), RAD2DEGF, str, t, T_PROP_EDIT_ALL, and TIP_.
Referenced by applyNormalRotation(), and applyRotation().
|
static |
Definition at line 164 of file transform_mode.c.
References angle(), axis_angle_to_eulO(), EULER_ORDER_DEFAULT, eulO_to_axis_angle(), IS_EQF, OB_LOCK_ROT4D, OB_LOCK_ROTW, OB_LOCK_ROTX, OB_LOCK_ROTY, and OB_LOCK_ROTZ.
Referenced by ElementRotation_ex().
|
static |
Definition at line 94 of file transform_mode.c.
References eul_to_quat(), mul_qt_fl(), normalize_qt_qt(), OB_LOCK_ROT4D, OB_LOCK_ROTW, OB_LOCK_ROTX, OB_LOCK_ROTY, OB_LOCK_ROTZ, and quat_to_eul().
Referenced by ElementRotation_ex().
Definition at line 149 of file transform_mode.c.
References OB_LOCK_ROTX, OB_LOCK_ROTY, and OB_LOCK_ROTZ.
Referenced by ElementRotation_ex().
Definition at line 215 of file transform_mode.c.
References OB_LOCK_SCALEX, OB_LOCK_SCALEY, OB_LOCK_SCALEZ, and size().
Referenced by ElementMirror(), and ElementResize().
Definition at line 80 of file transform_mode.c.
References OB_LOCK_LOCX, OB_LOCK_LOCY, and OB_LOCK_LOCZ.
Referenced by ElementMirror(), ElementResize(), ElementRotation_ex(), and transdata_elem_translate().
Definition at line 55 of file transform_mode.c.
References CTX_MASK, CTX_MOVIECLIP, CTX_OBJECT, CTX_PAINT_CURVE, CTX_POSE_BONE, CTX_SEQUENCER_IMAGE, ELEM, OB_ARMATURE, OB_CURVES_LEGACY, OB_GPENCIL, OB_MBALL, OB_MESH, SPACE_GRAPH, t, and V3D_AROUND_LOCAL_ORIGINS.
Referenced by applyShear(), applyToSphere(), clip_uv_transform_resize(), ElementMirror(), ElementResize(), ElementRotation(), and to_sphere_radius_update().
When in modal and not set, initializes a default orientation for the mode.
Definition at line 1223 of file transform_mode.c.
References BLI_assert, ED_transform_calc_orientation_from_type_ex(), ELEM, NULL, RGN_TYPE_WINDOW, SPACE_VIEW3D, t, T_MODAL, transform_orientations_current_set(), type, V3D_AROUND_CENTER_BOUNDS, V3D_ORIENT_GLOBAL, and V3D_ORIENT_VIEW.
Referenced by initNormalRotation(), initResize(), initRotation(), and initShear().
void transform_mode_init | ( | TransInfo * | t, |
wmOperator * | op, | ||
const int | mode | ||
) |
Definition at line 1064 of file transform_mode.c.
References BLI_assert, ELEM, wmOperator::idname, initAlign(), initBakeTime(), initBend(), initBevelWeight(), initBoneEnvelope(), initBoneRoll(), initBoneSize(), initCurveShrinkFatten(), initEdgeSlide_ex(), initEgdeCrease(), initGPOpacity(), initGPShrinkFatten(), initMaskShrinkFatten(), initMirror(), initNormalRotation(), initPushPull(), initResize(), initRotation(), initSeqSlide(), initShear(), initShrinkFatten(), initSkinResize(), initTilt(), initTimeScale(), initTimeSlide(), initTimeTranslate(), initToSphere(), initTrackball(), initTranslation(), initVertCrease(), initVertSlide_ex(), wmOperator::ptr, RNA_boolean_get(), RNA_property_float_get_array(), RNA_struct_find_property(), SPACE_GRAPH, SPACE_NLA, STREQ, t, TFM_ALIGN, TFM_BAKE_TIME, TFM_BEND, TFM_BONE_ENVELOPE, TFM_BONE_ENVELOPE_DIST, TFM_BONE_ROLL, TFM_BONESIZE, TFM_BWEIGHT, TFM_CURVE_SHRINKFATTEN, TFM_EDGE_CREASE, TFM_EDGE_SLIDE, TFM_GPENCIL_OPACITY, TFM_GPENCIL_SHRINKFATTEN, TFM_MASK_SHRINKFATTEN, TFM_MIRROR, TFM_NORMAL_ROTATION, TFM_PUSHPULL, TFM_RESIZE, TFM_ROTATION, TFM_SEQ_SLIDE, TFM_SHEAR, TFM_SHRINKFATTEN, TFM_SKIN_RESIZE, TFM_TILT, TFM_TIME_DUPLICATE, TFM_TIME_EXTEND, TFM_TIME_SCALE, TFM_TIME_SLIDE, TFM_TIME_TRANSLATE, TFM_TOSPHERE, TFM_TRACKBALL, TFM_TRANSLATION, TFM_VERT_CREASE, TFM_VERT_SLIDE, TransConvertType_Mesh, transform_convert_mesh_customdatacorrect_init(), and zero_v3().
Referenced by initTransform(), and transformEvent().
bool transform_mode_is_changeable | ( | int | mode | ) |
Informs if the mode can be switched during modal.
Definition at line 65 of file transform_mode.c.
References ELEM, TFM_EDGE_SLIDE, TFM_RESIZE, TFM_ROTATION, TFM_TRACKBALL, TFM_TRANSLATION, and TFM_VERT_SLIDE.
Referenced by transform_modal_item_poll(), and transformEvent().
Definition at line 38 of file transform_mode.c.
References ARM_ENVELOPE, BLI_assert, C, CTX_data_active_object(), Object::data, bArmature::drawtype, OB_ARMATURE, TFM_BONE_ENVELOPE_DIST, TFM_BONESIZE, TFM_RESIZE, and Object::type.
Referenced by initTransform().
smat is reference matrix only.
Definition at line 889 of file transform_mode.c.
References dot_v3v3(), mat3_to_rot_size(), and size().
Referenced by ElementResize().