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
5e69d4b4
Commit
5e69d4b4
authored
9 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
Update for changes to ray_cast/closest_point_on_mesh
parent
22830652
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_grease_scatter.py
+10
-11
10 additions, 11 deletions
object_grease_scatter.py
with
10 additions
and
11 deletions
object_grease_scatter.py
+
10
−
11
View file @
5e69d4b4
...
...
@@ -91,8 +91,8 @@ def _main(self,
DEBUG
=
False
def
fix_point
(
p
):
hit
,
no
,
ind
=
closest_point_on_mesh
(
obj_mat_inv
*
p
)
if
ind
!=
-
1
:
ok
,
hit
,
no
,
ind
=
closest_point_on_mesh
(
obj_mat_inv
*
p
)
if
ok
:
if
DEBUG
:
return
[
p
,
no
,
None
]
else
:
...
...
@@ -151,13 +151,12 @@ def _main(self,
m_alt_2
=
Matrix
.
Rotation
(
radians
(
-
22.5
),
3
,
n
)
for
_m
in
mats
:
for
m
in
(
_m
,
m_alt_1
*
_m
,
m_alt_2
*
_m
):
hit
,
nor
,
ind
=
ray
(
pofs
,
pofs
+
(
m
*
n_seek
))
if
ind
!=
-
1
:
dist
=
(
pofs
-
hit
).
length
if
dist
<
best_dist
:
best_dist
=
dist
best_nor
=
nor
#best_hit = hit
pdir
=
m
*
n_seek
ok
,
hit
,
nor
,
ind
=
ray
(
pofs
,
pdir
,
best_dist
)
if
ok
:
best_dist
=
(
pofs
-
hit
).
length
best_nor
=
nor
# best_hit = hit
if
best_nor
:
pt
[
1
].
length
=
best_dist
...
...
@@ -211,9 +210,9 @@ def _main(self,
ntmp
.
y
+=
uniform
(
-
l
,
l
)
*
RAND_LOC
ntmp
.
z
+=
uniform
(
-
l
,
l
)
*
RAND_LOC
hit
,
hit_no
,
ind
=
ray
(
vantage
,
vantage
+
ntmp
)
ok
,
hit
,
hit_no
,
ind
=
ray
(
vantage
,
ntmp
,
ntmp
.
length
)
# print(hit, hit_no)
if
ind
!=
-
1
:
if
ok
:
if
hit_no
.
angle
(
Z_UP
)
<
WALL_LIMIT
:
hits
.
append
(
hit
)
nors
.
append
(
hit_no
)
...
...
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