Last active
May 14, 2024 03:29
-
-
Save Fweeb/bb61c15139bff338cb17 to your computer and use it in GitHub Desktop.
Blender add-on for exposing the 3D View's rotation locking feature
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
# ***** 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 LICENCE BLOCK ***** | |
bl_info = { | |
"name": "Lock View", | |
"description": "Exposes rotation locking in the 3D View to a specific viewing angle", | |
"author": "Jason van Gumster (Fweeb)", | |
"version": (1, 0, 1), | |
"blender": (3, 0, 0), | |
"location": "3D View > Properties Region > View", | |
"warning": "", | |
"wiki_url": "", | |
"tracker_url": "", | |
"category": "3D View"} | |
import bpy | |
def lock_ui(self, context): | |
layout = self.layout | |
layout.prop(context.space_data.region_3d, 'lock_rotation', text='Lock View Rotation') | |
def register(): | |
bpy.types.VIEW3D_PT_view3d_properties.append(lock_ui) | |
def unregister(): | |
bpy.types.VIEW3D_PT_view3d_properties.remove(lock_ui) | |
if __name__ == "__main__": | |
register() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cool - thanks. Yes, there's definitely some workarounds! I tend to use view roll a lot when drawing in blender - there's a reason it was built into old animation light tables, and it's easily accessible in stuff like photoshop (hold R) and toon boom (hold ctrl+alt) - and you currently don't need to have a camera for it to work, but of course it gets disabled by view lock. There's a request to add this as core functionality but these things can take a while! https://blender.community/c/rightclickselect/q2cbbc/?sorting=hot