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
019fcd6a
Commit
019fcd6a
authored
12 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
add interior vertex group option.
parent
65695887
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
object_fracture_cell/__init__.py
+1
-1
1 addition, 1 deletion
object_fracture_cell/__init__.py
object_fracture_cell/fracture_cell_setup.py
+29
-0
29 additions, 0 deletions
object_fracture_cell/fracture_cell_setup.py
with
30 additions
and
1 deletion
object_fracture_cell/__init__.py
+
1
−
1
View file @
019fcd6a
...
@@ -392,7 +392,7 @@ class FractureCell(Operator):
...
@@ -392,7 +392,7 @@ class FractureCell(Operator):
rowsub
.
prop
(
self
,
"
use_smooth_faces
"
)
rowsub
.
prop
(
self
,
"
use_smooth_faces
"
)
rowsub
.
prop
(
self
,
"
use_smooth_edges
"
)
rowsub
.
prop
(
self
,
"
use_smooth_edges
"
)
rowsub
.
prop
(
self
,
"
use_data_match
"
)
rowsub
.
prop
(
self
,
"
use_data_match
"
)
#
rowsub.prop(self, "use_interior_vgroup")
rowsub
.
prop
(
self
,
"
use_interior_vgroup
"
)
rowsub
.
prop
(
self
,
"
material_index
"
)
rowsub
.
prop
(
self
,
"
material_index
"
)
rowsub
=
col
.
row
()
rowsub
=
col
.
row
()
# could be own section, control how we subdiv
# could be own section, control how we subdiv
...
...
This diff is collapsed.
Click to expand it.
object_fracture_cell/fracture_cell_setup.py
+
29
−
0
View file @
019fcd6a
...
@@ -324,6 +324,9 @@ def cell_fracture_boolean(scene, obj, objects,
...
@@ -324,6 +324,9 @@ def cell_fracture_boolean(scene, obj, objects,
):
):
objects_boolean
=
[]
objects_boolean
=
[]
if
use_interior_vgroup
:
obj
.
data
.
polygons
.
foreach_set
(
"
hide
"
,
[
False
]
*
len
(
obj
.
data
.
polygons
))
for
obj_cell
in
objects
:
for
obj_cell
in
objects
:
mod
=
obj_cell
.
modifiers
.
new
(
name
=
"
Boolean
"
,
type
=
'
BOOLEAN
'
)
mod
=
obj_cell
.
modifiers
.
new
(
name
=
"
Boolean
"
,
type
=
'
BOOLEAN
'
)
...
@@ -331,6 +334,10 @@ def cell_fracture_boolean(scene, obj, objects,
...
@@ -331,6 +334,10 @@ def cell_fracture_boolean(scene, obj, objects,
mod
.
operation
=
'
INTERSECT
'
mod
.
operation
=
'
INTERSECT
'
if
not
use_debug_bool
:
if
not
use_debug_bool
:
if
use_interior_vgroup
:
obj_cell
.
data
.
polygons
.
foreach_set
(
"
hide
"
,
[
True
]
*
len
(
obj_cell
.
data
.
polygons
))
mesh_new
=
obj_cell
.
to_mesh
(
scene
,
mesh_new
=
obj_cell
.
to_mesh
(
scene
,
apply_modifiers
=
True
,
apply_modifiers
=
True
,
settings
=
'
PREVIEW
'
)
settings
=
'
PREVIEW
'
)
...
@@ -366,6 +373,28 @@ def cell_fracture_boolean(scene, obj, objects,
...
@@ -366,6 +373,28 @@ def cell_fracture_boolean(scene, obj, objects,
bm
.
to_mesh
(
mesh_new
)
bm
.
to_mesh
(
mesh_new
)
bm
.
free
()
bm
.
free
()
if
use_interior_vgroup
and
mesh_new
:
bm
=
bmesh
.
new
()
bm
.
from_mesh
(
mesh_new
)
for
bm_vert
in
bm
.
verts
:
bm_vert
.
tag
=
True
for
bm_face
in
bm
.
faces
:
if
not
bm_face
.
hide
:
for
bm_vert
in
bm_face
.
verts
:
bm_vert
.
tag
=
False
# now add all vgroups
defvert_lay
=
bm
.
verts
.
layers
.
deform
.
verify
()
for
bm_vert
in
bm
.
verts
:
if
bm_vert
.
tag
:
bm_vert
[
defvert_lay
][
0
]
=
1.0
for
bm_face
in
bm
.
faces
:
bm_face
.
hide
=
False
bm
.
to_mesh
(
mesh_new
)
bm
.
free
()
# add a vgroup
obj_cell
.
vertex_groups
.
new
(
name
=
"
Interior
"
)
if
obj_cell
is
not
None
:
if
obj_cell
is
not
None
:
objects_boolean
.
append
(
obj_cell
)
objects_boolean
.
append
(
obj_cell
)
...
...
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