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
41614333
Commit
41614333
authored
13 years ago
by
Chris Foster
Browse files
Options
Downloads
Patches
Plain Diff
- Punctuation characters are now stripped from symbol names and replaced with underscores.
parent
1d5be62e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
io_export_directx_x.py
+12
-7
12 additions, 7 deletions
io_export_directx_x.py
with
12 additions
and
7 deletions
io_export_directx_x.py
+
12
−
7
View file @
41614333
...
...
@@ -66,8 +66,15 @@ class DirectXExporterSettings:
def
LegalName
(
Name
):
NewName
=
Name
.
replace
(
"
.
"
,
"
_
"
)
NewName
=
NewName
.
replace
(
"
"
,
"
_
"
)
def
ReplaceSet
(
String
,
OldSet
,
NewChar
):
for
OldChar
in
OldSet
:
String
=
String
.
replace
(
OldChar
,
NewChar
)
return
String
import
string
NewName
=
ReplaceSet
(
Name
,
string
.
punctuation
,
"
_
"
)
if
NewName
[
0
].
isdigit
()
or
NewName
in
[
"
ARRAY
"
,
"
DWORD
"
,
"
UCHAR
"
,
...
...
@@ -1199,10 +1206,8 @@ class DirectXExporter(bpy.types.Operator):
Verbose
=
BoolProperty
(
name
=
"
Verbose
"
,
description
=
"
Run the exporter in debug mode. Check the console for output.
"
,
default
=
False
)
def
execute
(
self
,
context
):
#Append .x if needed
FilePath
=
self
.
filepath
if
not
FilePath
.
lower
().
endswith
(
"
.x
"
):
FilePath
+=
"
.x
"
#Append .x
FilePath
=
os
.
path
.
splitext
(
self
.
filepath
)[
0
]
+
"
.x
"
Config
=
DirectXExporterSettings
(
context
,
FilePath
,
...
...
@@ -1243,4 +1248,4 @@ def unregister():
if
__name__
==
"
__main__
"
:
register
()
register
()
\ No newline at end of file
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