Loft with Curves

What if you only considered a hook if the length of the returned point count was 1. As far as offset, the way I created my hook was from CTRL-H which does place the hook at the exact location of the point on the curve.

This is the code im using to retrieve hooking points.
I have to finish some scripts that im working on so ill have to delay this for a while.
Feel free to use the code as u like. If you make any progress ill be glad to help.


#Hooks

#deselects all the spline points
def deselect(obj):
    for p in obj.data.splines[0].bezier_points:
        p.select_control_point = False
        p.select_right_handle = False
        p.select_left_handle = False

#checks for selected points
def modpoint(obj):
    point = []
    for i, p in enumerate(obj.data.splines[0].bezier_points):
        #i = point index
        #0,1,2 refers handleright, point, handleleft
        #if 0,2 hook is applied to a handle, not the point itself.
        if p.select_right_handle:
            point.append([i, 0])
            break
        if p.select_control_point:
            point.append([i, 1])
            break
        if p.select_left_handle:
            point.append([i, 2])
            break
    return point

    
obj = bpy.data.objects['c1']


for mod in obj.modifiers:
    if mod.type=="HOOK":
        #deselect all points before running hook_select
        deselect(obj)
        
        #hook select only works on edit mode so:
        toggle=0 
        if bpy.context.mode=="OBJECT": 
            toggle=1
            bpy.ops.object.editmode_toggle()
            
        
        bpy.ops.object.hook_select(modifier=mod.name)
        
        #with the hooked points selected we check for them
        modpoints = modpoint(obj)
        
        
        if toggle:
            bpy.ops.object.editmode_toggle()
        
        print(modpoints)


animation works fine with rotobezier addon… this is a great script, thanks!

Glad to know that, Rotobezier its another solution to animate the curves.
Thanks for the comment.

great script,especially the ability to edit surface after lofting.how to increase surface resolution? i hope you are aware of opensource spline modeller jpatch http://www.jpatch.com/

At the end of loftv4.txt there are 2 variables spans=12 and steps=12, modify those numbers to increase or decrease the resolution.
Delete the mesh if its created, the select the curves and run the Loftv4.txt again .

Didnt know about jpatch, ill check it out.

ok.thanks.

Hai Can You make it as an addon?

Thank you

Yep, would be useful.

Really nice work! Love it!

Im working on it. Ill release it soon. Thanks