[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3751] branches/protopipe/modelbuilder. py: Init the modelbuilder class
Aurel W
aurel.w at gmail.com
Sun Sep 16 20:45:31 CEST 2012
Revision: 3751
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3751
Author: aurel
Date: 2012-09-16 18:45:31 +0000 (Sun, 16 Sep 2012)
Log Message:
-----------
Init the modelbuilder class
Added Paths:
-----------
branches/protopipe/modelbuilder.py
Added: branches/protopipe/modelbuilder.py
===================================================================
--- branches/protopipe/modelbuilder.py (rev 0)
+++ branches/protopipe/modelbuilder.py 2012-09-16 18:45:31 UTC (rev 3751)
@@ -0,0 +1,46 @@
+#
+# Copyright 2012, Aurel Wildfellner.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+
+import bpy
+import bmesh
+import mathutils
+
+from protopipe.jointproto import JointProto
+from protopipe.jointproto import JointDescriptor
+from protopipe.jointproto import ProtoLibrary
+from protopipe import ppapp
+
+
+class ModelBuilder:
+
+ def __init__(self):
+ pass
+
+ def buildOnMesh(self, mesh):
+ bm = bmesh.new()
+ bm.from_mesh(mesh)
+ bm.verts.index_update()
+ bm.edges.index_update()
+
+ ### for every vertice, try to add a joint ###
+ for vert in bm.verts:
+ desc = JointDescriptor()
+ desc.buildFromVert(bm, vert.index)
+
+ (reg, rot_mat, jproto) = ppapp.jointFactory.getProto(desc)
+ print("reg: ", reg)
More information about the Bf-extensions-cvs
mailing list