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
e5fd9d36
Commit
e5fd9d36
authored
14 years ago
by
John Phan
Browse files
Options
Downloads
Patches
Plain Diff
Fixed missing option in export menu for export all actions check box.
parent
0e4a36c6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
io_export_unreal_psk_psa.py
+21
-21
21 additions, 21 deletions
io_export_unreal_psk_psa.py
with
21 additions
and
21 deletions
io_export_unreal_psk_psa.py
+
21
−
21
View file @
e5fd9d36
...
@@ -763,7 +763,7 @@ def parse_meshes(blender_meshes, psk_file):
...
@@ -763,7 +763,7 @@ def parse_meshes(blender_meshes, psk_file):
uv
=
[
faceUV
.
uv
[
i
][
0
],
faceUV
.
uv
[
i
][
1
]]
#OR bottom works better # 24 for cube
uv
=
[
faceUV
.
uv
[
i
][
0
],
faceUV
.
uv
[
i
][
1
]]
#OR bottom works better # 24 for cube
#uv = list(faceUV.uv[i]) #30 just cube
#uv = list(faceUV.uv[i]) #30 just cube
else
:
else
:
print
(
"
No UVs?
"
)
#
print ("No UVs?")
uv
=
[
0.0
,
0.0
]
uv
=
[
0.0
,
0.0
]
#print("UV >",uv)
#print("UV >",uv)
#uv = [0.0, 0.0] #over ride uv that is not fixed
#uv = [0.0, 0.0] #over ride uv that is not fixed
...
@@ -977,7 +977,7 @@ def parse_bone(blender_bone, psk_file, psa_file, parent_id, is_root_bone, parent
...
@@ -977,7 +977,7 @@ def parse_bone(blender_bone, psk_file, psa_file, parent_id, is_root_bone, parent
quat
=
make_fquat_default
(
rot_mat
.
to_quat
())
quat
=
make_fquat_default
(
rot_mat
.
to_quat
())
print
(
"
[[======= FINAL POSITION:
"
,
set_position
)
#
print ("[[======= FINAL POSITION:", set_position)
final_parent_id
=
parent_id
final_parent_id
=
parent_id
#RG/RE -
#RG/RE -
...
@@ -1114,17 +1114,14 @@ def parse_animation(blender_scene, blender_armatures, psa_file):
...
@@ -1114,17 +1114,14 @@ def parse_animation(blender_scene, blender_armatures, psa_file):
print
(
"
Exporting all action:
"
,
bpy
.
context
.
scene
.
unrealactionexportall
)
print
(
"
Exporting all action:
"
,
bpy
.
context
.
scene
.
unrealactionexportall
)
print
(
"
[==== Action list Start====]
"
)
print
(
"
[==== Action list Start====]
"
)
actionlist
=
[]
print
(
"
Number of Action set(s):
"
,
len
(
bpy
.
data
.
actions
))
print
(
"
Number of Action set(s):
"
,
len
(
bpy
.
data
.
actions
))
for
action
in
bpy
.
data
.
actions
:
#current number action sets
for
action
in
bpy
.
data
.
actions
:
#current number action sets
print
(
"
========>>>>>
"
)
print
(
"
========>>>>>
"
)
print
(
"
Action Name:
"
,
action
.
name
)
print
(
"
Action Name:
"
,
action
.
name
)
actionlist
.
append
(
action
.
name
)
#print("Groups:")
print
(
"
Groups:
"
)
#for bone in action.groups:
for
bone
in
action
.
groups
:
#print("> Name: ",bone.name)
print
(
"
> Name:
"
,
bone
.
name
)
#print(dir(bone))
#print(dir(bone))
print
(
"
[==== Action list End ====]
"
)
print
(
"
[==== Action list End ====]
"
)
...
@@ -1144,10 +1141,10 @@ def parse_animation(blender_scene, blender_armatures, psa_file):
...
@@ -1144,10 +1141,10 @@ def parse_animation(blender_scene, blender_armatures, psa_file):
print
(
"
[=========================]
"
)
print
(
"
[=========================]
"
)
for
ActionNLA
in
bpy
.
data
.
actions
:
for
ActionNLA
in
bpy
.
data
.
actions
:
print
(
"
\n
==== Action Set ====
"
)
nobone
=
0
nobone
=
0
baction
=
True
baction
=
True
print
(
"
\n
Checking actions matching groups with bone names...
"
)
#
print("\nChecking actions matching groups with bone names...")
#Check if the bone names matches the action groups names
#Check if the bone names matches the action groups names
for
group
in
ActionNLA
.
groups
:
for
group
in
ActionNLA
.
groups
:
for
abone
in
bonenames
:
for
abone
in
bonenames
:
...
@@ -1157,10 +1154,11 @@ def parse_animation(blender_scene, blender_armatures, psa_file):
...
@@ -1157,10 +1154,11 @@ def parse_animation(blender_scene, blender_armatures, psa_file):
break
break
#if action groups matches the bones length and names matching the gourps do something
#if action groups matches the bones length and names matching the gourps do something
if
(
len
(
ActionNLA
.
groups
)
==
len
(
bonenames
))
and
(
nobone
==
len
(
ActionNLA
.
groups
)):
if
(
len
(
ActionNLA
.
groups
)
==
len
(
bonenames
))
and
(
nobone
==
len
(
ActionNLA
.
groups
)):
print
(
"
Action Set
found for this Armature Object: Action set Name:
"
,
ActionNLA
.
name
)
print
(
"
Action Set
match: Pass
"
)
baction
=
True
baction
=
True
else
:
else
:
print
(
"
Action Set does not match for this Armature Object! , Action set Name:
"
,
ActionNLA
.
name
)
print
(
"
Action Set match: Fail
"
)
print
(
"
Action Name:
"
,
ActionNLA
.
name
)
baction
=
False
baction
=
False
if
baction
==
True
:
if
baction
==
True
:
...
@@ -1190,8 +1188,7 @@ def parse_animation(blender_scene, blender_armatures, psa_file):
...
@@ -1190,8 +1188,7 @@ def parse_animation(blender_scene, blender_armatures, psa_file):
#this deal with action export control
#this deal with action export control
if
bHaveAction
==
True
:
if
bHaveAction
==
True
:
print
(
""
)
print
(
"
==== Action Set ====
"
)
print
(
"
Action Name:
"
,
action_name
)
print
(
"
Action Name:
"
,
action_name
)
#look for min and max frame that current set keys
#look for min and max frame that current set keys
framemin
,
framemax
=
act
.
frame_range
framemin
,
framemax
=
act
.
frame_range
...
@@ -1452,7 +1449,7 @@ def parse_animation(blender_scene, blender_armatures, psa_file):
...
@@ -1452,7 +1449,7 @@ def parse_animation(blender_scene, blender_armatures, psa_file):
exportmessage
=
"
Export Finish
"
exportmessage
=
"
Export Finish
"
def
fs_callback
(
filename
,
context
,
user_setting
):
def
fs_callback
(
filename
,
context
):
#this deal with repeat export and the reset settings
#this deal with repeat export and the reset settings
global
bonedata
,
BBCount
,
nbone
,
exportmessage
global
bonedata
,
BBCount
,
nbone
,
exportmessage
bonedata
=
[]
#clear array
bonedata
=
[]
#clear array
...
@@ -1612,11 +1609,11 @@ def fs_callback(filename, context, user_setting):
...
@@ -1612,11 +1609,11 @@ def fs_callback(filename, context, user_setting):
#DONE
#DONE
print
(
"
PSK/PSA Export Complete
"
)
print
(
"
PSK/PSA Export Complete
"
)
def
write_data
(
path
,
context
,
user_setting
):
def
write_data
(
path
,
context
):
print
(
"
//============================
"
)
print
(
"
//============================
"
)
print
(
"
// running psk/psa export...
"
)
print
(
"
// running psk/psa export...
"
)
print
(
"
//============================
"
)
print
(
"
//============================
"
)
fs_callback
(
path
,
context
,
user_setting
)
fs_callback
(
path
,
context
)
pass
pass
from
bpy.props
import
*
from
bpy.props
import
*
...
@@ -1669,7 +1666,6 @@ class ExportUDKAnimData(bpy.types.Operator):
...
@@ -1669,7 +1666,6 @@ class ExportUDKAnimData(bpy.types.Operator):
# to the class instance from the operator settings before calling.
# to the class instance from the operator settings before calling.
filepath
=
StringProperty
(
name
=
"
File Path
"
,
description
=
"
Filepath used for exporting the PSA file
"
,
maxlen
=
1024
,
default
=
""
)
filepath
=
StringProperty
(
name
=
"
File Path
"
,
description
=
"
Filepath used for exporting the PSA file
"
,
maxlen
=
1024
,
default
=
""
)
use_setting
=
BoolProperty
(
name
=
"
No Options Yet
"
,
description
=
"
No Options Yet
"
,
default
=
True
)
pskexportbool
=
BoolProperty
(
name
=
"
Export PSK
"
,
description
=
"
Export Skeletal Mesh
"
,
default
=
True
)
pskexportbool
=
BoolProperty
(
name
=
"
Export PSK
"
,
description
=
"
Export Skeletal Mesh
"
,
default
=
True
)
psaexportbool
=
BoolProperty
(
name
=
"
Export PSA
"
,
description
=
"
Export Action Set (Animation Data)
"
,
default
=
True
)
psaexportbool
=
BoolProperty
(
name
=
"
Export PSA
"
,
description
=
"
Export Action Set (Animation Data)
"
,
default
=
True
)
actionexportall
=
BoolProperty
(
name
=
"
All Actions
"
,
description
=
"
This will export all the actions that matches the current armature.
"
,
default
=
False
)
actionexportall
=
BoolProperty
(
name
=
"
All Actions
"
,
description
=
"
This will export all the actions that matches the current armature.
"
,
default
=
False
)
...
@@ -1690,7 +1686,12 @@ class ExportUDKAnimData(bpy.types.Operator):
...
@@ -1690,7 +1686,12 @@ class ExportUDKAnimData(bpy.types.Operator):
else
:
else
:
bpy
.
context
.
scene
.
unrealexportpsa
=
False
bpy
.
context
.
scene
.
unrealexportpsa
=
False
write_data
(
self
.
filepath
,
context
,
self
.
use_setting
)
if
(
self
.
actionexportall
):
bpy
.
context
.
scene
.
unrealactionexportall
=
True
else
:
bpy
.
context
.
scene
.
unrealactionexportall
=
False
write_data
(
self
.
filepath
,
context
)
self
.
report
({
'
WARNING
'
,
'
INFO
'
},
exportmessage
)
self
.
report
({
'
WARNING
'
,
'
INFO
'
},
exportmessage
)
return
{
'
FINISHED
'
}
return
{
'
FINISHED
'
}
...
@@ -1700,7 +1701,6 @@ class ExportUDKAnimData(bpy.types.Operator):
...
@@ -1700,7 +1701,6 @@ class ExportUDKAnimData(bpy.types.Operator):
wm
.
add_fileselect
(
self
)
wm
.
add_fileselect
(
self
)
return
{
'
RUNNING_MODAL
'
}
return
{
'
RUNNING_MODAL
'
}
class
VIEW3D_PT_unrealtools_objectmode
(
bpy
.
types
.
Panel
):
class
VIEW3D_PT_unrealtools_objectmode
(
bpy
.
types
.
Panel
):
bl_space_type
=
"
VIEW_3D
"
bl_space_type
=
"
VIEW_3D
"
bl_region_type
=
"
TOOLS
"
bl_region_type
=
"
TOOLS
"
...
@@ -1765,7 +1765,7 @@ class OBJECT_OT_UnrealExport(bpy.types.Operator):
...
@@ -1765,7 +1765,7 @@ class OBJECT_OT_UnrealExport(bpy.types.Operator):
print
(
"
Exporting ALL...
"
)
print
(
"
Exporting ALL...
"
)
default_path
=
os
.
path
.
splitext
(
bpy
.
data
.
filepath
)[
0
]
+
"
.psk
"
default_path
=
os
.
path
.
splitext
(
bpy
.
data
.
filepath
)[
0
]
+
"
.psk
"
fs_callback
(
default_path
,
bpy
.
context
,
False
)
fs_callback
(
default_path
,
bpy
.
context
)
#self.report({'WARNING', 'INFO'}, exportmessage)
#self.report({'WARNING', 'INFO'}, exportmessage)
self
.
report
({
'
INFO
'
},
exportmessage
)
self
.
report
({
'
INFO
'
},
exportmessage
)
...
...
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