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
55bf814d
Commit
55bf814d
authored
13 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
fix #28988: Quake MAP export errors out
parent
83f84dfd
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
io_scene_map/export_map.py
+29
-11
29 additions, 11 deletions
io_scene_map/export_map.py
with
29 additions
and
11 deletions
io_scene_map/export_map.py
+
29
−
11
View file @
55bf814d
...
...
@@ -16,7 +16,7 @@
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
# <pep8
-80
compliant>
import
bpy
import
os
...
...
@@ -44,6 +44,14 @@ def face_uv_get(face):
return
None
def
face_material_get
(
face
):
me
=
face
.
id_data
try
:
return
me
.
materials
[
f
.
material_index
]
except
:
return
None
def
write_cube2brush
(
file
,
faces
):
'''
Takes 6 faces and writes a brush,
...
...
@@ -66,15 +74,18 @@ def write_cube2brush(file, faces):
for
v
in
f
.
vertices
[:][
2
::
-
1
]:
file
.
write
(
format_vec
%
me
.
vertices
[
v
].
co
[:])
uf
=
face_uv
_get
(
f
)
material
=
face_material
_get
(
f
)
if
uf
and
uf
.
hid
e
:
if
material
and
material
.
game_settings
.
invisibl
e
:
file
.
write
(
PREF_INVIS_TEX
)
else
:
uf
=
face_uv_get
(
f
)
image
=
uf
.
image
if
uf
else
None
if
image
:
file
.
write
(
os
.
path
.
splitext
(
bpy
.
path
.
basename
(
image
.
filepath
))[
0
])
file
.
write
(
os
.
path
.
splitext
(
bpy
.
path
.
basename
(
image
.
filepath
))[
0
])
else
:
file
.
write
(
PREF_NULL_TEX
)
...
...
@@ -103,11 +114,13 @@ def write_face2brush(file, face):
image_text
=
PREF_NULL_TEX
uf
=
face_uv
_get
(
f
ace
)
material
=
face_material
_get
(
f
)
if
uf
and
uf
.
hid
e
:
if
material
and
material
.
game_settings
.
invisibl
e
:
image_text
=
PREF_INVIS_TEX
else
:
uf
=
face_uv_get
(
face
)
image
=
uf
.
image
if
uf
else
None
if
image
:
...
...
@@ -269,13 +282,18 @@ def write_node_map(file, ob):
def
export_map
(
context
,
filepath
):
"""
pup_block = [
\
(
'
Scale:
'
, PREF_SCALE, 1, 1000,
'
Scale the blender scene by this value.
'
),
\
(
'
Face Width:
'
, PREF_FACE_THICK, 0.01, 10,
'
Thickness of faces exported as brushes.
'
),
\
(
'
Grid Snap
'
, PREF_GRID_SNAP,
'
snaps floating point values to whole numbers.
'
),
\
(
'
Scale:
'
, PREF_SCALE, 1, 1000,
'
Scale the blender scene by this value.
'
),
\
(
'
Face Width:
'
, PREF_FACE_THICK, 0.01, 10,
'
Thickness of faces exported as brushes.
'
),
\
(
'
Grid Snap
'
, PREF_GRID_SNAP,
'
snaps floating point values to whole numbers.
'
),
\
'
Null Texture
'
,
\
(
''
, PREF_NULL_TEX, 1, 128,
'
Export textureless faces with this texture
'
),
\
(
''
, PREF_NULL_TEX, 1, 128,
'
Export textureless faces with this texture
'
),
\
'
Unseen Texture
'
,
\
(
''
, PREF_INVIS_TEX, 1, 128,
'
Export invisible faces with this texture
'
),
\
(
''
, PREF_INVIS_TEX, 1, 128,
'
Export invisible faces with this texture
'
),
\
]
if not Draw.PupBlock(
'
map export
'
, pup_block):
...
...
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