Skip to content

Commit

Permalink
[#96][#98][#6]PEP 8 Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dwhite5914 committed Mar 9, 2015
1 parent 2717b32 commit 25bd181
Show file tree
Hide file tree
Showing 8 changed files with 806 additions and 372 deletions.
662 changes: 462 additions & 200 deletions io_export_cryblend/__init__.py

Large diffs are not rendered by default.

62 changes: 41 additions & 21 deletions io_export_cryblend/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,57 +173,77 @@ def add_collision_property(self, context):


# deformable
def add_deformable_property(self, context, mass, stiffness, hardness,
max_stretch, max_impulse, skin_dist, thickness, explosion_scale, is_primitive):
ob = bpy.context.active_object
ob['mass'] = 'mass=%s' % mass
ob['stfns'] = 'stiffness=%s' % stiffness
ob['stfns'] = 'hardness=%s' % hardness
ob['mxstr'] = 'max_stretch=%s' % max_stretch
ob['mxstr'] = 'max_impulse=%s' % max_impulse
ob['skdist'] = 'skin_dist=%s' % skin_dist
ob['thkns'] = 'thickness=%s' % thickness
ob['thkns'] = 'explosion_scale=%s' % explosion_scale
if (is_primitive == 'Yes'):
ob['notap'] = 'notaprim=0'
else:
ob['notap'] = 'notaprim=1'
return{'FINISHED'}
def add_deformable_property(
self,
context,
mass,
stiffness,
hardness,
max_stretch,
max_impulse,
skin_dist,
thickness,
explosion_scale,
is_primitive):
ob = bpy.context.active_object
ob['mass'] = 'mass=%s' % mass
ob['stfns'] = 'stiffness=%s' % stiffness
ob['stfns'] = 'hardness=%s' % hardness
ob['mxstr'] = 'max_stretch=%s' % max_stretch
ob['mxstr'] = 'max_impulse=%s' % max_impulse
ob['skdist'] = 'skin_dist=%s' % skin_dist
ob['thkns'] = 'thickness=%s' % thickness
ob['thkns'] = 'explosion_scale=%s' % explosion_scale
if (is_primitive == 'Yes'):
ob['notap'] = 'notaprim=0'
else:
ob['notap'] = 'notaprim=1'
return{'FINISHED'}


# material physics
def add_phys_default(self, context):
me = bpy.context.active_object
if me.active_material:
me.active_material.name = replacePhysMaterial(me.active_material.name, '__physDefault')
me.active_material.name = replacePhysMaterial(
me.active_material.name,
'__physDefault')
return{'FINISHED'}


def add_phys_none(self, context):
me = bpy.context.active_object
if me.active_material:
me.active_material.name = replacePhysMaterial(me.active_material.name, '__physNone')
me.active_material.name = replacePhysMaterial(
me.active_material.name,
'__physNone')
return{'FINISHED'}


def add_phys_proxy_no_draw(self, context):
me = bpy.context.active_object
if me.active_material:
me.active_material.name = replacePhysMaterial(me.active_material.name, '__physProxyNoDraw')
me.active_material.name = replacePhysMaterial(
me.active_material.name,
'__physProxyNoDraw')
return{'FINISHED'}


def add_phys_obstruct(self, context):
me = bpy.context.active_object
if me.active_material:
me.active_material.name = replacePhysMaterial(me.active_material.name, '__physObstruct')
me.active_material.name = replacePhysMaterial(
me.active_material.name,
'__physObstruct')
return{'FINISHED'}


def add_phys_no_collide(self, context):
me = bpy.context.active_object
if me.active_material:
me.active_material.name = replacePhysMaterial(me.active_material.name, '__physNoCollide')
me.active_material.name = replacePhysMaterial(
me.active_material.name,
'__physNoCollide')
return{'FINISHED'}


Expand Down
2 changes: 1 addition & 1 deletion io_export_cryblend/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class __Configuration:
__CONFIG_FILENAME = 'cryblend.cfg'
__CONFIG_FILEPATH = os.path.join(__CONFIG_PATH, __CONFIG_FILENAME)
__DEFAULT_CONFIGURATION = {'RC_PATH': r'',
'TEXTURE_RC_PATH': r''}
'TEXTURE_RC_PATH': r''}

def __init__(self):
self.__CONFIG = self.__load({})
Expand Down
4 changes: 4 additions & 0 deletions io_export_cryblend/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@


class CryBlendException(RuntimeError):

def __init__(self, message):
self._message = message

Expand All @@ -24,13 +25,15 @@ def what(self):


class BlendNotSavedException(CryBlendException):

def __init__(self):
message = 'Blend file has to be saved before exporting.'

CryBlendException.__init__(self, message)


class TextureAndBlendDiskMismatchException(CryBlendException):

def __init__(self, blend_path, texture_path):
message = """
Blend file and all textures have to be placed on the same disk.
Expand All @@ -42,6 +45,7 @@ def __init__(self, blend_path, texture_path):


class NoRcSelectedException(CryBlendException):

def __init__(self):
message = """
Please find Resource Compiler first.
Expand Down
Loading

0 comments on commit 25bd181

Please sign in to comment.