Skip to content

Commit

Permalink
Remove spaces from group name the same way as joints
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Sazhnev committed Jul 31, 2012
1 parent ab33498 commit b201518
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions poser2egg.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@
############################################################
import poser
import os
import string

V4_RELATIVE_TEXTURE_PATH = False
############################################################
# General Functions
############################################################

# from chicken

# some code from chicken exporter
def egg_safe_same(s):
"""Function that converts names into something suitable for the egg file format - simply puts " around names that contain spaces and prunes bad characters, replacing them with an underscore."""
s = s.replace('"', '_') # Sure there are more bad characters, but this will do for now.
s = s.replace('"', '_') # Sure there are more bad characters, but this will do for now.
if ' ' in s:
return '"' + s + '"'
else:
Expand Down Expand Up @@ -411,7 +413,7 @@ def collect_vertices(self, uniActorList):
# poser sets/texture sets containing vertices id for vertices/tex_vertices arrays
sets, tex_sets = geom.Sets(), geom.TexSets()
# collect all geom data for current actor and present as egg group
group_name = egg_safe_same(actor.Name())
group_name = fix_name(actor.Name())
group_polygons = []
for polygon_index, polygon in enumerate(polygons):
poly_start = vertex_index
Expand Down

0 comments on commit b201518

Please sign in to comment.