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
e27ec695
Commit
e27ec695
authored
5 years ago
by
Mikhail Rachinskiy
Browse files
Options
Downloads
Patches
Plain Diff
Bool Tool: Fix T66514 slice tool support for local view
parent
05dc8caa
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
object_boolean_tools.py
+20
-5
20 additions, 5 deletions
object_boolean_tools.py
with
20 additions
and
5 deletions
object_boolean_tools.py
+
20
−
5
View file @
e27ec695
...
...
@@ -116,10 +116,10 @@ def ConvertToMesh(obj):
# Do the Union, Difference and Intersection Operations with a Brush
def
Operation
(
context
,
_operation
):
prefs
=
bpy
.
context
.
preferences
.
addons
[
__name__
].
preferences
prefs
=
context
.
preferences
.
addons
[
__name__
].
preferences
useWire
=
prefs
.
use_wire
for
selObj
in
bpy
.
context
.
selected_objects
:
for
selObj
in
context
.
selected_objects
:
if
(
selObj
!=
context
.
active_object
and
(
selObj
.
type
==
"
MESH
"
or
selObj
.
type
==
"
CURVE
"
)
...
...
@@ -140,17 +140,26 @@ def Operation(context, _operation):
cyclesVis
.
glossy
=
False
cyclesVis
.
shadow
=
False
cyclesVis
.
transmission
=
False
if
_operation
==
"
SLICE
"
:
# copies instance_collection property(empty), but group property is empty (users_group = None)
clone
=
context
.
active_object
.
copy
()
# clone.select_set(state=True)
clone
=
actObj
.
copy
()
context
.
collection
.
objects
.
link
(
clone
)
space_data
=
context
.
space_data
is_local_view
=
bool
(
space_data
.
local_view
)
if
is_local_view
:
clone
.
local_view_set
(
space_data
,
True
)
sliceMod
=
clone
.
modifiers
.
new
(
"
BTool_
"
+
selObj
.
name
,
"
BOOLEAN
"
)
# add mod to clone obj
sliceMod
.
object
=
selObj
sliceMod
.
operation
=
"
DIFFERENCE
"
clone
[
"
BoolToolRoot
"
]
=
True
newMod
=
actObj
.
modifiers
.
new
(
"
BTool_
"
+
selObj
.
name
,
"
BOOLEAN
"
)
newMod
.
object
=
selObj
if
_operation
==
"
SLICE
"
:
newMod
.
operation
=
"
INTERSECT
"
else
:
...
...
@@ -645,8 +654,14 @@ class OBJECT_OT_BoolTool_Auto_Slice(Operator, Auto_Boolean):
obj_copy
.
data
=
obj
.
data
.
copy
()
context
.
collection
.
objects
.
link
(
obj_copy
)
space_data
=
context
.
space_data
is_local_view
=
bool
(
space_data
.
local_view
)
if
is_local_view
:
obj_copy
.
local_view_set
(
space_data
,
True
)
self
.
boolean_mod
(
obj
,
ob
,
"
DIFFERENCE
"
,
ob_delete
=
False
)
bpy
.
context
.
view_layer
.
objects
.
active
=
obj_copy
context
.
view_layer
.
objects
.
active
=
obj_copy
self
.
boolean_mod
(
obj_copy
,
ob
,
"
INTERSECT
"
)
obj_copy
.
select_set
(
state
=
True
)
...
...
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