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
cf8e2d20
Commit
cf8e2d20
authored
14 years ago
by
John Phan
Browse files
Options
Downloads
Patches
Plain Diff
update mesh not render scene once added in.
parent
3a2eaa64
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_import_scene_unreal_psk.py
+6
-28
6 additions, 28 deletions
io_import_scene_unreal_psk.py
with
6 additions
and
28 deletions
io_import_scene_unreal_psk.py
+
6
−
28
View file @
cf8e2d20
...
...
@@ -361,30 +361,6 @@ def pskimport(infile,importmesh,importbone,bDebugLogPSK):
break
if
bfound
==
False
:
'''
armdata = bpy.data.armatures.new(objectname)
ob_new = bpy.data.objects.new(meshname, armdata)
#ob_new = bpy.data.objects.new(meshname,
'
ARMATURE
'
)
#ob_new.data = armdata
bpy.context.scene.objects.link(ob_new)
#bpy.ops.object.mode_set(mode=
'
OBJECT
'
)
for i in bpy.context.scene.objects: i.select = False #deselect all objects
ob_new.select = True
#set current armature to edit the bone
bpy.context.scene.objects.active = ob_new
#set mode to able to edit the bone
bpy.ops.object.mode_set(mode=
'
EDIT
'
)
#newbone = ob_new.data.edit_bones.new(
'
test
'
)
#newbone.tail.y = 1
print(
"
creating bone(s)
"
)
for bone in md5_bones:
#print(dir(bone))
bpy.ops.object.mode_set(mode=
'
EDIT
'
)
newbone = ob_new.data.edit_bones.new(bone.name)
'''
armdata
=
bpy
.
data
.
armatures
.
new
(
objectname
)
ob_new
=
bpy
.
data
.
objects
.
new
(
meshname
,
armdata
)
#ob_new = bpy.data.objects.new(meshname, 'ARMATURE')
...
...
@@ -438,10 +414,9 @@ def pskimport(infile,importmesh,importbone,bDebugLogPSK):
newbone
.
tail
.
y
=
parentbone
.
head
.
y
+
(
pos_y
+
bonesize
*
rotmatrix
[
1
][
1
])
newbone
.
tail
.
z
=
parentbone
.
head
.
z
+
(
pos_z
+
bonesize
*
rotmatrix
[
1
][
2
])
else
:
print
(
"
rotmatrix:
"
,
dir
(
bone
.
bindmat
.
to_matrix
().
resize_4x4
()))
#
print("rotmatrix:",dir(bone.bindmat.to_matrix().resize_4x4()))
#rotmatrix = bone.bindmat.to_matrix().resize_4x4().to_3x3() # XXX, redundant matrix conversion?
rotmatrix
=
bone
.
bindmat
.
to_matrix
().
to_3x3
()
# XXX, redundant matrix conversion?
rotmatrix
=
bone
.
bindmat
.
to_matrix
().
to_3x3
()
newbone
.
head
.
x
=
bone
.
bindpos
[
0
]
newbone
.
head
.
y
=
bone
.
bindpos
[
1
]
...
...
@@ -577,13 +552,16 @@ def pskimport(infile,importmesh,importbone,bDebugLogPSK):
#===================================================================================================
#
#===================================================================================================
#print("me_ob",dir(me_ob))
#this update the render in the 3d scene.
me_ob
.
update
();
obmesh
=
bpy
.
data
.
objects
.
new
(
objName
,
me_ob
)
#check if there is a material to set to
if
len
(
materials
)
>
0
:
obmesh
.
active_material
=
materials
[
0
]
#material setup tmp
bpy
.
context
.
scene
.
objects
.
link
(
obmesh
)
#print("obmesh",dir(obmesh))
bpy
.
context
.
scene
.
update
()
print
(
"
PSK2Blender completed
"
)
...
...
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