Page MenuHome

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

Description

Select Menu:

Curve Menu:

Other:

Revisions and Commits

Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
rB Blender
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Closed
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned
Abandoned

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

Default

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)) {
    continue;
}

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)) {
        continue;
    }

    .
    .
    .

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) {
    continue;
}

Same here in MetaBall
https://developer.blender.org/T54649

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.

https://developer.blender.org/D3412

Dalai Felinto (dfelinto) changed the task status from Unknown Status to Resolved.Nov 7 2018, 1:59 AM
Dalai Felinto (dfelinto) updated the task description. (Show Details)

All operators addressed, thanks everyone for the contributions.