Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
c4c3c124
Commit
c4c3c124
authored
15 years ago
by
Brendon Murphy
Browse files
Options
Downloads
Patches
Plain Diff
added 3d cursor menu to trunk
[[Split portion of a mixed commit.]]
parent
fe8c7b6e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
3D_Cursor_Menu-2_5.py
+135
-0
135 additions, 0 deletions
3D_Cursor_Menu-2_5.py
with
135 additions
and
0 deletions
3D_Cursor_Menu-2_5.py
0 → 100644
+
135
−
0
View file @
c4c3c124
#3d_cursor_menu.py (c) 2010 Jonathan Smith (JayDez)
#Original Script by: Mariano Hidalgo (uselessdreamer)
#contributed to by: Crouch
#
#Tested with r27424
#
# ##### 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 LICENSE BLOCK #####
bl_addon_info
=
{
'
name
'
:
'
3d View: Cursor Menu
'
,
'
author
'
:
'
JayDez
'
,
'
version
'
:
'
2.4
'
,
'
blender
'
:
'
2.5.3
'
,
'
location
'
:
'
View3D > Mouse > Menu
'
,
'
url
'
:
'
http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/3d_Cursor_Menu
'
,
'
category
'
:
'
3d View
'
}
"""
Name:
'
3D Cursor Menu
'
Blender: 250
Group:
'
View3D
'
"""
__author__
=
[
"
Jonathan Smith (JayDez)
"
]
__version__
=
'
2.3
'
__url__
=
[
"
http://blenderartists.org/forum/showthread.php?p=1589350
"
]
__bpydoc__
=
"""
3D Cursor Menu
This adds a 3D Cursor Menu in the 3DView.
Usage:
Enable in
"
user preferences>addons>3d_cursor_menu
"
.
Right click in an empty space in the 3D View(that means nothing
selectable is there). If your select mouse is set to left then left
click in the 3D View.
Choose your function from the menu.
Version history:
v2.42 = (JayDez) - Added url for tech support.
v2.41 - (JayDez) - Cleaned up bpydoc, added underscores in the name.
v2.4 - (JayDez) - Added bpydoc as well as changing to click only
(instead of double click).
v2.3 - (JayDez) - Added revert_pivot() which allows you to change
pivot point back to normal(which right now is median point).
v2.2 - (Crouch) - Fix in register function, fix with random quotation
mark which crashed script.
v2.1 - (Crouch) - added unregister() and set pivot point to cursor.
v2.0 - (JayDez) - 2.5 script (initial revision)
v1.0 - Original 2.49 script
"""
import
bpy
from
bpy
import
*
class
pivot_cursor
(
bpy
.
types
.
Operator
):
bl_idname
=
"
view3d.pivot_cursor
"
bl_label
=
"
Cursor as Pivot Point
"
def
poll
(
self
,
context
):
return
bpy
.
context
.
space_data
.
pivot_point
!=
'
CURSOR
'
def
execute
(
self
,
context
):
bpy
.
context
.
space_data
.
pivot_point
=
'
CURSOR
'
return
{
'
FINISHED
'
}
class
revert_pivot
(
bpy
.
types
.
Operator
):
bl_idname
=
"
view3d.revert_pivot
"
bl_label
=
"
Reverts Pivot Point to median
"
def
poll
(
self
,
context
):
return
bpy
.
context
.
space_data
.
pivot_point
!=
'
MEDIAN_POINT
'
def
execute
(
self
,
context
):
bpy
.
context
.
space_data
.
pivot_point
=
'
MEDIAN_POINT
'
#change this to 'BOUDNING_BOX_CENTER' if needed...
return
{
'
FINISHED
'
}
class
VIEW3D_MT_3D_Cursor_Menu
(
bpy
.
types
.
Menu
):
bl_label
=
"
3D Cursor Menu
"
def
draw
(
self
,
context
):
layout
=
self
.
layout
layout
.
operator
(
"
view3d.snap_cursor_to_center
"
,
text
=
"
Snap Cursor to Center
"
)
layout
.
operator
(
"
view3d.snap_cursor_to_grid
"
,
text
=
"
Snap Cursor to Grid
"
)
layout
.
operator
(
"
view3d.snap_cursor_to_selected
"
,
text
=
"
Snap Cursor to Selected
"
)
layout
.
operator
(
"
view3d.snap_selected_to_cursor
"
,
text
=
"
Snap Selected to Cursor
"
)
layout
.
separator
()
layout
.
operator
(
"
view3d.pivot_cursor
"
,
text
=
"
Set Cursor as Pivot Point
"
)
layout
.
operator
(
"
view3d.revert_pivot
"
,
text
=
"
Revert Pivot Point
"
)
def
register
():
bpy
.
types
.
register
(
VIEW3D_MT_3D_Cursor_Menu
)
bpy
.
types
.
register
(
pivot_cursor
)
bpy
.
types
.
register
(
revert_pivot
)
km
=
bpy
.
context
.
manager
.
active_keyconfig
.
keymaps
[
'
3D View
'
]
kmi
=
km
.
add_item
(
'
wm.call_menu
'
,
'
SELECTMOUSE
'
,
'
CLICK
'
)
kmi
.
properties
.
name
=
"
VIEW3D_MT_3D_Cursor_Menu
"
def
unregister
():
bpy
.
types
.
unregister
(
VIEW3D_MT_3D_Cursor_Menu
)
bpy
.
types
.
unregister
(
pivot_cursor
)
bpy
.
types
.
unregister
(
revert_pivot
)
km
=
bpy
.
context
.
manager
.
active_keyconfig
.
keymaps
[
'
3D View
'
]
for
kmi
in
km
.
items
:
if
kmi
.
idname
==
'
wm.call_menu
'
:
if
kmi
.
properties
.
name
==
"
VIEW3D_MT_3D_Cursor_Menu
"
:
km
.
remove_item
(
kmi
)
break
if
__name__
==
"
__main__
"
:
register
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment