Page MenuHome

T39656 Ctrl+Click for Nurbs
Needs ReviewPublic

Authored by Achal Pandey (achalpandeyy) on Jan 24 2019, 12:11 PM.

Details

Summary

I tried to solve the first part of task T39656, namely "Get Ctrl+Click working for single nurbs curves."

As of now, Ctrl+Click works for all curve objects and surfcurve and surfcircle objects. It does not work for the remaining surfaces but the modified poll function ignores these so there shouldn't be a problem.

What exactly did I do?

  1. Changed the poll function for add vertex operator in editcurve.c
  2. Modified the poll function to return true if Ctrl+Click is pressed on either any one of the curve objects or anyone from surfcurve and surfcircle objects.

Diff Detail

Repository
rB Blender

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.Tue, Feb 5, 6:22 PM
Brecht Van Lommel (brecht) added inline comments.
source/blender/editors/screen/screen_ops.c
478 ↗(On Diff #13323)

This poll function is used for many operators. I don't think these changes are correct for all of them?

This revision now requires changes to proceed.Tue, Feb 5, 6:22 PM

Just as @Brecht Van Lommel (brecht) said, modifying the ED_operator_editsurfcurve poll function affected other operators as well.

To counter this, I reverted ED_operator_editsurfcurve back to its original state. Changed the poll function in add vertex operator from ED_operator_editcurve to ED_operator_editsurfcurve so that it allows both curves and surfaces.
Next, I modified the ed_editcurve_addvert function to check if the NURBS surface it is operating on is 1-D or not by checking the pntsv attribute of the NURBS object.

At this point, Ctrl + Click works as intended for all curves (included in both Curves and Surfaces) and since the ED_operator_editsurfcurve poll function is back to its original state, other operators which depend on this poll function should work as well.

Achal Pandey (achalpandeyy) marked an inline comment as done.Sun, Feb 10, 9:02 PM
Achal Pandey (achalpandeyy) added inline comments.
source/blender/editors/screen/screen_ops.c
478 ↗(On Diff #13323)

Yes, you're right. I updated the diff to account for this, please have a look at it again.