[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1424] trunk/py/scripts/addons: correct bad spelling; 'indicies' --> 'indices'
Campbell Barton
ideasman42 at gmail.com
Tue Jan 18 02:58:50 CET 2011
Revision: 1424
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=1424
Author: campbellbarton
Date: 2011-01-18 01:58:49 +0000 (Tue, 18 Jan 2011)
Log Message:
-----------
correct bad spelling; 'indicies' --> 'indices'
Modified Paths:
--------------
trunk/py/scripts/addons/curve_simplify.py
trunk/py/scripts/addons/io_anim_bvh/import_bvh.py
trunk/py/scripts/addons/io_scene_3ds/export_3ds.py
trunk/py/scripts/addons/io_scene_fbx/__init__.py
trunk/py/scripts/addons/io_scene_fbx/export_fbx.py
trunk/py/scripts/addons/io_scene_obj/export_obj.py
trunk/py/scripts/addons/io_scene_obj/import_obj.py
trunk/py/scripts/addons/io_scene_x3d/import_x3d.py
trunk/py/scripts/addons/render_povray/render.py
Modified: trunk/py/scripts/addons/curve_simplify.py
===================================================================
--- trunk/py/scripts/addons/curve_simplify.py 2011-01-18 00:04:49 UTC (rev 1423)
+++ trunk/py/scripts/addons/curve_simplify.py 2011-01-18 01:58:49 UTC (rev 1424)
@@ -44,7 +44,7 @@
##############################
#### simplipoly algorithm ####
##############################
-# get SplineVertIndicies to keep
+# get SplineVertIndices to keep
def simplypoly(splineVerts, options):
# main vars
newVerts = [] # list of vertindices to keep
@@ -79,7 +79,7 @@
distances.append(dist)
distances.append(0.0) # last vert is always kept
- # generate list of vertindicies to keep
+ # generate list of vertindices to keep
# tested against averaged curvatures and distances of neighbour verts
newVerts.append(0) # first vert is always kept
for i, curv in enumerate(curvatures):
@@ -172,7 +172,7 @@
return False
return new
-#### get SplineVertIndicies to keep
+#### get SplineVertIndices to keep
def simplify_RDP(splineVerts, options):
#main vars
error = options[4]
@@ -264,7 +264,7 @@
if mode == 'curvature':
newVerts = simplypoly(splineVerts, options)
- # convert indicies into vectors3D
+ # convert indices into vectors3D
newPoints = vertsToPoints(newVerts, splineVerts, splineType)
# create new spline
@@ -324,7 +324,7 @@
scene = context.scene
fcurves_obj = obj.animation_data.action.fcurves
- #get indicies of selected fcurves
+ #get indices of selected fcurves
fcurve_sel = selectedfcurves(obj)
# go through fcurves
@@ -339,7 +339,7 @@
if mode == 'curvature':
newVerts = simplypoly(fcurve, options)
- # convert indicies into vectors3D
+ # convert indices into vectors3D
newPoints = []
#this is different from the main() function for normal curves, different api...
Modified: trunk/py/scripts/addons/io_anim_bvh/import_bvh.py
===================================================================
--- trunk/py/scripts/addons/io_anim_bvh/import_bvh.py 2011-01-18 00:04:49 UTC (rev 1423)
+++ trunk/py/scripts/addons/io_anim_bvh/import_bvh.py 2011-01-18 01:58:49 UTC (rev 1424)
@@ -38,7 +38,7 @@
'rest_tail_world', # worldspace rest location for the tail of this node
'rest_tail_local', # worldspace rest location for the tail of this node
'channels', # list of 6 ints, -1 for an unused channel, otherwise an index for the BVH motion data lines, lock triple then rot triple
- 'rot_order', # a triple of indicies 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.
'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)
Modified: trunk/py/scripts/addons/io_scene_3ds/export_3ds.py
===================================================================
--- trunk/py/scripts/addons/io_scene_3ds/export_3ds.py 2011-01-18 00:04:49 UTC (rev 1423)
+++ trunk/py/scripts/addons/io_scene_3ds/export_3ds.py 2011-01-18 01:58:49 UTC (rev 1424)
@@ -485,7 +485,7 @@
self.mat= mat
self.image= image
self.faceuvs= faceuvs
- self.offset= [0, 0, 0] # offset indicies
+ self.offset= [0, 0, 0] # offset indices
def extract_triangles(mesh):
Modified: trunk/py/scripts/addons/io_scene_fbx/__init__.py
===================================================================
--- trunk/py/scripts/addons/io_scene_fbx/__init__.py 2011-01-18 00:04:49 UTC (rev 1423)
+++ trunk/py/scripts/addons/io_scene_fbx/__init__.py 2011-01-18 01:58:49 UTC (rev 1424)
@@ -18,18 +18,6 @@
# <pep8 compliant>
-bl_info = {
- "name": "Autodesk FBX format",
- "author": "Campbell Barton",
- "location": "File > Import-Export",
- "description": "Import-Export FBX meshes, UV's, vertex colors, materials, textures, cameras and lamps",
- "warning": "",
- "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/"\
- "Scripts/Import-Export/Autodesk_FBX",
- "tracker_url": "",
- "support": 'OFFICIAL',
- "category": "Import-Export"}
-
# To support reload properly, try to access a package var, if it's there, reload everything
if "bpy" in locals():
import imp
Modified: trunk/py/scripts/addons/io_scene_fbx/export_fbx.py
===================================================================
--- trunk/py/scripts/addons/io_scene_fbx/export_fbx.py 2011-01-18 00:04:49 UTC (rev 1423)
+++ trunk/py/scripts/addons/io_scene_fbx/export_fbx.py 2011-01-18 01:58:49 UTC (rev 1424)
@@ -20,6 +20,9 @@
# Script copyright (C) Campbell Barton
+# Modified by Steven Batchelor on 01/16/2011 to include these features:
+# 1. Bone and object rotation constraints.
+
"""
This script is an exporter to the FBX file format.
@@ -28,17 +31,16 @@
import os
import time
-import math # math.pi
-import shutil # for file copying
+import math # math.pi
+import shutil # for file copying
import bpy
from mathutils import Vector, Euler, Matrix
-
# XXX not used anymore, images are copied one at a time
def copy_images(dest_dir, textures):
import shutil
-
+
if not dest_dir.endswith(os.sep):
dest_dir += os.sep
@@ -52,17 +54,16 @@
if Blender.sys.exists(image_path):
# Make a name for the target path.
dest_image_path = dest_dir + image_path.split('\\')[-1].split('/')[-1]
- if not Blender.sys.exists(dest_image_path): # Image isnt already there
+ if not Blender.sys.exists(dest_image_path): # Image isnt already there
print("\tCopying %r > %r" % (image_path, dest_image_path))
try:
shutil.copy(image_path, dest_image_path)
- copyCount += 1
+ copyCount+=1
except:
print("\t\tWarning, file failed to copy, skipping.")
print('\tCopied %d images' % copyCount)
-
# I guess FBX uses degrees instead of radians (Arystan).
# Call this function just before writing to FBX.
# 180 / math.pi == 57.295779513
@@ -83,31 +84,30 @@
sane_name_mapping_ob['Scene'] = 'Scene_'
sane_name_mapping_ob['blend_root'] = 'blend_root_'
-
def increment_string(t):
name = t
num = ''
while name and name[-1].isdigit():
num = name[-1] + num
name = name[:-1]
- if num:
- return '%s%d' % (name, int(num) + 1)
- else:
- return name + '_0'
+ if num: return '%s%d' % (name, int(num)+1)
+ else: return name + '_0'
+
# todo - Disallow the name 'Scene' and 'blend_root' - it will bugger things up.
def sane_name(data, dct):
#if not data: return None
- if type(data) == tuple: # materials are paired up with images
+ if type(data)==tuple: # materials are paired up with images
data, other = data
use_other = True
else:
other = None
use_other = False
- name = data.name if data else None
+ if data: name = data.name
+ else: name = None
orig_name = name
if other:
@@ -122,41 +122,26 @@
#except: pass
if not name:
- name = 'unnamed' # blank string, ASKING FOR TROUBLE!
+ name = 'unnamed' # blank string, ASKING FOR TROUBLE!
else:
- name = bpy.path.clean_name(name) # use our own
+ name = bpy.path.clean_name(name) # use our own
- while name in iter(dct.values()):
- name = increment_string(name)
+ while name in iter(dct.values()): name = increment_string(name)
- if use_other: # even if other is None - orig_name_other will be a string or None
+ if use_other: # even if other is None - orig_name_other will be a string or None
dct[orig_name, orig_name_other] = name
else:
dct[orig_name] = name
return name
+def sane_obname(data): return sane_name(data, sane_name_mapping_ob)
+def sane_matname(data): return sane_name(data, sane_name_mapping_mat)
+def sane_texname(data): return sane_name(data, sane_name_mapping_tex)
+def sane_takename(data): return sane_name(data, sane_name_mapping_take)
+def sane_groupname(data): return sane_name(data, sane_name_mapping_group)
-def sane_obname(data):
- return sane_name(data, sane_name_mapping_ob)
-
-
-def sane_matname(data):
- return sane_name(data, sane_name_mapping_mat)
-
-
-def sane_texname(data):
- return sane_name(data, sane_name_mapping_tex)
-
-
-def sane_takename(data):
- return sane_name(data, sane_name_mapping_take)
-
-
-def sane_groupname(data):
- return sane_name(data, sane_name_mapping_group)
-
# def derived_paths(fname_orig, basepath, FORCE_CWD=False):
# '''
# fname_orig - blender path, can be relative
@@ -178,9 +163,8 @@
def mat4x4str(mat):
- return '%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f' % tuple([f for v in mat for f in v])
+ return '%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f,%.15f' % tuple([ f for v in mat for f in v ])
-
# XXX not used
# duplicated in OBJ exporter
def getVertsFromGroup(me, group_index):
@@ -193,7 +177,6 @@
return ret
-
# ob must be OB_MESH
def BPyMesh_meshWeight2List(ob, me):
''' Takes a mesh and return its group names and a list of lists, one list per vertex.
@@ -202,14 +185,14 @@
'''
# Clear the vert group.
- groupNames = [g.name for g in ob.vertex_groups]
- len_groupNames = len(groupNames)
+ groupNames= [g.name for g in ob.vertex_groups]
+ len_groupNames= len(groupNames)
if not len_groupNames:
# no verts? return a vert aligned empty list
return [[] for i in range(len(me.vertices))], []
else:
- vWeightList = [[0.0] * len_groupNames for i in range(len(me.vertices))]
+ vWeightList= [[0.0]*len_groupNames for i in range(len(me.vertices))]
for i, v in enumerate(me.vertices):
for g in v.groups:
@@ -217,24 +200,24 @@
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list