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
2a9bbe00
Commit
2a9bbe00
authored
12 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
- debug option to not apply booleans
- temp workaround for convex hull failing
parent
8c021097
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
+9
-0
9 additions, 0 deletions
object_fracture_cell/__init__.py
object_fracture_cell/fracture_cell_setup.py
+17
-3
17 additions, 3 deletions
object_fracture_cell/fracture_cell_setup.py
with
26 additions
and
3 deletions
object_fracture_cell/__init__.py
+
9
−
0
View file @
2a9bbe00
...
@@ -58,6 +58,7 @@ def main_object(scene, obj, level, **kw):
...
@@ -58,6 +58,7 @@ def main_object(scene, obj, level, **kw):
use_layer_next
=
kw_copy
.
pop
(
"
use_layer_next
"
)
use_layer_next
=
kw_copy
.
pop
(
"
use_layer_next
"
)
group_name
=
kw_copy
.
pop
(
"
group_name
"
)
group_name
=
kw_copy
.
pop
(
"
group_name
"
)
use_island_split
=
kw_copy
.
pop
(
"
use_island_split
"
)
use_island_split
=
kw_copy
.
pop
(
"
use_island_split
"
)
use_debug_bool
=
kw_copy
.
pop
(
"
use_debug_bool
"
)
from
.
import
fracture_cell_setup
from
.
import
fracture_cell_setup
...
@@ -71,6 +72,7 @@ def main_object(scene, obj, level, **kw):
...
@@ -71,6 +72,7 @@ def main_object(scene, obj, level, **kw):
objects
=
fracture_cell_setup
.
cell_fracture_objects
(
scene
,
obj
,
**
kw_copy
)
objects
=
fracture_cell_setup
.
cell_fracture_objects
(
scene
,
obj
,
**
kw_copy
)
objects
=
fracture_cell_setup
.
cell_fracture_boolean
(
scene
,
obj
,
objects
,
objects
=
fracture_cell_setup
.
cell_fracture_boolean
(
scene
,
obj
,
objects
,
use_island_split
=
use_island_split
,
use_island_split
=
use_island_split
,
use_debug_bool
=
use_debug_bool
,
use_debug_redraw
=
kw_copy
[
"
use_debug_redraw
"
])
use_debug_redraw
=
kw_copy
[
"
use_debug_redraw
"
])
# todo, split islands.
# todo, split islands.
...
@@ -315,6 +317,12 @@ class FractureCell(Operator):
...
@@ -315,6 +317,12 @@ class FractureCell(Operator):
default
=
True
,
default
=
True
,
)
)
use_debug_bool
=
BoolProperty
(
name
=
"
Debug Boolean
"
,
description
=
"
Skip applying the boolean modifier
"
,
default
=
False
,
)
def
execute
(
self
,
context
):
def
execute
(
self
,
context
):
keywords
=
self
.
as_keywords
()
# ignore=("blah",)
keywords
=
self
.
as_keywords
()
# ignore=("blah",)
...
@@ -383,6 +391,7 @@ class FractureCell(Operator):
...
@@ -383,6 +391,7 @@ class FractureCell(Operator):
rowsub
=
col
.
row
(
align
=
True
)
rowsub
=
col
.
row
(
align
=
True
)
rowsub
.
prop
(
self
,
"
use_debug_redraw
"
)
rowsub
.
prop
(
self
,
"
use_debug_redraw
"
)
rowsub
.
prop
(
self
,
"
use_debug_points
"
)
rowsub
.
prop
(
self
,
"
use_debug_points
"
)
rowsub
.
prop
(
self
,
"
use_debug_bool
"
)
#def menu_func(self, context):
#def menu_func(self, context):
# self.layout.menu("INFO_MT_add_fracture_objects", icon="PLUGIN")
# self.layout.menu("INFO_MT_add_fracture_objects", icon="PLUGIN")
...
...
This diff is collapsed.
Click to expand it.
object_fracture_cell/fracture_cell_setup.py
+
17
−
3
View file @
2a9bbe00
...
@@ -205,7 +205,21 @@ def cell_fracture_objects(scene, obj,
...
@@ -205,7 +205,21 @@ def cell_fracture_objects(scene, obj,
# create the convex hulls
# create the convex hulls
bm
=
bmesh
.
new
()
bm
=
bmesh
.
new
()
# WORKAROUND FOR CONVEX HULL BUG/LIMIT
# XXX small noise
import
random
def
R
():
return
(
random
.
random
()
-
0.5
)
*
0.01
# XXX small noise
for
i
,
co
in
enumerate
(
cell_points
):
for
i
,
co
in
enumerate
(
cell_points
):
# XXX small noise
co
.
x
+=
R
()
co
.
y
+=
R
()
co
.
z
+=
R
()
# XXX small noise
bm_vert
=
bm
.
verts
.
new
(
co
)
bm_vert
=
bm
.
verts
.
new
(
co
)
bm_vert
.
tag
=
True
bm_vert
.
tag
=
True
...
@@ -291,7 +305,7 @@ def cell_fracture_objects(scene, obj,
...
@@ -291,7 +305,7 @@ def cell_fracture_objects(scene, obj,
def
cell_fracture_boolean
(
scene
,
obj
,
objects
,
def
cell_fracture_boolean
(
scene
,
obj
,
objects
,
apply
=
Tru
e
,
use_debug_bool
=
Fals
e
,
clean
=
True
,
clean
=
True
,
use_island_split
=
False
,
use_island_split
=
False
,
use_debug_redraw
=
False
,
use_debug_redraw
=
False
,
...
@@ -304,7 +318,7 @@ def cell_fracture_boolean(scene, obj, objects,
...
@@ -304,7 +318,7 @@ def cell_fracture_boolean(scene, obj, objects,
mod
.
object
=
obj
mod
.
object
=
obj
mod
.
operation
=
'
INTERSECT
'
mod
.
operation
=
'
INTERSECT
'
if
apply
:
if
not
use_debug_bool
:
mesh_new
=
obj_cell
.
to_mesh
(
scene
,
mesh_new
=
obj_cell
.
to_mesh
(
scene
,
apply_modifiers
=
True
,
apply_modifiers
=
True
,
settings
=
'
PREVIEW
'
)
settings
=
'
PREVIEW
'
)
...
@@ -346,7 +360,7 @@ def cell_fracture_boolean(scene, obj, objects,
...
@@ -346,7 +360,7 @@ def cell_fracture_boolean(scene, obj, objects,
if
use_debug_redraw
:
if
use_debug_redraw
:
_redraw_yasiamevil
()
_redraw_yasiamevil
()
if
apply
and
use_island_split
:
if
(
not
use_debug_bool
)
and
use_island_split
:
# this is ugly and Im not proud of this - campbell
# this is ugly and Im not proud of this - campbell
objects_islands
=
[]
objects_islands
=
[]
for
obj_cell
in
objects_boolean
:
for
obj_cell
in
objects_boolean
:
...
...
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