Blender-28-Addons icon indicating copy to clipboard operation
Blender-28-Addons copied to clipboard

'Needs at least two selected objects' when distribute objects in blender 2.91

Open AlexLuya opened this issue 4 years ago • 5 comments

My configuration:

ubuntu 20.04

python 3.8.5 
blender 2.91

I cloned this:

git clone https://github.com/oscurart/Blender-28-Addons

To local,then copy subfolder to addons:

sudo cp -r /home/alex/workspace/Thirdparty/Blender-28-Addons/oscurart_tools/ /usr/share/blender/2.91/scripts/addons

Then try to distribute 5 selected objects,but got error:

Needs at least two selected objects

and it seems this error occurred in old version.

https://blenderartists.org/t/oscurart-tools-update-rig-model-render-setting-more/576702/28

AlexLuya avatar Dec 14 '20 07:12 AlexLuya

Try to use the last blender version.

Remember open the oscurart list in the properties menu.

image

oscurart avatar Dec 14 '20 10:12 oscurart

No longer works with v2.93

arminhupka avatar Sep 08 '21 09:09 arminhupka

No longer works with v2.93

yes. Only for builder version.

oscurart avatar Sep 08 '21 10:09 oscurart

@arminhupka change distribute.py to have this def:

def ObjectDistributeOscurart(self, X, Y, Z):
    if len(bpy.context.selected_objects) > 1:
        # VARIABLES
        selection = bpy.context.selected_objects
        dif = selection[-1].location - selection[0].location
        chunkglobal = dif / (len(selection) - 1)
        chunkx = 0
        chunky = 0
        chunkz = 0
        deltafst = selection[0].location

        # ORDENA
        for OBJECT in selection:
            if X:
                OBJECT.location.x = deltafst[0] + chunkx
            if Y:
                OBJECT.location[1] = deltafst[1] + chunky
            if Z:
                OBJECT.location.z = deltafst[2] + chunkz
            chunkx += chunkglobal[0]
            chunky += chunkglobal[1]
            chunkz += chunkglobal[2]
    else:
        self.report({'INFO'}, "Needs at least two selected objects")

quaeler avatar Sep 20 '21 05:09 quaeler

Thank you! it worked for blender 3.6!

jimousse avatar Aug 24 '23 23:08 jimousse