0

What is the python script to do a rip tool (V key) without moving the components after separating the components.

Danyl Bekhoucha
  • 3,722
  • 13
  • 47
  • 96
  • could you provide your .blend file with your script? Also add screenshots showing the problem. – Tak Jan 14 '17 at 12:10

1 Answers1

1
  1. Run the below script
  2. Select an edge
  3. Hit the spacebar and write "Rip Edge" as shown below

enter image description here

import bpy
bl_info = {
    "name": "Rip Edge",
    "category": "Edit",
}

class EdgeRip(bpy.types.Operator):
    """Rip Edge"""
    bl_idname = "edit.ripedge"
    bl_label = "Rip Edge"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        bpy.ops.mesh.rip('INVOKE_DEFAULT')
        return {'FINISHED'}

def register():
    bpy.utils.register_class(EdgeRip)


def unregister():
    bpy.utils.unregister_class(EdgeRip)


if __name__ == "__main__":
    register()
Tak
  • 6,293
  • 7
  • 43
  • 85
  • It doesn't work. – Danyl Bekhoucha Jan 14 '17 at 12:06
  • I have just copy/pasted your script with import bpy on top in the text editor and run the script after selecting an edge. Does it work for you? – Danyl Bekhoucha Jan 14 '17 at 12:14
  • It won't work that way, you need to put it in an operator and call this operator – Tak Jan 14 '17 at 12:37
  • @DanylBekhoucha answer updated. – Tak Jan 14 '17 at 12:54
  • Thank you for your script but i want a minimal code to integrate inside my current script. – Danyl Bekhoucha Jan 14 '17 at 15:43
  • Well, I don't know your current script, but this is the line doing what you want bpy.ops.mesh.rip('INVOKE_DEFAULT') – Tak Jan 14 '17 at 22:01
  • if i use this command the script doesn't compile. – Danyl Bekhoucha Jan 15 '17 at 15:34
  • @DanylBekhoucha Could you please accept and upvote the answer if it was helpful? – Tak Jan 26 '17 at 13:13
  • Hi, it's upvoted already but not marked as solved because i want to use one line to integrate in my current script and the one you given doesn't compile. – Danyl Bekhoucha Jan 27 '17 at 10:34
  • @DanylBekhoucha you are still facing the same problem? If so, you can share your whole script and I'll have a look – Tak Jan 27 '17 at 10:35
  • I will redo my script and use the rip tools to detach meshes based on sharp edges, refill faces and create bevel to generate stylized assets in one click for "Blender Game Tools" ( https://blenderartists.org/forum/showthread.php?383624-Dark-Blender-(Official-Thread)-optimized-for-sculpting-and-game-asset-creation&p=3133941&viewfull=1#post3133941 ). But for know this simple script doesn't compile after selecting an edge:

    import bpy

    bpy.ops.mesh.rip('INVOKE_DEFAULT')

    – Danyl Bekhoucha Jan 27 '17 at 10:43