nanblenderhome = os.getenv("NANBLENDERHOME")
-if nanblenderhome == None:
+if nanblenderhome is None:
nanblenderhome = os.path.dirname(os.path.abspath(sys.argv[0])) + "/.."
config = nanblenderhome + "/source/blender/blenkernel/BKE_blender.h"
if self.status not in {JOB_PAUSED, JOB_QUEUED}:
return
- if status == None:
+ if status is None:
self.status = JOB_PAUSED if self.status == JOB_QUEUED else JOB_QUEUED
elif status:
self.status = JOB_QUEUED
cancelled = False
stdout = bytes()
run_t = time.time()
- while not cancelled and process.poll() == None:
+ while not cancelled and process.poll() is None:
stdout += process.stdout.read(1024)
current_t = time.time()
cancelled = engine.test_break()
if cancelled:
# kill process if needed
- if process.poll() == None:
+ if process.poll() is None:
try:
process.terminate()
except OSError:
def getFileInfo(filepath, infos):
process = subprocess.Popen([sys.argv[0], "-b", "-noaudio", filepath, "-P", __file__, "--"] + infos, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout = bytes()
- while process.poll() == None:
+ while process.poll() is None:
stdout += process.stdout.read(1024)
# read leftovers if needed
for driver_s in obj.data.shape_keys.animation_data.drivers:
if driver_s.data_path == driver_path:
fcurve = driver_s
- if fcurve == None:
+ if fcurve is None:
fcurve = obj.data.shape_keys.keys[name].driver_add("value")
fcurve.driver.type = 'AVERAGE'
new = True
for driver_s in obj.data.shape_keys.animation_data.drivers:
if driver_s.data_path == driver_path:
fcurve = driver_s
- if fcurve == None:
+ if fcurve is None:
fcurve = obj.data.shape_keys.keys[name].driver_add("value")
fcurve.driver.type = 'AVERAGE'
new = True
for driver_s in obj.data.shape_keys.animation_data.drivers:
if driver_s.data_path == driver_path:
fcurve = driver_s
- if fcurve == None:
+ if fcurve is None:
fcurve = obj.data.shape_keys.keys[name].driver_add("value")
fcurve.driver.type = 'AVERAGE'
new = True
for driver_s in obj.data.shape_keys.animation_data.drivers:
if driver_s.data_path == driver_path:
fcurve = driver_s
- if fcurve == None:
+ if fcurve is None:
fcurve = obj.data.shape_keys.keys[name].driver_add("value")
fcurve.driver.type = 'AVERAGE'
for driver_s in obj.data.shape_keys.animation_data.drivers:
if driver_s.data_path == driver_path:
fcurve = driver_s
- if fcurve == None:
+ if fcurve is None:
fcurve = obj.data.shape_keys.keys[name].driver_add("value")
fcurve.driver.type = 'AVERAGE'
arm = obj.data
tail_base = arm.bones[orig_bone_name]
- if tail_base.parent == None:
+ if tail_base.parent is None:
raise RigifyError("'tail_control' rig type on bone '%s' requires a parent." % orig_bone_name)
bone_definitions = [tail_base.name]
def _GetInfoRNA(bl_rna, cls, parent_id=''):
- if bl_rna == None:
+ if bl_rna is None:
return None
key = parent_id, bl_rna.identifier
rna_ui = rna_idprop_ui_get(item, create)
- if rna_ui == None:
+ if rna_ui is None:
return None
try:
def rna_idprop_ui_prop_clear(item, prop):
rna_ui = rna_idprop_ui_get(item, False)
- if rna_ui == None:
+ if rna_ui is None:
return
try:
prev = keys[i-1] if i > 0 else None
next = keys[i+1] if i < len(keys)-1 else None
- if prev == None:
+ if prev is None:
continue
th = pi
# Apply the parents offset accumletivly
- if my_parent == None:
+ if my_parent is None:
rest_head_world = Vector(rest_head_local)
else:
rest_head_world = my_parent.rest_head_world + rest_head_local
vdict_local = vdict[vidx]
pf_vidx = vdict_local.get(key) # Will be None initially
- if pf_vidx == None: # same as vdict_local.has_key(key)
+ if pf_vidx is None: # same as vdict_local.has_key(key)
pf_vidx = vdict_local[key] = vert_count
ply_verts.append((vidx, normal, uvcoord, color))
vert_count += 1
self.value=val
def get_size(self):
- if (self.value==None):
+ if self.value is None:
return 0
else:
return self.value.get_size()
def write(self, file):
- if (self.value!=None):
+ if self.value is not None:
self.value.write(file)
def dump(self,indent):
- if (self.value!=None):
+ if self.value is not None:
spaces=""
for i in range(indent):
spaces += " "
# Check parent-child relationships:
parent = obj.parent
- if (parent == None) or (parent.name not in name_to_id):
+ if (parent is None) or (parent.name not in name_to_id):
# If no parent, or the parents name is not in the name_to_id dictionary,
# parent id becomes -1:
obj_node_header_chunk.add_variable("parent", _3ds_short(-1))
# get derived objects
free, derived = create_derived_objects(scene, ob)
- if derived == None: continue
+ if derived is None:
+ continue
for ob_derived, mat in derived:
# for ob_derived, mat in getDerivedObjects(ob, False):
# ----------------- Batch support!
if BATCH_ENABLE:
- if os == None: BATCH_OWN_DIR = False
-
fbxpath = filepath
# get the path component of filepath
def write_texture(texname, tex, num):
- # if tex == None then this is a dummy tex
+ # if tex is None then this is a dummy tex
file.write('\n\tTexture: "Texture::%s", "TextureVideoClip" {' % texname)
file.write('\n\t\tType: "TextureVideoClip"')
file.write('\n\t\tVersion: 202')
my_mesh.blenTextures = list(texture_mapping_local.keys())
# if only 1 null texture then empty the list
- if len(my_mesh.blenTextures) == 1 and my_mesh.blenTextures[0] == None:
+ if len(my_mesh.blenTextures) == 1 and my_mesh.blenTextures[0] is None:
my_mesh.blenTextures = []
my_mesh.fbxArm = armob # replace with my_object_generic armature instance later
for ob in blenGroup.objects:
if ob.name in tagged_objects:
# if ob.tag:
- if fbxGroupName == None:
+ if fbxGroupName is None:
fbxGroupName = sane_groupname(blenGroup)
groups.append((fbxGroupName, blenGroup))
print('\taction: "%s" has no armature using it, skipping' % blenAction.name)
continue
- if blenAction == None:
+ if blenAction is None:
# Warning, this only accounts for tmp_actions being [None]
file.write('\n\tTake: "Default Take" {')
act_start = start
import mathutils
def fixName(name):
- if name == None:
+ if name is None:
return 'None'
else:
return name.replace(' ', '_')
materialItems = [m for m in materials]
if materials:
for mat in materials:
- if mat: # !=None
+ if mat:
materialNames.append(mat.name)
else:
materialNames.append(None)
if key == contextMat:
pass # Context already switched, dont do anything
else:
- if key[0] == None and key[1] == None:
+ if key[0] is None and key[1] is None:
# Write a null material, since we know the context has changed.
if EXPORT_GROUP_BY_MAT:
# can be mat_image or (null)
# converting any spaces to underscores with fixName.
# If none image dont bother adding it to the name
- if key[1] == None:
+ if key[1] is None:
mat_data = mtl_dict[key] = ('%s'%fixName(key[0])), materialItems[f_mat], f_image
else:
mat_data = mtl_dict[key] = ('%s_%s' % (fixName(key[0]), fixName(key[1]))), materialItems[f_mat], f_image
# if CREATE_FGONS and fgon_edges:
# FGON= Mesh.EdgeFlags.FGON
# for ed in me.findEdges( fgon_edges.keys() ):
-# if ed!=None:
+# if ed is not None:
# me_edges[ed].flag |= FGON
# del FGON
# if unique_smooth_groups and sharp_edges:
# SHARP= Mesh.EdgeFlags.SHARP
# for ed in me.findEdges( sharp_edges.keys() ):
-# if ed!=None:
+# if ed is not None:
# me_edges[ed].flag |= SHARP
# del SHARP
name = context_nurbs.get('name', 'ObjNurb')
cstype = context_nurbs.get('cstype')
- if cstype == None:
+ if cstype is None:
print('\tWarning, cstype not found')
return
if cstype != 'bspline':
print("failed to import compression modules, exporting uncompressed")
self.filepath = filepath[:-1] # remove trailing z
- if self.file == None:
+ if self.file is None:
self.file = open(self.filepath, "w")
self.bNav=0
for i in range(alltexture):
tex = alltextures[i]
- if tex.type != 'IMAGE' or tex.image == None:
+ if tex.type != 'IMAGE' or tex.image is None:
continue
namemat = tex.name
free, derived = create_derived_objects(scene, ob_main)
- if derived == None: continue
+ if derived is None: continue
for ob, ob_mat in derived:
# for ob, ob_mat in BPyObject.getDerivedObjects(ob_main):
seq2 = None
for s in context.scene.sequence_editor.sequences:
if s.select and s.type == 'SOUND':
- if seq1 == None:
+ if seq1 is None:
seq1 = s
- elif seq2 == None:
+ elif seq2 is None:
seq2 = s
else:
seq2 = None
break
- if seq2 == None:
+ if seq2 is None:
self.report({'ERROR'}, "Select 2 sound strips.")
return {'CANCELLED'}
if seq1.frame_final_start > seq2.frame_final_start:
space = context.space_data
tex = context.texture
idblock = context_tex_datablock(context)
- tex_collection = space.pin_id == None and type(idblock) != bpy.types.Brush and not node
+ tex_collection = space.pin_id is None and type(idblock) != bpy.types.Brush and not node
if tex_collection:
row = layout.row()