[Durian-svn] [6730] fix

soenke institute at blender.org
Sun Jul 11 17:39:44 CEST 2010


Revision: 6730
          https://blenderinstitute.dyndns.org/durian-svn/?do=log&project=durian&path=/&rev=6730
Author:   soenke
Date:     2010-07-11 17:39:44 +0200 (Sun, 11 Jul 2010)
Log Message:
-----------
fix

Modified Paths:
--------------
    pro/scripts/modules/hairutils.py

Modified: pro/scripts/modules/hairutils.py
===================================================================
--- pro/scripts/modules/hairutils.py	2010-07-11 15:15:01 UTC (rev 6729)
+++ pro/scripts/modules/hairutils.py	2010-07-11 15:39:44 UTC (rev 6730)
@@ -5,12 +5,13 @@
     fw = file.write
     for p in psys.particles:
         for k in p.hair:
-            fw("v %f %f %f\n" % k.location.to_tuple(6)) # location_hairspace
+            fw("v %f %f %f\n" % k.location_hairspace.to_tuple(6)) # location_hairspace
         for i in range(len(p.hair) - 1):
             fw("f %d %d\n" % (i ^ -1, (i + 1) ^ -1))
     file.close()
 
 def load_hair_style(filepath, psys):
+    print(filepath)
     file = open(filepath, "r")
     locations = []
     for l in file.readlines():
@@ -24,10 +25,12 @@
             keys.append(k)
 
     if len(locations) != len(keys):
-        raise RuntimeError("can't load hair %d != %d" % (len(locations), len(keys)))
+        # raise RuntimeError("can't load hair %d != %d" % (len(locations), len(keys)))
+        print("can't load hair %d != %d" % (len(locations), len(keys)))
+        return
 
     for i, k in enumerate(keys):
-        k.location = locations[i]
+        k.location_hairspace = locations[i]
 
     file.close()
 
@@ -43,4 +46,4 @@
     '''
 import hairutils
 hairutils.save_hair_style("/d/pro/chars/sintel_hair_more_face.obj", bpy.context.active_object.active_particle_system)
-    '''
+    '''
\ No newline at end of file



More information about the Durian-svn mailing list