Merge branch 'blender-v2.83-release'

This commit is contained in:
Germano Cavalcante 2020-04-27 12:09:17 -03:00
commit 0a7dd1ec49
7 changed files with 28 additions and 37 deletions

View File

@ -1651,11 +1651,6 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
}
}
if ((prop = RNA_struct_find_property(op->ptr, "center_override"))) {
/* Important for redo operations. */
RNA_property_float_set_array(op->ptr, prop, t->center_global);
}
if (t->flag & T_PROP_EDIT_ALL) {
if (t->flag & T_PROP_EDIT) {
proportional |= PROP_EDIT_USE;

View File

@ -819,25 +819,29 @@ void clipUVData(TransInfo *t)
* \{ */
/**
* For modal operation: `t->center_global` may not have been set yet.
* Used for `TFM_TIME_EXTEND`.
*/
void transform_convert_center_global_v2(TransInfo *t, float r_center[2])
char transform_convert_frame_side_dir_get(TransInfo *t, float cframe)
{
char r_dir;
Scene *scene = t->scene;
float center[2];
if (t->flag & T_MODAL) {
UI_view2d_region_to_view(
(View2D *)t->view, t->mouse.imval[0], t->mouse.imval[1], &r_center[0], &r_center[1]);
(View2D *)t->view, t->mouse.imval[0], t->mouse.imval[1], &center[0], &center[1]);
r_dir = (center[0] > cframe) ? 'R' : 'L';
{
/* XXX: This saves the direction in the "mirror" property to be used for redo! */
if (r_dir == 'R') {
t->flag |= T_NO_MIRROR;
}
}
}
else {
copy_v2_v2(r_center, t->center_global);
r_dir = (t->flag & T_NO_MIRROR) ? 'R' : 'L';
}
}
void transform_convert_center_global_v2_int(TransInfo *t, int r_center[2])
{
float center[2];
transform_convert_center_global_v2(t, center);
r_center[0] = round_fl_to_int(center[0]);
r_center[1] = round_fl_to_int(center[1]);
return r_dir;
}
/* This function tests if a point is on the "mouse" side of the cursor/frame-marking */

View File

@ -104,8 +104,7 @@ void transform_around_single_fallback(TransInfo *t);
bool constraints_list_needinv(TransInfo *t, ListBase *list);
void calc_distanceCurveVerts(TransData *head, TransData *tail);
struct TransDataCurveHandleFlags *initTransDataCurveHandles(TransData *td, struct BezTriple *bezt);
void transform_convert_center_global_v2(TransInfo *t, float r_center[2]);
void transform_convert_center_global_v2_int(TransInfo *t, int r_center[2]);
char transform_convert_frame_side_dir_get(TransInfo *t, float cframe);
bool FrameOnMouseSide(char side, float frame, float cframe);
/* transform_convert_action.c */

View File

@ -331,10 +331,7 @@ void createTransActionData(bContext *C, TransInfo *t)
/* which side of the current frame should be allowed */
if (t->mode == TFM_TIME_EXTEND) {
/* only side on which center is gets transformed */
float center[2];
transform_convert_center_global_v2(t, center);
t->frame_side = (center[0] > CFRA) ? 'R' : 'L';
t->frame_side = transform_convert_frame_side_dir_get(t, (float)CFRA);
}
else {
/* normal transform - both sides of current frame are considered */

View File

@ -261,10 +261,7 @@ void createTransGraphEditData(bContext *C, TransInfo *t)
/* which side of the current frame should be allowed */
// XXX we still want this mode, but how to get this using standard transform too?
if (t->mode == TFM_TIME_EXTEND) {
/* only side on which center is gets transformed */
float center[2];
transform_convert_center_global_v2(t, center);
t->frame_side = (center[0] > CFRA) ? 'R' : 'L';
t->frame_side = transform_convert_frame_side_dir_get(t, (float)CFRA);
}
else {
/* normal transform - both sides of current frame are considered */

View File

@ -71,10 +71,7 @@ void createTransNlaData(bContext *C, TransInfo *t)
/* which side of the current frame should be allowed */
if (t->mode == TFM_TIME_EXTEND) {
/* only side on which center is gets transformed */
float center[2];
transform_convert_center_global_v2(t, center);
t->frame_side = (center[0] > CFRA) ? 'R' : 'L';
t->frame_side = transform_convert_frame_side_dir_get(t, (float)CFRA);
}
else {
/* normal transform - both sides of current frame are considered */

View File

@ -31,6 +31,8 @@
#include "BKE_report.h"
#include "BKE_sequencer.h"
#include "UI_view2d.h"
#include "transform.h"
#include "transform_convert.h"
@ -541,10 +543,7 @@ void createTransSeqData(TransInfo *t)
}
tc->custom.type.free_cb = freeSeqData;
/* only side on which center is gets transformed */
int center[2];
transform_convert_center_global_v2_int(t, center);
t->frame_side = (center[0] > CFRA) ? 'R' : 'L';
t->frame_side = transform_convert_frame_side_dir_get(t, (float)CFRA);
#ifdef XXX_DURIAN_ANIM_TX_HACK
{
@ -586,9 +585,12 @@ void createTransSeqData(TransInfo *t)
SeqToTransData_Recursive(t, ed->seqbasep, td, td2d, tdsq);
SeqTransDataBounds(t, ed->seqbasep, ts);
/* set the snap mode based on how close the mouse is at the end/start points */
if (abs(center[0] - ts->max) > abs(center[0] - ts->min)) {
ts->snap_left = true;
if (t->flag & T_MODAL) {
/* set the snap mode based on how close the mouse is at the end/start points */
int xmouse = (int)UI_view2d_region_to_view_x((View2D *)t->view, t->mouse.imval[0]);
if (abs(xmouse - ts->max) > abs(xmouse - ts->min)) {
ts->snap_left = true;
}
}
#undef XXX_DURIAN_ANIM_TX_HACK