[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2159] branches/ivygen/truman_ivy/ add_curve_ivygen.py: - Removed distance check now that the check for dead root nodes is working
Andrew Hale
TrumanBlending at gmail.com
Fri Jul 22 08:11:44 CEST 2011
Revision: 2159
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2159
Author: trumanblending
Date: 2011-07-22 06:11:43 +0000 (Fri, 22 Jul 2011)
Log Message:
-----------
- Removed distance check now that the check for dead root nodes is working
- Added printing of progress of the generation to the console
- Added console notifications of current position in code execution
Modified Paths:
--------------
branches/ivygen/truman_ivy/add_curve_ivygen.py
Modified: branches/ivygen/truman_ivy/add_curve_ivygen.py
===================================================================
--- branches/ivygen/truman_ivy/add_curve_ivygen.py 2011-07-22 04:03:44 UTC (rev 2158)
+++ branches/ivygen/truman_ivy/add_curve_ivygen.py 2011-07-22 06:11:43 UTC (rev 2159)
@@ -462,19 +462,6 @@
# Get the seeding point
seedPoint = context.scene.cursor_location
- # Find the distance to the closest point
- dist = (ob.closest_point_on_mesh(seedPoint)[0] - seedPoint).length
-
- # If the distance is too far, cancel the operator
- if dist > (radius * ivyProps.maxFloatLength / 2):
- print("Invalid Root Location")
- return {'CANCELLED'}
-
- # If the point is on the surface move it outward slightly
- if dist == 0.0:
- seedPoint += (radius * ivyProps.maxFloatLength / 10 *
- ob.closest_point_on_mesh(seedPoint)[1])
-
# Fix the random seed
rand_seed(ivyProps.randomSeed)
@@ -493,12 +480,24 @@
checkTime = True
t = time.time()
+ startPercent = 0.0
# Grow until 200 roots is reached or backup counter exceeds limit
while checkAlive and\
(IVY.maxLength < maxLength) and\
(not checkTime or (time.time() - t < ivyProps.maxTime)):
+ # Grow the ivy for this iteration
IVY.grow(radius, ob)
+
+ # Print the proportion of ivy growth to console
+ if (IVY.maxLength / maxLength * 100) > (startPercent // 10) * 10:
+ print('%0.2f%% of Ivy nodes have grown' %\
+ (IVY.maxLength / maxLength * 100))
+ startPercent += 10
+ if IVY.maxLength / maxLength > 1:
+ print("Halting Growth")
+
+ # Make an iterator to check if all are alive
checkAliveIter = (r.alive for r in IVY.ivyRoots)
checkAlive = False
if True in checkAliveIter:
@@ -506,7 +505,10 @@
# Create the curve and leaf geometry
curveOb = createIvyCurves(IVY, radius)
+ print("Curve Generation Complete")
+
leafOb = createIvyLeaves(IVY, radius)
+ print("Leaf Generation Complete")
# Parent the leave to the curve
leafOb.parent = curveOb
More information about the Bf-extensions-cvs
mailing list