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
1113b9f1
Commit
1113b9f1
authored
13 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
fix [#26895] STL import in Win 7 64bit
parent
9a3d7980
No related branches found
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
io_mesh_stl/__init__.py
+8
-2
8 additions, 2 deletions
io_mesh_stl/__init__.py
io_mesh_stl/blender_utils.py
+6
-3
6 additions, 3 deletions
io_mesh_stl/blender_utils.py
with
14 additions
and
5 deletions
io_mesh_stl/__init__.py
+
8
−
2
View file @
1113b9f1
...
@@ -77,7 +77,7 @@ class ImportSTL(bpy.types.Operator, ImportHelper):
...
@@ -77,7 +77,7 @@ class ImportSTL(bpy.types.Operator, ImportHelper):
"
the STL file
"
,
"
the STL file
"
,
type
=
bpy
.
types
.
OperatorFileListElement
)
type
=
bpy
.
types
.
OperatorFileListElement
)
directory
=
StringProperty
()
directory
=
StringProperty
(
subtype
=
'
DIR_PATH
'
)
def
execute
(
self
,
context
):
def
execute
(
self
,
context
):
from
.
import
stl_utils
from
.
import
stl_utils
...
@@ -88,8 +88,14 @@ class ImportSTL(bpy.types.Operator, ImportHelper):
...
@@ -88,8 +88,14 @@ class ImportSTL(bpy.types.Operator, ImportHelper):
if
not
paths
:
if
not
paths
:
paths
.
append
(
self
.
filepath
)
paths
.
append
(
self
.
filepath
)
if
bpy
.
ops
.
object
.
mode_set
.
poll
():
bpy
.
ops
.
object
.
mode_set
(
mode
=
'
OBJECT
'
)
if
bpy
.
ops
.
object
.
select_all
.
poll
():
bpy
.
ops
.
object
.
select_all
(
action
=
'
DESELECT
'
)
for
path
in
paths
:
for
path
in
paths
:
objName
=
bpy
.
path
.
display_name
(
path
.
split
(
"
\\
"
)[
-
1
].
split
(
"
/
"
)[
-
1
]
)
objName
=
bpy
.
path
.
display_name
(
os
.
path
.
basename
(
path
)
)
tris
,
pts
=
stl_utils
.
read_stl
(
path
)
tris
,
pts
=
stl_utils
.
read_stl
(
path
)
blender_utils
.
create_and_link_mesh
(
objName
,
tris
,
pts
)
blender_utils
.
create_and_link_mesh
(
objName
,
tris
,
pts
)
...
...
This diff is collapsed.
Click to expand it.
io_mesh_stl/blender_utils.py
+
6
−
3
View file @
1113b9f1
...
@@ -30,13 +30,16 @@ def create_and_link_mesh(name, faces, points):
...
@@ -30,13 +30,16 @@ def create_and_link_mesh(name, faces, points):
mesh
=
bpy
.
data
.
meshes
.
new
(
name
)
mesh
=
bpy
.
data
.
meshes
.
new
(
name
)
mesh
.
from_pydata
(
points
,
[],
faces
)
mesh
.
from_pydata
(
points
,
[],
faces
)
ob
=
bpy
.
data
.
objects
.
new
(
name
,
mesh
)
bpy
.
context
.
scene
.
objects
.
link
(
ob
)
# update mesh to allow proper display
# update mesh to allow proper display
mesh
.
validate
()
mesh
.
validate
()
mesh
.
update
()
mesh
.
update
()
scene
=
bpy
.
context
.
scene
obj
=
bpy
.
data
.
objects
.
new
(
name
,
mesh
)
scene
.
objects
.
link
(
obj
)
obj
.
select
=
True
def
faces_from_mesh
(
ob
,
apply_modifier
=
False
,
triangulate
=
True
):
def
faces_from_mesh
(
ob
,
apply_modifier
=
False
,
triangulate
=
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