Skip to content
Snippets Groups Projects
Commit dcb97c6b authored by Campbell Barton's avatar Campbell Barton
Browse files

py3.3 compat, __class__ is no longer in default namespace

parent c27565b0
No related branches found
No related tags found
No related merge requests found
......@@ -259,7 +259,7 @@ class ApiNavigator():
else :
too_long = False
__class__.generate_api_doc()
ApiNavigator.generate_api_doc()
return {'FINISHED'}
@staticmethod
......
......@@ -162,8 +162,8 @@ class CONSOLE_HT_icons(bpy.types.Header):
def draw(self, context):
props = context.scene.icon_props
# polling for updates
if props.search != __class__._search_old:
__class__._search_old = props.search
if props.search != self.__class__._search_old:
self.__class__._search_old = props.search
self.icon_list = create_icon_list()
# adjusting max value of scroller
# IconProps.scroll = bpy.props.IntProperty(default=1, min=1,
......
......@@ -140,7 +140,7 @@ def write_armature(context,
# redefine bones as sorted by serialized_names
# so we can write motion
class decorated_bone(object):
class DecoratedBone(object):
__slots__ = (\
"name", # bone name, used as key in many places
"parent", # decorated bone parent, set in a later loop
......@@ -176,7 +176,7 @@ def write_armature(context,
else:
self.rot_order_str = rotate_mode
self.rot_order = __class__._eul_order_lookup[self.rot_order_str]
self.rot_order = DecoratedBone._eul_order_lookup[self.rot_order_str]
self.pose_mat = self.pose_bone.matrix
......@@ -203,7 +203,7 @@ def write_armature(context,
else:
return "[\"%s\" root bone]\n" % (self.name)
bones_decorated = [decorated_bone(bone_name) for bone_name in serialized_names]
bones_decorated = [DecoratedBone(bone_name) for bone_name in serialized_names]
# Assign parents
bones_decorated_dict = {}
......
......@@ -26,10 +26,10 @@ import bpy
from mathutils import Vector, Euler, Matrix
class bvh_node_class(object):
class BVH_Node(object):
__slots__ = (
'name', # bvh joint name
'parent', # bvh_node_class type or None for no parent
'parent', # BVH_Node type or None for no parent
'children', # a list of children of this type.
'rest_head_world', # worldspace rest location for the head of this node
'rest_head_local', # localspace rest location for the head of this node
......@@ -60,7 +60,7 @@ class bvh_node_class(object):
self.parent = parent
self.channels = channels
self.rot_order = tuple(rot_order)
self.rot_order_str = __class__._eul_order_lookup[self.rot_order]
self.rot_order_str = BVH_Node._eul_order_lookup[self.rot_order]
# convenience functions
self.has_loc = channels[0] != -1 or channels[1] != -1 or channels[2] != -1
......@@ -167,7 +167,7 @@ def read_bvh(context, file_path, rotate_mode='XYZ', global_scale=1.0):
else:
rest_head_world = my_parent.rest_head_world + rest_head_local
bvh_node = bvh_nodes[name] = bvh_node_class(name, rest_head_world, rest_head_local, my_parent, my_channel, my_rot_order)
bvh_node = bvh_nodes[name] = BVH_Node(name, rest_head_world, rest_head_local, my_parent, my_channel, my_rot_order)
# If we have another child then we can call ourselves a parent, else
bvh_nodes_serial.append(bvh_node)
......
......@@ -297,15 +297,15 @@ class DemoMode(bpy.types.Operator):
def cleanup(self, disable=False):
demo_mode_timer_remove()
__class__.first_run = True
DemoMode.first_run = True
if disable:
__class__.enabled = False
DemoMode.enabled = False
DemoKeepAlive.remove()
def modal(self, context, event):
# print("DemoMode.modal", global_state["anim_cycles"])
if not __class__.enabled:
if not DemoMode.enabled:
self.cleanup(disable=True)
return {'CANCELLED'}
......@@ -316,8 +316,8 @@ class DemoMode(bpy.types.Operator):
return {'CANCELLED'}
# print(event.type)
if __class__.first_run:
__class__.first_run = False
if DemoMode.first_run:
DemoMode.first_run = False
demo_mode_init()
else:
......@@ -336,12 +336,12 @@ class DemoMode(bpy.types.Operator):
return {'CANCELLED'}
# toggle
if __class__.enabled and __class__.first_run == False:
if DemoMode.enabled and DemoMode.first_run == False:
# this actually cancells the previous running instance
# should never happen now, DemoModeControl is for this.
return {'CANCELLED'}
else:
__class__.enabled = True
DemoMode.enabled = True
context.window_manager.modal_handler_add(self)
return {'RUNNING_MODAL'}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment