1

I'm using a scrip Subprogram of Animation nodes to merge that will merge a list of objects using Bmesh (Because it holds the UVs)

But now i'm stuck at merging two Bmesh as the picture below explains.

enter image description here

Venay
  • 313
  • 1
  • 5
  • Maybe that can help http://blender.stackexchange.com/questions/13986/how-to-join-objects-with-python. Have a look in particular to CoDEmanX answer. But in AN context, I don't know if that can be applied so easily. – lemon Mar 16 '17 at 18:15
  • Yeah , it gave me pretty solid idea – Venay Mar 17 '17 at 15:26

1 Answers1

0

SO i've managed to do the trick using the answer of CoDEmanX here : enter link description here Still very strict to use and have a high ms

import bpy 

AN= bpy.data.node_groups['NodeTree']
L = AN.nodes["Data Interface"].value

def OB_list_joiner(L,b,n):

    ctx = bpy.context.copy()
    P=[]

    for v in L :
        o=v.copy()
        o.data=v.data.copy()
        P.append(o)

    for v in P:
        bpy.context.scene.objects.link(v)

    ctx['active_object'] = P[0]
    ctx['selected_objects'] = P
    ctx['selected_editable_bases'] = [bpy.context.scene.object_bases[ob.name] for ob in P]
    P[0].name = n
    bpy.ops.object.join(ctx)
    return P[0]

if N not in bpy.data.objects :
    O = OB_list_joiner(L,True,N)
else :
    O = bpy.data.objects[N]

enter image description here

Venay
  • 313
  • 1
  • 5