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
5d4ae918
Commit
5d4ae918
authored
14 years ago
by
John Phan
Browse files
Options
Downloads
Patches
Plain Diff
fixed tmp mesh to unlink to scene.
parent
adb6dac1
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_unreal_psk_psa.py
+25
-9
25 additions, 9 deletions
io_export_unreal_psk_psa.py
with
25 additions
and
9 deletions
io_export_unreal_psk_psa.py
+
25
−
9
View file @
5d4ae918
...
...
@@ -608,9 +608,10 @@ def is_1d_face(blender_face,mesh):
##################################################
# http://en.wikibooks.org/wiki/Blender_3D:_Blending_Into_Python/Cookbook#Triangulate_NMesh
bDeleteMergeMesh
=
False
#blender 2.50 format using the Operators/command convert the mesh to tri mesh
def
triangulateNMesh
(
object
):
global
bDeleteMergeMesh
bneedtri
=
False
scene
=
bpy
.
context
.
scene
bpy
.
ops
.
object
.
mode_set
(
mode
=
'
OBJECT
'
)
...
...
@@ -642,6 +643,10 @@ def triangulateNMesh(object):
bpy
.
ops
.
object
.
mode_set
(
mode
=
'
OBJECT
'
)
# set it in object
bpy
.
context
.
scene
.
unrealtriangulatebool
=
True
print
(
"
Triangulate Mesh Done!
"
)
if
bDeleteMergeMesh
==
True
:
print
(
"
Remove Merge tmp Mesh [
"
,
object
.
name
,
"
] from scene!
"
)
bpy
.
ops
.
object
.
mode_set
(
mode
=
'
OBJECT
'
)
# set it in object
bpy
.
context
.
scene
.
objects
.
unlink
(
object
)
else
:
bpy
.
context
.
scene
.
unrealtriangulatebool
=
False
print
(
"
No need to convert tri mesh.
"
)
...
...
@@ -682,7 +687,7 @@ def BoneIndexArmature(blender_armature):
#BBCount += 1
break
bDeleteMergeMesh
=
False
# Actual object parsing functions
def
parse_meshes
(
blender_meshes
,
psk_file
):
#this is use to call the bone name and the index array for group index matches
...
...
@@ -937,12 +942,23 @@ def parse_meshes(blender_meshes, psk_file):
psk_file
.
VertexGroups
[
bonegroup
.
bone
]
=
vert_list
#unrealtriangulatebool #this will remove the mesh from the scene
if
(
bpy
.
context
.
scene
.
unrealtriangulatebool
==
True
)
or
(
bDeleteMergeMesh
==
True
):
if
bDeleteMergeMesh
==
True
:
print
(
"
Removing merge mesh.
"
)
'''
if (bpy.context.scene.unrealtriangulatebool == True) and (bDeleteMergeMesh == True):
#if bDeleteMergeMesh == True:
# print(
"
Removing merge mesh.
"
)
print(
"
Remove tmp Mesh [
"
,current_obj.name,
"
] from scene >
"
,(bpy.context.scene.unrealtriangulatebool ))
bpy.ops.object.mode_set(mode=
'
OBJECT
'
) # set it in object
bpy.context.scene.objects.unlink(current_obj)
el
'''
if
bDeleteMergeMesh
==
True
:
print
(
"
Remove Merge tmp Mesh [
"
,
current_obj
.
name
,
"
] from scene >
"
,(
bpy
.
context
.
scene
.
unrealtriangulatebool
))
bpy
.
ops
.
object
.
mode_set
(
mode
=
'
OBJECT
'
)
# set it in object
bpy
.
context
.
scene
.
objects
.
unlink
(
current_obj
)
elif
bpy
.
context
.
scene
.
unrealtriangulatebool
==
True
:
print
(
"
Remove tri tmp Mesh [
"
,
current_obj
.
name
,
"
] from scene >
"
,(
bpy
.
context
.
scene
.
unrealtriangulatebool
))
bpy
.
ops
.
object
.
mode_set
(
mode
=
'
OBJECT
'
)
# set it in object
bpy
.
context
.
scene
.
objects
.
unlink
(
current_obj
)
#if bDeleteMergeMesh == True:
#print("Remove merge Mesh [ " ,current_obj.name, " ] from scene")
#bpy.ops.object.mode_set(mode='OBJECT') # set it in object
...
...
@@ -1498,14 +1514,14 @@ def meshmerge(selectedobjects):
print
(
"
selectedobjects:
"
,
len
(
selectedobjects
))
count
=
0
#reset count
for
count
in
range
(
len
(
selectedobjects
)):
print
(
"
Index:
"
,
count
)
#
print("Index:",count)
if
selectedobjects
[
count
]
!=
None
:
me_da
=
selectedobjects
[
count
].
data
.
copy
()
#copy data
me_ob
=
selectedobjects
[
count
].
copy
()
#copy object
#note two copy two types else it will use the current data or mesh
me_ob
.
data
=
me_da
bpy
.
context
.
scene
.
objects
.
link
(
me_ob
)
#link the object to the scene #current object location
print
(
"
clone object
"
,
me_ob
.
name
)
print
(
"
Index:
"
,
count
,
"
clone object
"
,
me_ob
.
name
)
cloneobjects
.
append
(
me_ob
)
#bpy.ops.object.mode_set(mode='OBJECT')
for
i
in
bpy
.
data
.
objects
:
i
.
select
=
False
#deselect all objects
...
...
@@ -1591,7 +1607,7 @@ def fs_callback(filename, context):
else
:
notcentermesh
.
append
(
selectmesh
[
countm
])
if
len
(
centermesh
)
>
0
:
print
(
"
c
enter
o
bject
f
ound
"
)
print
(
"
C
enter
O
bject
F
ound
!
"
)
blender_meshes
=
[]
selectmesh
=
[]
countm
=
0
...
...
@@ -1604,7 +1620,7 @@ def fs_callback(filename, context):
else
:
bDeleteMergeMesh
=
False
bmesh
=
False
print
(
"
c
enter
o
bject
n
ot
f
ound
"
)
print
(
"
C
enter
O
bject
N
ot
F
ound
"
)
else
:
print
(
"
- Too Many Meshes!
"
)
print
(
"
- Select One Mesh Object!
"
)
...
...
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