Yep. The Flexi Bezier Addon is quite useful. The plan (for now) is for something a little less feature packed but it can grow. Hopefully, it will
I haven’t seen the other addon you linked. It does seem quite handy. The implementation I’m working on does have the functionality to make a cut but it doesn’t maintain the exact curvature as well as the tool. It’ll likely be worth investing some time on it. Thanks for the link!
I haven’t follow it so close, I apologize if this was commented already.
I watched this video: https://developer.blender.org/T88957 and I noticed that when you add an intermediate point the curve changes the shape and I think that shouldn’t happen, the handles of that point should be aligned so the curve shape stays intact.
Hello @dilithjay, thanks a lot for putting your effort into this feature, can’t say how much I’m happy this is finally worked on!
I don’t want to give too much feedback without trying the tool first, so here are some thoughts based on the proposal video:
1- Did you consider the idea of having this tool not (only) inside the edit mode but in the object mode toolbar? Even though the tool adds way more immediacy in creating a curve, having it in edit mode means that we would still need to add a bezier curve from the add menu first, enter edit mode, delete it and then use the tool to create the curve we want. Like the newly added “add object tool”, it could be present both in object and edit mode with the same functionalities.
2- I’m not a big fan of the pen icon, for some reason I find it distracting and “less accurate.” I think the edit mode cross icon would fit better with this tool.
3- Still regarding icons, I think it would be good to have more depending on the functionality: one for simply adding a control point, one for making a “cut”, one for removing a point, one for closing a curve, and maybe also one for grabbing control points/handles (I think this would also benefit your idea of having fewer modifier keys to press for the different functionalities).
Probably I’ve already said too much, I admit I’m quite excited about this proposal and can’t wait to try it firsthand!! Thanks!
I agree. The reason it’s as it is is simply because it was easy to get something working upon which improvements can be made. Definitely will be working on that pretty soon. Thanks for the comment!
I quite like the idea. But, if it’s to work similar to the “add object tool”, I’m guessing only the creation of the curve would be possible while in object mode. I feel like that could/should be a separate tool in itself since I don’t think edits (like in the features I’m proposing) would be made in object mode.
I completely agree that the pen icon is not suitable for this tool. TBH, I didn’t really pay much attention to how it looks (You may have noticed that even the icon on the toolbar is exactly that of the draw curve tool). Just wanted to get something working :-). But I’ll definitely be paying attention to the UI at some point.
I quite like this one too. I think it’ll be a good addition to the tool. Will keep in mind.
Thanks a lot for all the suggestions. And it’s not too much at all. Please keep them coming. The more the better :-).
Yes I meant exactly that, “same functionalities” wasn’t appropriate, I also think any other edit that is not the creation of the curve should be in edit mode.
Right. That makes sense. But like I said, it might be more appropriate as a separate tool since, unlike the “add object tool”, there won’t be much shared functionality between edit mode and object mode. Either way, I wouldn’t mind taking a shot at it depending on whether the others think it’s necessary. For now, I think I’ll stick to the plan on this.
Great, really nice to see some improvements to the curve tool. Thanks for your work.
I am very interested to see a new snap mode for edges. Currently only curve vertices are supported.
Actually I have tried something like this in my script, about create fake snap helpers with mesh objects. But this is a monkey patch, it would be far better if true snapping could be provided out of the box. So many lines of code to do this which is boring.
class SnapUtils:
def generate_fromcurves():
'''a selected curve is converted to mesh object'''
# active object must be a curve
if not bpy.context.active_object.type == 'CURVE':
return 'Active object must be a curve'
# objects selected in object context - all have to be curves
if True in [x.type != 'CURVE' for x in bpy.context.selected_objects]:
return 'All selected objects must be curves'
# remove snap helper if exists
if bpy.data.objects.get('zzzSnapHelper'):
bpy.data.objects.remove(bpy.data.objects.get('zzzSnapHelper'), do_unlink=True)
# remember to restore context
# (if in edit curve context - remember the state - switch to object context)
rescon_wasineditmode = False
rescon_activeobject = bpy.context.active_object
if bpy.context.mode == 'EDIT_CURVE':
rescon_wasineditmode = True
bpy.ops.object.editmode_toggle()
# duplicate active object
# (in object mode - selected curve objects are duplicated - joined together if many)
bpy.ops.object.duplicate()
if len(bpy.context.selected_objects) > 1:
bpy.ops.object.join()
# curve resolution
# (resolution of selected curve must be changed - eg: 3 mesh vertices == 4 curve points)
snapres = bpy.context.scene.patchmodelingtool.snap_resolution - 1 # reduce one
bpy.context.object.data.resolution_u = snapres
# convert to mesh
bpy.ops.object.convert(target='MESH')
bpy.context.active_object.name = 'zzzSnapHelper'
# go to edit mesh mode and remove edges (perhaps will be used later)
# bpy.ops.object.editmode_toggle()
# bpy.ops.mesh.select_all(action='TOGGLE')
# bpy.ops.mesh.delete(type='EDGE_FACE')
# bpy.ops.object.editmode_toggle()
# now as in object mode deactivate selection
bpy.context.active_object.hide_select = True
# restore context
# (select previous object - make it active)
bpy.ops.object.select_pattern(pattern=rescon_activeobject.name, extend=False)
bpy.context.scene.objects.active = rescon_activeobject
# (switch back to edit mode - if previously were in edit mode)
if rescon_wasineditmode:
bpy.ops.object.editmode_toggle()
def generate_0():
mesh = bpy.data.meshes.new("mesh") # add a new mesh
obj = bpy.data.objects.new("MyObject", mesh) # add a new object using the mesh
scene = bpy.context.scene
scene.objects.link(obj) # put the object into the scene
scene.objects.active = obj # set as the active object in the scene
obj.select = True # select object
mesh = bpy.context.object.data
bm = bmesh.new()
# add 1000 random vertices
for i in range(5000):
v = (random.random(), random.random(), random.random())
bm.verts.new(v)
# make the bmesh the object's mesh
bm.to_mesh(mesh)
bm.free() # always do this when finished
These days I thought of a totally new way of doing the snapping, as a modal operator, and all points right from the memory, no need for any actual temp objects. But anyways…
Let me know if you have something in mind for future work. I would be interested to see.
First of all, apologies for the late reply. Had a bit of a busy day today.
Correct me if I’m wrong, but if I understood correctly, the suggestion is to allow vertices of a curve to snap onto the actual curve as well instead of just the vertices. That seems quite useful and doable.
I don’t want to promise any features that’s not on the proposal, at least for the summer. But I’m taking note of all these suggestions in case I have time left. In the meantime if you get a chance to work on this further, the contributions are always welcome
Either way, thanks a lot for the suggestion and the code snippet. It’ll be helpful in case I decide to work on this :-).
Yeah, as for example you can snap only on the “real” curve vertices, those generated on preview not count. However by converting the curve into a mesh fixes the problem, since all mesh vertices are snappable.
I will keep you informed if I come up with something.
I’m not sure if I understood what the project is about, but I hope that it allows to trace the contours with reference images much easier and less tedious than this: