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
d4b41a54
Commit
d4b41a54
authored
7 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
Fix development_edit_operator for changes in master
parent
4c037a84
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
development_edit_operator.py
+24
-21
24 additions, 21 deletions
development_edit_operator.py
with
24 additions
and
21 deletions
development_edit_operator.py
+
24
−
21
View file @
d4b41a54
...
...
@@ -39,35 +39,38 @@ from bpy.types import (
from
bpy.props
import
EnumProperty
def
get
clazz
(
opname
):
def
get
_py_class_from_op
(
opname
):
opid
=
opname
.
split
(
"
.
"
)
opmod
=
getattr
(
bpy
.
ops
,
opid
[
0
])
op
=
getattr
(
opmod
,
opid
[
1
])
id
=
op
.
get_rna
().
bl_rna
.
identifier
clazz
=
getattr
(
bpy
.
types
,
id
)
return
clazz
# C operators won't be added
return
getattr
(
bpy
.
types
,
id
,
None
)
def
getmodule
(
opname
):
addon
=
True
clazz
=
getclazz
(
opname
)
modn
=
clazz
.
__module__
try
:
line
=
inspect
.
getsourcelines
(
clazz
)[
1
]
except
IOError
:
line
=
-
1
except
TypeError
:
cls
=
get_py_class_from_op
(
opname
)
if
cls
is
None
:
addon
=
False
line
=
-
1
if
modn
==
'
bpy.types
'
:
mod
=
'
C operator
'
addon
=
False
elif
modn
!=
'
__main__
'
:
mod
=
sys
.
modules
[
modn
].
__file__
else
:
addon
=
False
mod
=
modn
addon
=
True
mod_name
=
cls
.
__module__
try
:
line
=
inspect
.
getsourcelines
(
cls
)[
1
]
except
IOError
:
line
=
-
1
except
TypeError
:
line
=
-
1
if
mod_name
==
'
bpy.types
'
:
addon
=
False
elif
mod_name
!=
'
__main__
'
:
mod
=
sys
.
modules
[
mod_name
].
__file__
else
:
addon
=
False
mod
=
mod_name
return
mod
,
line
,
addon
...
...
@@ -80,8 +83,8 @@ def get_ops():
opmoddir
=
dir
(
opmod
)
for
o
in
opmoddir
:
name
=
opmodname
+
"
.
"
+
o
cl
azz
=
get
clazz
(
name
)
if
(
cl
azz
.
__module__
!=
'
bpy.types
'
)
:
cl
s
=
get
_py_class_from_op
(
name
)
if
cl
s
is
not
None
:
allops
.
append
(
name
)
del
opmoddir
...
...
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