Compare commits
7 Commits
temp-geome
...
temp-multi
Author | SHA1 | Date | |
---|---|---|---|
![]() |
cec4fc3bd3 | ||
![]() |
ee80a79945 | ||
![]() |
25fcc24470 | ||
![]() |
d4a4751d98 | ||
![]() |
c3dfe47dfc | ||
![]() |
4962103391 | ||
![]() |
9f59448083 |
Submodule release/scripts/addons updated: 4b91309b12...f6e3238de3
Submodule release/scripts/addons_contrib updated: cd57934bd0...4747021578
@@ -2848,14 +2848,20 @@ void CURVE_OT_smooth_tilt(wmOperatorType *ot)
|
|||||||
|
|
||||||
static int hide_exec(bContext *C, wmOperator *op)
|
static int hide_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Object *obedit = CTX_data_edit_object(C);
|
const bool invert = RNA_boolean_get(op->ptr, "unselected");
|
||||||
|
int a, sel;
|
||||||
|
|
||||||
|
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||||
|
uint objects_len = 0;
|
||||||
|
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len);
|
||||||
|
|
||||||
|
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
|
||||||
|
Object *obedit = objects[ob_index];
|
||||||
Curve *cu = obedit->data;
|
Curve *cu = obedit->data;
|
||||||
ListBase *editnurb = object_editcurve_get(obedit);
|
ListBase *editnurb = object_editcurve_get(obedit);
|
||||||
Nurb *nu;
|
Nurb *nu;
|
||||||
BPoint *bp;
|
BPoint *bp;
|
||||||
BezTriple *bezt;
|
BezTriple *bezt;
|
||||||
int a, sel;
|
|
||||||
const bool invert = RNA_boolean_get(op->ptr, "unselected");
|
|
||||||
|
|
||||||
for (nu = editnurb->first; nu; nu = nu->next) {
|
for (nu = editnurb->first; nu; nu = nu->next) {
|
||||||
if (nu->type == CU_BEZIER) {
|
if (nu->type == CU_BEZIER) {
|
||||||
@@ -2899,7 +2905,9 @@ static int hide_exec(bContext *C, wmOperator *op)
|
|||||||
DEG_id_tag_update(obedit->data, 0);
|
DEG_id_tag_update(obedit->data, 0);
|
||||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
||||||
BKE_curve_nurb_vert_active_validate(obedit->data);
|
BKE_curve_nurb_vert_active_validate(obedit->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
MEM_freeN(objects);
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2925,13 +2933,19 @@ void CURVE_OT_hide(wmOperatorType *ot)
|
|||||||
|
|
||||||
static int reveal_exec(bContext *C, wmOperator *op)
|
static int reveal_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Object *obedit = CTX_data_edit_object(C);
|
const bool select = RNA_boolean_get(op->ptr, "select");
|
||||||
|
int a;
|
||||||
|
|
||||||
|
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||||
|
uint objects_len = 0;
|
||||||
|
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len);
|
||||||
|
|
||||||
|
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
|
||||||
|
Object *obedit = objects[ob_index];
|
||||||
ListBase *editnurb = object_editcurve_get(obedit);
|
ListBase *editnurb = object_editcurve_get(obedit);
|
||||||
Nurb *nu;
|
Nurb *nu;
|
||||||
BPoint *bp;
|
BPoint *bp;
|
||||||
BezTriple *bezt;
|
BezTriple *bezt;
|
||||||
int a;
|
|
||||||
const bool select = RNA_boolean_get(op->ptr, "select");
|
|
||||||
|
|
||||||
for (nu = editnurb->first; nu; nu = nu->next) {
|
for (nu = editnurb->first; nu; nu = nu->next) {
|
||||||
nu->hide = 0;
|
nu->hide = 0;
|
||||||
@@ -2961,7 +2975,9 @@ static int reveal_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
DEG_id_tag_update(obedit->data, 0);
|
DEG_id_tag_update(obedit->data, 0);
|
||||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
MEM_freeN(objects);
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -401,12 +401,19 @@ static void selectend_nurb(Object *obedit, eEndPoint_Types selfirst, bool doswap
|
|||||||
|
|
||||||
static int de_select_first_exec(bContext *C, wmOperator *UNUSED(op))
|
static int de_select_first_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
Object *obedit = CTX_data_edit_object(C);
|
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||||
|
uint objects_len = 0;
|
||||||
|
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len);
|
||||||
|
|
||||||
|
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
|
||||||
|
Object *obedit = objects[ob_index];
|
||||||
|
|
||||||
selectend_nurb(obedit, FIRST, true, DESELECT);
|
selectend_nurb(obedit, FIRST, true, DESELECT);
|
||||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
||||||
BKE_curve_nurb_vert_active_validate(obedit->data);
|
BKE_curve_nurb_vert_active_validate(obedit->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
MEM_freeN(objects);
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -427,12 +434,19 @@ void CURVE_OT_de_select_first(wmOperatorType *ot)
|
|||||||
|
|
||||||
static int de_select_last_exec(bContext *C, wmOperator *UNUSED(op))
|
static int de_select_last_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
Object *obedit = CTX_data_edit_object(C);
|
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||||
|
uint objects_len = 0;
|
||||||
|
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len);
|
||||||
|
|
||||||
|
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
|
||||||
|
Object *obedit = objects[ob_index];
|
||||||
|
|
||||||
selectend_nurb(obedit, LAST, true, DESELECT);
|
selectend_nurb(obedit, LAST, true, DESELECT);
|
||||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
||||||
BKE_curve_nurb_vert_active_validate(obedit->data);
|
BKE_curve_nurb_vert_active_validate(obedit->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
MEM_freeN(objects);
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -694,12 +708,25 @@ void CURVE_OT_select_row(wmOperatorType *ot)
|
|||||||
|
|
||||||
static int select_next_exec(bContext *C, wmOperator *UNUSED(op))
|
static int select_next_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
Object *obedit = CTX_data_edit_object(C);
|
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||||
|
uint objects_len = 0;
|
||||||
|
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len);
|
||||||
|
|
||||||
|
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
|
||||||
|
Object *obedit = objects[ob_index];
|
||||||
|
Curve *cu = obedit->data;
|
||||||
|
|
||||||
|
if (!ED_curve_select_check(cu, cu->editnurb)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ListBase *editnurb = object_editcurve_get(obedit);
|
ListBase *editnurb = object_editcurve_get(obedit);
|
||||||
|
|
||||||
select_adjacent_cp(editnurb, 1, 0, SELECT);
|
select_adjacent_cp(editnurb, 1, 0, SELECT);
|
||||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
MEM_freeN(objects);
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -722,12 +749,25 @@ void CURVE_OT_select_next(wmOperatorType *ot)
|
|||||||
|
|
||||||
static int select_previous_exec(bContext *C, wmOperator *UNUSED(op))
|
static int select_previous_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
Object *obedit = CTX_data_edit_object(C);
|
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||||
|
uint objects_len = 0;
|
||||||
|
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len);
|
||||||
|
|
||||||
|
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
|
||||||
|
Object *obedit = objects[ob_index];
|
||||||
|
Curve *cu = obedit->data;
|
||||||
|
|
||||||
|
if (!ED_curve_select_check(cu, cu->editnurb)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ListBase *editnurb = object_editcurve_get(obedit);
|
ListBase *editnurb = object_editcurve_get(obedit);
|
||||||
|
|
||||||
select_adjacent_cp(editnurb, -1, 0, SELECT);
|
select_adjacent_cp(editnurb, -1, 0, SELECT);
|
||||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
MEM_freeN(objects);
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -750,13 +790,24 @@ void CURVE_OT_select_previous(wmOperatorType *ot)
|
|||||||
|
|
||||||
static int select_more_exec(bContext *C, wmOperator *UNUSED(op))
|
static int select_more_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
Object *obedit = CTX_data_edit_object(C);
|
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||||
ListBase *editnurb = object_editcurve_get(obedit);
|
uint objects_len = 0;
|
||||||
|
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len);
|
||||||
Nurb *nu;
|
Nurb *nu;
|
||||||
BPoint *bp, *tempbp;
|
BPoint *bp, *tempbp;
|
||||||
int a;
|
int a;
|
||||||
short sel = 0;
|
short sel = 0;
|
||||||
|
|
||||||
|
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
|
||||||
|
Object *obedit = objects[ob_index];
|
||||||
|
Curve *cu = obedit->data;
|
||||||
|
|
||||||
|
if (!ED_curve_select_check(cu, cu->editnurb)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ListBase *editnurb = object_editcurve_get(obedit);
|
||||||
|
|
||||||
/* note that NURBS surface is a special case because we mimic */
|
/* note that NURBS surface is a special case because we mimic */
|
||||||
/* the behavior of "select more" of mesh tools. */
|
/* the behavior of "select more" of mesh tools. */
|
||||||
/* The algorithm is designed to work in planar cases so it */
|
/* The algorithm is designed to work in planar cases so it */
|
||||||
@@ -815,7 +866,9 @@ static int select_more_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
}
|
}
|
||||||
|
|
||||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
MEM_freeN(objects);
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -839,8 +892,9 @@ void CURVE_OT_select_more(wmOperatorType *ot)
|
|||||||
/* basic method: deselect if control point doesn't have all neighbors selected */
|
/* basic method: deselect if control point doesn't have all neighbors selected */
|
||||||
static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
|
static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
Object *obedit = CTX_data_edit_object(C);
|
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||||
ListBase *editnurb = object_editcurve_get(obedit);
|
uint objects_len = 0;
|
||||||
|
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len);
|
||||||
Nurb *nu;
|
Nurb *nu;
|
||||||
BPoint *bp;
|
BPoint *bp;
|
||||||
BezTriple *bezt;
|
BezTriple *bezt;
|
||||||
@@ -848,6 +902,16 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
int sel = 0;
|
int sel = 0;
|
||||||
bool lastsel = false;
|
bool lastsel = false;
|
||||||
|
|
||||||
|
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
|
||||||
|
Object *obedit = objects[ob_index];
|
||||||
|
Curve *cu = obedit->data;
|
||||||
|
|
||||||
|
if (!ED_curve_select_check(cu, cu->editnurb)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ListBase *editnurb = object_editcurve_get(obedit);
|
||||||
|
|
||||||
if (obedit->type == OB_SURF) {
|
if (obedit->type == OB_SURF) {
|
||||||
for (nu = editnurb->first; nu; nu = nu->next) {
|
for (nu = editnurb->first; nu; nu = nu->next) {
|
||||||
BLI_bitmap *selbpoints;
|
BLI_bitmap *selbpoints;
|
||||||
@@ -1003,7 +1067,9 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
|
|
||||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
||||||
BKE_curve_nurb_vert_active_validate(obedit->data);
|
BKE_curve_nurb_vert_active_validate(obedit->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
MEM_freeN(objects);
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1181,24 +1247,50 @@ static bool ed_curve_select_nth(Curve *cu, const struct CheckerIntervalParams *p
|
|||||||
|
|
||||||
static int select_nth_exec(bContext *C, wmOperator *op)
|
static int select_nth_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Object *obedit = CTX_data_edit_object(C);
|
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||||
|
uint objects_len = 0;
|
||||||
|
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len);
|
||||||
|
|
||||||
|
bool found_active_elt = false;
|
||||||
|
short ob_type;
|
||||||
|
|
||||||
|
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
|
||||||
|
Object *obedit = objects[ob_index];
|
||||||
|
Curve *cu = obedit->data;
|
||||||
|
ob_type = obedit->type;
|
||||||
|
|
||||||
|
if (!ED_curve_select_check(cu, cu->editnurb)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
struct CheckerIntervalParams op_params;
|
struct CheckerIntervalParams op_params;
|
||||||
|
|
||||||
WM_operator_properties_checker_interval_from_op(op, &op_params);
|
WM_operator_properties_checker_interval_from_op(op, &op_params);
|
||||||
|
|
||||||
if (!ed_curve_select_nth(obedit->data, &op_params)) {
|
if (ed_curve_select_nth(obedit->data, &op_params) == true) {
|
||||||
if (obedit->type == OB_SURF) {
|
found_active_elt = true;
|
||||||
BKE_report(op->reports, RPT_ERROR, "Surface has not got active point");
|
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MEM_freeN(objects);
|
||||||
|
|
||||||
|
if (!found_active_elt) {
|
||||||
|
if (ob_type == OB_SURF) {
|
||||||
|
BKE_report(op->reports, RPT_ERROR,
|
||||||
|
(objects_len == 1 ?
|
||||||
|
"Surface has no active point" :
|
||||||
|
"Surfaces have no active point"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BKE_report(op->reports, RPT_ERROR, "Curve has not got active point");
|
BKE_report(op->reports, RPT_ERROR,
|
||||||
|
(objects_len == 1 ?
|
||||||
|
"Curve has no active point" :
|
||||||
|
"Curves have no active point"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Submodule source/tools updated: 6bcd05cf6a...116ae2c6e6
Reference in New Issue
Block a user