Last active
December 1, 2015 20:19
-
-
Save zeffii/88499a79a078a9cccbc6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
class DuplicateAndUnparent(bpy.types.Operator): | |
"""Tooltip""" | |
bl_idname = "object.duplicate_and_unparent" | |
bl_label = "Duplicate And Unparent" | |
@classmethod | |
def poll(cls, context): | |
return context.active_object is not None | |
def execute(self, context): | |
bpy.ops.object.duplicate_move() | |
bpy.ops.object.parent_clear(type='CLEAR') | |
bpy.ops.transform.translate('INVOKE_DEFAULT') | |
return {'FINISHED'} | |
def register(): | |
bpy.utils.register_module(__name__) | |
def unregister(): | |
bpy.utils.unregister_module(__name__) | |
if __name__ == "__main__": | |
register() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment