Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons-contrib
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-contrib
Commits
b718e725
Commit
b718e725
authored
14 years ago
by
Michael Williamson
Browse files
Options
Downloads
Patches
Plain Diff
Updated for api changes. Npot sure when it broke but it works with r33907
parent
f54a6a05
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
space_view3d_manipulator_Menu.py
+21
-34
21 additions, 34 deletions
space_view3d_manipulator_Menu.py
with
21 additions
and
34 deletions
space_view3d_manipulator_Menu.py
+
21
−
34
View file @
b718e725
...
@@ -25,7 +25,7 @@ bl_addon_info = {
...
@@ -25,7 +25,7 @@ bl_addon_info = {
'
author
'
:
'
MichaelW
'
,
'
author
'
:
'
MichaelW
'
,
'
version
'
:
(
1
,),
'
version
'
:
(
1
,),
'
blender
'
:
(
2
,
5
,
3
),
'
blender
'
:
(
2
,
5
,
3
),
'
api
'
:
3
166
7
,
'
api
'
:
3
390
7
,
'
location
'
:
'
View3D > Ctrl Space
'
,
'
location
'
:
'
View3D > Ctrl Space
'
,
'
description
'
:
'
Menu to change the manipulator type and/or disable it
'
,
'
description
'
:
'
Menu to change the manipulator type and/or disable it
'
,
'
wiki_url
'
:
'
http://wiki.blender.org/index.php/Extensions:2.5/Py/
'
\
'
wiki_url
'
:
'
http://wiki.blender.org/index.php/Extensions:2.5/Py/
'
\
...
@@ -37,7 +37,8 @@ bl_addon_info = {
...
@@ -37,7 +37,8 @@ bl_addon_info = {
"
Add manipulator menu (Ctrl-space in 3d view)
"
"
Add manipulator menu (Ctrl-space in 3d view)
"
"""
"""
This adds a the Dynamic Menu in the 3DView.
This adds a popup menu to change the manipulator mode.
to move, rotate, scale or combo like in 2.49
Usage:
Usage:
* Ctrl Space in the 3d view
* Ctrl Space in the 3d view
...
@@ -48,35 +49,28 @@ Version history:
...
@@ -48,35 +49,28 @@ Version history:
V1(MichaelW) initial port form 2.49
V1(MichaelW) initial port form 2.49
"""
"""
import
bpy
import
bpy
def
main
(
context
):
def
main
(
context
):
bpy
.
context
.
space_data
.
show_manipulator
=
False
bpy
.
context
.
space_data
.
manipulator
=
False
class
VIEW3D_OT_disable_manipulator
(
bpy
.
types
.
Operator
):
''''''
bl_idname
=
"
VIEW3D_OT_disable_manipulator
"
bl_label
=
"
disable manipulator
"
@classmethod
def
poll
(
cls
,
context
):
return
context
.
active_object
!=
None
def
execute
(
self
,
context
):
main
(
context
)
return
{
'
FINISHED
'
}
#class VIEW3D_OT_disable_manipulator(bpy.types.Operator):
# ''''''
# bl_idname = "VIEW3D_OT_disable_manipulator"
# bl_label = "disable manipulator"
#
# def poll(self, context):
# return context.active_object != None
#
# def execute(self, context):
# main(context)
# return {'FINISHED'}
#
class
VIEW3D_MT_ManipulatorMenu
(
bpy
.
types
.
Menu
):
class
VIEW3D_MT_ManipulatorMenu
(
bpy
.
types
.
Menu
):
''''''
bl_label
=
"
ManipulatorType
"
bl_label
=
"
ManipulatorType
"
@classmethod
def
poll
(
cls
,
context
):
return
context
.
space_data
.
type
==
'
VIEW_3D
'
def
draw
(
self
,
context
):
def
draw
(
self
,
context
):
layout
=
self
.
layout
layout
=
self
.
layout
layout
.
operator_context
=
'
INVOKE_REGION_WIN
'
layout
.
operator_context
=
'
INVOKE_REGION_WIN
'
...
@@ -99,27 +93,20 @@ class VIEW3D_MT_ManipulatorMenu(bpy.types.Menu):
...
@@ -99,27 +93,20 @@ class VIEW3D_MT_ManipulatorMenu(bpy.types.Menu):
prop
.
translate
=
True
prop
.
translate
=
True
layout
.
separator
()
layout
.
separator
()
if
not
bpy
.
context
.
space_data
.
show_manipulator
:
bpy
.
context
.
space_data
.
show_manipulator
=
True
layout
.
operator
(
"
view3d.disable_manipulator
"
,
text
=
'
Disable
'
,
icon
=
'
MANIPUL
'
)
layout
.
separator
()
bpy
.
context
.
space_data
.
show_manipulator
=
True
# layout.operator("view3d.disable_manipulator",text ='Disable', icon='MANIPUL')
# layout.separator()
def
register
():
def
register
():
km
=
bpy
.
context
.
window_manager
.
keyconfigs
.
default
.
keymaps
[
'
3D View
'
]
km
=
bpy
.
context
.
window_manager
.
keyconfigs
.
default
.
keymaps
[
'
3D View Generic
'
]
for
kmi
in
km
.
items
:
if
kmi
.
idname
==
'
wm.context_toggle
'
:
if
kmi
.
ctrl
and
not
kmi
.
shift
and
not
kmi
.
alt
and
kmi
.
value
==
"
PRESS
"
:
if
kmi
.
type
==
"
SPACE
"
:
km
.
items
.
remove
(
kmi
)
break
kmi
=
km
.
items
.
new
(
'
wm.call_menu
'
,
'
SPACE
'
,
'
PRESS
'
,
ctrl
=
True
)
kmi
=
km
.
items
.
new
(
'
wm.call_menu
'
,
'
SPACE
'
,
'
PRESS
'
,
ctrl
=
True
)
kmi
.
properties
.
name
=
"
VIEW3D_MT_ManipulatorMenu
"
kmi
.
properties
.
name
=
"
VIEW3D_MT_ManipulatorMenu
"
def
unregister
():
def
unregister
():
km
=
bpy
.
context
.
window_manager
.
keyconfigs
.
default
.
keymaps
[
'
3D View
'
]
for
kmi
in
km
.
items
:
for
kmi
in
km
.
items
:
if
kmi
.
idname
==
'
wm.call_menu
'
:
if
kmi
.
idname
==
'
wm.call_menu
'
:
if
kmi
.
properties
.
name
==
"
VIEW3D_MT_ManipulatorMenu
"
:
if
kmi
.
properties
.
name
==
"
VIEW3D_MT_ManipulatorMenu
"
:
...
...
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