<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<small>Think it should be dirname instead of basename<br>
<br>
Campbell Barton wrote:</small>
<blockquote
cite="mid:CAEcf3NzUJN431zHH62LF6E47Be_sXscXYKr3FqoiPbbyhZpCWQ@mail.gmail.com"
type="cite">
<pre wrap="">Noticed you're adding hard coded path to sys.path
sys.path.append("c:\\Users\\Peter\\25blender\\branches\\geodesic_domes")
While manipulating sys.path in a script isn't really great in the
first place, you can do it in a portable way:
To get the directory the script is in you can use this:
os.path.basename(__file__)
Though you could probably use a package and relative imports in this case.
On Mon, Oct 17, 2011 at 7:27 PM, Peter K.H. Gragert
<a class="moz-txt-link-rfc2396E" href="mailto:pkhgragert@gmail.com"><pkhgragert@gmail.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Revision: 2469
<a class="moz-txt-link-freetext" href="http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2469">http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2469</a>
Author: pkhg
Date: 2011-10-17 08:27:54 +0000 (Mon, 17 Oct 2011)
Log Message:
-----------
a test for analyzing the sphereparameters
meaning trying to understand the effects
Added Paths:
-----------
branches/geodesic_domes/tests/unittest3_sphere_problems.py
Added: branches/geodesic_domes/tests/unittest3_sphere_problems.py
===================================================================
--- branches/geodesic_domes/tests/unittest3_sphere_problems.py (rev 0)
+++ branches/geodesic_domes/tests/unittest3_sphere_problems.py 2011-10-17 08:27:54 UTC (rev 2469)
@@ -0,0 +1,85 @@
+##usable with SVN:2450
+import bpy
+import sys
+#!!!!!!!!!!!!!!!!!!adjust this path to your settings
+sys.path.append("c:\\Users\\Peter\\25blender\\branches\\geodesic_domes")
+import unittest
+import math
+from mathutils import Vector #needed to check vertex.vector values
+import geodesic_classes_259
+import vefm_259
+import forms_259
+from forms_259 import sphere
+print("\n--------------------start test SPHERE-------------\n\n")
+def check_contains(cl,name , print_value = False, only_this = None):
+ dir_class = dir(cl)
+ tmp = None
+ for el in dir_class:
+ if el.startswith("_"):
+ pass
+ else:
+ if print_value == only_this:
+ tmp = getattr(cl,el)
+ print(name , " contains ==>",el," value = ", tmp)
+ else:
+ print(name , " contains ==>",el)
+ print("\ncheck_contains finished\n\n")
+ return tmp
+
+class geodesic_259_Test(unittest.TestCase):
+
+ def setUp(self):
+ print("\n\n=============setup called================\n\n")
+ unittest.TestCase.setUp(self)
+ ## Superformula controls
+ um = 0 # Draw.Create(
+ un1 = 10.0 # Draw.Create(
+ un2 = 10.0 # Draw.Create(
+ un3 = 10.0 # Draw.Create(
+ ua = 1.0 # Draw.Create(
+ ub = 1.0 # Draw.Create(
+ vm = 4 # Draw.Create(
+ vn1 = 10.0 # Draw.Create(
+ vn2 = 10.0 # Draw.Create(
+ vn3 = 10.0 # Draw.Create(
+ va = 1.0 # Draw.Create(
+ vb = 1.0 # Draw.Create(
+ uact = 0 # Draw.Create(
+ vact = 0 # Draw.Create(
+ uturn = 0.0 # Draw.Create(
+ vturn = 0.0 # Draw.Create(
+ utwist = 0.232 # Draw.Create(
+ vtwist = 0.0 # Draw.Create(
+
+ uresolution = 15 #number of lines N-S (u coordinate)
+ vresolution = 15 #number of lines O-W (v cordinate)
+ uscale = 10 #seams to be scaling from center in r direction
+ vscale = 0 #expand and shift get factor vscale
+ upart = 6.5 #gap?
+ vpart = 1 #defines gaps?!
+ uphase = vphase = 1
+ utwist = 0
+ vtwist = 0
+ xscale = 1 #scale in x direction
+ yscale = 1 #scale in z direction not y ?! the heigth so to say
+ sform = superformparam=[um,un1,un2,un3,ua,ub,vm,vn1,vn2,vn3,va,vb,uact,vact,uturn*math.pi,vturn*(math.pi),utwist,vtwist]
+
+ self.sphere=forms_259.sphere(uresolution,vresolution,uscale,vscale,upart,vpart,uphase,vphase,utwist,vtwist,xscale,yscale,sform)
+
+
+ def test_content_modules(self):
+ sphere = self.sphere
+ try:
+ self.assertTrue(sphere != None)
+
+ check_contains(dir(sphere), name="sphere", print_value = True)
+ finally:
+ vefm_259.vefm_add_object(sphere)
+ print("\ntest_content_modules done\n\n")
+
+
+if __name__ == '__main__':
+#if main use: exit=False unittest.main(exit=False)
+ suite = unittest.TestLoader().loadTestsFromTestCase(geodesic_259_Test)
+ unittest.TextTestRunner(verbosity=3).run(suite)
+
_______________________________________________
Bf-extensions-cvs mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Bf-extensions-cvs@blender.org">Bf-extensions-cvs@blender.org</a>
<a class="moz-txt-link-freetext" href="http://lists.blender.org/mailman/listinfo/bf-extensions-cvs">http://lists.blender.org/mailman/listinfo/bf-extensions-cvs</a>
</pre>
</blockquote>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
With best regards, Sergey I. Sharybin</pre>
</body>
</html>