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
5c0205e9
Commit
5c0205e9
authored
5 years ago
by
Mikhail Rachinskiy
Browse files
Options
Downloads
Patches
Plain Diff
3D-Print: make sure all UI panels have poll method
parent
6306134a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
object_print3d_utils/operators.py
+3
-3
3 additions, 3 deletions
object_print3d_utils/operators.py
object_print3d_utils/ui.py
+5
-5
5 additions, 5 deletions
object_print3d_utils/ui.py
with
8 additions
and
8 deletions
object_print3d_utils/operators.py
+
3
−
3
View file @
5c0205e9
...
@@ -344,7 +344,7 @@ class MESH_OT_print3d_clean_distorted(Operator):
...
@@ -344,7 +344,7 @@ class MESH_OT_print3d_clean_distorted(Operator):
bl_description
=
"
Tessellate distorted faces
"
bl_description
=
"
Tessellate distorted faces
"
bl_options
=
{
'
REGISTER
'
,
'
UNDO
'
}
bl_options
=
{
'
REGISTER
'
,
'
UNDO
'
}
angle
_distort
:
FloatProperty
(
angle
:
FloatProperty
(
name
=
"
Angle
"
,
name
=
"
Angle
"
,
description
=
"
Limit for checking distorted faces
"
,
description
=
"
Limit for checking distorted faces
"
,
subtype
=
'
ANGLE
'
,
subtype
=
'
ANGLE
'
,
...
@@ -357,7 +357,7 @@ class MESH_OT_print3d_clean_distorted(Operator):
...
@@ -357,7 +357,7 @@ class MESH_OT_print3d_clean_distorted(Operator):
obj
=
context
.
active_object
obj
=
context
.
active_object
bm
=
mesh_helpers
.
bmesh_from_object
(
obj
)
bm
=
mesh_helpers
.
bmesh_from_object
(
obj
)
bm
.
normal_update
()
bm
.
normal_update
()
elems_triangulate
=
[
ele
for
ele
in
bm
.
faces
if
mesh_helpers
.
face_is_distorted
(
ele
,
self
.
angle
_distort
)]
elems_triangulate
=
[
ele
for
ele
in
bm
.
faces
if
mesh_helpers
.
face_is_distorted
(
ele
,
self
.
angle
)]
if
elems_triangulate
:
if
elems_triangulate
:
bmesh
.
ops
.
triangulate
(
bm
,
faces
=
elems_triangulate
)
bmesh
.
ops
.
triangulate
(
bm
,
faces
=
elems_triangulate
)
...
@@ -369,7 +369,7 @@ class MESH_OT_print3d_clean_distorted(Operator):
...
@@ -369,7 +369,7 @@ class MESH_OT_print3d_clean_distorted(Operator):
def
invoke
(
self
,
context
,
event
):
def
invoke
(
self
,
context
,
event
):
print_3d
=
context
.
scene
.
print_3d
print_3d
=
context
.
scene
.
print_3d
self
.
angle
_distort
=
print_3d
.
angle_distort
self
.
angle
=
print_3d
.
angle_distort
return
self
.
execute
(
context
)
return
self
.
execute
(
context
)
...
...
This diff is collapsed.
Click to expand it.
object_print3d_utils/ui.py
+
5
−
5
View file @
5c0205e9
...
@@ -31,6 +31,11 @@ class Setup:
...
@@ -31,6 +31,11 @@ class Setup:
bl_space_type
=
'
VIEW_3D
'
bl_space_type
=
'
VIEW_3D
'
bl_region_type
=
'
UI
'
bl_region_type
=
'
UI
'
@classmethod
def
poll
(
cls
,
context
):
obj
=
context
.
active_object
return
obj
is
not
None
and
obj
.
type
==
'
MESH
'
and
obj
.
mode
in
{
'
OBJECT
'
,
'
EDIT
'
}
class
VIEW3D_PT_print3d_analyze
(
Panel
,
Setup
):
class
VIEW3D_PT_print3d_analyze
(
Panel
,
Setup
):
bl_label
=
"
Analyze
"
bl_label
=
"
Analyze
"
...
@@ -41,11 +46,6 @@ class VIEW3D_PT_print3d_analyze(Panel, Setup):
...
@@ -41,11 +46,6 @@ class VIEW3D_PT_print3d_analyze(Panel, Setup):
bmesh
.
types
.
BMFace
:
'
FACESEL
'
,
bmesh
.
types
.
BMFace
:
'
FACESEL
'
,
}
}
@classmethod
def
poll
(
cls
,
context
):
obj
=
context
.
active_object
return
obj
is
not
None
and
obj
.
type
==
'
MESH
'
and
obj
.
mode
in
{
'
OBJECT
'
,
'
EDIT
'
}
def
draw_report
(
self
,
context
):
def
draw_report
(
self
,
context
):
layout
=
self
.
layout
layout
=
self
.
layout
info
=
report
.
info
()
info
=
report
.
info
()
...
...
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