Skip to content
Snippets Groups Projects
Commit 76970df2 authored by Sebastian Nell's avatar Sebastian Nell
Browse files

Pedantic comment correction

parent 471370d8
No related branches found
No related tags found
No related merge requests found
...@@ -39,8 +39,8 @@ class BVH_Node(object): ...@@ -39,8 +39,8 @@ class BVH_Node(object):
'rot_order', # a triple of indices as to the order rotation is applied. [0,1,2] is x/y/z - [None, None, None] if no rotation. 'rot_order', # a triple of indices as to the order rotation is applied. [0,1,2] is x/y/z - [None, None, None] if no rotation.
'rot_order_str', # same as above but a string 'XYZ' format. 'rot_order_str', # same as above but a string 'XYZ' format.
'anim_data', # a list one tuple's one for each frame. (locx, locy, locz, rotx, roty, rotz), euler rotation ALWAYS stored xyz order, even when native used. 'anim_data', # a list one tuple's one for each frame. (locx, locy, locz, rotx, roty, rotz), euler rotation ALWAYS stored xyz order, even when native used.
'has_loc', # Conveinience function, bool, same as (channels[0]!=-1 or channels[1]!=-1 channels[2]!=-1) 'has_loc', # Convenience function, bool, same as (channels[0]!=-1 or channels[1]!=-1 or channels[2]!=-1)
'has_rot', # Conveinience function, bool, same as (channels[3]!=-1 or channels[4]!=-1 channels[5]!=-1) 'has_rot', # Convenience function, bool, same as (channels[3]!=-1 or channels[4]!=-1 or channels[5]!=-1)
'index', # index from the file, not strictly needed but nice to maintain order 'index', # index from the file, not strictly needed but nice to maintain order
'temp', # use this for whatever you want 'temp', # use this for whatever you want
) )
...@@ -72,7 +72,7 @@ class BVH_Node(object): ...@@ -72,7 +72,7 @@ class BVH_Node(object):
self.children = [] self.children = []
# list of 6 length tuples: (lx,ly,lz, rx,ry,rz) # list of 6 length tuples: (lx,ly,lz, rx,ry,rz)
# even if the channels arnt used they will just be zero # even if the channels aren't used they will just be zero
# #
self.anim_data = [(0, 0, 0, 0, 0, 0)] self.anim_data = [(0, 0, 0, 0, 0, 0)]
...@@ -125,9 +125,9 @@ def read_bvh(context, file_path, rotate_mode='XYZ', global_scale=1.0): ...@@ -125,9 +125,9 @@ def read_bvh(context, file_path, rotate_mode='XYZ', global_scale=1.0):
file_lines[lineIdx][1] = '_'.join(file_lines[lineIdx][1:]) file_lines[lineIdx][1] = '_'.join(file_lines[lineIdx][1:])
file_lines[lineIdx] = file_lines[lineIdx][:2] file_lines[lineIdx] = file_lines[lineIdx][:2]
# MAY NEED TO SUPPORT MULTIPLE ROOT's HERE!!!, Still unsure weather multiple roots are possible.?? # MAY NEED TO SUPPORT MULTIPLE ROOTS HERE! Still unsure weather multiple roots are possible?
# Make sure the names are unique- Object names will match joint names exactly and both will be unique. # Make sure the names are unique - Object names will match joint names exactly and both will be unique.
name = file_lines[lineIdx][1] name = file_lines[lineIdx][1]
#print '%snode: %s, parent: %s' % (len(bvh_nodes_serial) * ' ', name, bvh_nodes_serial[-1]) #print '%snode: %s, parent: %s' % (len(bvh_nodes_serial) * ' ', name, bvh_nodes_serial[-1])
...@@ -137,9 +137,9 @@ def read_bvh(context, file_path, rotate_mode='XYZ', global_scale=1.0): ...@@ -137,9 +137,9 @@ def read_bvh(context, file_path, rotate_mode='XYZ', global_scale=1.0):
lineIdx += 1 # Increment to the next line (Channels) lineIdx += 1 # Increment to the next line (Channels)
# newChannel[Xposition, Yposition, Zposition, Xrotation, Yrotation, Zrotation] # newChannel[Xposition, Yposition, Zposition, Xrotation, Yrotation, Zrotation]
# newChannel references indecies to the motiondata, # newChannel references indices to the motiondata,
# if not assigned then -1 refers to the last value that will be added on loading at a value of zero, this is appended # if not assigned then -1 refers to the last value that will be added on loading at a value of zero, this is appended
# We'll add a zero value onto the end of the MotionDATA so this is always refers to a value. # We'll add a zero value onto the end of the MotionDATA so this always refers to a value.
my_channel = [-1, -1, -1, -1, -1, -1] my_channel = [-1, -1, -1, -1, -1, -1]
my_rot_order = [None, None, None] my_rot_order = [None, None, None]
rot_count = 0 rot_count = 0
...@@ -189,7 +189,7 @@ def read_bvh(context, file_path, rotate_mode='XYZ', global_scale=1.0): ...@@ -189,7 +189,7 @@ def read_bvh(context, file_path, rotate_mode='XYZ', global_scale=1.0):
bvh_nodes_serial[-1].rest_tail_world = bvh_nodes_serial[-1].rest_head_world + rest_tail bvh_nodes_serial[-1].rest_tail_world = bvh_nodes_serial[-1].rest_head_world + rest_tail
bvh_nodes_serial[-1].rest_tail_local = bvh_nodes_serial[-1].rest_head_local + rest_tail bvh_nodes_serial[-1].rest_tail_local = bvh_nodes_serial[-1].rest_head_local + rest_tail
# Just so we can remove the Parents in a uniform way- End has kids # Just so we can remove the Parents in a uniform way - End has kids
# so this is a placeholder # so this is a placeholder
bvh_nodes_serial.append(None) bvh_nodes_serial.append(None)
...@@ -209,7 +209,7 @@ def read_bvh(context, file_path, rotate_mode='XYZ', global_scale=1.0): ...@@ -209,7 +209,7 @@ def read_bvh(context, file_path, rotate_mode='XYZ', global_scale=1.0):
del bvh_nodes_serial del bvh_nodes_serial
# importing world with any order but nicer to maintain order # importing world with any order but nicer to maintain order
# second life expects it, which isnt to spec. # second life expects it, which isn't to spec.
bvh_nodes_list = sorted_nodes(bvh_nodes) bvh_nodes_list = sorted_nodes(bvh_nodes)
while lineIdx < len(file_lines): while lineIdx < len(file_lines):
...@@ -270,7 +270,7 @@ def read_bvh(context, file_path, rotate_mode='XYZ', global_scale=1.0): ...@@ -270,7 +270,7 @@ def read_bvh(context, file_path, rotate_mode='XYZ', global_scale=1.0):
bvh_node.rest_tail_world = rest_tail_world * (1.0 / len(bvh_node.children)) bvh_node.rest_tail_world = rest_tail_world * (1.0 / len(bvh_node.children))
bvh_node.rest_tail_local = rest_tail_local * (1.0 / len(bvh_node.children)) bvh_node.rest_tail_local = rest_tail_local * (1.0 / len(bvh_node.children))
# Make sure tail isnt the same location as the head. # Make sure tail isn't the same location as the head.
if (bvh_node.rest_tail_local - bvh_node.rest_head_local).length <= 0.001 * global_scale: if (bvh_node.rest_tail_local - bvh_node.rest_head_local).length <= 0.001 * global_scale:
print("\tzero length node found:", bvh_node.name) print("\tzero length node found:", bvh_node.name)
bvh_node.rest_tail_local.y = bvh_node.rest_tail_local.y + global_scale / 10 bvh_node.rest_tail_local.y = bvh_node.rest_tail_local.y + global_scale / 10
...@@ -381,7 +381,7 @@ def bvh_node_dict2armature(context, ...@@ -381,7 +381,7 @@ def bvh_node_dict2armature(context,
average_bone_length += l average_bone_length += l
nonzero_count += 1 nonzero_count += 1
# Very rare cases all bones couldbe zero length??? # Very rare cases all bones could be zero length???
if not average_bone_length: if not average_bone_length:
average_bone_length = 0.1 average_bone_length = 0.1
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment