oscurart / Blender-28-Addons

Blender 2.8 addons
102 stars 11 forks source link

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

Open AlexLuya opened 3 years ago

AlexLuya commented 3 years ago

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

oscurart commented 3 years ago

Try to use the last blender version.

Remember open the oscurart list in the properties menu.

image

arminhupka commented 3 years ago

No longer works with v2.93

oscurart commented 3 years ago

No longer works with v2.93

yes. Only for builder version.

quaeler commented 2 years ago

@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")
jimousse commented 1 year ago

Thank you! it worked for blender 3.6!