1
$\begingroup$

Is there any way that I can duplicate children of other objects without automatically parenting it?

I mean, Each time after duplicating child objects (more often when making helper bones in a rig), it seems I have to manually clear the parent after that. So I wonder if there is any existing operation for that. Thanks!

$\endgroup$
2
  • $\begingroup$ Well, if you say so... :P Just wondering if I missed any "awesome hidden undocumented" tricks. Something like to copy full rna path by a new introduced shortcut v.s. by manually typing. Hmm, if there isn't, probably I should talk to devs like Campbell directly as a small feature request. (not on SE for sure) Maybe by Shift Alt D to duplicate without auto-parenting, something like that. Is THAT convenient enough? ;) But before that, I have to make sure it isn't an existing operation. $\endgroup$ Dec 1, 2015 at 15:09
  • $\begingroup$ it probably makes sense to have a dedicated operator built in, but the docs don't show any exist at the moment. $\endgroup$
    – zeffii
    Dec 1, 2015 at 15:17

2 Answers 2

2
$\begingroup$

While there is no built-in solution other than multiple keystrokes, an addon can easily add this.

This small script adds a "Duplicate without parenting" operator and connects it to the shortcut ⇧ Shift⎇ AltD This is available in object and armature edit modes.

import bpy

bl_info = {
    "name": "Duplicate object(s) without parenting",
    "author": "sambler",
    "version": (1,0),
    "blender": (2, 65, 0),
    "location": "Shift-Alt-D",
    "description": "Duplicate selected objects or bones without copying the parent connection",
    "warning": "",
    "wiki_url": "https://github.com/sambler/addonsByMe/blob/master/duplicate_without_parent.py",
    "tracker_url": "https://github.com/sambler/addonsByMe/issues",
    "category": "Object",
}

class DuplicateWithoutParent(bpy.types.Operator):
    """Duplicate selection without parenting"""
    bl_idname = "object.duplicate_no_parent"
    bl_label = "Duplicate without parenting"

    @classmethod
    def poll(cls, context):
        return context.active_object is not None

    def execute(self, context):
        if context.active_object.type == 'ARMATURE' and context.active_object.mode == 'EDIT':
            bpy.ops.armature.duplicate()
            for b in context.selected_bones:
                b.parent = None
        else:
            bpy.ops.object.duplicate()
            bpy.ops.object.parent_clear(type='CLEAR')
        return bpy.ops.transform.translate('INVOKE_DEFAULT')

addon_keymaps = []

def register():
    bpy.utils.register_module(__name__)

    if bpy.app.background: return

    wm = bpy.context.window_manager
    kc = wm.keyconfigs.addon
    if kc:
        km = kc.keymaps.new('Armature', space_type='EMPTY')
        kmi = km.keymap_items.new(DuplicateWithoutParent.bl_idname, 'D', 'PRESS', alt=True, shift=True)
        addon_keymaps.append((km, kmi))

        km = kc.keymaps.new('Object Mode', space_type='EMPTY')
        kmi = km.keymap_items.new(DuplicateWithoutParent.bl_idname, 'D', 'PRESS', alt=True, shift=True)
        addon_keymaps.append((km, kmi))

def unregister():
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()

    bpy.utils.unregister_module(__name__)

if __name__ == "__main__":
    register()
$\endgroup$
1
  • $\begingroup$ Yes, it does work for bones in Edit mode. Now it seems the moment to make my choice. :) $\endgroup$ Dec 2, 2015 at 14:36
1
$\begingroup$

Operating on mesh objects, one very simple way is to select the children and copy/paste it. Just CTRLC and CTRLV.

$\endgroup$
1
  • $\begingroup$ You are right about these two shortcuts, however, as you said, it's just for non-bone objects. :( $\endgroup$ Dec 1, 2015 at 14:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .