Joining objects should work also in the Outliner

Another day, another round of functionalities that should be ported from the 3D View to the Outliner. There are instances where with a large number of objects to join it’s easier to select them via the Outliner, and it would be extremely handy to have both the context menu entry and the Ctrl+J shortcut to work there.

join

4 Likes

Hi,
try this addon, it simply adds join and separate operators to outliner.

Outliner_Join_Separate.py
# ##### BEGIN GPL LICENSE BLOCK #####
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License
#  as published by the Free Software Foundation; either version 2
#  of the License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software Foundation,
#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####

# Add-on info
bl_info = {
    "name": "Join/Separate Objects",
    "author": "APEC",
    "version": (0, 1, 0),
    "blender": (2, 93, 0),
    "location": "Outliner - Mesh Objects",
    "description": "Adds menu entries for Mesh Objects selected to Join/Separate", 
    "doc_url": "",
    "tracker_url": "",      
    "category": "Outliner"
}

import bpy
from bpy.types import Operator

class OUTLINER_OT_join(Operator):    
    bl_idname = "outliner.join"
    bl_label = "Objects Join"
    bl_description = "Join Objects"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        bpy.ops.object.join()
        return {'FINISHED'} 


class OUTLINER_OT_separate(Operator):    
    bl_idname = "outliner.separate"
    bl_label = "Objects Separate"
    bl_description = "Separate Objects by Loose parts"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        bpy.ops.mesh.separate(type='LOOSE')        
        return {'FINISHED'}    
    
###########################################################################################
#####################################    UI    ############################################
########################################################################################### 

def menu_outliner_join_separate(self, context):    
    ob = bpy.context.object
    if ob is not None and ob.type == 'MESH':
        layout = self.layout
        layout.separator()
        layout.operator(OUTLINER_OT_join.bl_idname)
        layout.operator(OUTLINER_OT_separate.bl_idname)
        
###########################################################################################
##################################### Register ############################################
########################################################################################### 	

def register():
    bpy.utils.register_class(OUTLINER_OT_join)
    bpy.utils.register_class(OUTLINER_OT_separate)
    bpy.types.OUTLINER_MT_object.append(menu_outliner_join_separate)
    
def unregister():
    bpy.utils.unregister_class(OUTLINER_OT_join)
    bpy.utils.unregister_class(OUTLINER_OT_separate)
    bpy.types.OUTLINER_MT_object.remove(menu_outliner_join_separate)
    
if __name__ == "__main__":
    register()

or add a keymap for outliner

2 Likes

OMG man thanks, I’ve seen you before, you’re giving out Outliner addons around the community ahahahah. Thanks a lot, but it’s a shame that these simple functionalities are not in master. Being able to select multiple hierarchies, duplicate them etc. it’s something that should really be tackled here.