From 1d838454afb884cf7b288afc7b6915c779230ecb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 29 Mar 2011 03:54:27 +0000 Subject: use identity comparison with None (as suggested by python) --- rigify/rigs/biped/arm/fk.py | 2 +- rigify/rigs/biped/leg/deform.py | 5 ++--- rigify/rigs/biped/leg/fk.py | 6 +++--- rigify/rigs/biped/leg/ik.py | 4 ++-- rigify/rigs/misc/delta.py | 2 +- rigify/rigs/palm.py | 2 +- rigify/rigs/spine.py | 6 +++--- 7 files changed, 13 insertions(+), 14 deletions(-) (limited to 'rigify/rigs') diff --git a/rigify/rigs/biped/arm/fk.py b/rigify/rigs/biped/arm/fk.py index 20ba89f2..77dcc6a6 100644 --- a/rigify/rigs/biped/arm/fk.py +++ b/rigify/rigs/biped/arm/fk.py @@ -49,7 +49,7 @@ class Rig: raise MetarigError("RIGIFY ERROR: Bone '%s': input to rig type must be a chain of 3 bones." % (strip_org(bone))) # Get (optional) parent - if self.obj.data.bones[bone].parent == None: + if self.obj.data.bones[bone].parent is None: self.org_parent = None else: self.org_parent = self.obj.data.bones[bone].parent.name diff --git a/rigify/rigs/biped/leg/deform.py b/rigify/rigs/biped/leg/deform.py index 2f9b2b02..bb6b6f39 100644 --- a/rigify/rigs/biped/leg/deform.py +++ b/rigify/rigs/biped/leg/deform.py @@ -99,7 +99,7 @@ class Rig: else: heel = b.name - if foot == None or heel == None: + if foot is None or heel is None: raise MetarigError("RIGIFY ERROR: Bone '%s': incorrect bone configuration for rig type." % (strip_org(bone))) # Get the toe @@ -108,7 +108,7 @@ class Rig: if b.use_connect == True: toe = b.name - if toe == None: + if toe is None: raise MetarigError("RIGIFY ERROR: Bone '%s': incorrect bone configuration for rig type." % (strip_org(bone))) self.org_bones = leg_bones + [foot, toe, heel] @@ -261,4 +261,3 @@ class Rig: con.name = "track_to" con.target = self.obj con.subtarget = stip - diff --git a/rigify/rigs/biped/leg/fk.py b/rigify/rigs/biped/leg/fk.py index bc7a8dbd..e231fa8e 100644 --- a/rigify/rigs/biped/leg/fk.py +++ b/rigify/rigs/biped/leg/fk.py @@ -59,7 +59,7 @@ class Rig: else: heel = b.name - if foot == None or heel == None: + if foot is None or heel is None: raise MetarigError("RIGIFY ERROR: Bone '%s': incorrect bone configuration for rig type." % (strip_org(bone))) # Get the toe @@ -69,13 +69,13 @@ class Rig: toe = b.name # Get the toe - if toe == None: + if toe is None: raise MetarigError("RIGIFY ERROR: Bone '%s': incorrect bone configuration for rig type." % (strip_org(bone))) self.org_bones = leg_bones + [foot, toe, heel] # Get (optional) parent - if self.obj.data.bones[bone].parent == None: + if self.obj.data.bones[bone].parent is None: self.org_parent = None else: self.org_parent = self.obj.data.bones[bone].parent.name diff --git a/rigify/rigs/biped/leg/ik.py b/rigify/rigs/biped/leg/ik.py index 42ead8b5..265b4e32 100644 --- a/rigify/rigs/biped/leg/ik.py +++ b/rigify/rigs/biped/leg/ik.py @@ -112,7 +112,7 @@ class Rig: if len(b.children) > 0: rocker = b.children[0].name - if foot == None or heel == None: + if foot is None or heel is None: print("blah") raise MetarigError("RIGIFY ERROR: Bone '%s': incorrect bone configuration for rig type." % (strip_org(bone))) @@ -123,7 +123,7 @@ class Rig: toe = b.name # Get toe - if toe == None: + if toe is None: raise MetarigError("RIGIFY ERROR: Bone '%s': incorrect bone configuration for rig type." % (strip_org(bone))) self.org_bones = leg_bones + [foot, toe, heel, rocker] diff --git a/rigify/rigs/misc/delta.py b/rigify/rigs/misc/delta.py index bc5f7eba..dc8edd41 100644 --- a/rigify/rigs/misc/delta.py +++ b/rigify/rigs/misc/delta.py @@ -39,7 +39,7 @@ class Rig: """ bb = obj.data.bones - if bb[bone].children == None: + if bb[bone].children is None: raise MetarigError("RIGIFY ERROR: bone '%s': rig type requires one child." % org_name(bone.name)) if bb[bone].use_connect == True: raise MetarigError("RIGIFY ERROR: bone '%s': rig type cannot be connected to parent." % org_name(bone.name)) diff --git a/rigify/rigs/palm.py b/rigify/rigs/palm.py index 26cb3715..d1a3cf61 100644 --- a/rigify/rigs/palm.py +++ b/rigify/rigs/palm.py @@ -32,7 +32,7 @@ def bone_siblings(obj, bone): """ parent = obj.data.bones[bone].parent - if parent == None: + if parent is None: return [] bones = [] diff --git a/rigify/rigs/spine.py b/rigify/rigs/spine.py index 2318b3b9..37dda1b1 100644 --- a/rigify/rigs/spine.py +++ b/rigify/rigs/spine.py @@ -215,7 +215,7 @@ class Rig: # Parenting bone_e.use_connect = False helper_e.use_connect = False - if prev_bone == None: + if prev_bone is None: helper_e.parent = eb[hip_control] bone_e.parent = helper_e @@ -314,7 +314,7 @@ class Rig: flip_bone(self.obj, bone) bone_e.tail = Vector(eb[b[0]].head) #bone_e.head = Vector(eb[b[0]].tail) - if prev_bone == None: + if prev_bone is None: pass # Position base bone wherever you want, for now do nothing (i.e. position at hips) else: put_bone(self.obj, bone, eb[prev_bone].tail) @@ -331,7 +331,7 @@ class Rig: con = bone_p.constraints.new('COPY_LOCATION') con.name = "copy_location" con.target = self.obj - if prev_bone == None: + if prev_bone is None: con.subtarget = hip_control # Position base bone wherever you want, for now hips else: con.subtarget = prev_bone -- cgit v1.2.3