diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-29 07:54:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-29 07:54:27 +0400 |
commit | 1d838454afb884cf7b288afc7b6915c779230ecb (patch) | |
tree | a8d433cd705f8f3b47e3bb272daccea320f66dba /rigify | |
parent | 0fcd2037beda8c2ce5fbd29700b1fc5545a29d28 (diff) |
use identity comparison with None (as suggested by python)
Diffstat (limited to 'rigify')
-rw-r--r-- | rigify/generate.py | 3 | ||||
-rw-r--r-- | rigify/rigs/biped/arm/fk.py | 2 | ||||
-rw-r--r-- | rigify/rigs/biped/leg/deform.py | 5 | ||||
-rw-r--r-- | rigify/rigs/biped/leg/fk.py | 6 | ||||
-rw-r--r-- | rigify/rigs/biped/leg/ik.py | 4 | ||||
-rw-r--r-- | rigify/rigs/misc/delta.py | 2 | ||||
-rw-r--r-- | rigify/rigs/palm.py | 2 | ||||
-rw-r--r-- | rigify/rigs/spine.py | 6 |
8 files changed, 14 insertions, 16 deletions
diff --git a/rigify/generate.py b/rigify/generate.py index a860b86b..7dd0dac2 100644 --- a/rigify/generate.py +++ b/rigify/generate.py @@ -231,7 +231,7 @@ def generate_rig(context, metarig): # Parent any free-floating bones to the root. bpy.ops.object.mode_set(mode='EDIT') for bone in bones: - if obj.data.edit_bones[bone].parent == None: + if obj.data.edit_bones[bone].parent is None: obj.data.edit_bones[bone].use_connect = False obj.data.edit_bones[bone].parent = obj.data.edit_bones[root_bone] bpy.ops.object.mode_set(mode='OBJECT') @@ -351,4 +351,3 @@ def param_name(param_name, rig_type): """ Get the actual parameter name, sans-rig-type. """ return param_name[len(rig_type) + 1:] - 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 |