Curve Converter

I just wanna say thank you so much for you script - huge time saver.

tested this on sapling tree, worked great.

maybe a video demonstration?

Firstly thanks for the very clear and specific instructions. For other user. This addon does that same thing as duplicating a curve that has a bevel then converting that curve object to a mesh with shift-alt-c. The features that this addon gives you is the ability NOT to destroy the original curve object( which you could avoid but copying the curve before you convert it to a mesh using Shift-D), and the ability to dynamically adjust the original curve object and have the mesh object adjust those changes as you make them.

Got any screenshots of this in action? :wink:

Kind of a hard add-on to sum up in a picture, if you are looking for some more info and a picture though check out the listing for it on my website: http://blendingjacob.blogspot.com/p/curve-converter.html

Jacob,
Thanks so much for this addon! (#7)
I wanted to make a tube, use the Wireframe mod on it, and fly through it.
But the tube (circle extruded along a closed spline) wasn’t a mesh, and
wouldn’t export as an obj.

But using your addon, I converted the tube to a mesh, and then used the same spline as the
motion path for the camera.

Updated version TubeRide (Blender 2.76b, BlenderRender)

BTW, thanks also for the other addons and themes at your blogspot. :smiley:

Thanks! Always nice to see how people use these add-ons.

Hullo Jacob, I changed couple of lines so ‘Propagate Changes’ works now in curve edit mode also and you can continue curve modeling.

Hey, that’s a great change! I’ll add that and go head and release it here.

Version 0.8 is out and I copied that changes that JuhaW did.

Added support for layers (ugly fix). If destination object is on other hidden layer that layer will be shown. Use this ALOT for design alterations and using boolean operations on curve objects. Thanks!

1 Like

By default Alt +C has two options. At this point we have the ability to use convert to mesh for a curve with this non destructive addon. Would it be possible to add convert to curve for a poly line and have the same non destructive options?

Possibly. I’ll have to look into it.

You can also convert 4 curves to a mesh without add-on.

You first build the contour of a surface with 4 Bezier curves, forming approximately a rectangle. Check if each of the corner vertices are snapped together. Then convert the 4 Bezier curves in “Object Mode” with “Alt C”. Now the curves are multiple edges. You may obtain double vertices with the transformation. Remove them in “Edit Mode” with the function “Remove Doubles”. This is important otherwise the next steps won’t work.

To obtain a surface, you will use the “Grid Fill” that you will find with the menu “Mesh/Faces/Grid Fill”, but first of all you have to extrude faces from the edges by extruding them outside the rectangle, otherwise the function cannot be applied. Check again if there are no double vertices with the function “Remove doubles”, then use the function “Grid Fill” and you should have it filled

This addon is very useful, so when I updated to 2.8 I needed to figure out how to update the addon as well. It seems to work now:

(as a new user I can’t upload attachment unfortunately):

bl_info = {
    "name" : "Curve Conversion",
    "description" : "Converts Curve To Mesh To Allow Updating Of Mesh",
    "author" : "Jacob Morris",
    "blender" : (2, 80, 0),
    "location" : "Properties > Modifiers > Curve Conversion",
    "versoin" : (0, 2),
    "category" : "Object"
    }

import bpy
from bpy.props import StringProperty, BoolProperty
bpy.types.Object.names = StringProperty(name = "", default = "")
bpy.types.Object.rscale = BoolProperty(name = "Respect Scale?", default = False)

def CurveConvert(self, context):
    o = context.object
    if o.names in bpy.data.objects:
        curve = bpy.data.objects[o.names]            
        if curve.type == "CURVE":
            mesh = curve.data.copy()
            ob = bpy.data.objects.new("mesh", mesh)
            context.scene.collection.objects.link(ob)
            ob.select_set(True); o.select_set(False); bpy.context.view_layer.objects.active = ob; bpy.ops.object.convert(target = "MESH")
            for i in o.data.materials:
                ob.data.materials.append(i)
            o.data = ob.data
            if o.rscale == True:
                o.scale = curve.scale
            bpy.ops.object.delete()
            bpy.context.view_layer.objects.active = o; o.select_set(True)
            bpy.ops.object.mode_set(mode='EDIT', toggle=False)
            bpy.ops.mesh.select_all(action='SELECT')
            bpy.ops.mesh.remove_doubles(threshold=0.0001)
            bpy.ops.mesh.normals_make_consistent()
            bpy.ops.object.mode_set()
        else:
            self.report({"ERROR"}, "Object Not Curve")
    else:
        self.report({"ERROR"}, "Object Not Found")
    
class CurveConversionAdd(bpy.types.Operator):
    bl_label = "Add Mesh Object"
    bl_idname = "mesh.curve_convert_add"
    bl_options = {"UNDO"}
    
    def execute(self, context):
        na = context.object.name
        loc = list(context.object.location.copy()); loc[2] += 0.5
        bpy.ops.mesh.primitive_cube_add(location = loc)
        return {"FINISHED"}
        
class CurveConversionUpdate(bpy.types.Operator):
    bl_label = "Update Mesh"
    bl_idname = "mesh.curve_convert_update"
    bl_options = {"UNDO"}
    
    def execute(self, context):
        CurveConvert(self, context)
        return {"FINISHED"}
                
class CurveConversionPanel(bpy.types.Panel):
    bl_label = "Curve Conversion"
    bl_idname = "OBJECT_PT_convert"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "modifier"
    bl_options = {"DEFAULT_CLOSED"}

    def draw(self, context):
        layout = self.layout; o = context.object
        if o.type == "MESH":
            layout.label(text="Curve Name:")
            layout.prop_search(o, "names",  context.scene, "objects")
            layout.prop(o, "rscale", icon="NONE") #I can't find "MAN_SCALE" (scaling icon)
            layout.operator(CurveConversionUpdate.bl_idname, text=CurveConversionUpdate.bl_label)
        elif o.type == "CURVE":
            layout.operator(CurveConversionAdd.bl_idname, text=CurveConversionAdd.bl_label)
        else:
            layout.label(text="Base Object Needs To Be Mesh Object", icon = "ERROR")        

            
classes = (
    CurveConversionAdd,
    CurveConversionUpdate,
    CurveConversionPanel,
)

register, unregister = bpy.utils.register_classes_factory(classes)

if __name__ == "__main__":
    register()

7 Likes

Glad to here it was easy to update for 2.8. Normally, the process is more complicated, but I’m glad it wasn’t. Thanks for passing this along.

1 Like

It was just back and forth, finding the errors in blender, googling and reading api and Q&As to find the replacements to make, reinstalling the addon, and then repeating until no more errors. Thankfully it only took some time. :slight_smile:

1 Like

Thank you. This work fine.

Hi,
I have yet to use it but it looks to be what I am looking for.
A couple of years ago, there was a suggestion of submitting this to core.
Has this process started? Is there a ticket we can track on this thread?

That would force:

  • updates to happen in line with breaking releases,
  • potentially unit tests and updated documentation,
  • no installation required for all users.
  • easy discovery and publication in an upcoming feature release.

Hopefully you can let me know your thoughts. Some of the blog links have disappeared.
Cheers and thanks for contributing!