Created
April 15, 2016 10:41
-
-
Save sweenist/072821575c445c430731a158778575bd to your computer and use it in GitHub Desktop.
Blender: A quick and easy way to disable relocation of the 3d cursor on LMB click in Blender
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
bl_info = { | |
"name": "3D Cursor LMB Toggle", | |
"author": "Ryan Sweeney", | |
"version": (1, 0), | |
"blender": (2, 75, 0), | |
"location": "View3D > Properties Panel > 3D Cursor", | |
"description": "Adds a toggle to the 3D Cursor properties tab.", | |
"warning": "", | |
"wiki_url": "http://sweenist.wordpress.com/2014/12/22/blender-add-on-3d-cursor-toggle/", | |
"category": "3D View"} | |
import bpy | |
from bpy.types import Panel | |
from bpy.props import BoolProperty | |
def draw_item(self, context): | |
wm = context.window_manager | |
keymaps = wm.keyconfigs['Blender User'].keymaps['3D View'].keymap_items | |
cursor_key = keymaps['view3d.cursor3d'] | |
layout = self.layout | |
col = layout.column() | |
col.prop(wm, "toggle_3d_key") | |
cursor_key.active = wm.toggle_3d_key | |
def register(): | |
bpy.types.VIEW3D_PT_view3d_cursor.append(draw_item) | |
bpy.types.WindowManager.toggle_3d_key = BoolProperty(name="Place with Click", description="Controls whether the 3D cursor moves on mouse click", default=True) | |
def unregister(): | |
bpy.types.VIEW3D_PT_view3d_cursor.remove(draw_item) | |
del bpy.types.WindowManager.toggle_3d_key | |
if __name__ == "__main__": | |
register() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment