0
$\begingroup$

I currently try to speed up my script by using

bpy.context.object.copy()

instead of

bpy.ops.object.duplicate(linked=False, mode='DUMMY')

It really is a lot faster, but I don't seem to be able to join the copies without linking them into the scene and calling for a scene update. bpy.ops.object.join() doesn't work, I guess because the copies are just data sets flying around in memory and not being linked to the scene. Updating the scene and joining afterwards is not an option because it's as slow using the .duplicate() function.

Is there any option how I could join my copies without updating the scene? Thanks a lot!

$\endgroup$
5
  • 1
    $\begingroup$ Have you tried to create all copies first, then link them to scene in a separate loop and join? $\endgroup$
    – CodeManX
    Nov 28, 2014 at 18:22
  • $\begingroup$ Yeah, that's exactly how I do it. Maybe I wasn't too clear in my post, what I meant was the real bottleneck now is the join(). Using copy() instead of duplicate() made my script as fast as I wanted. But joining after the scene update slows everything down again drastically. Sadly I didn't find documentation on how an "object dataset" is built up. My hope is that I could somehow copy all those data together into one object manually, in a faster way than Blender's join(). $\endgroup$
    – bortran
    Nov 29, 2014 at 9:16
  • $\begingroup$ To be more clear, I need to copy the mesh data from object 1..1000 into object x. I also didn't find a solution to just append mesh data to an object. There are functions like that but only for primitives. I had a look into approaches with bmesh, but they seemed complicated and from what I've understood they are not performing too great. Any solution or hint is highly welcome! $\endgroup$
    – bortran
    Nov 29, 2014 at 9:25
  • $\begingroup$ You may be interested in this answer, the quickest way to create a large number of duplicates was to use dupliverts and then make duplicates real. $\endgroup$
    – sambler
    Nov 29, 2014 at 11:43
  • $\begingroup$ Thanks sambler, but I guess that won't work as I don't see how I could rotate and scale the single duplicates. The creation of the objects isn't a problem anyway, my script works pretty fast on that part, up to the limits of the blender ui itself. Also making duplicates real creates single objects not a joined mesh. $\endgroup$
    – bortran
    Nov 29, 2014 at 13:25

0

You must log in to answer this question.

Browse other questions tagged .