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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
a8fd59a0
Commit
a8fd59a0
authored
Jul 3, 2011
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
use nicer api functions for adding extension, and define enum items as static tuples.
parent
91a1998d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
io_export_directx_x.py
+22
-14
22 additions, 14 deletions
io_export_directx_x.py
with
22 additions
and
14 deletions
io_export_directx_x.py
+
22
−
14
View file @
a8fd59a0
...
...
@@ -1164,20 +1164,26 @@ def CloseFile(Config):
if
Config
.
Verbose
:
print
(
"
Done
"
)
CoordinateSystems
=
[]
CoordinateSystems
.
append
((
"
1
"
,
"
Left-Handed
"
,
""
))
CoordinateSystems
.
append
((
"
2
"
,
"
Right-Handed
"
,
""
))
AnimationMode
s
=
[]
AnimationModes
.
append
(
(
"
0
"
,
"
None
"
,
""
)
)
AnimationModes
.
append
(
(
"
1
"
,
"
Keyframes Only
"
,
""
)
)
AnimationModes
.
append
((
"
2
"
,
"
Full Animation
"
,
""
)
)
CoordinateSystem
s
=
(
(
"
1
"
,
"
Left-Handed
"
,
""
)
,
(
"
2
"
,
"
Right-Handed
"
,
""
)
,
)
ExportModes
=
[]
ExportModes
.
append
((
"
1
"
,
"
All Objects
"
,
""
))
ExportModes
.
append
((
"
2
"
,
"
Selected Objects
"
,
""
))
from
bpy.props
import
*
AnimationModes
=
(
(
"
0
"
,
"
None
"
,
""
),
(
"
1
"
,
"
Keyframes Only
"
,
""
),
(
"
2
"
,
"
Full Animation
"
,
""
),
)
ExportModes
=
(
(
"
1
"
,
"
All Objects
"
,
""
),
(
"
2
"
,
"
Selected Objects
"
,
""
),
)
from
bpy.props
import
StringProperty
,
EnumProperty
,
BoolProperty
class
DirectXExporter
(
bpy
.
types
.
Operator
):
...
...
@@ -1207,7 +1213,7 @@ class DirectXExporter(bpy.types.Operator):
def
execute
(
self
,
context
):
#Append .x
FilePath
=
os
.
path
.
split
ext
(
self
.
filepath
)[
0
]
+
"
.x
"
FilePath
=
bpy
.
path
.
ensure_
ext
(
self
.
filepath
,
"
.x
"
)
Config
=
DirectXExporterSettings
(
context
,
FilePath
,
...
...
@@ -1221,18 +1227,20 @@ class DirectXExporter(bpy.types.Operator):
ExportAnimation
=
self
.
ExportAnimation
,
ExportMode
=
self
.
ExportMode
,
Verbose
=
self
.
Verbose
)
ExportDirectX
(
Config
)
return
{
"
FINISHED
"
}
def
invoke
(
self
,
context
,
event
):
if
not
self
.
filepath
:
self
.
filepath
=
bpy
.
path
.
ensure_ext
(
bpy
.
data
.
filepath
,
"
.x
"
)
WindowManager
=
context
.
window_manager
WindowManager
.
fileselect_add
(
self
)
return
{
"
RUNNING_MODAL
"
}
def
menu_func
(
self
,
context
):
default_path
=
os
.
path
.
splitext
(
bpy
.
data
.
filepath
)[
0
]
+
"
.x
"
self
.
layout
.
operator
(
DirectXExporter
.
bl_idname
,
text
=
"
DirectX (.x)
"
).
filepath
=
default_path
self
.
layout
.
operator
(
DirectXExporter
.
bl_idname
,
text
=
"
DirectX (.x)
"
)
def
register
():
...
...
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
sign in
to comment