Is there a reason that there can be a selection with no active object?

I’ve noticed that it’s possible in Blender to select objects but not have an active object. For example, box selecting, or using select all merely adds objects to the selection, but without an active object many group operations (join, for example) cannot be performed because they require an object to join to. I realise that it’s trivial to just click on an object, but is there a reason that box select or select all do not assign an active object if there is not one already, and also, is there a reason the active object can be active, but not selected (possible if you manually deselect the active object with shift+click)? You also cannot easily clear the active object when there is one other than by deleting it.

This doesn’t cause me a lot of trouble, but occasionally I’ll notice Blender failed to perform an operation because I didn’t have an active object. It seems like it’s either a weird design choice, or a bug, and I’m not sure whether I should report it as a bug or ask for a feature on right click select.

Anyone know why it’s this way? Personally I prefer the active object to just be the last object in the selection, and if it is deselected, just make the active object the next last selected, or just another object in the selection. At the very least, setting the active object on box select/select all when there isn’t one would be an improvement.

the last selected object becomes the active object
but it can be unselected afterward

box select or all select don’t change the active object
just adds ob’s to selected list
active is the last selected ob!

active is also saved with file as parameter

happy bl

Thanks, I’ve noticed this behaviour, but I was just wondering what the reason for being able to have a selection with no active object is. Maybe it’s not a big deal, but as I said, I do find it a bit strange that you can box select a bunch of objects and upon trying to group them it will fail because box select doesn’t assign an active object.

There are ways to clear the active object, but it’s not something you can do easily; You could delete the object, or remove the active object in python.

grouping works fine with box select
not certain what your are doing !

active ob is always the last selected object
but object can be de selected which does not change the active object
only list of selected object!

active object is needed for many modifier !

happy bl

I reported this issue as a bug a while back.
https://developer.blender.org/T68975
There can be issues caused by a lack of active object.
The collections bug was fixed though.

1 Like

are you in 2.8 or 2.79 ?
I did group test in 2.79

I mean group / layers don’t exist in 2.8
replace by collection
so not the same things

happy bl

When I import xfrog trees into Blender as objs they generally come in as separate objects - trunk, branch, etc, and all are selected but none is active. I can transform (usually scale and maybe apply transorms) but to join into a single object I have to shift-click on one component and Ctrl-J

That would be normal behaviour. Blender needs to know which object to join to.
for example when joining blender needs to know:
where will the new objects centre be,
what is the scale and rotation,
what to do with modifiers,

so it needs an active object to take this info and more from when joining meshes.

I think most people still use the jargon of group and layers in 2.8, Although not technically correct. I wouldn’t take the fact someone says ‘group’ to mean they are talking about pre 2.8.

pressing ctrl+g creates a collection not visible in the view layer and so closely mirrors the old function of groups it isn’t surprising people still say groups.

It’s a design choice, not a bug.

I agree with this. I was actually writing a python add-on to implement this sort of behavior (always having an active object, and basing it on selection order including box select, copy/paste, and duplicate) and I even had some pretty nice logic for persistently tracking object order, but then I ran into problems with Blender’s… “special”… undo system that breaks object memory references whenever you undo/redo.

I abandoned it because without being able to keep a persistent history of selection and deselection that survives through undo and redo it’s not worth anything. Maybe I’ll try going back to the add-on at a later time; I haven’t tried using pointer properties yet which I’ve heard might survive through undo/redo.

but if you do a box select how do you define which ob is the last selected ?
and what do you do if you have some addon that try to define an active object or do some other selection ?

not easy to find a single solution

happy bl

I see what you mean, and perhaps it is not an easy thing to find a very clean solution to, but typically that would be handled by using the object that appears first in the scene hierarchy, although this may not be apparent to the user. The active object can then be changed manually by clicking on other objects in the selection, but at least there is an active object so that if the user quickly selects some objects using box select and tries to join them, it will always work.

You can also make the same thing happen by hiding the active object and then using select all or box select. In this case, if you try to join the objects you don’t even get an error because the hidden object is still the active object. Even if the user clicks on empty space and makes another selection box, the issue will persist until they actually click on a single object.

Personally I don’t mind an error message. But there have been some cases where nothing happens.
If an error message appeared saying something like “please define a visible active object”. If you check the link I posted earlier there is still some work being done regarding the underlying way blender deals with active objects. so it is a known issue that is being looked at.

1 Like

I was planning on using the last object in the hierarchy (from the set of items added in the box selection), but yes using the object hierarchy order is how you’d do it. I believe this is how Maya chooses which object to set as the active object when you box select, for example.