Page MenuHome

Multi-Object-Mode: Edit Curve Tools
Closed, ResolvedPublic


Select Menu:

Curve Menu:



Differential Revisions
D3888: Edit Curve Tools CURVE_OT_separate
D3887: Edit Curve Tools CURVE_OT_draw
D3882: Edit Curve Tools CURVE_OT_cyclic_toggle
D3881: Edit Curve Tools CURVE_OT_normals_make_consistent
D3879: Multi-Object EditMode: CURVE_OT_switch_direction
D3875: Edit Curve Tools CURVE_OT_handle_type_set
D3876: Edit Curve Tools CURVE_OT_tilt_clear
D3873: Multi-Object EditMode: CURVE_OT_reveal
D3872: Edit Curve Tools CURVE_OT_hide
D3859: Multi-Object EditMode: CURVE_OT_delete
D3845: Multi-Object EditMode: CURVE_OT_select_similar
D3844: Multi-Object EditMode: CURVE_OT_select_more
D3843: Multi-Object EditMode: CURVE_OT_de_select_previous
D3842: Multi-Object EditMode: CURVE_OT_de_select_next
D3841: Multi-Object EditMode: CURVE_OT_de_select_last
D3839: Multi-Object EditMode: CURVE_OT_de_select_first
D3437: Multi-Object-Mode: Edit Curve Tools - CURVE_OT_separate
D3435: Multi-Object-Mode: Edit Curve Tools - CURVE_OT_duplicate_move
D3436: Multi-Object-Mode: Edit Curve Tools - CURVE_OT_split
D3434: Multi-Object-Mode: Edit Curve Tools - CURVE_OT_extrude_move
D3427: Multi-Object-Mode: Edit Curve Tools: CURVE_OT_reveal
D3426: Multi-Object-Mode: Edit Curve Tools: CURVE_OT_hide
D3382: T54643-Multi-Object-Mode: Edit Curve Tools: CURVE_OT_subdivide
D3407: T54643-Multi-Object-Mode: Edit Curve Tools: CURVE_OT_select_nth
D3409: T54643-Multi-Object-Mode: Edit Curve Tools: CURVE_OT_select_linked
D3412: Multi-Object-Mode: Edit Curve Tools - Add test for selected elements
D3309: Multi-Object-Mode : Edit Curve Tools add support for CURVE_OT_decimate
D3277: Multi-Object-Mode: Edit Curve Tools add support for Select More
D3275: Multi-Object-Mode: Edit Curve Tools add support for Select Previous
D3274: Multi-Object-Mode: Edit Curve Tools add support for Select Next
D3272: Multi-Object-Mode: Edit Curve Tools add support for (De)select Last
D3271: Multi-Object-Mode: Edit Curve Tools add support for (De)select First
D3270: Multi-Object-Mode: Edit Curve Tools add support for Select Similar
D3263: Multi-Object-Mode: Edit Curve Tools add support for Select Linked All
D3262: Multi-Object-Mode: Edit Curve Tools add support for Checker Deselect
D3258: Multi-Object-Editing : Add layer utility macros to edit curve select
D3259: Multi-Object-Mode: Add support for Curves (De)select All
D3260: Multi-Object-Mode: Edit Curve Tools add support for Select Random
D3278: Multi-Object-Mode: Edit Curve Tools add support for Select Less
D3282: Multi-Object-Mode: Edit Curve Tools add support for Delete
D3286: Multi-Object-Mode: Edit Curve Tools add support for Split
D3281: Multi-Object-Mode: Edit Curve Tools add support for Dissolve Vertices
D3288: Multi-Object-Mode: Edit Curve Tools add support for Subdivide
D3287: Multi-Object-Mode: Edit Curve Tools add support for Switch Direction

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

When in edit mode I'm not able to select multiple control points. I have to do the following as a work around.

  1. In Object Mode select a Bezier Curve
  2. Switch to Edit Mode and select the Control Points
  3. Switch back to Object Mode and select another Bezier Curve
  4. Switch to Edit Model and select the Control Points
  5. Switch back to Object Mode and Select both Bezier Curves
  6. Switch back to Edit Mode and perform the operators.

The expected behavior

  1. Select the Bezier Curves
  2. Switch to Edit Mode
  3. Select Control Points from any Bezier Curve selected

Default colors make it hard to distinguish between selected and none selected Control Points


Versus one with more contrast

@Guy Boicey (stealthtech)

The patches overall are fine, but we need to skip the for loop when there is no selected elements. There is no equivalent of totvertsel/edge/face in curves. You need to add this (as its own patch), so we can proceed with the other patches? It should be straight forward.

@Dalai Felinto (dfelinto)

It should be straight forward but it is not, which is because I'm a noob at this.

First question what would justify that this would need to be a separate patch? Would I update my existing patches? How do I do this? I'm lost on this one. I was working on some other pieces of code and lost my updates and I don't want that to happen again. On a side note, the YouTube video which lead me here was awesome, great job. If there was one that covered end to end on how to actually do these patches, with git and diffing and branching would be great. The documentation is good otherwise I would not have gotten this far, but a video like a picture says thousands more words than words themselves. Teaching by example is great and your video did some of that, just some parts where left out. This could also be part of this as well how to make an update to a patch after being submitted.

Before I dive into making all sorts of code changes I want to share my thoughts and my direction. I see that most functions do something similar to this:

ListBase *editnurb = object_editcurve_get(obedit);
Nurb *nu;
for (nu = editnurb->first; nu; nu = nu->next)

My thoughts are that this could be the basis for the test. Now what would that test would be I don't know? Is it testing if editnurb is NULL? Is it to test if editnurb->first exist? Or do we go deeper than this and add something similar to tot...sel?

How do you test if two vertices are selected for such functions as subdivide?

And my last question, which I think I know the answer which is performance. Why was there no test before Multi-Object-Mode and why does there need to be one now? I'm guessing performance, you don't want to do a loop on N objects if you don't have to where as before Multi-Object-Mode there was only one.

I think I might have found something would this work? I applied it to a few operations with some test output and looks to skip curves that have no selected control points.

if(!ED_curve_nurb_select_check((Curve *)obedit->data, object_editcurve_get(obedit)->first)) {

In some function you can use declared varialbes for example in the curve_dissolve_exec

for (uint ob_index = 0; ob_index < objects_len; ob_index++)
    Object *obedit = objects[ob_index];
    Curve *cu = (Curve *)obedit->data;
    ListBase *editnurb = object_editcurve_get(obedit);
    if(!ED_curve_nurb_select_check(cu, editnurb->first)) {


And for operations that require more than one I could use ED_curve_nurb_select_count?

For example subdivided_exec

if(!ED_curve_nurb_select_count((Curve *)obedit->data, object_editcurve_get(obedit)->first) < 2) {

Same here in MetaBall

i am waiting @Dalai Felinto (dfelinto) to clarify what he means..
because i am thinking we need to implement somthing like tot...sel....

To use ED_curve_nurb_select_check and ED_curve_nurb_select_count don't you need to cycle through the Nurbs to know if any of it is selected?
e.g.: for (i = 0, nu = editnurb->first; nu; i++, nu = nu->next) ?

This is where an util like what @Campbell Barton (campbellbarton) did for metaballs can be handy.

First question what would justify that this would need to be a separate patch?

We try to have git commits as atomic as possible. That said it is ok if it is part of one of the patches, but afterwards you still need to update the remaining patches to use it.

@Dalai Felinto (dfelinto) is there a way to get the count in the style that @Campbell Barton (campbellbarton) did with the metaballs without cycling through the Nurbs? (Checking the f1 at each point)

@Dalai Felinto (dfelinto) you are correct we need a function that iterates through editnurb for a given Curve and check if any are selected. I wrapped the body of ED_curve_nurb_select_check with a loop for (const Nurb *nu = cu->editnurb->nurbs.first; nu; nu = nu->next). Other parts of ED_curve_nurb_select_check depend on the Curve so I figure pass in the Curve instead of editnurb.

I followed the naming conventions and locations like the ones for metaballs, created bool BKE_curve_is_any_nurbs_selected(const Curve *cu) located in /blender/source/blender/blenkernel/intern/curve.c. I figure those things along with the place of the code is trivial and if needs to change someone else can do that.

If this is acceptable then I will make changes to the function to skip if not selected elements.

Dalai Felinto (dfelinto) closed this task as Resolved.Nov 7 2018, 1:59 AM
Dalai Felinto (dfelinto) updated the task description. (Show Details)

All operators addressed, thanks everyone for the contributions.